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

Make derive_const derive properly const-if-const impls #107777

Merged

Conversation

compiler-errors
Copy link
Member

Fixes #107774
Fixes #107666

Also fixes rendering of const-if-const bounds in pretty printing.

r? @oli-obk or @fee1-dead

@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 Feb 7, 2023
@@ -154,7 +154,7 @@ fn mk_ty_param(
.iter()
.map(|b| {
let path = b.to_path(cx, span, self_ident, self_generics);
cx.trait_bound(path)
cx.trait_bound(path, false)
Copy link
Member Author

Choose a reason for hiding this comment

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

This prevents us from generating methods with const bounds on their parameters, but none of the built-in impls actually use type parameters on their methods, so I didn't really want to thread a boolean down 3 levels to this call site.

Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

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

LGTM

@fee1-dead
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 8, 2023

📌 Commit 7a45059 has been approved by fee1-dead

It is now in the queue for this repository.

@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 Feb 8, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Feb 8, 2023
…lly-derive-const, r=fee1-dead

Make `derive_const` derive properly const-if-const impls

Fixes rust-lang#107774
Fixes rust-lang#107666

Also fixes rendering of const-if-const bounds in pretty printing.

r? `@oli-obk` or `@fee1-dead`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 8, 2023
…lly-derive-const, r=fee1-dead

Make `derive_const` derive properly const-if-const impls

Fixes rust-lang#107774
Fixes rust-lang#107666

Also fixes rendering of const-if-const bounds in pretty printing.

r? ``@oli-obk`` or ``@fee1-dead``
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 8, 2023
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#105641 (Implement cursors for BTreeMap)
 - rust-lang#107271 (Treat Drop as a rmw operation)
 - rust-lang#107710 (Update strip-ansi-escapes and vte)
 - rust-lang#107758 (Change `arena_cache` to not alter the declared query result)
 - rust-lang#107777 (Make `derive_const` derive properly const-if-const impls)
 - rust-lang#107780 (Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*`)
 - rust-lang#107793 (Add missing tracking issue for `RawOsError`)
 - rust-lang#107807 (Fix small debug typo)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5b8403c into rust-lang:master Feb 8, 2023
@rustbot rustbot added this to the 1.69.0 milestone Feb 8, 2023
@compiler-errors compiler-errors deleted the derive_const-actually-derive-const branch February 10, 2023 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
5 participants