| Age | Commit message (Collapse) | Author | Lines |
|
This reverts commit 15c30ddd69d6cc3fffe6d304c6dc968a5ed046f1.
|
|
|
|
This commit applies rustfmt with default settings to files in
src/libcore *that are not involved in any currently open PR* to minimize
merge conflicts. The list of files involved in open PRs was determined
by querying GitHub's GraphQL API with this script:
https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8
With the list of files from the script in `outstanding_files`, the
relevant commands were:
$ find src/libcore -name '*.rs' | xargs rustfmt --edition=2018
$ rg libcore outstanding_files | xargs git checkout --
Repeating this process several months apart should get us coverage of
most of the rest of libcore.
|
|
|
|
|
|
|
|
fmt::Write is about string slices, not byte slices
No idea why the docs talk about bytes, maybe a copy-paste error?
|
|
|
|
|
|
|
|
|
|
Instead let's do this via `RUSTFLAGS` in `builder.rs`. Currently
requires a submodule update of `stdarch` to fix a problem with previous
compilers.
|
|
This allows lints and other diagnostics to refer to items
by a unique ID instead of relying on whacky path
resolution schemes that may break when items are
relocated.
|
|
|
|
|
|
|
|
|
|
|
|
use const array repeat expressions for uninit_array
With a first implementation of https://github.com/rust-lang/rust/issues/49147 having landed, we can make this macro nicer and phase it out with the next bootstrap bump.
However, to make this work, we have to mark `MaybeUninit::uninit()` as promotable. I do feel uneasy about promoting stuff involving uninitialized memory, but OTOH no *operation* on `MaybeUninit` is promotable, so maybe this is okay?
r? @oli-obk @eddyb
|
|
|
|
|
|
|
|
|
|
|
|
The errors are either:
- The meta-variable used in the right-hand side is not bound (or defined) in the
left-hand side.
- The meta-variable used in the right-hand side does not repeat with the same
kleene operator as its binder in the left-hand side. Either it does not repeat
enough, or it uses a different operator somewhere.
This change should have no semantic impact.
|
|
Fix the data types indication in basic examples of the Trait std::fmt::LowerExp and std::fmt::UpperExp.
Since there aren’t any type annotation on the let statement using the number 42.0, they are of type f64 according to The Book:
https://doc.rust-lang.org/book/ch03-02-data-types.html#floating-point-types
|
|
|
|
|
|
This commit changes the behavior of Formatter::debug_struct,
debug_tuple, debug_list, debug_set, and debug_map to render trailing
commas in {:#?} mode, which is the dominant style in modern Rust code.
Before:
Language {
name: "Rust",
trailing_commas: false
}
After:
Language {
name: "Rust",
trailing_commas: true,
}
|
|
uninitialized -> uninit
into_initialized -> assume_init
read_initialized -> read
set -> write
|
|
|
|
Add missing fmt structs examples
r? @rust-lang/docs
|
|
|
|
Cut down on number formating code size
r? @alexcrichton
|
|
|
|
Removes some unsafe *and* saves almost half a kilobyte of code size.
|
|
|
|
The generic `F` in `with_padding` was causing a bunch of stuff to get inlined
that otherwise needn't be, blowing up code size.
|
|
For smaller code size.
|
|
Instead of inlining the same logic into every number formatting implementation,
pull it out into a function that each of the number formatting impls call into.
|
|
|
|
|
|
|
|
|
|
Small perf improvement for fmt
Added benchmark is based on #10761
|
|
Improve docs for Formatter
Some improvements to `std::fmt::Formatter` to make it a bit more consistent with other documentation, as well as calling out that you don't ever instantiate one yourself.
|
|
name old ns/iter new ns/iter diff ns/iter diff % speedup
fmt::write_str_macro1 13,927 12,489 -1,438 -10.33% x 1.12
fmt::write_str_macro2 24,633 23,418 -1,215 -4.93% x 1.05
fmt::write_str_macro_debug 234,633 233,092 -1,541 -0.66% x 1.01
fmt::write_str_ref 5,819 5,823 4 0.07% x 1.00
fmt::write_str_value 6,012 5,828 -184 -3.06% x 1.03
fmt::write_vec_macro1 18,550 17,143 -1,407 -7.58% x 1.08
fmt::write_vec_macro2 30,369 28,920 -1,449 -4.77% x 1.05
fmt::write_vec_macro_debug 244,338 244,901 563 0.23% x 1.00
fmt::write_vec_ref 5,952 5,885 -67 -1.13% x 1.01
fmt::write_vec_value 5,944 5,894 -50 -0.84% x 1.01
|
|
|
|
|
|
manual impl was a workaround for #28229.
|