]> git.lizzy.rs Git - rust.git/blob - tests/ui/trivial-bounds/trivial-bounds-inconsistent-associated-functions.rs
Rollup merge of #106106 - jyn514:remote-tracking-branch, r=Mark-Simulacrum
[rust.git] / tests / ui / trivial-bounds / trivial-bounds-inconsistent-associated-functions.rs
1 // check-pass
2 // compile-flags: --emit=mir,link
3 // Force mir to be emitted, to ensure that const
4 // propagation doesn't ICE on a function
5 // with an 'impossible' body. See issue #67696
6 // Inconsistent bounds with trait implementations
7
8 #![feature(trivial_bounds)]
9 #![allow(unused)]
10
11 trait A {
12     fn foo(&self) -> Self where Self: Copy;
13 }
14
15 impl A for str {
16     fn foo(&self) -> Self where Self: Copy { *"" }
17 }
18
19 impl A for i32 {
20     fn foo(&self) -> Self { 3 }
21 }
22
23 fn main() {}