-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Never emit
vptr
for empty/auto traits
- Loading branch information
Showing
4 changed files
with
36 additions
and
14 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
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