Skip to content

shrinking the deprecated method span - #85018

Merged
bors merged 2 commits into
rust-lang:masterfrom
0xPoe:rustin-patch-84637
May 12, 2021
Merged

shrinking the deprecated method span#85018
bors merged 2 commits into
rust-lang:masterfrom
0xPoe:rustin-patch-84637

Conversation

@0xPoe

@0xPoe0xPoe commented May 7, 2021

Copy link
Copy Markdown
Member

close#84637

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @estebank

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

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 7, 2021
@0xPoe

0xPoe commented May 7, 2021

Copy link
Copy Markdown
MemberAuthor

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

@estebankestebank left a comment

Copy link
Copy Markdown
Contributor

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?

// 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
Copy Markdown
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
Copy Markdown
MemberAuthor

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
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

pubfnallows_unstable(&self,feature:Symbol) -> bool{

It looks like this is because allow_internal_unstable is not recognized when we use method_span.

Comment threadcompiler/rustc_middle/src/middle/stability.rs Outdated
@0xPoe
0xPoe requested a review from estebankMay 8, 2021 04:30
@estebank

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented May 11, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 7c5bc20 has been approved by estebank

@borsbors 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
@JohnTitorJohnTitor mentioned this pull request 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:masterMay 12, 2021
@rustbotrustbot added this to the 1.54.0 milestone May 12, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: 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

@0xPoe@rust-highfive@estebank@bors@rustbot