Implement consecutive type-relative paths#126651
Draft
fmease wants to merge 3 commits intorust-lang:mainfrom
Draft
Implement consecutive type-relative paths#126651fmease wants to merge 3 commits intorust-lang:mainfrom
fmease wants to merge 3 commits intorust-lang:mainfrom
Conversation
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.
Adds support for paths of the form
TyParam::AssocTy::AssocItemwhereTyParamis a type param (incl.Self) orSelftype alias in trait impls and whereAssocItemis an assoc type, assoc const (mGCA) or assoc fn (RTN).Addresses #126360 (comment).
CC #22519 (arbitrary type-relative paths).
Fixes #38078.
FIXME:
Fix ICE ontests/ui/coroutine/coroutine-in-orphaned-anon-const.rs(I'm stumped atm)Details
error: internal compiler error: compiler/rustc_middle/src/ty/typeck_results.rs:591:9: node HirId(DefId(0:631 ~ rustc_data_structures[c6b2]::graph::Successors::successors).11) (typeSelf::Node) cannot be placed in TypeckResults with hir_owner DefId(0:5868 ~ rustc_data_structures[c6b2]::graph::Successors::successors::{anon_assoc#0})Type::AssocTybased solely on type, instead of a Def #22519)where T: Trait<Assoc: Bound>Selfty aliases don't have such a restriction eitherWellFormed(for<'r> <<T as A>::X as B>::f<'r>::{opaque#0}), however RBV happens before HIR ty lowering (so it doesn't yet know the necessary resolution forX::X::f) but HIR ty lowering depends on the results of RBV -> 💀🔒