-
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.
Generalize trait object generic param check to aliases.
- Loading branch information
Showing
9 changed files
with
136 additions
and
133 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 |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
|
||
trait Foo<X = Box<dyn Foo>> { | ||
//~^ ERROR cycle detected | ||
//~| ERROR cycle detected | ||
} | ||
|
||
fn main() { } |
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 @@ | ||
trait SendEqAlias<T> = PartialEq; | ||
//~^ ERROR trait aliases are experimental | ||
|
||
struct Foo<T>(dyn SendEqAlias<T>); | ||
//~^ ERROR the type parameter `Rhs` must be explicitly specified [E0393] | ||
|
||
struct Bar<T>(dyn SendEqAlias<T>, T); | ||
//~^ ERROR the type parameter `Rhs` must be explicitly specified [E0393] | ||
|
||
fn main() {} |
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,39 @@ | ||
error[E0658]: trait aliases are experimental | ||
--> $DIR/generic-default-in-dyn.rs:1:1 | ||
| | ||
LL | trait SendEqAlias<T> = PartialEq; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #41517 <https://github.com/rust-lang/rust/issues/41517> for more information | ||
= help: add `#![feature(trait_alias)]` to the crate attributes to enable | ||
|
||
error[E0393]: the type parameter `Rhs` must be explicitly specified | ||
--> $DIR/generic-default-in-dyn.rs:4:19 | ||
| | ||
LL | struct Foo<T>(dyn SendEqAlias<T>); | ||
| ^^^^^^^^^^^^^^ missing reference to `Rhs` | ||
| | ||
::: $SRC_DIR/core/src/cmp.rs:LL:COL | ||
| | ||
LL | pub trait PartialEq<Rhs: ?Sized = Self> { | ||
| --------------------------------------- type parameter `Rhs` must be specified for this | ||
| | ||
= note: because of the default `Self` reference, type parameters must be specified on object types | ||
|
||
error[E0393]: the type parameter `Rhs` must be explicitly specified | ||
--> $DIR/generic-default-in-dyn.rs:7:19 | ||
| | ||
LL | struct Bar<T>(dyn SendEqAlias<T>, T); | ||
| ^^^^^^^^^^^^^^ missing reference to `Rhs` | ||
| | ||
::: $SRC_DIR/core/src/cmp.rs:LL:COL | ||
| | ||
LL | pub trait PartialEq<Rhs: ?Sized = Self> { | ||
| --------------------------------------- type parameter `Rhs` must be specified for this | ||
| | ||
= note: because of the default `Self` reference, type parameters must be specified on object types | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0393, E0658. | ||
For more information about an error, try `rustc --explain E0393`. |
File renamed without changes.
File renamed without changes.