-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Allow multiple allow_internal_unstable attributes #77183
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
r? @varkor (rust_highfive has picked a reviewer for you, use r? to override) |
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.
r=me after adjusting the error text.
c3c0af3
to
3dfd1bf
Compare
Co-authored-by: varkor <github@varkor.com>
3dfd1bf
to
54c9c94
Compare
@varkor it should be good now, I've also squashed the changes |
Thanks! @bors r+ rollup |
📌 Commit 54c9c94 has been approved by |
…as-schievink Rollup of 15 pull requests Successful merges: - rust-lang#76932 (Relax promises about condition variable.) - rust-lang#76973 (Unstably allow assume intrinsic in const contexts) - rust-lang#77005 (BtreeMap: refactoring around edges) - rust-lang#77066 (Fix dest prop miscompilation around references) - rust-lang#77073 (dead_code: look at trait impls even if they don't contain items) - rust-lang#77086 (Include libunwind in the rust-src component.) - rust-lang#77097 (Make [].as_[mut_]ptr_range() (unstably) const.) - rust-lang#77106 (clarify that `changelog-seen = 1` goes to the beginning of config.toml) - rust-lang#77120 (Add `--keep-stage-std` to `x.py` for keeping only standard library artifacts) - rust-lang#77126 (Invalidate local LLVM cache less often) - rust-lang#77146 (Install std for non-host targets) - rust-lang#77155 (remove enum name from ImplSource variants) - rust-lang#77176 (Removing erroneous semicolon in transmute documentation) - rust-lang#77183 (Allow multiple allow_internal_unstable attributes) - rust-lang#77189 (Remove extra space from vec drawing) Failed merges: r? `@ghost`
Cc @rust-lang/wg-const-eval |
.span_err(attr.span, "allow_internal_unstable expects list of feature names"); | ||
None | ||
})?; | ||
let attrs = sess.filter_by_name(attrs, sym::allow_internal_unstable); |
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.
I don't see how this PR fixes anything. All you've done is replace a ?
operator with a filter map. But find_by_name
will still only return a single attribute.
Please revert the PR. I'll reopen the issue, then we can discuss an actual fix.
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.
It's not find_by_name, but filter_by_name which returns an iterator with all matching attributes, instead of the first one.
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.
🤦 I apologize. I should not review half asleep
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.
It's fine. I'll check locally if the test case I added actually fails without
Without the changes, the added test case fails with the following (diff of stderr):
Yesterday, I had some trouble with this, the changes didn't seem to apply and the test case failed regardless. It seemed for a long time that even getting the list of attributes returned only 1. After wasting an hour and a half, I realized that I added Thanks for raising concerns, it's always good to double check. |
Thanks for double checking! |
Does this change fix both macros and stable |
I'm not sure about |
Fixes #77088