rust/tests/ui/specialization/min_specialization/specialize_on_static.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
280 B
Rust
Raw Normal View History

// 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() {}