Skip to content

Add more tests for fixed ICEs #66407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/test/ui/extern/issue-36122-accessing-externed-dst.rs
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 src/test/ui/extern/issue-36122-accessing-externed-dst.stderr
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`.
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 src/test/ui/parser/issue-58094-missing-right-square-bracket.stderr
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

36 changes: 0 additions & 36 deletions src/test/ui/unboxed-closures/issue-30904.rs

This file was deleted.

24 changes: 0 additions & 24 deletions src/test/ui/unboxed-closures/issue-30904.stderr

This file was deleted.

8 changes: 8 additions & 0 deletions src/test/ui/unboxed-closures/issue-30906.nll.stderr
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

18 changes: 18 additions & 0 deletions src/test/ui/unboxed-closures/issue-30906.rs
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() {}
12 changes: 12 additions & 0 deletions src/test/ui/unboxed-closures/issue-30906.stderr
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`.