Compiling core v0.0.0 (/home/nazo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core)
error[E0428]: the name `_inner_slow_integer_to_str` is defined multiple times
--> /home/nazo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/num.rs:415:9
|
415 | fn _inner_slow_integer_to_str(mut n: $u, buf: &mut [MaybeUninit::<u8>]) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| `_inner_slow_integer_to_str` redefined here
| previous definition of the value `_inner_slow_integer_to_str` here
...
643 | / impl_Display!(
644 | | i8, u8,
645 | | i16, u16,
646 | | i32, u32,
647 | | isize, usize,
648 | | ; as u32 via to_u32 named fmt_u32);
| |__________________________________________- in this macro invocation
|
= note: `_inner_slow_integer_to_str` must be defined only once in the value namespace of this module
= note: this error originates in the macro `impl_Display` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0308]: mismatched types
--> /home/nazo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/num.rs:361:57
|
361 | offset = _inner_slow_integer_to_str(self.unsigned_abs().$conv_fn(), &mut buf.buf);
| -------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found `u64`
| |
| arguments to this function are incorrect
...
649 | / impl_Display!(
650 | | i64, u64,
651 | | ; as u64 via to_u64 named fmt_u64);
| |__________________________________________- in this macro invocation
|
note: function defined here
--> /home/nazo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/num.rs:415:12
|
415 | fn _inner_slow_integer_to_str(mut n: $u, buf: &mut [MaybeUninit::<u8>]) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------
...
643 | / impl_Display!(
644 | | i8, u8,
645 | | i16, u16,
646 | | i32, u32,
647 | | isize, usize,
648 | | ; as u32 via to_u32 named fmt_u32);
| |__________________________________________- in this macro invocation
= note: this error originates in the macro `impl_Display` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
|
361 | offset = _inner_slow_integer_to_str(self.unsigned_abs().$conv_fn().try_into().unwrap(), &mut buf.buf);
| ++++++++++++++++++++
error[E0308]: mismatched types
--> /home/nazo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/num.rs:404:57
|
404 | offset = _inner_slow_integer_to_str(self.$conv_fn(), &mut buf.buf);
| -------------------------- ^^^^^^^^^^^^^^^ expected `u32`, found `u64`
| |
| arguments to this function are incorrect
...
649 | / impl_Display!(
650 | | i64, u64,
651 | | ; as u64 via to_u64 named fmt_u64);
| |__________________________________________- in this macro invocation
|
note: function defined here
--> /home/nazo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/num.rs:415:12
|
415 | fn _inner_slow_integer_to_str(mut n: $u, buf: &mut [MaybeUninit::<u8>]) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------
...
643 | / impl_Display!(
644 | | i8, u8,
645 | | i16, u16,
646 | | i32, u32,
647 | | isize, usize,
648 | | ; as u32 via to_u32 named fmt_u32);
| |__________________________________________- in this macro invocation
= note: this error originates in the macro `impl_Display` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
|
404 | offset = _inner_slow_integer_to_str(self.$conv_fn().try_into().unwrap(), &mut buf.buf);
| ++++++++++++++++++++
error[E0308]: mismatched types
--> /home/nazo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/num.rs:440:53
|
440 | let offset = _inner_slow_integer_to_str(n, &mut buf);
| -------------------------- ^ expected `u32`, found `u64`
| |
| arguments to this function are incorrect
...
649 | / impl_Display!(
650 | | i64, u64,
651 | | ; as u64 via to_u64 named fmt_u64);
| |__________________________________________- in this macro invocation
|
note: function defined here
--> /home/nazo/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/num.rs:415:12
|
415 | fn _inner_slow_integer_to_str(mut n: $u, buf: &mut [MaybeUninit::<u8>]) -> usize {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------
...
643 | / impl_Display!(
644 | | i8, u8,
645 | | i16, u16,
646 | | i32, u32,
647 | | isize, usize,
648 | | ; as u32 via to_u32 named fmt_u32);
| |__________________________________________- in this macro invocation
= note: this error originates in the macro `impl_Display` (in Nightly builds, run with -Z macro-backtrace for more info)
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
|
440 | let offset = _inner_slow_integer_to_str(n.try_into().unwrap(), &mut buf);
| ++++++++++++++++++++
Some errors have detailed explanations: E0308, E0428.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `core` (lib) due to 4 previous errors
With this code,
This builds fine for
thumbv6m-none-eabitarget:However, adding
optimize_for_sizetobuild-std-featuresas follows causes the build to failwith this error
I am not familiar with the Rust code base, but I think the cause is that #142098 resulted in
_inner_slow_integer_to_strbeing defined multiple times.In fact, this compiles without error in nightly-2025-07-08.
Meta
rustc --version --verbose:Backtrace