summaryrefslogtreecommitdiffstats
path: root/src/test/ui/compare-method/trait-bound-on-type-parameter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/compare-method/trait-bound-on-type-parameter.rs')
-rw-r--r--src/test/ui/compare-method/trait-bound-on-type-parameter.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/compare-method/trait-bound-on-type-parameter.rs b/src/test/ui/compare-method/trait-bound-on-type-parameter.rs
new file mode 100644
index 000000000..5359001ea
--- /dev/null
+++ b/src/test/ui/compare-method/trait-bound-on-type-parameter.rs
@@ -0,0 +1,18 @@
+// Tests that impl can't add extra `F: Sync` bound aren't *more* restrictive
+// than the trait method it's implementing.
+//
+// Regr test for #26111.
+
+trait A {
+ fn b<C,D>(&self, x: C) -> C;
+}
+
+struct E {
+ f: isize
+}
+
+impl A for E {
+ fn b<F: Sync, G>(&self, _x: F) -> F { panic!() } //~ ERROR E0276
+}
+
+fn main() {}