about summary refs log tree commit diff
path: root/tests/ui/drop/dropck-normalize-errors.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/drop/dropck-normalize-errors.rs')
-rw-r--r--tests/ui/drop/dropck-normalize-errors.rs31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/ui/drop/dropck-normalize-errors.rs b/tests/ui/drop/dropck-normalize-errors.rs
new file mode 100644
index 00000000000..793122bd33d
--- /dev/null
+++ b/tests/ui/drop/dropck-normalize-errors.rs
@@ -0,0 +1,31 @@
+// Test that we don't ICE when computing the drop types for
+
+trait Decode<'a> {
+    type Decoder;
+}
+
+trait NonImplementedTrait {
+    type Assoc;
+}
+struct NonImplementedStruct;
+
+pub struct ADecoder<'a> {
+    b: <B as Decode<'a>>::Decoder,
+}
+fn make_a_decoder<'a>() -> ADecoder<'a> {
+    //~^ ERROR the trait bound
+    //~| ERROR the trait bound
+    panic!()
+}
+
+struct B;
+impl<'a> Decode<'a> for B {
+    type Decoder = BDecoder;
+    //~^ ERROR the trait bound
+}
+pub struct BDecoder {
+    non_implemented: <NonImplementedStruct as NonImplementedTrait>::Assoc,
+    //~^ ERROR the trait bound
+}
+
+fn main() {}