-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
shrinking the deprecated method span #85018
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -205,7 +205,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
| .insert(*import_id); | ||||
| } | ||||
|
|
||||
| self.tcx.check_stability(pick.item.def_id, Some(call_expr.hir_id), span); | ||||
| self.tcx.check_stability(pick.item.def_id, Some(call_expr.hir_id), span, None); | ||||
|
|
||||
| let result = | ||||
| self.confirm_method(span, self_expr, call_expr, self_ty, pick.clone(), segment); | ||||
|
|
@@ -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)); | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if you change this and the change below to pass
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will get an error:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rust/compiler/rustc_span/src/lib.rs Line 512 in d6d0283
It looks like this is because |
||||
| return Ok(( | ||||
| DefKind::Ctor(CtorOf::Variant, variant_def.ctor_kind), | ||||
| ctor_def_id, | ||||
|
|
@@ -475,7 +475,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { | |||
|
|
||||
| let def_kind = pick.item.kind.as_def_kind(); | ||||
| debug!("resolve_ufcs: def_kind={:?}, def_id={:?}", def_kind, pick.item.def_id); | ||||
| tcx.check_stability(pick.item.def_id, Some(expr_id), span); | ||||
| tcx.check_stability(pick.item.def_id, Some(expr_id), span, Some(method_name.span)); | ||||
| Ok((def_kind, pick.item.def_id)) | ||||
| } | ||||
|
|
||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // run-rustfix | ||
|
|
||
| #![deny(deprecated)] | ||
|
|
||
| fn main() { | ||
| let _foo = str::trim_start(" aoeu"); //~ ERROR use of deprecated associated function `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated] | ||
|
|
||
| let _bar = " aoeu".trim_start(); //~ ERROR use of deprecated associated function `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated] | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.