diff --git a/compiler/rustc_builtin_macros/src/standard_library_imports.rs b/compiler/rustc_builtin_macros/src/standard_library_imports.rs index 2068b5ca54dd0..9f22d9eacb33c 100644 --- a/compiler/rustc_builtin_macros/src/standard_library_imports.rs +++ b/compiler/rustc_builtin_macros/src/standard_library_imports.rs @@ -43,7 +43,7 @@ pub fn inject( let item = cx.item( span, - thin_vec![cx.attr_word(sym::macro_use, span)], + ast::AttrVec::new(), ast::ItemKind::ExternCrate(None, Ident::new(name, ident_span)), ); diff --git a/library/alloctests/lib.rs b/library/alloctests/lib.rs index 3241b4b00454b..d1519c8c04604 100644 --- a/library/alloctests/lib.rs +++ b/library/alloctests/lib.rs @@ -52,6 +52,7 @@ #![feature(negative_impls)] #![feature(never_type)] #![feature(optimize_attribute)] +#![feature(prelude_import)] #![feature(rustc_allow_const_fn_unstable)] #![feature(rustc_attrs)] #![feature(staged_api)] @@ -61,11 +62,17 @@ // Allow testing this library extern crate alloc as realalloc; -#[macro_use] + +// This is needed to provide macros to the directly imported alloc modules below. extern crate std; +#[prelude_import] +#[allow(unused_imports)] +use std::prelude::rust_2024::*; + #[cfg(test)] extern crate test; mod testing; + use realalloc::*; // We are directly including collections and raw_vec here as both use non-public @@ -86,8 +93,7 @@ pub(crate) mod test_helpers { let mut hasher = std::hash::RandomState::new().build_hasher(); std::panic::Location::caller().hash(&mut hasher); let hc64 = hasher.finish(); - let seed_vec = - hc64.to_le_bytes().into_iter().chain(0u8..8).collect::>(); + let seed_vec = hc64.to_le_bytes().into_iter().chain(0u8..8).collect::>(); let seed: [u8; 16] = seed_vec.as_slice().try_into().unwrap(); rand::SeedableRng::from_seed(seed) } diff --git a/library/core/src/prelude/v1.rs b/library/core/src/prelude/v1.rs index a4be66b90cab3..77dc10d165cfe 100644 --- a/library/core/src/prelude/v1.rs +++ b/library/core/src/prelude/v1.rs @@ -59,12 +59,29 @@ pub use crate::hash::macros::Hash; #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[doc(no_inline)] +#[allow(deprecated)] pub use crate::{ - assert, cfg, column, compile_error, concat, env, file, format_args, - format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env, - stringify, trace_macros, + assert, assert_eq, assert_ne, cfg, column, compile_error, concat, debug_assert, debug_assert_eq, debug_assert_ne, file, format_args, include, include_bytes, include_str, line, matches, module_path, option_env, stringify, todo, r#try, unimplemented, unreachable, write, writeln, }; +// These macros needs special handling, so that we don't export it *and* the modules of the same +// name. We only want the macro in the prelude. +mod ambiguous_macro_only { + #[allow(hidden_glob_reexports)] + mod env {} + #[allow(hidden_glob_reexports)] + mod panic {} + #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] + pub use crate::*; +} +#[stable(feature = "builtin_macro_prelude", since = "1.38.0")] +#[doc(no_inline)] +pub use self::ambiguous_macro_only::{env, panic}; + +#[unstable(feature = "cfg_select", issue = "115585")] +#[doc(no_inline)] +pub use crate::cfg_select; + #[unstable( feature = "concat_bytes", issue = "87555", @@ -73,6 +90,30 @@ pub use crate::{ #[doc(no_inline)] pub use crate::concat_bytes; +#[unstable(feature = "const_format_args", issue = "none")] +#[doc(no_inline)] +pub use crate::const_format_args; + +#[unstable( + feature = "log_syntax", + issue = "29598", + reason = "`log_syntax!` is not stable enough for use and is subject to change" +)] +#[doc(no_inline)] +pub use crate::log_syntax; + +#[unstable(feature = "pattern_type_macro", issue = "123646")] +#[doc(no_inline)] +pub use crate::pattern_type; + +#[unstable( + feature = "trace_macros", + issue = "29598", + reason = "`trace_macros` is not stable enough for use and is subject to change" +)] +#[doc(no_inline)] +pub use crate::trace_macros; + // Do not `doc(no_inline)` so that they become doc items on their own // (no public module for them to be re-exported from). #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] diff --git a/library/proc_macro/src/bridge/symbol.rs b/library/proc_macro/src/bridge/symbol.rs index 57ca7db9fcdd7..e0f3a6a2860b2 100644 --- a/library/proc_macro/src/bridge/symbol.rs +++ b/library/proc_macro/src/bridge/symbol.rs @@ -11,9 +11,12 @@ use std::cell::RefCell; use std::num::NonZero; -use std::str; +use std::{fmt, str}; -use super::*; +// Explicit import to avoid macro namespace collision. +use super::{ + DecodeMut, Encode, Mark, Marked, Reader, Unmark, Writer, arena, client, fxhash, server, +}; /// Handle for a symbol string stored within the Interner. #[derive(Copy, Clone, PartialEq, Eq, Hash)] diff --git a/library/std/src/prelude/mod.rs b/library/std/src/prelude/mod.rs index 5f7097c26e228..8a0a293c4e1d1 100644 --- a/library/std/src/prelude/mod.rs +++ b/library/std/src/prelude/mod.rs @@ -145,6 +145,11 @@ pub mod rust_2021 { #[stable(feature = "prelude_2021", since = "1.55.0")] #[doc(no_inline)] pub use core::prelude::rust_2021::*; + + // There are two different panic macros, one in `core` and one in `std`. They are slightly + // different. For `std` we explicitly want the one defined in `std`. + #[stable(feature = "prelude_2021", since = "1.55.0")] + pub use super::v1::panic; } /// The 2024 version of the prelude of The Rust Standard Library. @@ -159,6 +164,11 @@ pub mod rust_2024 { #[stable(feature = "prelude_2024", since = "1.85.0")] #[doc(no_inline)] pub use core::prelude::rust_2024::*; + + // There are two different panic macros, one in `core` and one in `std`. They are slightly + // different. For `std` we explicitly want the one defined in `std`. + #[stable(feature = "prelude_2024", since = "1.85.0")] + pub use super::v1::panic; } /// The Future version of the prelude of The Rust Standard Library. @@ -174,4 +184,9 @@ pub mod rust_future { #[unstable(feature = "prelude_next", issue = "none")] #[doc(no_inline)] pub use core::prelude::rust_future::*; + + // There are two different panic macros, one in `core` and one in `std`. They are slightly + // different. For `std` we explicitly want the one defined in `std`. + #[unstable(feature = "prelude_next", issue = "none")] + pub use super::v1::panic; } diff --git a/library/std/src/prelude/v1.rs b/library/std/src/prelude/v1.rs index 70c1113155656..27bf745f640a5 100644 --- a/library/std/src/prelude/v1.rs +++ b/library/std/src/prelude/v1.rs @@ -43,15 +43,41 @@ pub use crate::option::Option::{self, None, Some}; #[doc(no_inline)] pub use crate::result::Result::{self, Err, Ok}; -// Re-exported built-in macros +// Re-exported built-in macros and traits #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] #[doc(no_inline)] +#[allow(deprecated)] pub use core::prelude::v1::{ - assert, cfg, column, compile_error, concat, env, file, format_args, - format_args_nl, include, include_bytes, include_str, line, log_syntax, module_path, option_env, - stringify, trace_macros, Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, + assert, assert_eq, assert_ne, cfg, column, compile_error, concat, debug_assert, debug_assert_eq, debug_assert_ne, env, file, format_args, include, include_bytes, include_str, line, matches, + module_path, option_env, stringify, todo, r#try, unimplemented, unreachable, write, + writeln, Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, }; +#[stable(feature = "builtin_macro_prelude", since = "1.38.0")] +#[doc(no_inline)] +pub use crate::{ + dbg, eprint, eprintln, format, is_x86_feature_detected, print, println, thread_local +}; + +// These macros needs special handling, so that we don't export it *and* the modules of the same +// name. We only want the macro in the prelude. +mod ambiguous_macro_only_std { + #[allow(hidden_glob_reexports)] + mod vec {} + #[allow(hidden_glob_reexports)] + mod panic {} + #[allow(exported_private_dependencies)] + #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] + pub use crate::*; +} +#[stable(feature = "builtin_macro_prelude", since = "1.38.0")] +#[doc(no_inline)] +pub use self::ambiguous_macro_only_std::{vec, panic}; + +#[unstable(feature = "cfg_select", issue = "115585")] +#[doc(no_inline)] +pub use core::prelude::v1::cfg_select; + #[unstable( feature = "concat_bytes", issue = "87555", @@ -60,6 +86,26 @@ pub use core::prelude::v1::{ #[doc(no_inline)] pub use core::prelude::v1::concat_bytes; +#[unstable(feature = "const_format_args", issue = "none")] +#[doc(no_inline)] +pub use core::prelude::v1::const_format_args; + +#[unstable( + feature = "log_syntax", + issue = "29598", + reason = "`log_syntax!` is not stable enough for use and is subject to change" +)] +#[doc(no_inline)] +pub use core::prelude::v1::log_syntax; + +#[unstable( + feature = "trace_macros", + issue = "29598", + reason = "`trace_macros` is not stable enough for use and is subject to change" +)] +#[doc(no_inline)] +pub use core::prelude::v1::trace_macros; + // Do not `doc(no_inline)` so that they become doc items on their own // (no public module for them to be re-exported from). #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 373584d0117ce..3e776e10e0b19 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -169,7 +169,7 @@ use crate::path::Path; use crate::sys::pipe::{AnonPipe, read2}; use crate::sys::process as imp; use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner}; -use crate::{fmt, fs, str}; +use crate::{fmt, format_args_nl, fs, str}; /// Representation of a running or exited child process. /// diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 272180fb9904c..1aab669c60f6d 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -7,6 +7,7 @@ use std::collections::VecDeque; use std::fmt::{self, Display, Write}; +use std::format_args_nl; use rustc_data_structures::fx::FxIndexMap; use rustc_lexer::{Cursor, FrontmatterAllowed, LiteralKind, TokenKind}; diff --git a/tests/pretty/asm.pp b/tests/pretty/asm.pp index dca28f99a37d5..2ec58a449e124 100644 --- a/tests/pretty/asm.pp +++ b/tests/pretty/asm.pp @@ -1,6 +1,7 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/autodiff/autodiff_forward.pp b/tests/pretty/autodiff/autodiff_forward.pp index 6eddb5669c7ab..e3400516212f1 100644 --- a/tests/pretty/autodiff/autodiff_forward.pp +++ b/tests/pretty/autodiff/autodiff_forward.pp @@ -3,7 +3,8 @@ //@ needs-enzyme #![feature(autodiff)] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/autodiff/autodiff_reverse.pp b/tests/pretty/autodiff/autodiff_reverse.pp index 8f598b865c7b2..c9dd6d5b0e878 100644 --- a/tests/pretty/autodiff/autodiff_reverse.pp +++ b/tests/pretty/autodiff/autodiff_reverse.pp @@ -3,7 +3,8 @@ //@ needs-enzyme #![feature(autodiff)] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/autodiff/inherent_impl.pp b/tests/pretty/autodiff/inherent_impl.pp index 36a9222640ae5..fc3e8960b3ad7 100644 --- a/tests/pretty/autodiff/inherent_impl.pp +++ b/tests/pretty/autodiff/inherent_impl.pp @@ -3,7 +3,8 @@ //@ needs-enzyme #![feature(autodiff)] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/cast-lt.pp b/tests/pretty/cast-lt.pp index e82636edca7e5..ce6d440000cd8 100644 --- a/tests/pretty/cast-lt.pp +++ b/tests/pretty/cast-lt.pp @@ -1,6 +1,7 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/dollar-crate.pp b/tests/pretty/dollar-crate.pp index 31a55ec2bdaa8..b6aad86cf704d 100644 --- a/tests/pretty/dollar-crate.pp +++ b/tests/pretty/dollar-crate.pp @@ -1,6 +1,7 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/expanded-and-path-remap-80832.pp b/tests/pretty/expanded-and-path-remap-80832.pp index 6206498e4a2be..f028e446864c3 100644 --- a/tests/pretty/expanded-and-path-remap-80832.pp +++ b/tests/pretty/expanded-and-path-remap-80832.pp @@ -1,6 +1,7 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/format-args-str-escape.pp b/tests/pretty/format-args-str-escape.pp index d0bd7cf0c72a3..bb4872edff6e3 100644 --- a/tests/pretty/format-args-str-escape.pp +++ b/tests/pretty/format-args-str-escape.pp @@ -1,6 +1,7 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/hir-delegation.pp b/tests/pretty/hir-delegation.pp index f8ad02f2fccce..cc2c9fcb3dc96 100644 --- a/tests/pretty/hir-delegation.pp +++ b/tests/pretty/hir-delegation.pp @@ -8,6 +8,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; fn b(e: C) { } diff --git a/tests/pretty/hir-fn-params.pp b/tests/pretty/hir-fn-params.pp index fb4ea0304e5a9..67106f0de716b 100644 --- a/tests/pretty/hir-fn-params.pp +++ b/tests/pretty/hir-fn-params.pp @@ -2,6 +2,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-fn-params.pp diff --git a/tests/pretty/hir-fn-variadic.pp b/tests/pretty/hir-fn-variadic.pp index c0f5b7069a2d7..473f3f08cc480 100644 --- a/tests/pretty/hir-fn-variadic.pp +++ b/tests/pretty/hir-fn-variadic.pp @@ -7,6 +7,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; extern "C" { unsafe fn foo(x: i32, va1: ...); diff --git a/tests/pretty/hir-if-else.pp b/tests/pretty/hir-if-else.pp index af5d31b07cb18..324fa295849c4 100644 --- a/tests/pretty/hir-if-else.pp +++ b/tests/pretty/hir-if-else.pp @@ -2,6 +2,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-if-else.pp diff --git a/tests/pretty/hir-lifetimes.pp b/tests/pretty/hir-lifetimes.pp index 00c052d3f7986..1f29bf93d2dab 100644 --- a/tests/pretty/hir-lifetimes.pp +++ b/tests/pretty/hir-lifetimes.pp @@ -9,6 +9,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; struct Foo<'a> { x: &'a u32, diff --git a/tests/pretty/hir-pretty-attr.pp b/tests/pretty/hir-pretty-attr.pp index 01bfe2c095476..cdfebb2b1b746 100644 --- a/tests/pretty/hir-pretty-attr.pp +++ b/tests/pretty/hir-pretty-attr.pp @@ -2,6 +2,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-pretty-attr.pp diff --git a/tests/pretty/hir-pretty-loop.pp b/tests/pretty/hir-pretty-loop.pp index a0830c5188ada..659ca6aa72bd6 100644 --- a/tests/pretty/hir-pretty-loop.pp +++ b/tests/pretty/hir-pretty-loop.pp @@ -2,6 +2,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-pretty-loop.pp diff --git a/tests/pretty/hir-struct-expr.pp b/tests/pretty/hir-struct-expr.pp index bb222dc2e5f10..edc7e020f84d7 100644 --- a/tests/pretty/hir-struct-expr.pp +++ b/tests/pretty/hir-struct-expr.pp @@ -2,6 +2,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; //@ pretty-compare-only //@ pretty-mode:hir //@ pp-exact:hir-struct-expr.pp diff --git a/tests/pretty/if-else.pp b/tests/pretty/if-else.pp index f29b693e571eb..49c5159e0e9cd 100644 --- a/tests/pretty/if-else.pp +++ b/tests/pretty/if-else.pp @@ -1,6 +1,7 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/issue-12590-c.pp b/tests/pretty/issue-12590-c.pp index 0df095b0ee554..412031d9031b5 100644 --- a/tests/pretty/issue-12590-c.pp +++ b/tests/pretty/issue-12590-c.pp @@ -1,6 +1,7 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/issue-4264.pp b/tests/pretty/issue-4264.pp index 1344923f4c47c..74d1360fb9eb8 100644 --- a/tests/pretty/issue-4264.pp +++ b/tests/pretty/issue-4264.pp @@ -2,6 +2,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; //@ pretty-compare-only //@ pretty-mode:hir,typed //@ pp-exact:issue-4264.pp diff --git a/tests/pretty/issue-85089.pp b/tests/pretty/issue-85089.pp index 28a85bdf4ad8b..bfd79f7392417 100644 --- a/tests/pretty/issue-85089.pp +++ b/tests/pretty/issue-85089.pp @@ -2,6 +2,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; // Test to print lifetimes on HIR pretty-printing. //@ pretty-compare-only diff --git a/tests/pretty/never-pattern.pp b/tests/pretty/never-pattern.pp index 1ce332ea50643..6ba5fa3f3a338 100644 --- a/tests/pretty/never-pattern.pp +++ b/tests/pretty/never-pattern.pp @@ -7,7 +7,8 @@ #![allow(incomplete_features)] #![feature(never_patterns)] #![feature(never_type)] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/pin-ergonomics-hir.pp b/tests/pretty/pin-ergonomics-hir.pp index beca5988017dc..1cb7f94ad649e 100644 --- a/tests/pretty/pin-ergonomics-hir.pp +++ b/tests/pretty/pin-ergonomics-hir.pp @@ -8,6 +8,7 @@ extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; +extern crate std; use std::pin::Pin; diff --git a/tests/pretty/postfix-match/precedence.pp b/tests/pretty/postfix-match/precedence.pp index b6ff45daea120..36972df44d725 100644 --- a/tests/pretty/postfix-match/precedence.pp +++ b/tests/pretty/postfix-match/precedence.pp @@ -1,7 +1,8 @@ #![feature(prelude_import)] #![no_std] #![feature(postfix_match)] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/shebang-at-top.pp b/tests/pretty/shebang-at-top.pp index 197def4a154b1..c27ac52d0960d 100644 --- a/tests/pretty/shebang-at-top.pp +++ b/tests/pretty/shebang-at-top.pp @@ -1,7 +1,8 @@ #!/usr/bin/env rust #![feature(prelude_import)] #![no_std] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/pretty/tests-are-sorted.pp b/tests/pretty/tests-are-sorted.pp index 9e1566b2eff3b..b3a4edd8b7950 100644 --- a/tests/pretty/tests-are-sorted.pp +++ b/tests/pretty/tests-are-sorted.pp @@ -1,6 +1,7 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] +#[prelude_import] +use ::std::prelude::rust_2015::*; extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/asm/unpretty-expanded.stdout b/tests/ui/asm/unpretty-expanded.stdout index 7678f6bc3450c..ce636c150c1cc 100644 --- a/tests/ui/asm/unpretty-expanded.stdout +++ b/tests/ui/asm/unpretty-expanded.stdout @@ -1,6 +1,5 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout index 7499df5be5da1..c53491a6747c6 100644 --- a/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout +++ b/tests/ui/associated-type-bounds/return-type-notation/unpretty-parenthesized.stdout @@ -1,5 +1,4 @@ #![feature(prelude_import)] -#[macro_use] extern crate std; #[prelude_import] use std::prelude::rust_2021::*; diff --git a/tests/ui/codemap_tests/unicode.expanded.stdout b/tests/ui/codemap_tests/unicode.expanded.stdout index af375108b4780..4a29277fe3bff 100644 --- a/tests/ui/codemap_tests/unicode.expanded.stdout +++ b/tests/ui/codemap_tests/unicode.expanded.stdout @@ -1,6 +1,5 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/const-generics/defaults/pretty-printing-ast.stdout b/tests/ui/const-generics/defaults/pretty-printing-ast.stdout index 030fcec9cf2a7..efd703b24b435 100644 --- a/tests/ui/const-generics/defaults/pretty-printing-ast.stdout +++ b/tests/ui/const-generics/defaults/pretty-printing-ast.stdout @@ -6,7 +6,6 @@ //@ edition: 2015 #![crate_type = "lib"] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/deriving/built-in-proc-macro-scope.stdout b/tests/ui/deriving/built-in-proc-macro-scope.stdout index 4fbce5edb8194..e2a9119af3d61 100644 --- a/tests/ui/deriving/built-in-proc-macro-scope.stdout +++ b/tests/ui/deriving/built-in-proc-macro-scope.stdout @@ -6,7 +6,6 @@ //@ edition:2015 #![feature(derive_coerce_pointee)] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/deriving/deriving-all-codegen.stdout b/tests/ui/deriving/deriving-all-codegen.stdout index 0e4bfa30257df..c3d19543ca39b 100644 --- a/tests/ui/deriving/deriving-all-codegen.stdout +++ b/tests/ui/deriving/deriving-all-codegen.stdout @@ -17,7 +17,6 @@ #![crate_type = "lib"] #![allow(dead_code)] #![allow(deprecated)] -#[macro_use] extern crate std; #[prelude_import] use std::prelude::rust_2021::*; diff --git a/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout b/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout index 89300a5c6d0ca..ace45c4d760f6 100644 --- a/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout +++ b/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout @@ -4,7 +4,6 @@ //@ compile-flags: -Zunpretty=expanded //@ edition: 2015 #![feature(derive_coerce_pointee)] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/deriving/proc-macro-attribute-mixing.stdout b/tests/ui/deriving/proc-macro-attribute-mixing.stdout index b81110682d68f..e82f1780d0959 100644 --- a/tests/ui/deriving/proc-macro-attribute-mixing.stdout +++ b/tests/ui/deriving/proc-macro-attribute-mixing.stdout @@ -12,7 +12,6 @@ //@ edition: 2015 #![feature(derive_coerce_pointee)] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/feature-gates/feature-gate-format_args_nl.rs b/tests/ui/feature-gates/feature-gate-format_args_nl.rs index aeee2fbad9071..4749eea13a6db 100644 --- a/tests/ui/feature-gates/feature-gate-format_args_nl.rs +++ b/tests/ui/feature-gates/feature-gate-format_args_nl.rs @@ -1,3 +1,5 @@ +use std::format_args_nl; //~ ERROR `format_args_nl` is only for internal language use + fn main() { format_args_nl!(""); //~ ERROR `format_args_nl` is only for internal language use } diff --git a/tests/ui/feature-gates/feature-gate-format_args_nl.stderr b/tests/ui/feature-gates/feature-gate-format_args_nl.stderr index c7e8f8c686f90..1265bd447f40e 100644 --- a/tests/ui/feature-gates/feature-gate-format_args_nl.stderr +++ b/tests/ui/feature-gates/feature-gate-format_args_nl.stderr @@ -1,5 +1,5 @@ error[E0658]: use of unstable library feature `format_args_nl`: `format_args_nl` is only for internal language use and is subject to change - --> $DIR/feature-gate-format_args_nl.rs:2:5 + --> $DIR/feature-gate-format_args_nl.rs:4:5 | LL | format_args_nl!(""); | ^^^^^^^^^^^^^^ @@ -7,6 +7,15 @@ LL | format_args_nl!(""); = help: add `#![feature(format_args_nl)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error: aborting due to 1 previous error +error[E0658]: use of unstable library feature `format_args_nl`: `format_args_nl` is only for internal language use and is subject to change + --> $DIR/feature-gate-format_args_nl.rs:1:5 + | +LL | use std::format_args_nl; + | ^^^^^^^^^^^^^^^^^^^ + | + = help: add `#![feature(format_args_nl)]` to the crate attributes to enable + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/hygiene/format-args.rs b/tests/ui/hygiene/format-args.rs index ff08aecfd9eb7..f845f5d8a4c8f 100644 --- a/tests/ui/hygiene/format-args.rs +++ b/tests/ui/hygiene/format-args.rs @@ -3,6 +3,8 @@ #![allow(non_upper_case_globals)] #![feature(format_args_nl)] +use std::format_args_nl; + static arg0: () = (); fn main() { diff --git a/tests/ui/imports/glob-shadowing.stderr b/tests/ui/imports/glob-shadowing.stderr index 0ce8d4f54f8d5..025147d08f014 100644 --- a/tests/ui/imports/glob-shadowing.stderr +++ b/tests/ui/imports/glob-shadowing.stderr @@ -5,14 +5,15 @@ LL | let x = env!("PATH"); | ^^^ ambiguous name | = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution - = note: `env` could refer to a macro from prelude -note: `env` could also refer to the macro imported here +note: `env` could refer to the macro imported here --> $DIR/glob-shadowing.rs:9:9 | LL | use crate::m::*; | ^^^^^^^^^^^ = help: consider adding an explicit import of `env` to disambiguate = help: or use `self::env` to refer to this macro unambiguously +note: `env` could also refer to a macro from prelude + --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL error[E0659]: `env` is ambiguous --> $DIR/glob-shadowing.rs:19:21 @@ -21,13 +22,14 @@ LL | let x = env!("PATH"); | ^^^ ambiguous name | = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution - = note: `env` could refer to a macro from prelude -note: `env` could also refer to the macro imported here +note: `env` could refer to the macro imported here --> $DIR/glob-shadowing.rs:17:13 | LL | use crate::m::*; | ^^^^^^^^^^^ = help: consider adding an explicit import of `env` to disambiguate +note: `env` could also refer to a macro from prelude + --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL error[E0659]: `fenv` is ambiguous --> $DIR/glob-shadowing.rs:29:21 diff --git a/tests/ui/imports/local-modularized-tricky-fail-1.stderr b/tests/ui/imports/local-modularized-tricky-fail-1.stderr index 52a01e8bcdfe3..5e87531a05333 100644 --- a/tests/ui/imports/local-modularized-tricky-fail-1.stderr +++ b/tests/ui/imports/local-modularized-tricky-fail-1.stderr @@ -30,8 +30,7 @@ LL | panic!(); | ^^^^^ ambiguous name | = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution - = note: `panic` could refer to a macro from prelude -note: `panic` could also refer to the macro defined here +note: `panic` could refer to the macro defined here --> $DIR/local-modularized-tricky-fail-1.rs:12:5 | LL | / macro_rules! panic { @@ -42,6 +41,8 @@ LL | | } LL | define_panic!(); | --------------- in this macro invocation = help: use `crate::panic` to refer to this macro unambiguously +note: `panic` could also refer to a macro from prelude + --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL = note: this error originates in the macro `define_panic` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `include` is ambiguous @@ -51,8 +52,7 @@ LL | include!(); | ^^^^^^^ ambiguous name | = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution - = note: `include` could refer to a macro from prelude -note: `include` could also refer to the macro defined here +note: `include` could refer to the macro defined here --> $DIR/local-modularized-tricky-fail-1.rs:18:5 | LL | / macro_rules! include { @@ -63,6 +63,8 @@ LL | | } LL | define_include!(); | ----------------- in this macro invocation = help: use `crate::include` to refer to this macro unambiguously +note: `include` could also refer to a macro from prelude + --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL = note: this error originates in the macro `define_include` (in Nightly builds, run with -Z macro-backtrace for more info) error: aborting due to 3 previous errors diff --git a/tests/ui/imports/shadow_builtin_macros.stderr b/tests/ui/imports/shadow_builtin_macros.stderr index c828b1193d81e..7799fb230d434 100644 --- a/tests/ui/imports/shadow_builtin_macros.stderr +++ b/tests/ui/imports/shadow_builtin_macros.stderr @@ -5,14 +5,15 @@ LL | fn f() { panic!(); } | ^^^^^ ambiguous name | = note: ambiguous because of a conflict between a name from a glob import and an outer scope during import or macro resolution - = note: `panic` could refer to a macro from prelude -note: `panic` could also refer to the macro imported here +note: `panic` could refer to the macro imported here --> $DIR/shadow_builtin_macros.rs:14:9 | LL | use crate::foo::*; | ^^^^^^^^^^^^^ = help: consider adding an explicit import of `panic` to disambiguate = help: or use `self::panic` to refer to this macro unambiguously +note: `panic` could also refer to a macro from prelude + --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL error[E0659]: `panic` is ambiguous --> $DIR/shadow_builtin_macros.rs:33:5 @@ -21,8 +22,7 @@ LL | panic!(); | ^^^^^ ambiguous name | = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution - = note: `panic` could refer to a macro from prelude -note: `panic` could also refer to the macro defined here +note: `panic` could refer to the macro defined here --> $DIR/shadow_builtin_macros.rs:30:9 | LL | macro_rules! panic { () => {} } @@ -30,6 +30,8 @@ LL | macro_rules! panic { () => {} } LL | } } LL | m!(); | ---- in this macro invocation +note: `panic` could also refer to a macro from prelude + --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0659]: `n` is ambiguous @@ -59,13 +61,14 @@ LL | fn f() { panic!(); } | ^^^^^ ambiguous name | = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution - = note: `panic` could refer to a macro from prelude -note: `panic` could also refer to the macro imported here +note: `panic` could refer to the macro imported here --> $DIR/shadow_builtin_macros.rs:19:26 | LL | ::two_macros::m!(use crate::foo::panic;); | ^^^^^^^^^^^^^^^^^ = help: use `self::panic` to refer to this macro unambiguously +note: `panic` could also refer to a macro from prelude + --> $SRC_DIR/std/src/prelude/mod.rs:LL:COL error: aborting due to 4 previous errors diff --git a/tests/ui/lint/dead-code/with-core-crate.rs b/tests/ui/lint/dead-code/with-core-crate.rs index 0a94b528f3339..9ccb6aecb75fb 100644 --- a/tests/ui/lint/dead-code/with-core-crate.rs +++ b/tests/ui/lint/dead-code/with-core-crate.rs @@ -1,7 +1,6 @@ #![deny(dead_code)] #![allow(unreachable_code)] -#[macro_use] extern crate core; fn foo() { //~ ERROR function `foo` is never used diff --git a/tests/ui/lint/dead-code/with-core-crate.stderr b/tests/ui/lint/dead-code/with-core-crate.stderr index f466a616580c5..9db26c956298e 100644 --- a/tests/ui/lint/dead-code/with-core-crate.stderr +++ b/tests/ui/lint/dead-code/with-core-crate.stderr @@ -1,5 +1,5 @@ error: function `foo` is never used - --> $DIR/with-core-crate.rs:7:4 + --> $DIR/with-core-crate.rs:6:4 | LL | fn foo() { | ^^^ diff --git a/tests/ui/lint/rfc-2383-lint-reason/no_ice_for_partial_compiler_runs.stdout b/tests/ui/lint/rfc-2383-lint-reason/no_ice_for_partial_compiler_runs.stdout index 80abac44ca84c..0fcfc936a59bc 100644 --- a/tests/ui/lint/rfc-2383-lint-reason/no_ice_for_partial_compiler_runs.stdout +++ b/tests/ui/lint/rfc-2383-lint-reason/no_ice_for_partial_compiler_runs.stdout @@ -1,6 +1,5 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout b/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout index ba93384644d59..6e41432ad7df1 100644 --- a/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout +++ b/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/macros/rfc-2011-nicer-assert-messages/non-consuming-methods-have-optimized-codegen.stdout b/tests/ui/macros/rfc-2011-nicer-assert-messages/non-consuming-methods-have-optimized-codegen.stdout index e29655faabe58..d47f733d40edb 100644 --- a/tests/ui/macros/rfc-2011-nicer-assert-messages/non-consuming-methods-have-optimized-codegen.stdout +++ b/tests/ui/macros/rfc-2011-nicer-assert-messages/non-consuming-methods-have-optimized-codegen.stdout @@ -5,7 +5,6 @@ //@ edition: 2015 #![feature(core_intrinsics, generic_assert)] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/match/issue-82392.stdout b/tests/ui/match/issue-82392.stdout index d7eef0497392b..d44ffbe216716 100644 --- a/tests/ui/match/issue-82392.stdout +++ b/tests/ui/match/issue-82392.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/proc-macro/meta-macro-hygiene.stdout b/tests/ui/proc-macro/meta-macro-hygiene.stdout index 452598c372c17..b5db9922b31a8 100644 --- a/tests/ui/proc-macro/meta-macro-hygiene.stdout +++ b/tests/ui/proc-macro/meta-macro-hygiene.stdout @@ -16,7 +16,6 @@ Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro // in the stdout #![no_std /* 0#0 */] -#[macro_use /* 0#1 */] extern crate core /* 0#1 */; #[prelude_import /* 0#1 */] use core /* 0#1 */::prelude /* 0#1 */::rust_2018 /* 0#1 */::*; diff --git a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout index e10a5199f1793..e45abab03b4c4 100644 --- a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout +++ b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout @@ -36,7 +36,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ #![feature /* 0#0 */(decl_macro)] #![no_std /* 0#0 */] -#[macro_use /* 0#1 */] extern crate core /* 0#2 */; #[prelude_import /* 0#1 */] use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*; diff --git a/tests/ui/proc-macro/quote/debug.stdout b/tests/ui/proc-macro/quote/debug.stdout index 77c52f02a33c1..896c809fedaba 100644 --- a/tests/ui/proc-macro/quote/debug.stdout +++ b/tests/ui/proc-macro/quote/debug.stdout @@ -12,7 +12,6 @@ #![feature(proc_macro_quote)] #![crate_type = "proc-macro"] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout index 66ba726fb9a49..9a34d6c1af7ac 100644 --- a/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout +++ b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout @@ -1,6 +1,5 @@ #![feature(prelude_import)] #![no_std] -#[macro_use] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/stats/input-stats.stderr b/tests/ui/stats/input-stats.stderr index 72a9820bb6431..b0393a2c89ef0 100644 --- a/tests/ui/stats/input-stats.stderr +++ b/tests/ui/stats/input-stats.stderr @@ -15,7 +15,7 @@ ast-stats - Ptr 64 (NN.N%) 1 ast-stats - Ref 64 (NN.N%) 1 ast-stats - ImplicitSelf 128 (NN.N%) 2 ast-stats - Path 640 (NN.N%) 10 -ast-stats PathSegment 888 (NN.N%) 37 24 +ast-stats PathSegment 864 (NN.N%) 36 24 ast-stats Expr 648 (NN.N%) 9 72 ast-stats - InlineAsm 72 (NN.N%) 1 ast-stats - Match 72 (NN.N%) 1 @@ -41,9 +41,9 @@ ast-stats - Let 32 (NN.N%) 1 ast-stats - Semi 32 (NN.N%) 1 ast-stats - Expr 96 (NN.N%) 3 ast-stats Param 160 (NN.N%) 4 40 -ast-stats Attribute 160 (NN.N%) 5 32 +ast-stats Attribute 128 (NN.N%) 4 32 ast-stats - DocComment 32 (NN.N%) 1 -ast-stats - Normal 128 (NN.N%) 4 +ast-stats - Normal 96 (NN.N%) 3 ast-stats InlineAsm 120 (NN.N%) 1 120 ast-stats FnDecl 120 (NN.N%) 5 24 ast-stats Local 96 (NN.N%) 1 96 @@ -57,7 +57,7 @@ ast-stats GenericArgs 40 (NN.N%) 1 40 ast-stats - AngleBracketed 40 (NN.N%) 1 ast-stats Crate 40 (NN.N%) 1 40 ast-stats ---------------------------------------------------------------- -ast-stats Total 7_472 129 +ast-stats Total 7_416 127 ast-stats ================================================================ hir-stats ================================================================ hir-stats HIR STATS: input_stats @@ -93,7 +93,7 @@ hir-stats - Binding 216 (NN.N%) 3 hir-stats Block 288 (NN.N%) 6 48 hir-stats GenericBound 256 (NN.N%) 4 64 hir-stats - Trait 256 (NN.N%) 4 -hir-stats Attribute 200 (NN.N%) 5 40 +hir-stats Attribute 160 (NN.N%) 4 40 hir-stats Variant 144 (NN.N%) 2 72 hir-stats GenericArgs 144 (NN.N%) 3 48 hir-stats FieldDef 128 (NN.N%) 2 64 @@ -119,5 +119,5 @@ hir-stats TraitItemId 8 (NN.N%) 2 4 hir-stats ImplItemId 8 (NN.N%) 2 4 hir-stats ForeignItemId 4 (NN.N%) 1 4 hir-stats ---------------------------------------------------------------- -hir-stats Total 8_584 173 +hir-stats Total 8_544 172 hir-stats ================================================================ diff --git a/tests/ui/type-alias-impl-trait/issue-60662.stdout b/tests/ui/type-alias-impl-trait/issue-60662.stdout index 7ad29c88bcfe5..d1f337819f8b0 100644 --- a/tests/ui/type-alias-impl-trait/issue-60662.stdout +++ b/tests/ui/type-alias-impl-trait/issue-60662.stdout @@ -3,7 +3,6 @@ //@ edition: 2015 #![feature(type_alias_impl_trait)] -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/unpretty/bad-literal.stdout b/tests/ui/unpretty/bad-literal.stdout index 1f697aff27c9b..267d59a868e41 100644 --- a/tests/ui/unpretty/bad-literal.stdout +++ b/tests/ui/unpretty/bad-literal.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/unpretty/debug-fmt-hir.stdout b/tests/ui/unpretty/debug-fmt-hir.stdout index 9c79421e32aba..342dc144909ce 100644 --- a/tests/ui/unpretty/debug-fmt-hir.stdout +++ b/tests/ui/unpretty/debug-fmt-hir.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/unpretty/deprecated-attr.stdout b/tests/ui/unpretty/deprecated-attr.stdout index 26cc74c11604d..0b0f17d556665 100644 --- a/tests/ui/unpretty/deprecated-attr.stdout +++ b/tests/ui/unpretty/deprecated-attr.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/unpretty/diagnostic-attr.stdout b/tests/ui/unpretty/diagnostic-attr.stdout index 4822cf4700b94..80cd11753493a 100644 --- a/tests/ui/unpretty/diagnostic-attr.stdout +++ b/tests/ui/unpretty/diagnostic-attr.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/unpretty/exhaustive-asm.expanded.stdout b/tests/ui/unpretty/exhaustive-asm.expanded.stdout index 9a58e4c2877b1..9b3c60b03ba77 100644 --- a/tests/ui/unpretty/exhaustive-asm.expanded.stdout +++ b/tests/ui/unpretty/exhaustive-asm.expanded.stdout @@ -1,5 +1,4 @@ #![feature(prelude_import)] -#[macro_use] extern crate std; #[prelude_import] use std::prelude::rust_2024::*; diff --git a/tests/ui/unpretty/exhaustive-asm.hir.stdout b/tests/ui/unpretty/exhaustive-asm.hir.stdout index b33b38c2caba4..ed98191e1dd56 100644 --- a/tests/ui/unpretty/exhaustive-asm.hir.stdout +++ b/tests/ui/unpretty/exhaustive-asm.hir.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use std::prelude::rust_2024::*; diff --git a/tests/ui/unpretty/exhaustive.expanded.stdout b/tests/ui/unpretty/exhaustive.expanded.stdout index 0327ad5f92bb3..8a653e6674fe2 100644 --- a/tests/ui/unpretty/exhaustive.expanded.stdout +++ b/tests/ui/unpretty/exhaustive.expanded.stdout @@ -29,7 +29,6 @@ #![feature(try_blocks)] #![feature(yeet_expr)] #![allow(incomplete_features)] -#[macro_use] extern crate std; #[prelude_import] use std::prelude::rust_2024::*; diff --git a/tests/ui/unpretty/exhaustive.hir.stdout b/tests/ui/unpretty/exhaustive.hir.stdout index 68356a33c9e60..b6713878a37f4 100644 --- a/tests/ui/unpretty/exhaustive.hir.stdout +++ b/tests/ui/unpretty/exhaustive.hir.stdout @@ -28,7 +28,6 @@ #![feature(try_blocks)] #![feature(yeet_expr)] #![allow(incomplete_features)] -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use std::prelude::rust_2024::*; diff --git a/tests/ui/unpretty/flattened-format-args.stdout b/tests/ui/unpretty/flattened-format-args.stdout index 0792dc10e946b..19d4b7471182c 100644 --- a/tests/ui/unpretty/flattened-format-args.stdout +++ b/tests/ui/unpretty/flattened-format-args.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/unpretty/interpolation-expanded.stdout b/tests/ui/unpretty/interpolation-expanded.stdout index 7284a89e7a9b0..d385a021ed57a 100644 --- a/tests/ui/unpretty/interpolation-expanded.stdout +++ b/tests/ui/unpretty/interpolation-expanded.stdout @@ -10,7 +10,6 @@ // synthesizing parentheses indiscriminately; only where necessary. #![feature(if_let_guard)] -#[macro_use] extern crate std; #[prelude_import] use std::prelude::rust_2024::*; diff --git a/tests/ui/unpretty/let-else-hir.stdout b/tests/ui/unpretty/let-else-hir.stdout index 14270a5720274..cc19f392c3a43 100644 --- a/tests/ui/unpretty/let-else-hir.stdout +++ b/tests/ui/unpretty/let-else-hir.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/unpretty/self-hir.stdout b/tests/ui/unpretty/self-hir.stdout index b190565dcc472..c973e143275cd 100644 --- a/tests/ui/unpretty/self-hir.stdout +++ b/tests/ui/unpretty/self-hir.stdout @@ -1,4 +1,3 @@ -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*; diff --git a/tests/ui/unpretty/unpretty-expr-fn-arg.stdout b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout index c04909a736136..41d62d11aaa61 100644 --- a/tests/ui/unpretty/unpretty-expr-fn-arg.stdout +++ b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout @@ -8,7 +8,6 @@ //@ compile-flags: -Zunpretty=hir,typed //@ edition: 2015 #![allow(dead_code)] -#[attr = MacroUse {arguments: UseAll}] extern crate std; #[prelude_import] use ::std::prelude::rust_2015::*;