Skip to content
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

Merged
merged 2 commits into from
May 12, 2021

Conversation

Rustin170506
Copy link
Member

close #84637

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 7, 2021
@Rustin170506
Copy link
Member Author

Rustin170506 commented May 7, 2021

I don't know if passing method span is a good solution😆

Copy link
Contributor

@estebank estebank left a 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));
Copy link
Contributor

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?

Copy link
Member Author

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`

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

compiler/rustc_middle/src/middle/stability.rs Outdated Show resolved Hide resolved
@Rustin170506 Rustin170506 requested a review from estebank May 8, 2021 04:30
@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 11, 2021

📌 Commit 7c5bc20 has been approved by estebank

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 11, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request May 11, 2021
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
@bors bors merged commit 649b385 into rust-lang:master May 12, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rustc_deprecated suggestions don't always cargo fix correctly
5 participants