]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-free-vs-bound-region.rs
Rollup merge of #103065 - aDotInTheVoid:rdj-arg-pattern, r=GuillaumeGomez
[rust.git] / src / test / ui / coherence / coherence-free-vs-bound-region.rs
1 // Capture a coherence pattern from wasm-bindgen that we discovered as part of
2 // future-compatibility warning #56105. This pattern currently receives a lint
3 // warning but we probably want to support it long term.
4 //
5 // Key distinction: we are implementing once for `A` (take ownership) and one
6 // for `&A` (borrow).
7 //
8 // c.f. #56105
9
10 #![deny(coherence_leak_check)]
11
12 trait TheTrait {}
13
14 impl<'a> TheTrait for fn(&'a u8) {}
15
16 impl TheTrait for fn(&u8) {
17     //~^ ERROR conflicting implementations of trait
18     //~| WARNING this was previously accepted by the compiler
19 }
20
21 fn main() {}