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

Const Deref #88887

Merged
merged 1 commit into from
Sep 17, 2021
Merged

Const Deref #88887

merged 1 commit into from
Sep 17, 2021

Conversation

fee1-dead
Copy link
Member

@fee1-dead fee1-dead commented Sep 12, 2021

Implements const Deref/const DerefMut for &mut T, &T, Cow<'_, B> and ManuallyDrop<T>

@rust-highfive
Copy link
Collaborator

r? @kennytm

(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 Sep 12, 2021
@rust-log-analyzer

This comment has been minimized.

@kennytm kennytm added the F-const_trait_impl `#![feature(const_trait_impl)]` label Sep 13, 2021
@kennytm
Copy link
Member

kennytm commented Sep 13, 2021

r? @oli-obk

@rust-highfive rust-highfive assigned oli-obk and unassigned kennytm Sep 13, 2021
Copy link
Contributor

@oli-obk oli-obk left a comment

Choose a reason for hiding this comment

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

Please create a tracking issue or point to the const trait impls tracking issue.

Also include a short message in the main post explaining what this PR does.

I think this PR would also benefit from a test or two

library/alloc/src/string.rs Outdated Show resolved Hide resolved
library/core/src/panic/unwind_safe.rs Outdated Show resolved Hide resolved
@oli-obk
Copy link
Contributor

oli-obk commented Sep 15, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 15, 2021

📌 Commit 349ac4f 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 Sep 15, 2021
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 16, 2021
Const Deref

Implements `const Deref`/`const DerefMut` for `&mut T`, `&T`, `Cow<'_, B>` and `ManuallyDrop<T>`
@jhpratt
Copy link
Member

jhpratt commented Sep 16, 2021

Does #[rustc_const_unstable] actually work on trait impls? Only asking because I know regular unstable attributes don't.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 17, 2021

Does #[rustc_const_unstable] actually work on trait impls? Only asking because I know regular unstable attributes don't.

yes, and there are explicit tests for this

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2021
Rollup of 10 pull requests

Successful merges:

 - rust-lang#86382 (Make diagnostics clearer for `?` operators)
 - rust-lang#87529 (Fix ICE in `improper_ctypes_definitions` lint with all-ZST transparent types)
 - rust-lang#88339 (Add TcpListener::into_incoming and IntoIncoming)
 - rust-lang#88735 (Don't lint about missing code examples in derived traits)
 - rust-lang#88751 (Couple of changes to FileSearch and SearchPath)
 - rust-lang#88883 (Move some tests to more reasonable directories - 7)
 - rust-lang#88887 (Const Deref)
 - rust-lang#88911 (Improve error message for type mismatch in generator arguments)
 - rust-lang#89014 (PassWrapper: handle separate Module*SanitizerPass)
 - rust-lang#89033 (Set the library path in sysroot-crates-are-unstable)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 5d14396 into rust-lang:master Sep 17, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 17, 2021
@fee1-dead fee1-dead deleted the const-deref branch November 2, 2021 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-const_trait_impl `#![feature(const_trait_impl)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants