File tree Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Original file line number Diff line number Diff line change 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 ( ) { }
Original file line number Diff line number Diff line change 1+ error: trait objects without an explicit `dyn` are deprecated
2+ --> $DIR/ice-3969.rs:25:17
3+ |
4+ LL | for<'a> Dst<A + 'a>: Sized,
5+ | ^^^^^^ help: use `dyn`: `dyn A + 'a`
6+ |
7+ = note: `-D bare-trait-objects` implied by `-D warnings`
8+
9+ error: trait objects without an explicit `dyn` are deprecated
10+ --> $DIR/ice-3969.rs:27:16
11+ |
12+ LL | let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>);
13+ | ^ help: use `dyn`: `dyn A`
14+
15+ error: trait objects without an explicit `dyn` are deprecated
16+ --> $DIR/ice-3969.rs:27:57
17+ |
18+ LL | let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>);
19+ | ^ help: use `dyn`: `dyn A`
20+
21+ error: aborting due to 3 previous errors
22+
You can’t perform that action at this time.
0 commit comments