-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Problem running a method on the output of a function that returns an associated type ("missing optimized MIR") #117997
Labels
C-bug
Category: This is a bug.
P-high
High priority
regression-from-stable-to-beta
Performance or correctness regression from stable to beta.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Nov 16, 2023
tmiasko
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
regression-from-stable-to-beta
Performance or correctness regression from stable to beta.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Nov 17, 2023
rustbot
added
the
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
label
Nov 17, 2023
oli's on leave so cc-ing PR #117076's reviewer @petrochenkov |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
rustbot
added
P-high
High priority
and removed
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
labels
Nov 20, 2023
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 8, 2023
…it-trait-ref-and-args, r=TaKO8Ki privacy: visit trait def id of projections Fixes rust-lang#117997. A refactoring in rust-lang#117076 changed the `DefIdVisitorSkeleton` to avoid calling `visit_projection_ty` for `ty::Projection` aliases, and instead just iterate over the args - this makes sense, as `visit_projection_ty` will indirectly visit all of the same args, but in doing so, will also create a `TraitRef` containing the trait's `DefId`, which also gets visited. The trait's `DefId` isn't visited when we only visit the arguments without separating them into `TraitRef` and own args first. Eventually this influences the reachability set and whether a function is encoded into the metadata.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 8, 2023
…it-trait-ref-and-args, r=TaKO8Ki privacy: visit trait def id of projections Fixes rust-lang#117997. A refactoring in rust-lang#117076 changed the `DefIdVisitorSkeleton` to avoid calling `visit_projection_ty` for `ty::Projection` aliases, and instead just iterate over the args - this makes sense, as `visit_projection_ty` will indirectly visit all of the same args, but in doing so, will also create a `TraitRef` containing the trait's `DefId`, which also gets visited. The trait's `DefId` isn't visited when we only visit the arguments without separating them into `TraitRef` and own args first. Eventually this influences the reachability set and whether a function is encoded into the metadata.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 9, 2023
Rollup merge of rust-lang#118715 - davidtwco:issue-117997-privacy-visit-trait-ref-and-args, r=TaKO8Ki privacy: visit trait def id of projections Fixes rust-lang#117997. A refactoring in rust-lang#117076 changed the `DefIdVisitorSkeleton` to avoid calling `visit_projection_ty` for `ty::Projection` aliases, and instead just iterate over the args - this makes sense, as `visit_projection_ty` will indirectly visit all of the same args, but in doing so, will also create a `TraitRef` containing the trait's `DefId`, which also gets visited. The trait's `DefId` isn't visited when we only visit the arguments without separating them into `TraitRef` and own args first. Eventually this influences the reachability set and whether a function is encoded into the metadata.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
P-high
High priority
regression-from-stable-to-beta
Performance or correctness regression from stable to beta.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This is a pretty common use case, so this bug has probably already been registered, but I couldn't find anything while searching around, so I'm reporting this here just in case. I ran this code:
lib.rs
examples/failing_code.rs
When running this code, I expect to simply get a not yet implemented error on the
get_assoc()
function.Instead, I get this:
Meta
rustc --version --verbose
:get_assoc
returns anAssociatedType
, andmethod_on_assoc
is not a trait method–it's just a regularimpl
method. Therefore, AFAIK, this should compile. Notably, making eithertrait_mod
orimpl_mod
aspub
makes it compile fine.The text was updated successfully, but these errors were encountered: