summaryrefslogtreecommitdiffstats
path: root/src/test/ui/specialization/min_specialization/specialize_on_static.rs
blob: dd1b05401e6e7dc754fd695f896172517517f0e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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() {}