Skip to content
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

WIP Add late desugaring to rustc_resolve #120247

Closed
wants to merge 8 commits into from

Conversation

axelmagn
Copy link

Closes #99669

rustc_resolve::late::LateResolutionVisitor contained a typo, claiming
that `in_func_body` could hold a `None` value.  From context clues, I am
guessing that at some point `in_func_body` was an optional.
still need to correctly construct TraitObject kind from res
@rustbot
Copy link
Collaborator

rustbot commented Jan 22, 2024

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@axelmagn axelmagn marked this pull request as draft January 22, 2024 19:22
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 22, 2024
@axelmagn
Copy link
Author

FYI - this is a draft PR. It's definitely not ready for review. I'm using it to track my progress and coordinate.

@petrochenkov
Copy link
Contributor

Okay.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 22, 2024
@@ -273,7 +273,7 @@ fn configure_and_expand(

// Done with macro expansion!

resolver.resolve_crate(&krate);
resolver.resolve_crate(&mut krate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the new pass is supposed to run right after this function finishes, at least for the step 1 in #99669 (comment).
Also makes sense to put this pass into a separate file.
(I'm still not sure it's a good idea, all in all, maybe it will become more visible once the step 1 is finished.)

{
debug!("[Desugar][Ty][BareTrait][{:?}] {:?}\n{:#?}", ty.span, res, ty);

let trait_obj = TyKind::TraitObject(vec![], TraitObjectSyntax::None);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are creating a trait object with a single generic bound, which is a trait with no bound generics (for<'a>) and no modifiers (?Foo, const Bar). The trait's path is _path from the type.

@cjgillot cjgillot self-assigned this Jan 22, 2024
@axelmagn
Copy link
Author

Closing - no longer working on this issue.

@axelmagn axelmagn closed this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate mutating the AST during late resolution
4 participants