Skip to content
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

Add some tests for fixed ICEs #65688

Merged
merged 4 commits into from
Oct 23, 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
10 changes: 10 additions & 0 deletions src/test/ui/asm/issue-51431.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// ignore-emscripten no asm! support

#![feature(asm)]

fn main() {
unsafe {
asm! {"mov $0,$1"::"0"("bx"),"1"(0x00)}
//~^ ERROR: invalid value for constraint in inline assembly
}
}
8 changes: 8 additions & 0 deletions src/test/ui/asm/issue-51431.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error[E0669]: invalid value for constraint in inline assembly
--> $DIR/issue-51431.rs:7:32
|
LL | asm! {"mov $0,$1"::"0"("bx"),"1"(0x00)}
| ^^^^

error: aborting due to previous error

9 changes: 9 additions & 0 deletions src/test/ui/associated-const/issue-63496.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
trait A {
const C: usize;

fn f() -> ([u8; A::C], [u8; A::C]);
//~^ ERROR: type annotations needed: cannot resolve
//~| ERROR: type annotations needed: cannot resolve
}

fn main() {}
21 changes: 21 additions & 0 deletions src/test/ui/associated-const/issue-63496.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
error[E0283]: type annotations needed: cannot resolve `_: A`
--> $DIR/issue-63496.rs:4:21
|
LL | const C: usize;
| --------------- required by `A::C`
LL |
LL | fn f() -> ([u8; A::C], [u8; A::C]);
| ^^^^

error[E0283]: type annotations needed: cannot resolve `_: A`
--> $DIR/issue-63496.rs:4:33
|
LL | const C: usize;
| --------------- required by `A::C`
LL |
LL | fn f() -> ([u8; A::C], [u8; A::C]);
| ^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0283`.
13 changes: 13 additions & 0 deletions src/test/ui/closures/issue-41366.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
trait T<'x> {
type V;
}

impl<'g> T<'g> for u32 {
type V = u16;
}

fn main() {
(&|_|()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
//~^ ERROR: type mismatch in closure arguments
//~| ERROR: type mismatch resolving
}
22 changes: 22 additions & 0 deletions src/test/ui/closures/issue-41366.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
error[E0631]: type mismatch in closure arguments
--> $DIR/issue-41366.rs:10:5
|
LL | (&|_|()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
| ^^-----^
| | |
| | found signature of `fn(_) -> _`
| expected signature of `for<'x> fn(<u32 as T<'x>>::V) -> _`
|
= note: required for the cast to the object type `dyn for<'x> std::ops::Fn(<u32 as T<'x>>::V)`

error[E0271]: type mismatch resolving `for<'x> <[closure@$DIR/issue-41366.rs:10:7: 10:12] as std::ops::FnOnce<(<u32 as T<'x>>::V,)>>::Output == ()`
--> $DIR/issue-41366.rs:10:5
|
LL | (&|_|()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
| ^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime
|
= note: required for the cast to the object type `dyn for<'x> std::ops::Fn(<u32 as T<'x>>::V)`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.
5 changes: 5 additions & 0 deletions src/test/ui/closures/issue-52437.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fn main() {
[(); &(&'static: loop { |x| {}; }) as *const _ as usize]
//~^ ERROR: invalid label name `'static`
//~| ERROR: type annotations needed
}
15 changes: 15 additions & 0 deletions src/test/ui/closures/issue-52437.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error: invalid label name `'static`
--> $DIR/issue-52437.rs:2:13
|
LL | [(); &(&'static: loop { |x| {}; }) as *const _ as usize]
| ^^^^^^^

error[E0282]: type annotations needed
--> $DIR/issue-52437.rs:2:30
|
LL | [(); &(&'static: loop { |x| {}; }) as *const _ as usize]
| ^ consider giving this closure parameter a type

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0282`.