-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3800a1
commit c4bce0b
Showing
5 changed files
with
85 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
before | ||
goodbye | ||
before | ||
goodbye |
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,12 @@ | ||
#![feature(dyn_star)] | ||
#![allow(incomplete_features)] | ||
|
||
trait Trait {} | ||
impl Trait for usize {} | ||
|
||
fn main() { | ||
// We allow &dyn Trait + Send -> &dyn Send (i.e. dropping principal), | ||
// but we don't (currently?) allow the same for dyn* | ||
let x: dyn* Trait + Send = 1usize; | ||
x as dyn* Send; //~ error: `dyn* Trait + Send` needs to have the same ABI as a pointer | ||
} |
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 @@ | ||
error[E0277]: `dyn* Trait + Send` needs to have the same ABI as a pointer | ||
--> $DIR/dyn-star-drop-principal.rs:11:5 | ||
| | ||
LL | x as dyn* Send; | ||
| ^ `dyn* Trait + Send` needs to be a pointer-like type | ||
| | ||
= help: the trait `PointerLike` is not implemented for `dyn* Trait + Send` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |