about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-09-09 00:58:38 +0000
committerbors <bors@rust-lang.org>2019-09-09 00:58:38 +0000
commit7eb65dfe66e56618f87531cdc378865135c47efb (patch)
tree93b0dedbfd2a054b8de311e8e8b51e30dcc9dfd0 /src/test/ui
parenta6624ed9806fe4caa10de5b94e590f71a4a1eab9 (diff)
parentc44ffafab902e687ef01d2366a7de7237e25245c (diff)
downloadrust-7eb65dfe66e56618f87531cdc378865135c47efb.tar.gz
rust-7eb65dfe66e56618f87531cdc378865135c47efb.zip
Auto merge of #64108 - estebank:issue-36836, r=Centril
Do not complain about unconstrained params when Self is Ty Error

Fix #36836.
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/issues/issue-36836.rs15
-rw-r--r--src/test/ui/issues/issue-36836.stderr9
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-36836.rs b/src/test/ui/issues/issue-36836.rs
new file mode 100644
index 00000000000..99c56213153
--- /dev/null
+++ b/src/test/ui/issues/issue-36836.rs
@@ -0,0 +1,15 @@
+// Previously, in addition to the real cause of the problem as seen below,
+// the compiler would tell the user:
+//
+// ```
+// error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or
+// predicates
+// ```
+//
+// With this test, we check that only the relevant error is emitted.
+
+trait Foo {}
+
+impl<T> Foo for Bar<T> {} //~ ERROR cannot find type `Bar` in this scope
+
+fn main() {}
diff --git a/src/test/ui/issues/issue-36836.stderr b/src/test/ui/issues/issue-36836.stderr
new file mode 100644
index 00000000000..418194fac99
--- /dev/null
+++ b/src/test/ui/issues/issue-36836.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `Bar` in this scope
+  --> $DIR/issue-36836.rs:13:17
+   |
+LL | impl<T> Foo for Bar<T> {}
+   |                 ^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.