X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_infer%2Fsrc%2Finfer%2Ferror_reporting%2Fnice_region_error%2Fstatic_impl_trait.rs;h=0a9f59fbc9783dc378000dbf3520de5752927eed;hb=a643e5980052153bdb7a8271b68bd28a2bd06126;hp=412a077959d01a9104d51275eaa26c3a69cc2f5d;hpb=be3d25bd7800b67bb7675a3d74445de305fcff3d;p=rust.git diff --git a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs index 412a077959d..0a9f59fbc97 100644 --- a/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs +++ b/compiler/rustc_infer/src/infer/error_reporting/nice_region_error/static_impl_trait.rs @@ -70,7 +70,7 @@ pub(super) fn try_report_static_impl_trait(&self) -> Option { .map(|s| format!("`{}`", s)) .unwrap_or_else(|| "`fn` parameter".to_string()), lifetime, - ctxt.assoc_item.ident, + ctxt.assoc_item.name, ); err.span_label(param.param_ty_span, &format!("this data with {}...", lifetime)); err.span_label( @@ -231,7 +231,7 @@ pub(super) fn try_report_static_impl_trait(&self) -> Option { // Handle case of `impl Foo for dyn Bar { fn qux(&self) {} }` introducing a // `'static` lifetime when called as a method on a binding: `bar.qux()`. if self.find_impl_on_dyn_trait(&mut err, param.param_ty, &ctxt) { - override_error_code = Some(ctxt.assoc_item.ident); + override_error_code = Some(ctxt.assoc_item.name); } } } @@ -252,7 +252,7 @@ pub(super) fn try_report_static_impl_trait(&self) -> Option { self.get_impl_ident_and_self_ty_from_trait(*item_def_id, &v.0) { if self.suggest_constrain_dyn_trait_in_impl(&mut err, &v.0, ident, self_ty) { - override_error_code = Some(ident); + override_error_code = Some(ident.name); } } }