]> git.lizzy.rs Git - rust.git/blob - tests/ui/crashes/ice-3969.rs
Auto merge of #6298 - JohnTitor:fix-example, r=llogiq
[rust.git] / tests / ui / crashes / ice-3969.rs
1 // https://github.com/rust-lang/rust-clippy/issues/3969
2 // used to crash: error: internal compiler error:
3 // src/librustc_traits/normalize_erasing_regions.rs:43: could not fully normalize `<i32 as
4 // std::iter::Iterator>::Item test from rustc ./ui/trivial-bounds/trivial-bounds-inconsistent.rs
5
6 // Check that tautalogically false bounds are accepted, and are used
7 // in type inference.
8 #![feature(trivial_bounds)]
9 #![allow(unused)]
10
11 trait A {}
12
13 impl A for i32 {}
14
15 struct Dst<X: ?Sized> {
16     x: X,
17 }
18
19 struct TwoStrs(str, str)
20 where
21     str: Sized;
22
23 fn unsized_local()
24 where
25     for<'a> Dst<A + 'a>: Sized,
26 {
27     let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>);
28 }
29
30 fn return_str() -> str
31 where
32     str: Sized,
33 {
34     *"Sized".to_string().into_boxed_str()
35 }
36
37 fn use_op(s: String) -> String
38 where
39     String: ::std::ops::Neg<Output = String>,
40 {
41     -s
42 }
43
44 fn use_for()
45 where
46     i32: Iterator,
47 {
48     for _ in 2i32 {}
49 }
50
51 fn main() {}