Skip to content

Commit 4a95b16

Browse files
committed
Move crashes tests.
1 parent cbc3cf7 commit 4a95b16

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
//@ known-bug: rust-lang/rust#128094
1+
//! Verify that we do not ICE when a coroutine body is malformed.
22
//@ compile-flags: -Zmir-enable-passes=+GVN
33
//@ edition: 2018
44

55
pub enum Request {
66
TestSome(T),
7+
//~^ ERROR cannot find type `T` in this scope [E0412]
78
}
89

910
pub async fn handle_event(event: Request) {
1011
async move {
1112
static instance: Request = Request { bar: 17 };
13+
//~^ ERROR expected struct, variant or union type, found enum `Request` [E0574]
1214
&instance
1315
}
1416
.await;
1517
}
18+
19+
fn main() {}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
error[E0412]: cannot find type `T` in this scope
2+
--> $DIR/gvn-nonsensical-coroutine-layout.rs:6:14
3+
|
4+
LL | TestSome(T),
5+
| ^ not found in this scope
6+
|
7+
help: you might be missing a type parameter
8+
|
9+
LL | pub enum Request<T> {
10+
| +++
11+
12+
error[E0574]: expected struct, variant or union type, found enum `Request`
13+
--> $DIR/gvn-nonsensical-coroutine-layout.rs:12:36
14+
|
15+
LL | static instance: Request = Request { bar: 17 };
16+
| ^^^^^^^ not a struct, variant or union type
17+
|
18+
help: consider importing this struct instead
19+
|
20+
LL + use std::error::Request;
21+
|
22+
23+
error: aborting due to 2 previous errors
24+
25+
Some errors have detailed explanations: E0412, E0574.
26+
For more information about an error, try `rustc --explain E0412`.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
//@ known-bug: #135128
1+
//! Verify that we do not ICE when optimizing bodies with nonsensical bounds.
22
//@ compile-flags: -Copt-level=1
33
//@ edition: 2021
4+
//@ build-pass
45

56
#![feature(trivial_bounds)]
67

78
async fn return_str() -> str
89
where
910
str: Sized,
11+
//~^ WARN trait bound str: Sized does not depend on any type or lifetime parameters
1012
{
1113
*"Sized".to_string().into_boxed_str()
1214
}
15+
1316
fn main() {}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+

0 commit comments

Comments
 (0)