forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#52558 - wesleywiser:ice_melting, r=estebank
Add tests for ICEs which no longer repro Adds tests for some ICEs which no longer repro and closes the associated issues.
- Loading branch information
Showing
9 changed files
with
210 additions
and
0 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,37 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#![allow(dead_code, non_upper_case_globals)] | ||
#![feature(asm)] | ||
|
||
#[repr(C)] | ||
pub struct D32x4(f32,f32,f32,f32); | ||
|
||
impl D32x4 { | ||
fn add(&self, vec: Self) -> Self { | ||
unsafe { | ||
let ret: Self; | ||
asm!(" | ||
movaps $1, %xmm1 | ||
movaps $2, %xmm2 | ||
addps %xmm1, %xmm2 | ||
movaps $xmm1, $0 | ||
" | ||
: "=r"(ret) | ||
: "1"(self), "2"(vec) | ||
: "xmm1", "xmm2" | ||
); | ||
ret | ||
} | ||
} | ||
} | ||
|
||
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,21 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
const C: *const u8 = &0; | ||
|
||
fn foo(x: *const u8) { | ||
match x { | ||
C => {} | ||
_ => {} | ||
} | ||
} | ||
|
||
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,39 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
pub trait Foo<'a> { | ||
type Bar; | ||
fn foo(&'a self) -> Self::Bar; | ||
} | ||
|
||
impl<'a, 'b, T: 'a> Foo<'a> for &'b T { | ||
type Bar = &'a T; | ||
fn foo(&'a self) -> &'a T { | ||
self | ||
} | ||
} | ||
|
||
pub fn uncallable<T, F>(x: T, f: F) | ||
where T: for<'a> Foo<'a>, | ||
F: for<'a> Fn(<T as Foo<'a>>::Bar) | ||
{ | ||
f(x.foo()); | ||
} | ||
|
||
pub fn catalyst(x: &i32) { | ||
broken(x, |_| {}) | ||
} | ||
|
||
pub fn broken<F: Fn(&i32)>(x: &i32, f: F) { | ||
uncallable(x, |y| f(y)); | ||
} | ||
|
||
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,20 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
const C: *const [u8; 4] = b"abcd"; | ||
|
||
fn main() { | ||
match C { | ||
C => {} | ||
//~^ ERROR this expression will panic at runtime | ||
_ => {} | ||
} | ||
} | ||
|
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,10 @@ | ||
error: this expression will panic at runtime | ||
--> $DIR/issue-34784.rs:15:9 | ||
| | ||
LL | C => {} | ||
| ^ "pointer arithmetic or comparison" needs an rfc before being allowed inside constants | ||
| | ||
= note: #[deny(const_err)] on by default | ||
|
||
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,22 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
fn main() { | ||
let thing = (); | ||
let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant | ||
//~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516] | ||
} | ||
|
||
fn f(){ | ||
let q = 1; | ||
<typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant | ||
//~^ ERROR `typeof` is a reserved keyword but unimplemented [E0516] | ||
} | ||
|
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,28 @@ | ||
error[E0435]: attempt to use a non-constant value in a constant | ||
--> $DIR/issue-42060.rs:13:23 | ||
| | ||
LL | let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant | ||
| ^^^^^ non-constant value | ||
|
||
error[E0435]: attempt to use a non-constant value in a constant | ||
--> $DIR/issue-42060.rs:19:13 | ||
| | ||
LL | <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant | ||
| ^ non-constant value | ||
|
||
error[E0516]: `typeof` is a reserved keyword but unimplemented | ||
--> $DIR/issue-42060.rs:13:16 | ||
| | ||
LL | let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant | ||
| ^^^^^^^^^^^^^ reserved keyword | ||
|
||
error[E0516]: `typeof` is a reserved keyword but unimplemented | ||
--> $DIR/issue-42060.rs:19:6 | ||
| | ||
LL | <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant | ||
| ^^^^^^^^^ reserved keyword | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors occurred: E0435, E0516. | ||
For more information about an error, try `rustc --explain E0435`. |
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,17 @@ | ||
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
fn main() { | ||
| | ||
} | ||
//~^ ERROR expected `|`, found `}` | ||
| | ||
//~^ ERROR expected item, found `|` | ||
|
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: expected `|`, found `}` | ||
--> $DIR/issue-43196.rs:13:1 | ||
| | ||
LL | | | ||
| - expected `|` here | ||
LL | } | ||
| ^ unexpected token | ||
|
||
error: expected item, found `|` | ||
--> $DIR/issue-43196.rs:15:1 | ||
| | ||
LL | | | ||
| ^ expected item | ||
|
||
error: aborting due to 2 previous errors | ||
|