Skip to content

Don't use LateContext in the constant evaluator #13200

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 3 commits into from
Aug 8, 2024

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Aug 1, 2024

This also changes the interface to require explicitly creating the context. constant could be added back in, but the others are probably not worth it.

A couple of bugs have been fixed. The wrong TypeckResults was used once when evaluating a constant, and the wrong ParamEnv was used by some callers (there wasn't a way to use the correct one).

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2024

r? @dswij

rustbot has assigned @dswij.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Aug 1, 2024
@Jarcho Jarcho force-pushed the constant_no_typeck branch 2 times, most recently from 1d5b9b9 to 3474d6a Compare August 1, 2024 18:39
@Jarcho Jarcho force-pushed the constant_no_typeck branch from 3474d6a to 59a1ff9 Compare August 6, 2024 23:25
@bors
Copy link
Contributor

bors commented Aug 8, 2024

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

&& let ["core", "num", int_impl, "max_value"] = *def_path
&& let ExprKind::Path(qpath @ QPath::TypeRelative(_, name)) = &callee.kind
&& let Res::Def(DefKind::AssocFn, did) = self.typeck.qpath_res(qpath, callee.hir_id)
&& name.ident.as_str() == "max_value"
Copy link
Member

Choose a reason for hiding this comment

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

Just one nit I can see: since we're checking the diagnostic name we don't need the by str one

@Jarcho Jarcho force-pushed the constant_no_typeck branch from 59a1ff9 to 5114d37 Compare August 8, 2024 14:20
Copy link
Member

@Alexendoo Alexendoo left a comment

Choose a reason for hiding this comment

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

r=me with rebase

@Jarcho Jarcho force-pushed the constant_no_typeck branch from 5114d37 to e4ad36d Compare August 8, 2024 14:37
@Alexendoo
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Aug 8, 2024

📌 Commit e4ad36d has been approved by Alexendoo

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Aug 8, 2024

⌛ Testing commit e4ad36d with merge b1e8792...

@bors
Copy link
Contributor

bors commented Aug 8, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Alexendoo
Pushing b1e8792 to master...

@bors bors merged commit b1e8792 into rust-lang:master Aug 8, 2024
8 checks passed
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.

5 participants