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

normalize env constness for nested obligations #92257

Merged
merged 2 commits into from
Dec 26, 2021

Conversation

fee1-dead
Copy link
Member

Closes #92230.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 24, 2021
@rust-highfive
Copy link
Collaborator

r? @cjgillot

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 24, 2021
@fee1-dead
Copy link
Member Author

r? @oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned cjgillot Dec 24, 2021
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Dec 25, 2021

So... if we're gonna replace the hack soonish, then this lgtm. I'd rather have it working now and then look into fixing it than wait for a clean fix.

I think the clean fix would be a two step thing:

  1. Use ParamEnvAnd instead of a ParamEnv and a predicate field inside the Obligation datastructure
  2. Make ParamEnv::and lose the constness on the ParamEnv if there are no ~const in the value. I think we can get that working by adding a new type flag and setting it in visit_predicate in the typeflag visitor.

Thoughts? Opinions?

@oli-obk
Copy link
Contributor

oli-obk commented Dec 25, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 25, 2021
@bors
Copy link
Contributor

bors commented Dec 25, 2021

⌛ Trying commit bb4c551 with merge 738af7d0d909f15525c320a4c51b0051b1d355ee...

@bors
Copy link
Contributor

bors commented Dec 25, 2021

☀️ Try build successful - checks-actions
Build commit: 738af7d0d909f15525c320a4c51b0051b1d355ee (738af7d0d909f15525c320a4c51b0051b1d355ee)

@rust-timer
Copy link
Collaborator

Queued 738af7d0d909f15525c320a4c51b0051b1d355ee with parent 67491a2, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (738af7d0d909f15525c320a4c51b0051b1d355ee): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 25, 2021
@fee1-dead
Copy link
Member Author

Thoughts? Opinions?

Agreed, basically this was blocking constifying PartialEq/Eq/PartialOrd/Ord implementations, which blocks #92228.

@oli-obk
Copy link
Contributor

oli-obk commented Dec 26, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 26, 2021

📌 Commit bb4c551 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 26, 2021
@bors
Copy link
Contributor

bors commented Dec 26, 2021

⌛ Testing commit bb4c551 with merge f8abed9...

@bors
Copy link
Contributor

bors commented Dec 26, 2021

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing f8abed9 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 26, 2021
@bors bors merged commit f8abed9 into rust-lang:master Dec 26, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 26, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f8abed9): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

@fee1-dead fee1-dead deleted the fix_env_further_bounds branch December 28, 2021 05:07
@fee1-dead fee1-dead added the const-hack This PR introduced a hack to make things valid in `const fn`. label Dec 28, 2021
@fee1-dead fee1-dead added the F-const_trait_impl `#![feature(const_trait_impl)]` label Jul 20, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Jul 25, 2022
Constify a few `(Partial)Ord` impls

Only a few `impl`s are constified for now, as rust-lang#92257 has not landed in the bootstrap compiler yet and quite a few impls would need that fix.

This unblocks rust-lang#92228, which unblocks marking iterator methods as `default_method_body_is_const`.
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jul 25, 2022
Constify a few `(Partial)Ord` impls

Only a few `impl`s are constified for now, as rust-lang#92257 has not landed in the bootstrap compiler yet and quite a few impls would need that fix.

This unblocks rust-lang#92228, which unblocks marking iterator methods as `default_method_body_is_const`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
const-hack This PR introduced a hack to make things valid in `const fn`. F-const_trait_impl `#![feature(const_trait_impl)]` merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

const_trait_impl: super trait not satisfied for generic impl
8 participants