-
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
chore: add deprecation notice for type ascription use #2483
chore: add deprecation notice for type ascription use #2483
Conversation
The formatting is a bit clunky with all the spaces, but this is how EDIT: I also couldn't get the span to wrap the entirety of the expression for some reason. It completely ignores the type override part. |
sqlx-macros-core/src/query/args.rs
Outdated
\t\tSee <https://github.com/rust-lang/rfcs/pull/3307> for more information | ||
" | ||
); | ||
let name = Ident::new(&format!("warning_{name}"), span); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The names won't conflict as the const
s are created inside the invocation's local scope.
6be6874
to
40ade0b
Compare
@abonander should I enable the missing |
We enable the correct features in |
40ade0b
to
505d0fa
Compare
Done, I've enabled both "parsing" and "proc-macro", which were missing and causing my local test to fail while building without |
Adds a deprecation notice when type ascription pattern is used, preparing grounds for when
we drop support for the pattern, keeping compatibility with Rust's supported syntax, as decided
on RFC 3307.
This change was created as discussed in #2482.
Example
The following code uses type ascription for the second argument.
Generating a warning that looks as follows: