about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs6
-rw-r--r--tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_eager.stderr8
-rw-r--r--tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_lazy.stderr8
-rw-r--r--tests/ui/lazy-type-alias/trailing-where-clause.stderr11
4 files changed, 19 insertions, 14 deletions
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
index 823422fab14..7707cc6de54 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs
@@ -318,8 +318,10 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
     fn record_ty(&self, hir_id: hir::HirId, ty: Ty<'tcx>, span: Span) {
         // FIXME: normalization and escaping regions
         let ty = if !ty.has_escaping_bound_vars() {
-            if let ty::Alias(ty::AliasKind::Projection, ty::AliasTy { args, def_id, .. }) =
-                ty.kind()
+            if let ty::Alias(
+                ty::AliasKind::Projection | ty::AliasKind::Weak,
+                ty::AliasTy { args, def_id, .. },
+            ) = ty.kind()
             {
                 self.add_required_obligations_for_hir(span, *def_id, args, hir_id);
             }
diff --git a/tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_eager.stderr b/tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_eager.stderr
index 9e0e2bfa872..3b216ac1581 100644
--- a/tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_eager.stderr
+++ b/tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_eager.stderr
@@ -1,14 +1,14 @@
 error[E0277]: the trait bound `String: Copy` is not satisfied
-  --> $DIR/extern-crate-has-lazy-type-aliases.rs:15:12
+  --> $DIR/extern-crate-has-lazy-type-aliases.rs:15:24
    |
 LL |     let _: lazy::Alias<String>;
-   |            ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+   |                        ^^^^^^ the trait `Copy` is not implemented for `String`
    |
-note: required by a bound on the type alias `Alias`
+note: required by a bound in `lazy::Alias`
   --> $DIR/auxiliary/lazy.rs:4:19
    |
 LL | pub type Alias<T: Copy> = Option<T>;
-   |                   ^^^^ required by this bound
+   |                   ^^^^ required by this bound in `Alias`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_lazy.stderr b/tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_lazy.stderr
index 9e0e2bfa872..3b216ac1581 100644
--- a/tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_lazy.stderr
+++ b/tests/ui/lazy-type-alias/extern-crate-has-lazy-type-aliases.locally_lazy.stderr
@@ -1,14 +1,14 @@
 error[E0277]: the trait bound `String: Copy` is not satisfied
-  --> $DIR/extern-crate-has-lazy-type-aliases.rs:15:12
+  --> $DIR/extern-crate-has-lazy-type-aliases.rs:15:24
    |
 LL |     let _: lazy::Alias<String>;
-   |            ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+   |                        ^^^^^^ the trait `Copy` is not implemented for `String`
    |
-note: required by a bound on the type alias `Alias`
+note: required by a bound in `lazy::Alias`
   --> $DIR/auxiliary/lazy.rs:4:19
    |
 LL | pub type Alias<T: Copy> = Option<T>;
-   |                   ^^^^ required by this bound
+   |                   ^^^^ required by this bound in `Alias`
 
 error: aborting due to previous error
 
diff --git a/tests/ui/lazy-type-alias/trailing-where-clause.stderr b/tests/ui/lazy-type-alias/trailing-where-clause.stderr
index d7606ba6b2a..193f80b23d3 100644
--- a/tests/ui/lazy-type-alias/trailing-where-clause.stderr
+++ b/tests/ui/lazy-type-alias/trailing-where-clause.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the trait bound `String: From<()>` is not satisfied
-  --> $DIR/trailing-where-clause.rs:12:12
+  --> $DIR/trailing-where-clause.rs:12:18
    |
 LL |     let _: Alias<()>;
-   |            ^^^^^^^^^ the trait `From<()>` is not implemented for `String`
+   |                  ^^ the trait `From<()>` is not implemented for `String`
    |
    = help: the following other types implement trait `From<T>`:
              <String as From<char>>
@@ -11,11 +11,14 @@ LL |     let _: Alias<()>;
              <String as From<&str>>
              <String as From<&mut str>>
              <String as From<&String>>
-note: required by a bound on the type alias `Alias`
+note: required by a bound in `Alias`
   --> $DIR/trailing-where-clause.rs:8:13
    |
+LL | type Alias<T> = T
+   |      ----- required by a bound in this type alias
+LL | where
 LL |     String: From<T>;
-   |             ^^^^^^^ required by this bound
+   |             ^^^^^^^ required by this bound in `Alias`
 
 error: aborting due to previous error