Skip to content

Commit

Permalink
wording nits
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Mar 19, 2018
1 parent 0e6d40a commit 37ff473
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/librustc_lint/builtin.rs
Expand Up @@ -1356,9 +1356,9 @@ impl TypeAliasBounds {

fn suggest_changing_assoc_types(ty: &hir::Ty, err: &mut DiagnosticBuilder) {
// Access to associates types should use `<T as Bound>::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 {
Expand All @@ -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., <T as Trait>::Assoc) to refer to associated \
types in type aliases");
"use fully disambiguated paths (i.e., `<T as Trait>::Assoc`) to refer to \
associated types in type aliases");
}
intravisit::walk_qpath(self, qpath, id, span)
}
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/type-alias-bounds.stderr
Expand Up @@ -46,7 +46,7 @@ LL | type T1<U: Bound> = 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., <T as Trait>::Assoc) to refer to associated types in type aliases
help: use fully disambiguated paths (i.e., `<T as Trait>::Assoc`) to refer to associated types in type aliases
--> $DIR/type-alias-bounds.rs:57:21
|
LL | type T1<U: Bound> = U::Assoc; //~ WARN not enforced in type aliases
Expand All @@ -59,7 +59,7 @@ LL | type T2<U> 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., <T as Trait>::Assoc) to refer to associated types in type aliases
help: use fully disambiguated paths (i.e., `<T as Trait>::Assoc`) to refer to associated types in type aliases
--> $DIR/type-alias-bounds.rs:58:29
|
LL | type T2<U> where U: Bound = U::Assoc; //~ WARN not enforced in type aliases
Expand Down

0 comments on commit 37ff473

Please sign in to comment.