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

Add Self: ~const Trait to traits with #[const_trait] #99704

Merged
merged 4 commits into from
Jul 27, 2022

Conversation

fee1-dead
Copy link
Member

@rustbot
Copy link
Collaborator

rustbot commented Jul 25, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 25, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 25, 2022
@@ -1,18 +1,49 @@
error: pointers cannot be reliably compared during const eval
Copy link
Contributor

Choose a reason for hiding this comment

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

The const checking logic for this message can now just be an assert or a delay_span_bug I believe

LL | unsafe { x == y }
| ^^
= help: the following other types implement trait `PartialEq<Rhs>`:
extern "C" fn() -> Ret
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these types implement PartialEq as const? If not, this seems like a slight diagnostic regression. (Not sure if that's relevant for this PR.)

@rust-log-analyzer

This comment has been minimized.

@fee1-dead
Copy link
Member Author

Note to self: need to prepare a PR for disallowing impl const Traits where Trait is not marked with const_trait.

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 26, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jul 26, 2022

📌 Commit 4b7a348 has been approved by oli-obk

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 Jul 26, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 27, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#99079 (Check that RPITs constrained by a recursive call in a closure are compatible)
 - rust-lang#99704 (Add `Self: ~const Trait` to traits with `#[const_trait]`)
 - rust-lang#99769 (Sync rustc_codegen_cranelift)
 - rust-lang#99783 (rustdoc: remove Clean trait impls for more items)
 - rust-lang#99789 (Refactor: use `pluralize!`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 28b44ff into rust-lang:master Jul 27, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 27, 2022
@fee1-dead fee1-dead deleted the add_self_tilde_const_trait branch July 28, 2022 06:51
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. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants