mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-09 05:23:07 +00:00
add a test for ICE #112822
This commit is contained in:
parent
edcbcc768a
commit
3006814404
@ -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() {}
|
@ -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`.
|
Loading…
Reference in New Issue
Block a user