-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking issue for the matches!
macro
#65721
Comments
This caused a regression in html5ever because the prelude macro becomes ambiguous with a macro that was brought into scope by a glob import: servo/html5ever#402 @rust-lang/lang, could we make that situation not an error? It seems that we could resolve the ambiguity in favor of the glob import since it is "more local" to the rest of the code in the module. |
For macros (and imports) it's hard to do. To remove the ambiguity error we need to prove that with any expansion order and any import resolution order Otherwise we'll get code that compiles today but not tomorrow depending on random implementation details. (Making e.g. things like this impossible.) |
I have a memory of a change made to treat differently during name resolution items that are unstable, so that new standard library addition can (at first) warn instead of error when they conflict with existing code. However I couldn’t find this again. Maybe it was only for traits? |
Yeah, that was for method resolution. |
Would a similar special case for unstable prelude items make sense? |
The 1.42 cycle starts soon. Any objection? @rfcbot fcp merge |
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Should we also add a |
I personally find that one less useful, but feel free to also propose it in a PR. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Stabilize the `matches!` macro Fixes rust-lang#65721 FCP: rust-lang#65721 (comment)
How do we feel about giving this the "relnotes" tag? |
Already on the stabilized PR: #67659 |
@jonhoo I thought |
Could matches!(expr,
| SomeFirstPattern
| SomeOtherPattern
...
); This would be consistent with the syntax of Rust accepting it where fallible patterns are accepted: match expr {
| SomeFirstPattern $(=> ...)?
| SomeOtherPattern => ...
} |
The Rust compiler version on Debian 10 ("Buster") does not support the matches_macro feature used in rusqlite 0.24.2. It fails with error[E0658]: use of unstable library feature 'matches_macro' --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/rusqlite-0.24.2/src/types/from_sql.rs:146:44 | 146 | i64::column_result(value).map(|i| !matches!(i, 0)) | ^^^^^^^ | = note: for more information, see rust-lang/rust#65721 error: aborting due to previous error For more information about this error, try `rustc --explain E0658`. error: could not compile `rusqlite`. when trying to compile rusqlite 0.24.2. However, it does compile with the older version 0.23.1 of rusqlite. Until there is a more recent Rust compiler version available in Debian 10, e.g. via the backports repository, it will probably stay at this version.
With rust 1.41 the build was failing with errors such as: According to the following pages this is due to a minimum requirement of rust 1.42 rust-lang/rust#65721 diem/diem#3558 Updated to almost latest rust 1.51. 1.52 was released today but is not available in the docker repository
For some reason ran into rust-lang/rust#65721 and rust-lang/rust#49146 along with some other misc compiler errors and lints Feels like every time I come back to this project the rust versions get out of wack
#65479 adds this macro to the prelude:
Example usage:
The text was updated successfully, but these errors were encountered: