diff options
Diffstat (limited to 'tests/ui/specialization/min_specialization/specialize_on_static.rs')
-rw-r--r-- | tests/ui/specialization/min_specialization/specialize_on_static.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/specialization/min_specialization/specialize_on_static.rs b/tests/ui/specialization/min_specialization/specialize_on_static.rs new file mode 100644 index 000000000..dd1b05401 --- /dev/null +++ b/tests/ui/specialization/min_specialization/specialize_on_static.rs @@ -0,0 +1,18 @@ +// Test that directly specializing on `'static` is not allowed. + +#![feature(min_specialization)] + +trait X { + fn f(); +} + +impl<T> X for &'_ T { + default fn f() {} +} + +impl X for &'static u8 { + //~^ ERROR cannot specialize on `'static` lifetime + fn f() {} +} + +fn main() {} |