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#90266 - b-naber:uneval_substs, r=lcnr
Prevent duplicate caller bounds candidates by exposing default substs in Unevaluated Fixes rust-lang#89334 The changes introduced in rust-lang#87280 allowed for "duplicate" caller bounds candidates to be assembled that only differed in their default substs having been "exposed" or not and resulted in an ambiguity error during trait selection. To fix this we expose the defaults substs during the creation of the ParamEnv. r? `@lcnr`
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 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
9 changes: 9 additions & 0 deletions
9
src/test/ui/const-generics/expose-default-substs-param-env.rs
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,9 @@ | ||
// build-pass | ||
|
||
#![feature(generic_const_exprs)] | ||
#![allow(unused_braces, incomplete_features)] | ||
|
||
pub trait Foo<const N: usize> {} | ||
pub trait Bar: Foo<{ 1 }> { } | ||
|
||
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,16 @@ | ||
// build-pass | ||
|
||
#![feature(generic_const_exprs)] | ||
#![allow(unused_braces, incomplete_features)] | ||
|
||
pub trait AnotherTrait{ | ||
const ARRAY_SIZE: usize; | ||
} | ||
pub trait Shard<T: AnotherTrait>: | ||
AsMut<[[u8; T::ARRAY_SIZE]]> | ||
where | ||
[(); T::ARRAY_SIZE]: Sized | ||
{ | ||
} | ||
|
||
fn main() {} |