From fe08ac6da4643fa30e0da5e78f1d040d2aff4f01 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 5 Sep 2019 11:26:51 +1000 Subject: [PATCH] Use `ast::Name` in `report_ambiguous_associated_type()`. --- src/librustc_typeck/astconv.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index 9e52eae88ef..af0818053a4 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -1461,7 +1461,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { span: Span, type_str: &str, trait_str: &str, - name: &str, + name: ast::Name, ) { let mut err = struct_span_err!(self.tcx().sess, span, E0223, "ambiguous associated type"); if let (Some(_), Ok(snippet)) = ( @@ -1688,7 +1688,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { span, &qself_ty.to_string(), "Trait", - &assoc_ident.as_str(), + assoc_ident.name, ); } return Err(ErrorReported); @@ -1761,7 +1761,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { span, "Type", &path_str, - &item_segment.ident.as_str(), + item_segment.ident.name, ); return tcx.types.err; };