Skip to content

Commit f6904d9

Browse files
authored
Unrolled build for rust-lang#119255
Rollup merge of rust-lang#119255 - fee1-dead-contrib:fix-ice, r=compiler-errors add a test for ICE rust-lang#112822 closes rust-lang#112822.
2 parents 520e30b + 3006814 commit f6904d9

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#![feature(const_trait_impl, effects)]
2+
3+
const fn test() -> impl ~const Fn() { //~ ERROR ~const can only be applied to `#[const_trait]` traits
4+
const move || { //~ ERROR const closures are experimental
5+
let sl: &[u8] = b"foo";
6+
7+
match sl {
8+
[first, remainder @ ..] => {
9+
assert_eq!(first, &b'f');
10+
}
11+
[] => panic!(),
12+
}
13+
}
14+
}
15+
16+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
error[E0658]: const closures are experimental
2+
--> $DIR/ice-112822-expected-type-for-param.rs:4:5
3+
|
4+
LL | const move || {
5+
| ^^^^^
6+
|
7+
= note: see issue #106003 <https://github.com/rust-lang/rust/issues/106003> for more information
8+
= help: add `#![feature(const_closures)]` to the crate attributes to enable
9+
10+
error: ~const can only be applied to `#[const_trait]` traits
11+
--> $DIR/ice-112822-expected-type-for-param.rs:3:32
12+
|
13+
LL | const fn test() -> impl ~const Fn() {
14+
| ^^^^
15+
16+
error: aborting due to 2 previous errors
17+
18+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)