]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-fn-implied-bounds.rs
Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync
[rust.git] / src / test / ui / coherence / coherence-fn-implied-bounds.rs
1 // Test that our leak-check is not smart enough to take implied bounds
2 // into account (yet). Here we have two types that look like they
3 // should not be equivalent, but because of the rules on implied
4 // bounds we ought to know that, in fact, `'a = 'b` must always hold,
5 // and hence they are.
6 //
7 // Rustc can't figure this out and hence it accepts the impls but
8 // gives a future-compatibility warning (because we'd like to make
9 // this an error someday).
10 //
11 // Note that while we would like to make this a hard error, we also
12 // give the same warning for `coherence-wasm-bindgen.rs`, which ought
13 // to be accepted.
14
15 #![deny(coherence_leak_check)]
16
17 trait Trait {}
18
19 impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {}
20
21 impl Trait for for<'c> fn(&'c &'c u32, &'c &'c u32) -> &'c u32 {
22     //~^ ERROR conflicting implementations
23     //~| WARNING this was previously accepted by the compiler
24 }
25
26 fn main() {}