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

feat: MIR episode 4 #14664

Merged
merged 1 commit into from May 1, 2023
Merged

feat: MIR episode 4 #14664

merged 1 commit into from May 1, 2023

Conversation

HKalbasi
Copy link
Member

@HKalbasi HKalbasi commented Apr 26, 2023

In lowering, it now supports overloaded and arith assignment binary operators, statics. and constants in patterns. There is now 252 functions that we fail to emit mir for them, and the majority of them are due type mismatches or other deep and unrelated issues (but it isn't done yet, for example slice patterns and destructing assignment is not implemented yet).

In evaluating, it now can evaluate associated constants in traits (so now typenum's U5::ToConst should work), allocator functions, atomic intrinsics, and some more things. It also provides a (hacky) basis for making progress in #14275. I also added a Interpret code lens to Run and Debug when the experimental interpret tests is enabled (previously it showed result in hover, which was unusable even for debugging)

Changes in unrelated files are:

  • Changes substitutions of closures, now it includes parent substs before after sig_ty.
  • A salsa input for retrieving the path of a file id, used in emitting stack trace for interpret result.
  • Normalizing associated types in layout computing

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 26, 2023
crates/hir-def/src/body/lower.rs Outdated Show resolved Hide resolved
use crate::TraitEnvironment;
use crate::{
Copy link
Member

Choose a reason for hiding this comment

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

huh, did r-a fail at merging this into the use tree here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, when I remove it and use assist, it will add it here again.

crates/ide/src/interpret_function.rs Outdated Show resolved Hide resolved
crates/hir-ty/src/builder.rs Outdated Show resolved Hide resolved
crates/hir-def/src/body/lower.rs Show resolved Hide resolved
crates/hir-ty/src/builder.rs Outdated Show resolved Hide resolved
@bors
Copy link
Collaborator

bors commented Apr 30, 2023

☔ The latest upstream changes (presumably #14690) made this pull request unmergeable. Please resolve the merge conflicts.

@HKalbasi
Copy link
Member Author

HKalbasi commented May 1, 2023

@bors r+

@bors
Copy link
Collaborator

bors commented May 1, 2023

📌 Commit 6312fbf has been approved by HKalbasi

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented May 1, 2023

⌛ Testing commit 6312fbf with merge 2fdd1ac...

@bors
Copy link
Collaborator

bors commented May 1, 2023

☀️ Test successful - checks-actions
Approved by: HKalbasi
Pushing 2fdd1ac to master...

@bors bors merged commit 2fdd1ac into rust-lang:master May 1, 2023
10 checks passed
@lnicola lnicola changed the title MIR episode 4 feat: MIR episode 4 May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants