about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-07-19 11:37:47 +0200
committerGitHub <noreply@github.com>2021-07-19 11:37:47 +0200
commit4dd32a1cac15d2fec6e68d41c2483a8bdd3a78ff (patch)
tree923b4ba4dbdb9cc9de02d8334a0d282c3e4b5f2f /src/test
parent8cf995f6acb70cb09f14080df4d1232f736b2fc5 (diff)
parent93aa89023fb7eb9149e6739c7f54c3ae4a8235bf (diff)
downloadrust-4dd32a1cac15d2fec6e68d41c2483a8bdd3a78ff.tar.gz
rust-4dd32a1cac15d2fec6e68d41c2483a8bdd3a78ff.zip
Rollup merge of #87256 - Aaron1011:hir-wf-assoc-default, r=oli-obk
Extend HIR-based WF checking to associated type defaults

Previously, we would only look at associated types in `impl` blocks.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/associated-types/defaults-wf.stderr4
-rw-r--r--src/test/ui/wf/wf-trait-associated-type-trait.rs2
-rw-r--r--src/test/ui/wf/wf-trait-associated-type-trait.stderr6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/test/ui/associated-types/defaults-wf.stderr b/src/test/ui/associated-types/defaults-wf.stderr
index d4fa5be742f..73ef567ffae 100644
--- a/src/test/ui/associated-types/defaults-wf.stderr
+++ b/src/test/ui/associated-types/defaults-wf.stderr
@@ -1,8 +1,8 @@
 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/defaults-wf.rs:7:5
+  --> $DIR/defaults-wf.rs:7:15
    |
 LL |     type Ty = Vec<[u8]>;
-   |     ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+   |               ^^^^^^^^^ doesn't have a size known at compile-time
    | 
   ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
    |
diff --git a/src/test/ui/wf/wf-trait-associated-type-trait.rs b/src/test/ui/wf/wf-trait-associated-type-trait.rs
index ddc0b323a11..d67e110edee 100644
--- a/src/test/ui/wf/wf-trait-associated-type-trait.rs
+++ b/src/test/ui/wf/wf-trait-associated-type-trait.rs
@@ -8,7 +8,7 @@ struct IsCopy<T:Copy> { x: T }
 
 trait SomeTrait {
     type Type1;
-    type Type2 = IsCopy<Self::Type1>;
+    type Type2 = (IsCopy<Self::Type1>, bool);
     //~^ ERROR E0277
 }
 
diff --git a/src/test/ui/wf/wf-trait-associated-type-trait.stderr b/src/test/ui/wf/wf-trait-associated-type-trait.stderr
index a139186ebb6..d1c2c65043d 100644
--- a/src/test/ui/wf/wf-trait-associated-type-trait.stderr
+++ b/src/test/ui/wf/wf-trait-associated-type-trait.stderr
@@ -1,11 +1,11 @@
 error[E0277]: the trait bound `<Self as SomeTrait>::Type1: Copy` is not satisfied
-  --> $DIR/wf-trait-associated-type-trait.rs:11:5
+  --> $DIR/wf-trait-associated-type-trait.rs:11:19
    |
 LL | struct IsCopy<T:Copy> { x: T }
    |                 ---- required by this bound in `IsCopy`
 ...
-LL |     type Type2 = IsCopy<Self::Type1>;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `<Self as SomeTrait>::Type1`
+LL |     type Type2 = (IsCopy<Self::Type1>, bool);
+   |                   ^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `<Self as SomeTrait>::Type1`
    |
 help: consider further restricting the associated type
    |