forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#119255 - fee1-dead-contrib:fix-ice, r=compi…
…ler-errors add a test for ICE rust-lang#112822 closes rust-lang#112822.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.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,16 @@ | ||
#![feature(const_trait_impl, effects)] | ||
|
||
const fn test() -> impl ~const Fn() { //~ ERROR ~const can only be applied to `#[const_trait]` traits | ||
const move || { //~ ERROR const closures are experimental | ||
let sl: &[u8] = b"foo"; | ||
|
||
match sl { | ||
[first, remainder @ ..] => { | ||
assert_eq!(first, &b'f'); | ||
} | ||
[] => panic!(), | ||
} | ||
} | ||
} | ||
|
||
fn main() {} |
18 changes: 18 additions & 0 deletions
18
tests/ui/rfcs/rfc-2632-const-trait-impl/effects/ice-112822-expected-type-for-param.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,18 @@ | ||
error[E0658]: const closures are experimental | ||
--> $DIR/ice-112822-expected-type-for-param.rs:4:5 | ||
| | ||
LL | const move || { | ||
| ^^^^^ | ||
| | ||
= note: see issue #106003 <https://github.com/rust-lang/rust/issues/106003> for more information | ||
= help: add `#![feature(const_closures)]` to the crate attributes to enable | ||
|
||
error: ~const can only be applied to `#[const_trait]` traits | ||
--> $DIR/ice-112822-expected-type-for-param.rs:3:32 | ||
| | ||
LL | const fn test() -> impl ~const Fn() { | ||
| ^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |