-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FromRow macro can't be used on a struct contains a field named "row" #3344
Comments
abonander
added a commit
that referenced
this issue
Jul 20, 2024
…e` for `TryFrom` errors (#3356) * chore: create regression test for #3344 * fix(derives): use a parameter name that's less likely to collide * breaking(derives): emit `Error::ColumnDecode` when a `TryFrom` conversion fails in `FromRow` Breaking because `#[sqlx(default)]` on an individual field or the struct itself would have previously suppressed the error. This doesn't seem like good behavior as it could result in some potentially very difficult bugs. Instead of using `TryFrom` for these fields, just implement `From` and apply the default explicitly. * fix: run `cargo fmt` * fix: use correct field in `ColumnDecode`
🎉 |
jrasanen
pushed a commit
to jrasanen/sqlx
that referenced
this issue
Oct 14, 2024
…e` for `TryFrom` errors (launchbadge#3356) * chore: create regression test for launchbadge#3344 * fix(derives): use a parameter name that's less likely to collide * breaking(derives): emit `Error::ColumnDecode` when a `TryFrom` conversion fails in `FromRow` Breaking because `#[sqlx(default)]` on an individual field or the struct itself would have previously suppressed the error. This doesn't seem like good behavior as it could result in some potentially very difficult bugs. Instead of using `TryFrom` for these fields, just implement `From` and apply the default explicitly. * fix: run `cargo fmt` * fix: use correct field in `ColumnDecode`
jrasanen
pushed a commit
to jrasanen/sqlx
that referenced
this issue
Oct 14, 2024
…e` for `TryFrom` errors (launchbadge#3356) * chore: create regression test for launchbadge#3344 * fix(derives): use a parameter name that's less likely to collide * breaking(derives): emit `Error::ColumnDecode` when a `TryFrom` conversion fails in `FromRow` Breaking because `#[sqlx(default)]` on an individual field or the struct itself would have previously suppressed the error. This doesn't seem like good behavior as it could result in some potentially very difficult bugs. Instead of using `TryFrom` for these fields, just implement `From` and apply the default explicitly. * fix: run `cargo fmt` * fix: use correct field in `ColumnDecode`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Description
Minimal Reproduction
The following code does not compile, but if I comment the
pub row: i32
line , it compiles.Info
rustc --version
: [1.79.0 (129f3b996 2024-06-10]The text was updated successfully, but these errors were encountered: