-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extend the sixth trait system requirement #1671
Merged
Merged
Conversation
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
lcnr
changed the title
extend the sixth requirement
extend the sixth trait system requirement
Apr 11, 2023
lqd
reviewed
Apr 12, 2023
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Apr 14, 2023
don't uniquify regions when canonicalizing uniquifying causes a bunch of issues, most notably it causes `AliasEq(<?x as Trait<'a>>::Assoc, <?x as Trait<'a>>::Assoc)` to result in ambiguity because both `normalizes-to` paths result in ambiguity and substs equate should trivially succeed but doesn't because we uniquified `'a` to two different regions. I originally added uniquification to make it easier to deal with requirement 6 from the dev-guide: https://rustc-dev-guide.rust-lang.org/solve/trait-solving.html#requirements > ### 6. Trait solving must be (free) lifetime agnostic > > Trait solving during codegen should have the same result as during typeck. As we erase > all free regions during codegen we must not rely on them during typeck. A noteworthy example > is special behavior for `'static`. cc rust-lang/rustc-dev-guide#1671 Relying on regions being identical may cause ICE during MIR typeck, but even without this PR we can end up relying on that as type inference vars can resolve to types which contain an identical region. Let's land this and deal with any ICE that crop up as we go. Will look at this issue again before stabilization. r? `@compiler-errors`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Apr 14, 2023
don't uniquify regions when canonicalizing uniquifying causes a bunch of issues, most notably it causes `AliasEq(<?x as Trait<'a>>::Assoc, <?x as Trait<'a>>::Assoc)` to result in ambiguity because both `normalizes-to` paths result in ambiguity and substs equate should trivially succeed but doesn't because we uniquified `'a` to two different regions. I originally added uniquification to make it easier to deal with requirement 6 from the dev-guide: https://rustc-dev-guide.rust-lang.org/solve/trait-solving.html#requirements > ### 6. Trait solving must be (free) lifetime agnostic > > Trait solving during codegen should have the same result as during typeck. As we erase > all free regions during codegen we must not rely on them during typeck. A noteworthy example > is special behavior for `'static`. cc rust-lang/rustc-dev-guide#1671 Relying on regions being identical may cause ICE during MIR typeck, but even without this PR we can end up relying on that as type inference vars can resolve to types which contain an identical region. Let's land this and deal with any ICE that crop up as we go. Will look at this issue again before stabilization. r? ``@compiler-errors``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Apr 14, 2023
don't uniquify regions when canonicalizing uniquifying causes a bunch of issues, most notably it causes `AliasEq(<?x as Trait<'a>>::Assoc, <?x as Trait<'a>>::Assoc)` to result in ambiguity because both `normalizes-to` paths result in ambiguity and substs equate should trivially succeed but doesn't because we uniquified `'a` to two different regions. I originally added uniquification to make it easier to deal with requirement 6 from the dev-guide: https://rustc-dev-guide.rust-lang.org/solve/trait-solving.html#requirements > ### 6. Trait solving must be (free) lifetime agnostic > > Trait solving during codegen should have the same result as during typeck. As we erase > all free regions during codegen we must not rely on them during typeck. A noteworthy example > is special behavior for `'static`. cc rust-lang/rustc-dev-guide#1671 Relying on regions being identical may cause ICE during MIR typeck, but even without this PR we can end up relying on that as type inference vars can resolve to types which contain an identical region. Let's land this and deal with any ICE that crop up as we go. Will look at this issue again before stabilization. r? ```@compiler-errors```
compiler-errors
approved these changes
Apr 26, 2023
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
May 9, 2023
Update books ## rust-lang/edition-guide 1 commits in 6038be9d37d7251c966b486154af621d1794d7af..f63e578b92ff43e8cc38fcaa257b660f45c8a8c2 2023-04-26 18:40:19 UTC to 2023-04-26 18:40:19 UTC - Fix grammar (rust-lang/edition-guide#281) ## rust-embedded/book 2 commits in 897fcf566f16bf87bf37199bdddec1801fd00532..d9eb4c3f75435b008881062ffa77bf0d1527b37d 2023-05-08 10:06:29 UTC to 2023-05-08 07:19:03 UTC - Update Interoperability section (rust-embedded/book#351) - Update c-with-rust.md (rust-embedded/book#352) ## rust-lang/reference 3 commits in 1f8dc727e94ae4ef92adf70df979521a1ea1143e..28dc0f3576b55f5e57c5d6e65cd68ba3161e9fd5 2023-05-06 20:25:36 UTC to 2023-05-05 01:51:00 UTC - Add an entry for macro_rules in the "Weak keywords" lexer block (rust-lang/reference#1356) - Document f16c target feature (rust-lang/reference#1337) - Fix example for non-x86 targets (rust-lang/reference#1334) ## rust-lang/rust-by-example 4 commits in 31961fe22521a779070a44a8f30a2b00a20b6212..8ee9528b72b927cff8fd32346db8bbd1198816f0 2023-05-01 21:18:34 UTC to 2023-04-25 11:19:41 UTC - add: zero padding example (rust-lang/rust-by-example#1706) - Update reenter_question_mark.md (rust-lang/rust-by-example#1705) - Clarify array out-of-bounds behavior. (rust-lang/rust-by-example#1703) - Update README.md (rust-lang/rust-by-example#1704) ## rust-lang/rustc-dev-guide 2 commits in 2a5eb92..28dbeaf 2023-05-02 02:20:21 UTC to 2023-04-26 19:09:10 UTC - Add unset-exec-env compiletest header. (rust-lang/rustc-dev-guide#1682) - extend the sixth trait system requirement (rust-lang/rustc-dev-guide#1671)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cc rust-lang/rust#110180
this is a bit worrying as I can imagine us getting ICE when checking user type annotations. https://rust-lang.zulipchat.com/#narrow/stream/364551-t-types.2Ftrait-system-refactor/topic/mir.20typeck.20and.20relying.20on.20region.20equality