diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 2ea13b2cb6d..f6acc085861 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -1356,9 +1356,9 @@ impl TypeAliasBounds { fn suggest_changing_assoc_types(ty: &hir::Ty, err: &mut DiagnosticBuilder) { // Access to associates types should use `::Assoc`, which does not need a - // bound. Let's see of this type does that. + // bound. Let's see if this type does that. - // We use an AST visitor to walk the type. + // We use a HIR visitor to walk the type. use rustc::hir::intravisit::{self, Visitor}; use syntax::ast::NodeId; struct WalkAssocTypes<'a, 'db> where 'db: 'a { @@ -1373,8 +1373,8 @@ impl TypeAliasBounds { fn visit_qpath(&mut self, qpath: &'v hir::QPath, id: NodeId, span: Span) { if TypeAliasBounds::is_type_variable_assoc(qpath) { self.err.span_help(span, - "use absolute paths (i.e., ::Assoc) to refer to associated \ - types in type aliases"); + "use fully disambiguated paths (i.e., `::Assoc`) to refer to \ + associated types in type aliases"); } intravisit::walk_qpath(self, qpath, id, span) } diff --git a/src/test/ui/type-alias-bounds.stderr b/src/test/ui/type-alias-bounds.stderr index 5288dca79be..2a2b0b0f26e 100644 --- a/src/test/ui/type-alias-bounds.stderr +++ b/src/test/ui/type-alias-bounds.stderr @@ -46,7 +46,7 @@ LL | type T1 = U::Assoc; //~ WARN not enforced in type aliases | ^^^^^ | = help: the bound will not be checked when the type alias is used, and should be removed -help: use absolute paths (i.e., ::Assoc) to refer to associated types in type aliases +help: use fully disambiguated paths (i.e., `::Assoc`) to refer to associated types in type aliases --> $DIR/type-alias-bounds.rs:57:21 | LL | type T1 = U::Assoc; //~ WARN not enforced in type aliases @@ -59,7 +59,7 @@ LL | type T2 where U: Bound = U::Assoc; //~ WARN not enforced in type aliase | ^^^^^^^^ | = help: the clause will not be checked when the type alias is used, and should be removed -help: use absolute paths (i.e., ::Assoc) to refer to associated types in type aliases +help: use fully disambiguated paths (i.e., `::Assoc`) to refer to associated types in type aliases --> $DIR/type-alias-bounds.rs:58:29 | LL | type T2 where U: Bound = U::Assoc; //~ WARN not enforced in type aliases