-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
shrinking the deprecated method span #85018
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
I don't know if passing method span is a good solution😆 |
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'm happy with the changes, and it'd be fine to pass in a new param, but can't we use the existing Span
parameter?
@@ -445,7 +445,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
// them as well. It's ok to use the variant's id as a ctor id since an | |||
// error will be reported on any use of such resolution anyway. | |||
let ctor_def_id = variant_def.ctor_def_id.unwrap_or(variant_def.def_id); | |||
tcx.check_stability(ctor_def_id, Some(expr_id), span); | |||
tcx.check_stability(ctor_def_id, Some(expr_id), span, Some(method_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.
What happens if you change this and the change below to pass method_name.span
on the already existing span
parameter?
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.
Will get an error:
error[E0658]: use of unstable library feature 'fmt_internals': internal to format_args!
--> /Users/rustin/ClionProjects/rust/library/core/src/macros/mod.rs:473:49
|
473 | ($dst:expr, $($arg:tt)*) => ($dst.write_fmt($crate::format_args!($($arg)*)))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(fmt_internals)]` to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.
error: could not compile `rustc-demangle`
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.
rust/compiler/rustc_span/src/lib.rs
Line 512 in d6d0283
pub fn allows_unstable(&self, feature: Symbol) -> bool { |
It looks like this is because allow_internal_unstable
is not recognized when we use method_span.
@bors r+ |
📌 Commit 7c5bc20 has been approved by |
Rollup of 8 pull requests Successful merges: - rust-lang#83501 (rustdoc: Add unstable CLI option to show basic type layout information) - rust-lang#85018 (shrinking the deprecated method span) - rust-lang#85124 (rustdoc: remove explicit boolean comparisons.) - rust-lang#85136 (Change param name (k to key and v to value) in std::env module) - rust-lang#85162 (Fix typo in variable name) - rust-lang#85187 (Use .name_str() to format primitive types in error messages) - rust-lang#85191 (Improve rustdoc gui tester) - rust-lang#85196 (Revert "Auto merge of rust-lang#84797 - richkadel:cover-unreachable-statements…) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
close #84637