-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't ICE for late-bound consts across AnonConstBoundary
- Loading branch information
1 parent
f1b1ed7
commit 8a53570
Showing
3 changed files
with
37 additions
and
7 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
11 changes: 11 additions & 0 deletions
11
tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.rs
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,11 @@ | ||
#![feature(non_lifetime_binders)] | ||
//~^ WARN the feature `non_lifetime_binders` is incomplete | ||
|
||
fn b() | ||
where | ||
for<const C: usize> [(); C]: Copy, | ||
//~^ ERROR cannot capture late-bound const parameter in a constant | ||
{ | ||
} | ||
|
||
fn main() {} |
19 changes: 19 additions & 0 deletions
19
tests/ui/traits/non_lifetime_binders/capture-late-ct-in-anon.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,19 @@ | ||
warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/capture-late-ct-in-anon.rs:1:12 | ||
| | ||
LL | #![feature(non_lifetime_binders)] | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
error: cannot capture late-bound const parameter in a constant | ||
--> $DIR/capture-late-ct-in-anon.rs:6:30 | ||
| | ||
LL | for<const C: usize> [(); C]: Copy, | ||
| -------------- ^ | ||
| | | ||
| parameter defined here | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|