forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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#66407 - JohnTitor:add-ice-tests, r=Centril
Add more tests for fixed ICEs Closes rust-lang#36122 (fixed in 1.20.0) Closes rust-lang#58094 (fixed in rust-lang#66054) Also, fix mistaken test case, from rust-lang#30904 to rust-lang#30906 (cc @eddyb) r? @Centril
- Loading branch information
Showing
9 changed files
with
76 additions
and
60 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
fn main() { | ||
extern { | ||
static symbol: [usize]; //~ ERROR: the size for values of type | ||
} | ||
println!("{}", symbol[0]); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/test/ui/extern/issue-36122-accessing-externed-dst.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,12 @@ | ||
error[E0277]: the size for values of type `[usize]` cannot be known at compilation time | ||
--> $DIR/issue-36122-accessing-externed-dst.rs:3:24 | ||
| | ||
LL | static symbol: [usize]; | ||
| ^^^^^^^ doesn't have a size known at compile-time | ||
| | ||
= help: the trait `std::marker::Sized` is not implemented for `[usize]` | ||
= note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait> | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
4 changes: 4 additions & 0 deletions
4
src/test/ui/parser/issue-58094-missing-right-square-bracket.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,4 @@ | ||
// Fixed in #66054. | ||
// ignore-tidy-trailing-newlines | ||
// error-pattern: aborting due to 2 previous errors | ||
#[Ѕ |
16 changes: 16 additions & 0 deletions
16
src/test/ui/parser/issue-58094-missing-right-square-bracket.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,16 @@ | ||
error: this file contains an un-closed delimiter | ||
--> $DIR/issue-58094-missing-right-square-bracket.rs:4:4 | ||
| | ||
LL | #[Ѕ | ||
| - ^ | ||
| | | ||
| un-closed delimiter | ||
|
||
error: expected item after attributes | ||
--> $DIR/issue-58094-missing-right-square-bracket.rs:4:4 | ||
| | ||
LL | #[Ѕ | ||
| ^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
error: higher-ranked subtype error | ||
--> $DIR/issue-30906.rs:15:5 | ||
| | ||
LL | test(Compose(f, |_| {})); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
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 @@ | ||
#![feature(fn_traits, unboxed_closures)] | ||
|
||
fn test<F: for<'x> FnOnce<(&'x str,)>>(_: F) {} | ||
|
||
struct Compose<F,G>(F,G); | ||
impl<T,F,G> FnOnce<(T,)> for Compose<F,G> | ||
where F: FnOnce<(T,)>, G: FnOnce<(F::Output,)> { | ||
type Output = G::Output; | ||
extern "rust-call" fn call_once(self, (x,): (T,)) -> G::Output { | ||
(self.1)((self.0)(x)) | ||
} | ||
} | ||
|
||
fn bad<T>(f: fn(&'static str) -> T) { | ||
test(Compose(f, |_| {})); //~ ERROR: mismatched types | ||
} | ||
|
||
fn main() {} |
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,12 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-30906.rs:15:5 | ||
| | ||
LL | test(Compose(f, |_| {})); | ||
| ^^^^ one type is more general than the other | ||
| | ||
= note: expected type `std::ops::FnOnce<(&'x str,)>` | ||
found type `std::ops::FnOnce<(&str,)>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |