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.
Rollup merge of rust-lang#100500 - cjgillot:verify-self-predicate, r=…
…lcnr Ban references to `Self` in trait object substs for projection predicates too. Fixes rust-lang#100484 Fixes rust-lang#100485 r? ``@lcnr``
- Loading branch information
Showing
5 changed files
with
67 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![allow(incomplete_features)] | ||
#![feature(generic_const_exprs)] | ||
#![feature(trait_alias)] | ||
|
||
trait Bar<const N: usize> {} | ||
|
||
trait BB = Bar<{ 2 + 1 }>; | ||
|
||
fn foo(x: &dyn BB) {} | ||
//~^ ERROR the trait alias `BB` cannot be made into an object [E0038] | ||
|
||
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,11 @@ | ||
error[E0038]: the trait alias `BB` cannot be made into an object | ||
--> $DIR/self-in-const-generics.rs:9:16 | ||
| | ||
LL | fn foo(x: &dyn BB) {} | ||
| ^^ | ||
| | ||
= note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0038`. |
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