-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 #57836 - oli-obk:existential_crisis, r=estebank
Fix some cross crate existential type ICEs fixes #53443
- Loading branch information
Showing
7 changed files
with
66 additions
and
2 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
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
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
12 changes: 12 additions & 0 deletions
12
src/test/ui/existential_types/auxiliary/cross_crate_ice.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,12 @@ | ||
// Crate that exports an existential type. Used for testing cross-crate. | ||
|
||
#![crate_type="rlib"] | ||
|
||
#![feature(existential_type)] | ||
|
||
pub existential type Foo: std::fmt::Debug; | ||
|
||
pub fn foo() -> Foo { | ||
5 | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
src/test/ui/existential_types/auxiliary/cross_crate_ice2.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,21 @@ | ||
// Crate that exports an existential type. Used for testing cross-crate. | ||
|
||
#![crate_type="rlib"] | ||
|
||
#![feature(existential_type)] | ||
|
||
pub trait View { | ||
type Tmp: Iterator<Item = u32>; | ||
|
||
fn test(&self) -> Self::Tmp; | ||
} | ||
|
||
pub struct X; | ||
|
||
impl View for X { | ||
existential type Tmp: Iterator<Item = u32>; | ||
|
||
fn test(&self) -> Self::Tmp { | ||
vec![1,2,3].into_iter() | ||
} | ||
} |
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 @@ | ||
// aux-build:cross_crate_ice.rs | ||
// compile-pass | ||
|
||
extern crate cross_crate_ice; | ||
|
||
struct Bar(cross_crate_ice::Foo); | ||
|
||
impl Bar { | ||
fn zero(&self) -> &cross_crate_ice::Foo { | ||
&self.0 | ||
} | ||
} | ||
|
||
fn main() { | ||
let _ = cross_crate_ice::foo(); | ||
} |
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,11 @@ | ||
// aux-build:cross_crate_ice2.rs | ||
// compile-pass | ||
|
||
extern crate cross_crate_ice2; | ||
|
||
use cross_crate_ice2::View; | ||
|
||
fn main() { | ||
let v = cross_crate_ice2::X; | ||
v.test(); | ||
} |