Skip to content

Commit 28340ba

Browse files
authored
Rollup merge of #101569 - m-ou-se:alloc-no-rexport-argumentv1, r=thomcc
Don't re-export private/unstable ArgumentV1 from `alloc`. The `alloc::fmt::ArgumentV1` re-export was marked as `#[stable]` even though the original `core::fmt::ArgumentV1` is `#[unstable]` (and `#[doc(hidden)]`). (It wasn't usable though: ``` error[E0658]: use of unstable library feature 'fmt_internals': internal to format_args! --> src/main.rs:4:12 | 4 | let _: alloc::fmt::ArgumentV1 = todo!(); | ^^^^^^^^^^^^^^^^^^^^^^ | = help: add `#![feature(fmt_internals)]` to the crate attributes to enable ``` ) Part of #99012
2 parents f55b002 + 47adb65 commit 28340ba

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

library/alloc/src/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ pub use core::fmt::Alignment;
558558
#[stable(feature = "rust1", since = "1.0.0")]
559559
pub use core::fmt::Error;
560560
#[stable(feature = "rust1", since = "1.0.0")]
561-
pub use core::fmt::{write, ArgumentV1, Arguments};
561+
pub use core::fmt::{write, Arguments};
562562
#[stable(feature = "rust1", since = "1.0.0")]
563563
pub use core::fmt::{Binary, Octal};
564564
#[stable(feature = "rust1", since = "1.0.0")]

tests/pretty/issue-4264.pp

+4-3
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@
3434
((::alloc::fmt::format as
3535
for<'a> fn(Arguments<'a>) -> String {format})(((<#[lang = "format_arguments"]>::new_v1
3636
as
37-
fn(&[&'static str], &[ArgumentV1<'_>]) -> Arguments<'_> {Arguments::<'_>::new_v1})((&([("test"
37+
fn(&[&'static str], &[core::fmt::ArgumentV1<'_>]) -> Arguments<'_> {Arguments::<'_>::new_v1})((&([("test"
3838
as &str)] as [&str; 1]) as &[&str; 1]),
39-
(&([] as [ArgumentV1<'_>; 0]) as &[ArgumentV1<'_>; 0])) as
40-
Arguments<'_>)) as String);
39+
(&([] as [core::fmt::ArgumentV1<'_>; 0]) as
40+
&[core::fmt::ArgumentV1<'_>; 0])) as Arguments<'_>)) as
41+
String);
4142
(res as String)
4243
} as String);
4344
} as ())

tests/ui/fmt/ifmt-unimpl.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ LL | format!("{:X}", "3");
1515
NonZeroIsize
1616
and 21 others
1717
= note: required for `&str` to implement `UpperHex`
18-
note: required by a bound in `ArgumentV1::<'a>::new_upper_hex`
18+
note: required by a bound in `core::fmt::ArgumentV1::<'a>::new_upper_hex`
1919
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
2020
= note: this error originates in the macro `$crate::__export::format_args` which comes from the expansion of the macro `arg_new` (in Nightly builds, run with -Z macro-backtrace for more info)
2121

tests/ui/fmt/send-sync.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ LL | send(format_args!("{:?}", c));
66
| |
77
| required by a bound introduced by this call
88
|
9-
= help: within `[ArgumentV1<'_>]`, the trait `Sync` is not implemented for `core::fmt::Opaque`
9+
= help: within `[core::fmt::ArgumentV1<'_>]`, the trait `Sync` is not implemented for `core::fmt::Opaque`
1010
= note: required because it appears within the type `&core::fmt::Opaque`
1111
= note: required because it appears within the type `ArgumentV1<'_>`
1212
= note: required because it appears within the type `[ArgumentV1<'_>]`
13-
= note: required for `&[ArgumentV1<'_>]` to implement `Send`
13+
= note: required for `&[core::fmt::ArgumentV1<'_>]` to implement `Send`
1414
= note: required because it appears within the type `Arguments<'_>`
1515
note: required by a bound in `send`
1616
--> $DIR/send-sync.rs:1:12

0 commit comments

Comments
 (0)