summaryrefslogtreecommitdiffstats
path: root/src/test/ui/compare-method/region-extra-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/compare-method/region-extra-2.rs')
-rw-r--r--src/test/ui/compare-method/region-extra-2.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/compare-method/region-extra-2.rs b/src/test/ui/compare-method/region-extra-2.rs
new file mode 100644
index 000000000..3d57b544e
--- /dev/null
+++ b/src/test/ui/compare-method/region-extra-2.rs
@@ -0,0 +1,15 @@
+// Regression test for issue #22779. An extra where clause was
+// permitted on the impl that is not present on the trait.
+
+trait Tr<'a, T> {
+ fn renew<'b: 'a>(self) -> &'b mut [T];
+}
+
+impl<'a, T> Tr<'a, T> for &'a mut [T] {
+ fn renew<'b: 'a>(self) -> &'b mut [T] where 'a: 'b {
+ //~^ ERROR E0276
+ &mut self[..]
+ }
+}
+
+fn main() { }