-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add continue livenodes in liveness check for blocks
- Loading branch information
1 parent
53ed660
commit 46d6915
Showing
5 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#![allow(incomplete_features)] | ||
#![feature(adt_const_params)] | ||
|
||
trait Trait<const S: &'static str> {} | ||
|
||
struct Bug<T> | ||
where | ||
T: Trait< | ||
{ | ||
'b: { | ||
continue 'b; | ||
//~^ ERROR [E0080] | ||
//~| ERROR [E0080] | ||
//~| ERROR [E0696] | ||
} | ||
}, | ||
>, | ||
{ | ||
t: T, | ||
} | ||
|
||
fn f() -> impl Sized { | ||
'b: { | ||
continue 'b; | ||
//~^ ERROR [E0696] | ||
} | ||
} | ||
|
||
fn main() { | ||
f(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
error[E0696]: `continue` pointing to a labeled block | ||
--> $DIR/cont-in-fn-issue-113379.rs:11:17 | ||
| | ||
LL | / 'b: { | ||
LL | | continue 'b; | ||
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d | ||
LL | | | ||
LL | | | ||
LL | | | ||
LL | | } | ||
| |_____________- labeled block the `continue` points to | ||
|
||
error[E0696]: `continue` pointing to a labeled block | ||
--> $DIR/cont-in-fn-issue-113379.rs:24:9 | ||
| | ||
LL | / 'b: { | ||
LL | | continue 'b; | ||
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d | ||
LL | | | ||
LL | | } | ||
| |_____- labeled block the `continue` points to | ||
|
||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/cont-in-fn-issue-113379.rs:11:17 | ||
| | ||
LL | continue 'b; | ||
| ^^^^^^^^^^^ entering unreachable code | ||
|
||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/cont-in-fn-issue-113379.rs:11:17 | ||
| | ||
LL | continue 'b; | ||
| ^^^^^^^^^^^ entering unreachable code | ||
| | ||
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0080, E0696. | ||
For more information about an error, try `rustc --explain E0080`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
fn main() { | ||
match () { | ||
_ => 'b: { | ||
continue 'b; | ||
//~^ ERROR [E0696] | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/ui/mir/liveness/cont-in-match-arm-issue-121623.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error[E0696]: `continue` pointing to a labeled block | ||
--> $DIR/cont-in-match-arm-issue-121623.rs:4:13 | ||
| | ||
LL | _ => 'b: { | ||
| ______________- | ||
LL | | continue 'b; | ||
| | ^^^^^^^^^^^ labeled blocks cannot be `continue`'d | ||
LL | | | ||
LL | | } | ||
| |_________- labeled block the `continue` points to | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0696`. |