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.
Auto merge of rust-lang#131895 - jieyouxu:rollup-jyt3pic, r=jieyouxu
Rollup of 3 pull requests Successful merges: - rust-lang#126207 (std::unix::stack_overflow::drop_handler addressing todo through libc …) - rust-lang#131864 (Never emit `vptr` for empty/auto traits) - rust-lang#131870 (compiletest: Store test collection context/state in two structs) r? `@ghost` `@rustbot` modify labels: rollup
Showing
7 changed files
with
135 additions
and
121 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//@ run-pass | ||
// | ||
// issue: <https://github.com/rust-lang/rust/issues/131813> | ||
|
||
#![feature(trait_upcasting)] | ||
|
||
trait Pollable { | ||
#[allow(unused)] | ||
fn poll(&self) {} | ||
} | ||
trait FileIo: Pollable + Send + Sync { | ||
fn read(&self) {} | ||
} | ||
trait Terminal: Send + Sync + FileIo {} | ||
|
||
struct A; | ||
|
||
impl Pollable for A {} | ||
impl FileIo for A {} | ||
impl Terminal for A {} | ||
|
||
fn main() { | ||
let a = A; | ||
|
||
let b = &a as &dyn Terminal; | ||
let c = b as &dyn FileIo; | ||
|
||
c.read(); | ||
} |
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