Commit graph

30 commits

Author SHA1 Message Date
Justin Yao Du
7fa23530bf
Fix typo in default.rs 2025-09-07 21:16:35 -07:00
Nathaniel McCallum
00fcb14e4e
clean up some old const trait impl syntax 2025-09-06 04:35:52 +02:00
Deadbeef
6b02597ed3 update issue number for const_trait_impl 2025-07-13 23:55:06 +08:00
Esteban Küber
c3301503b9 Make Default const and add some const Default impls
Full list of `impl const Default` types:

- ()
- bool
- char
- Cell
- 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>
2025-07-07 22:09:37 +00:00
Mu001999
52167e04e6 Marks ADT live if it appears in pattern 2025-06-14 13:44:43 +08:00
Thalia Archibald
638b226a6a Remove #[cfg(not(test))] gates in core
These gates are unnecessary now that unit tests for `core` are in a
separate package, `coretests`, instead of in the same files as the
source code. They previously prevented the two `core` versions from
conflicting with each other.
2025-03-06 13:21:59 -08:00
Boxy
0091b8ab2a update cfgs 2024-09-05 17:24:01 +01:00
Michael Goulet
5f5b4ee128 Revert "Rollup merge of #127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix"
This reverts commit 31fe9628cf, reversing
changes made to f20307851e.
2024-08-03 07:57:31 -04:00
mu001999
0adb82528f Improve dead code analysis 2024-07-04 22:05:00 +08:00
mu001999
6997b6876d Detect unused structs which derived Default 2024-06-25 23:29:44 +08:00
Mark Rousskov
a64f941611 Step bootstrap cfgs 2024-05-01 22:19:11 -04:00
Trevor Gross
d7d5fc9734 Add basic trait impls for f16 and f128
Split off part of <https://github.com/rust-lang/rust/pull/122470> so the
compiler doesn't ICE because it expects primitives to have some minimal
traits.

Fixes <https://github.com/rust-lang/rust/issues/123074>
2024-03-28 15:02:51 -04:00
Travis Finkenauer
d7b4b01911 core: document default attribute stabilization 2024-03-16 21:20:29 -07:00
joseLuís
1c7ea307cf implement Default for AsciiChar 2024-02-13 12:04:44 +01:00
Jason Newcomb
d464b72970 Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
Yuki Okushi
a088e7961c
Remove default_free_fn feature
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2023-07-08 12:10:12 +09:00
George
bb33730361
Always inline primitive data types. 2023-06-25 12:36:21 +03:00
Deadbeef
76dbe29104 rm const traits in libcore 2023-04-16 06:49:27 +00:00
Mark Rousskov
40290505fb cfg-step code 2022-11-06 17:21:21 -05:00
Deadbeef
bc6483d11e Prevent errors for stage0 rustc build 2022-09-16 11:48:42 +08:00
Deadbeef
81b1810cd7 Require #[const_trait] for const impls 2022-09-16 11:48:42 +08:00
Cameron Steffen
17ddcb434b Improve primitive/std docs separation and headers 2022-08-20 16:50:29 -05:00
Jacob Pratt
a3dd654ae9
Add documentation 2022-04-07 20:03:24 -04:00
John Kugelman
68b0d86294 Add #[must_use] to remaining core functions 2021-10-30 18:21:29 -04:00
Deadbeef
b5afa6807b
Constified Default implementations
The libs-api team agrees to allow const_trait_impl to appear in the
standard library as long as stable code cannot be broken (they are
properly gated) this means if the compiler teams thinks it's okay, then
it's okay.

My priority on constifying would be:

	1. Non-generic impls (e.g. Default) or generic impls with no
	   bounds
	2. Generic functions with bounds (that use const impls)
	3. Generic impls with bounds
	4. Impls for traits with associated types

For people opening constification PRs: please cc me and/or oli-obk.
2021-08-17 07:15:54 +00:00
Pietro Albini
24f9de5a44 bump bootstrap compiler to 1.55 2021-08-01 11:19:24 -04:00
Jacob Pratt
c70147fd66
Permit deriving default on enums with #[default] 2021-07-27 15:47:47 -04:00
Mateusz Gacek
a5951d4b23 Add diagnostic item to Default trait
Required to resolve #6562 rust-clippy issue.
2021-03-04 10:14:48 -08:00
Mark Rousskov
d5b760ba62 Bump rustfmt version
Also switches on formatting of the mir build module
2021-02-02 09:09:52 -05:00
mark
2c31b45ae8 mv std libs to library/ 2020-07-27 19:51:13 -05:00
Renamed from src/libcore/default.rs (Browse further)