-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #115009 - matthiaskrgr:rollup-ainf2gb, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #114605 (Increase clarity about Hash - Eq consistency in HashMap and HashSet docs) - #114934 (instantiate response: no unnecessary new universe) - #114950 (Inline strlen_rt in CStr::from_ptr) - #114973 (Expose core::error::request_value in std) - #114983 (Usage zero as language id for `FormatMessageW()`) - #114991 (remove redundant var rebindings) - #114992 (const-eval: ensure we never const-execute a function marked rustc_do_not_const_check) - #115001 (clippy::perf stuff) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
16 changed files
with
213 additions
and
69 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
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
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
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
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
73 changes: 73 additions & 0 deletions
73
tests/ui/traits/new-solver/generalize/generalize-proj-new-universe-index-1.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,73 @@ | ||
// compile-flags: -Ztrait-solver=next | ||
// check-pass | ||
|
||
// A minimization of an ambiguity when using typenum. See | ||
// https://github.com/rust-lang/trait-system-refactor-initiative/issues/55 | ||
// for more details. | ||
trait Id { | ||
type Assoc: ?Sized; | ||
} | ||
impl<T: ?Sized> Id for T { | ||
type Assoc = T; | ||
} | ||
|
||
trait WithAssoc<T: ?Sized> { | ||
type Assoc: ?Sized; | ||
} | ||
|
||
|
||
struct Leaf; | ||
struct Wrapper<U: ?Sized>(U); | ||
|
||
impl<U: ?Sized> WithAssoc<U> for Leaf { | ||
type Assoc = U; | ||
} | ||
|
||
impl<Ul: ?Sized, Ur: ?Sized> WithAssoc<Wrapper<Ur>> for Wrapper<Ul> | ||
where | ||
Ul: WithAssoc<Ur>, | ||
{ | ||
type Assoc = <<Ul as WithAssoc<Ur>>::Assoc as Id>::Assoc; | ||
} | ||
|
||
fn bound<T: ?Sized, U: ?Sized, V: ?Sized>() | ||
where | ||
T: WithAssoc<U, Assoc = V>, | ||
{ | ||
} | ||
|
||
// normalize self type to `Wrapper<Leaf>` | ||
// This succeeds, HOWEVER, instantiating the query response previously | ||
// incremented the universe index counter. | ||
// equate impl headers: | ||
// <Wrapper<Leaf> as WithAssoc<<Wrapper<Leaf> as Id>::Assoc>> | ||
// <Wrapper<?2t> as WithAssoc<Wrapper<?3t>>> | ||
// ~> AliasRelate(<Wrapper<Leaf> as Id>::Assoc, Equate, Wrapper<?3t>) | ||
// add where bounds: | ||
// ~> Leaf: WithAssoc<?3t> | ||
// equate with assoc type: | ||
// ?0t | ||
// <Leaf as WithAssoc<?3t>>::Assoc as Id>::Assoc | ||
// ~> AliasRelate( | ||
// <<Leaf as WithAssoc<?3t>>::Assoc as Id>::Assoc, | ||
// Equate, | ||
// <<Leaf as WithAssoc<?4t>>::Assoc as Id>::Assoc, | ||
// ) | ||
// | ||
// We do not reuse `?3t` during generalization because `?0t` cannot name `?4t` as we created | ||
// it after incrementing the universe index while normalizing the self type. | ||
// | ||
// evaluate_added_goals_and_make_query_response: | ||
// AliasRelate(<Wrapper<Leaf> as Id>::Assoc, Equate, Wrapper<?3t>) | ||
// YES, constrains ?3t to Leaf | ||
// AliasRelate( | ||
// <<Leaf as WithAssoc<Leaf>>::Assoc as Id>::Assoc, | ||
// Equate, | ||
// <<Leaf as WithAssoc<?4t>>::Assoc as Id>::Assoc, | ||
// ) | ||
// | ||
// Normalizing <<Leaf as WithAssoc<?4t>>::Assoc as Id>::Assoc then *correctly* | ||
// results in ambiguity. | ||
fn main() { | ||
bound::<<Wrapper<Leaf> as Id>::Assoc, <Wrapper<Leaf> as Id>::Assoc, _>() | ||
} |
Oops, something went wrong.