-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address nits, add test for implicit dyn-star coercion without feature…
… gate
- Loading branch information
1 parent
0cb217d
commit 8c7e836
Showing
6 changed files
with
50 additions
and
3 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,10 @@ | ||
#![feature(dyn_star)] | ||
#![allow(incomplete_features)] | ||
|
||
use std::fmt::Display; | ||
|
||
pub fn require_dyn_star_display(_: dyn* Display) {} | ||
|
||
fn works_locally() { | ||
require_dyn_star_display(1usize); | ||
} |
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,8 @@ | ||
// aux-build:dyn-star-foreign.rs | ||
|
||
extern crate dyn_star_foreign; | ||
|
||
fn main() { | ||
dyn_star_foreign::require_dyn_star_display(1usize); | ||
//~^ ERROR mismatched types | ||
} |
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,19 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/no-implicit-dyn-star.rs:6:48 | ||
| | ||
LL | dyn_star_foreign::require_dyn_star_display(1usize); | ||
| ------------------------------------------ ^^^^^^ expected trait object `dyn std::fmt::Display`, found `usize` | ||
| | | ||
| arguments to this function are incorrect | ||
| | ||
= note: expected trait object `(dyn* std::fmt::Display + 'static)` | ||
found type `usize` | ||
note: function defined here | ||
--> $DIR/auxiliary/dyn-star-foreign.rs:6:8 | ||
| | ||
LL | pub fn require_dyn_star_display(_: dyn* Display) {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |