Skip to content

Commit e3c78d5

Browse files
authored
Rollup merge of #66407 - JohnTitor:add-ice-tests, r=Centril
Add more tests for fixed ICEs Closes #36122 (fixed in 1.20.0) Closes #58094 (fixed in #66054) Also, fix mistaken test case, from #30904 to #30906 (cc @eddyb) r? @Centril
2 parents 6e5a4c1 + 614abe4 commit e3c78d5

9 files changed

+76
-60
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn main() {
2+
extern {
3+
static symbol: [usize]; //~ ERROR: the size for values of type
4+
}
5+
println!("{}", symbol[0]);
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0277]: the size for values of type `[usize]` cannot be known at compilation time
2+
--> $DIR/issue-36122-accessing-externed-dst.rs:3:24
3+
|
4+
LL | static symbol: [usize];
5+
| ^^^^^^^ doesn't have a size known at compile-time
6+
|
7+
= help: the trait `std::marker::Sized` is not implemented for `[usize]`
8+
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0277`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// Fixed in #66054.
2+
// ignore-tidy-trailing-newlines
3+
// error-pattern: aborting due to 2 previous errors
4+
#[Ѕ
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
error: this file contains an un-closed delimiter
2+
--> $DIR/issue-58094-missing-right-square-bracket.rs:4:4
3+
|
4+
LL | #[Ѕ
5+
| - ^
6+
| |
7+
| un-closed delimiter
8+
9+
error: expected item after attributes
10+
--> $DIR/issue-58094-missing-right-square-bracket.rs:4:4
11+
|
12+
LL | #[Ѕ
13+
| ^
14+
15+
error: aborting due to 2 previous errors
16+

src/test/ui/unboxed-closures/issue-30904.rs

-36
This file was deleted.

src/test/ui/unboxed-closures/issue-30904.stderr

-24
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: higher-ranked subtype error
2+
--> $DIR/issue-30906.rs:15:5
3+
|
4+
LL | test(Compose(f, |_| {}));
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#![feature(fn_traits, unboxed_closures)]
2+
3+
fn test<F: for<'x> FnOnce<(&'x str,)>>(_: F) {}
4+
5+
struct Compose<F,G>(F,G);
6+
impl<T,F,G> FnOnce<(T,)> for Compose<F,G>
7+
where F: FnOnce<(T,)>, G: FnOnce<(F::Output,)> {
8+
type Output = G::Output;
9+
extern "rust-call" fn call_once(self, (x,): (T,)) -> G::Output {
10+
(self.1)((self.0)(x))
11+
}
12+
}
13+
14+
fn bad<T>(f: fn(&'static str) -> T) {
15+
test(Compose(f, |_| {})); //~ ERROR: mismatched types
16+
}
17+
18+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0308]: mismatched types
2+
--> $DIR/issue-30906.rs:15:5
3+
|
4+
LL | test(Compose(f, |_| {}));
5+
| ^^^^ one type is more general than the other
6+
|
7+
= note: expected type `std::ops::FnOnce<(&'x str,)>`
8+
found type `std::ops::FnOnce<(&str,)>`
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)