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 Default const and add some const Default impls #134628

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

estebank
Copy link
Contributor

Full list of impl const Default types:

  • ()
  • bool
  • char
  • std::ascii::Char
  • usize
  • u8
  • u16
  • u32
  • u64
  • u128
  • i8
  • i16
  • i32
  • i64
  • i128
  • f16
  • f32
  • f64
  • f128
  • std::marker::PhantomData
  • Option
  • std::iter::Empty
  • std::ptr::Alignment
  • &[T]
  • &mut [T]
  • &str
  • &mut str
  • String
  • Vec

@rustbot
Copy link
Collaborator

rustbot commented Dec 21, 2024

r? @wesleywiser

rustbot has assigned @wesleywiser.
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 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. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 21, 2024
@estebank
Copy link
Contributor Author

Made this for some experiments with default field values, might as well put it somewhere visible as it seems like an obvious next step for the const traits effort.

@compiler-errors
Copy link
Member

Please make sure this is assigned to someone on @rust-lang/project-const-traits if you take this out of draft.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Dec 24, 2024

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

@estebank
Copy link
Contributor Author

r? @oli-obk

Let me know what would be needed to make this merge-ready.

@fee1-dead
Copy link
Member

I'd like to block this on #133999.

@fee1-dead fee1-dead added the S-blocked Status: Blocked on something else such as an RFC or other implementation work. label Dec 30, 2024
@estebank estebank added F-const_trait_impl `#![feature(const_trait_impl)]` F-default_field_values `#![feature(default_field_values)]` labels Jan 18, 2025
Full list of `impl const Default` types:

- ()
- bool
- char
- std::ascii::Char
- usize
- u8
- u16
- u32
- u64
- u128
- i8
- i16
- i32
- i64
- i128
- f16
- f32
- f64
- f128
- std::marker::PhantomData<T>
- Option<T>
- std::iter::Empty<T>
- std::ptr::Alignment
- &[T]
- &mut [T]
- &str
- &mut str
- String
- Vec<T>
@estebank estebank marked this pull request as ready for review February 12, 2025 02:39
@rust-log-analyzer

This comment has been minimized.

The lint should likely still trigger while the const Default impl is unstable.
@rustbot
Copy link
Collaborator

rustbot commented Feb 12, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@bors
Copy link
Contributor

bors commented Mar 2, 2025

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

@apiraino
Copy link
Contributor

apiraino commented Mar 6, 2025

This was blocked on #133999 (comment) which is now closed.

@fee1-dead are you still interested in working on a follow-up to #133999 or are there other plans? Or no plans for now?

Just to get a clearer picture of the progress here :-) Thanks

cc @oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Mar 6, 2025

This is blocked on a T-lang decision on syntax of const traits

@Dylan-DPC Dylan-DPC removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 12, 2025
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)]` F-default_field_values `#![feature(default_field_values)]` S-blocked Status: Blocked on something else such as an RFC or other implementation work. 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.

10 participants