-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Check for missing const-stability attributes in rustc_passes
#77203
Check for missing const-stability attributes in rustc_passes
#77203
Conversation
r? @davidtwco (rust_highfive has picked a reviewer for you, use r? to override) |
0ca3db8
to
490bcbd
Compare
This used to happen as a side-effect of `is_min_const_fn`, which was subtle.
This should be caught by the new check in `rustc_passes`. At some point, this function will be removed entirely.
490bcbd
to
6ce178f
Compare
@@ -50,7 +50,7 @@ pub fn is_min_const_fn(tcx: TyCtxt<'_>, def_id: DefId) -> bool { | |||
None => { | |||
if let Some(stab) = tcx.lookup_stability(def_id) { | |||
if stab.level.is_stable() { | |||
tcx.sess.span_err( |
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.
can we just span_bug!
here now, or is it still reachable even if the stability error was reported?
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.
This function is called in check_unsafety
, which runs before MissingStabilityAnnotations
.
r? @oli-obk |
@bors r+ |
📌 Commit 6ce178f has been approved by |
…as-schievink Rollup of 7 pull requests Successful merges: - rust-lang#76839 (Add asm! support for MIPS) - rust-lang#77203 (Check for missing const-stability attributes in `rustc_passes`) - rust-lang#77249 (Separate `private_intra_doc_links` and `broken_intra_doc_links` into separate lints) - rust-lang#77252 (reduce overlong line) - rust-lang#77256 (Fix typo in ExpnData documentation) - rust-lang#77262 (Remove duplicate comment) - rust-lang#77263 (Clean up trivial if let) Failed merges: r? `@ghost`
Currently, this happens as a side effect of
is_min_const_fn
, which is non-obvious. Also adds a test for this case, since we didn't seem to have one before.