Skip to content

fix: Lazy evaluate consts in path_to_const #14727

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

Merged
merged 1 commit into from
May 8, 2023
Merged

Conversation

HKalbasi
Copy link
Member

@HKalbasi HKalbasi commented May 3, 2023

fix #14275

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 3, 2023
@@ -118,9 +118,12 @@ pub(crate) fn infer_query(db: &dyn HirDatabase, def: DefWithBodyId) -> Arc<Infer
/// This is appropriate to use only after type-check: it assumes
/// that normalization will succeed, for example.
pub(crate) fn normalize(db: &dyn HirDatabase, trait_env: Arc<TraitEnvironment>, ty: Ty) -> Ty {
if !ty.data(Interner).flags.intersects(TypeFlags::HAS_PROJECTION) {
Copy link
Member

Choose a reason for hiding this comment

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

I would believe this to ruin performance, could you check that? Because if it does I don't think we want to merge this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed that, and per the CI time we are good again. But it is not an important part of the PR, we can remove that (at cost of not being able to find layout for struct Something { some_field: [Ty; SOME_CONST] }, the original issue works without this)

@HKalbasi HKalbasi force-pushed the mir branch 2 times, most recently from a2e0a61 to 2719beb Compare May 3, 2023 15:24
@HKalbasi HKalbasi requested a review from flodiebold May 3, 2023 16:44
@HKalbasi
Copy link
Member Author

HKalbasi commented May 8, 2023

@bors r+

@bors
Copy link
Contributor

bors commented May 8, 2023

📌 Commit aafe9b1 has been approved by HKalbasi

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 8, 2023

⌛ Testing commit aafe9b1 with merge ff8b969...

@bors
Copy link
Contributor

bors commented May 8, 2023

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

@bors bors merged commit ff8b969 into rust-lang:master May 8, 2023
@lnicola lnicola changed the title Lazy evaluate consts in path_to_const fix: Lazy evaluate consts in path_to_const May 8, 2023
@Veykril
Copy link
Member

Veykril commented May 18, 2023

This increased type mismatched on webrender by 9

@HKalbasi
Copy link
Member Author

Probably is the same problem of #14844

@utkarshgupta137
Copy link

Can we revert this before tomorrow's release before until this is fixed?

@HKalbasi
Copy link
Member Author

Type mismatch is an experimental diagnostic, and the problem is easily solvable (I just need to find some time to put on it) so I don't think we should revert this only for false positive in type mismatch. Does it have other negative effects?

@utkarshgupta137
Copy link

Hmmm. I didn't realize that this wasn't a "core" diagnostic. I can live with disabling this diagnostic till it gets fixed :)

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.

Go to Definition doesn't pointed to correct implementation.
5 participants