File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 1
- //@ known-bug: #135128
1
+ //! Verify that we do not ICE when optimizing bodies with nonsensical bounds.
2
2
//@ compile-flags: -Copt-level=1
3
3
//@ edition: 2021
4
+ //@ build-pass
4
5
5
6
#![ feature( trivial_bounds) ]
6
7
7
8
async fn return_str ( ) -> str
8
9
where
9
10
str : Sized ,
11
+ //~^ WARN trait bound str: Sized does not depend on any type or lifetime parameters
10
12
{
11
13
* "Sized" . to_string ( ) . into_boxed_str ( )
12
14
}
15
+
13
16
fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ warning: trait bound str: Sized does not depend on any type or lifetime parameters
2
+ --> $DIR/gvn-nonsensical-sized-str.rs:10:10
3
+ |
4
+ LL | str: Sized,
5
+ | ^^^^^
6
+ |
7
+ = note: `#[warn(trivial_bounds)]` on by default
8
+
9
+ warning: 1 warning emitted
10
+
You can’t perform that action at this time.
0 commit comments