-
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
matches macro conflicts with matches crate #66518
Comments
cc @rust-lang/libs |
It’s not any crate. Servo’s dependency graph includes a number of users of We did run into glob imports becoming ambiguous servo/html5ever#402, but this is different. This code is already importing The only thing of note I see is that That part of the macro’s input is parsed as It looks like the “connection” between the import and the use is “lost”. But what’s surprising is that this (seemingly) happens in 1.40.0 whereas the same code in 1.39.0 does resolve to the import, it doesn’t fail to resolve. Does 1.40 also include changes to macro hygiene? |
triage: P-high; need to at least determine scope of what changed here. And preferably do a bisection. Leaving nominated for now. |
The error says error[E0659]: `matches` is ambiguous (glob import vs any other name from outer scope during import/macro resolution) so it looks like the same issue? |
Oh sorry, I was looking at the first errors which do not mention ambiguity or glob and missed that later errors do. [INFO] [stderr] error[E0658]: use of unstable library feature 'matches_macro'
[INFO] [stderr] --> src/request.rs:152:21
[INFO] [stderr] |
[INFO] [stderr] 152 | assert!(matches!(&new_request, Request::Delete(ref _key)));
[INFO] [stderr] | ^^^^^^^
[INFO] [stderr] ...
[INFO] [stderr] 162 | assert_delete!(b"name");
[INFO] [stderr] | ------------------------ in this macro invocation
[INFO] [stderr] |
[INFO] [stderr] = note: for more information, see https://github.com/rust-lang/rust/issues/65721 … and there is the glob import: quote_spanned!(name.span() =>
mod #name {
#[allow(unused_imports)]
use super::*; So yes it’s the same issue. Thanks @petrochenkov. I’ve already written my thoughts on this at #65721 (comment). |
okay, based on the dialogue here, I'm treating this as not a T-compiler thing. (@SimonSapin did propose some compiler/diagnostic changes to try to mitigate the effect of additions like this, in #65721, but that doesn't change the fact that this is still just a library issue, not a compiler or language one.) Removing T-compiler label. |
Closing as we've "eaten" this at this point as it's landed into stable. |
cc #65721
https://crater-reports.s3.amazonaws.com/beta-1.40-1/beta-2019-11-06/reg/bronzedb-protocol-0.1.0/log.txt
Any(?) crate using the
matches
crate from crates.io is likely to have breakage as the macro there will be ignored in favor of the std macro at least in some cases.The text was updated successfully, but these errors were encountered: