diff --git a/compiler/rustc_builtin_macros/src/standard_library_imports.rs b/compiler/rustc_builtin_macros/src/standard_library_imports.rs index a1ee53b7ca21f..748dacc284e9e 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 56e60ed4c8448..e75dd93e08606 100644 --- a/library/alloctests/lib.rs +++ b/library/alloctests/lib.rs @@ -62,7 +62,6 @@ // Allow testing this library extern crate alloc as realalloc; -#[macro_use] extern crate std; #[cfg(test)] extern crate test; diff --git a/library/core/src/prelude/v1.rs b/library/core/src/prelude/v1.rs index c5975c0305031..c012ba6ea01f6 100644 --- a/library/core/src/prelude/v1.rs +++ b/library/core/src/prelude/v1.rs @@ -61,11 +61,26 @@ pub use crate::hash::macros::Hash; #[allow(deprecated)] #[doc(no_inline)] pub use crate::{ - assert, cfg, column, compile_error, concat, concat_idents, 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")] +pub use self::ambiguous_macro_only::{env, panic}; + +#[unstable(feature = "cfg_match", issue = "115585")] +#[doc(no_inline)] +pub use crate::cfg_match; + #[unstable( feature = "concat_bytes", issue = "87555", @@ -74,6 +89,38 @@ pub use crate::{ #[doc(no_inline)] pub use crate::concat_bytes; +#[unstable( + feature = "concat_idents", + issue = "29599", + reason = "`concat_idents` is not stable enough for use and is subject to change" +)] +#[doc(no_inline)] +pub use crate::concat_idents; + +#[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 6a1cecd69fb5f..6ff480460e6f3 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 4217f65864072..4ec204963a828 100644 --- a/library/std/src/prelude/v1.rs +++ b/library/std/src/prelude/v1.rs @@ -43,16 +43,39 @@ 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")] #[allow(deprecated)] #[doc(no_inline)] pub use core::prelude::v1::{ - assert, cfg, column, compile_error, concat, concat_idents, 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 {} + #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] + pub use crate::*; +} +#[stable(feature = "builtin_macro_prelude", since = "1.38.0")] +pub use self::ambiguous_macro_only_std::{vec, panic}; + +#[unstable(feature = "cfg_match", issue = "115585")] +#[doc(no_inline)] +pub use core::prelude::v1::cfg_match; + #[unstable( feature = "concat_bytes", issue = "87555", @@ -61,6 +84,34 @@ pub use core::prelude::v1::{ #[doc(no_inline)] pub use core::prelude::v1::concat_bytes; +#[unstable( + feature = "concat_idents", + issue = "29599", + reason = "`concat_idents` is not stable enough for use and is subject to change" +)] +#[doc(no_inline)] +pub use core::prelude::v1::concat_idents; + +#[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 3b765a9537bc9..5e5cb8b394175 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -171,7 +171,7 @@ use crate::sys::process as imp; #[stable(feature = "command_access", since = "1.57.0")] pub use crate::sys_common::process::CommandEnvs; 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 c943d3ad4d056..b024b62f3ec2e 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -7,6 +7,7 @@ use std::collections::VecDeque; use std::fmt::{Display, Write}; +use std::format_args_nl; use rustc_data_structures::fx::FxIndexMap; use rustc_lexer::{Cursor, LiteralKind, TokenKind}; diff --git a/src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs b/src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs index 0d1c977506276..b9694d6f42e43 100644 --- a/src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs +++ b/src/tools/rust-analyzer/crates/ide-diagnostics/src/handlers/unresolved_macro_call.rs @@ -94,7 +94,6 @@ macro_rules! panic { } //- /lib.rs crate:foo deps:core -#[macro_use] extern crate core; fn foo() { diff --git a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs index 8f69bb8230000..21196ecf94688 100644 --- a/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs +++ b/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting/tests.rs @@ -445,7 +445,7 @@ fn test_string_highlighting() { //- minicore: fmt, assert, asm, concat, panic macro_rules! println { ($($arg:tt)*) => ({ - $crate::io::_print(format_args_nl!($($arg)*)); + $crate::io::_print(std::format_args_nl!($($arg)*)); }) } diff --git a/tests/pretty/asm.pp b/tests/pretty/asm.pp index e6c9545f51ee4..05887c17ce927 100644 --- a/tests/pretty/asm.pp +++ b/tests/pretty/asm.pp @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-mode:expanded //@ pp-exact:asm.pp diff --git a/tests/pretty/autodiff_forward.pp b/tests/pretty/autodiff_forward.pp index 713b8f541ae0d..89fe1bea353e0 100644 --- a/tests/pretty/autodiff_forward.pp +++ b/tests/pretty/autodiff_forward.pp @@ -5,7 +5,6 @@ #![feature(autodiff)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-mode:expanded //@ pretty-compare-only diff --git a/tests/pretty/autodiff_reverse.pp b/tests/pretty/autodiff_reverse.pp index 31920694a3ad5..1681a5fec9b07 100644 --- a/tests/pretty/autodiff_reverse.pp +++ b/tests/pretty/autodiff_reverse.pp @@ -5,7 +5,6 @@ #![feature(autodiff)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-mode:expanded //@ pretty-compare-only diff --git a/tests/pretty/cast-lt.pp b/tests/pretty/cast-lt.pp index f6155c9d827b4..e0660ee098478 100644 --- a/tests/pretty/cast-lt.pp +++ b/tests/pretty/cast-lt.pp @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-compare-only //@ pretty-mode:expanded diff --git a/tests/pretty/dollar-crate.pp b/tests/pretty/dollar-crate.pp index 561a9500aaaa0..6ec67b918c2ad 100644 --- a/tests/pretty/dollar-crate.pp +++ b/tests/pretty/dollar-crate.pp @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-compare-only //@ pretty-mode:expanded diff --git a/tests/pretty/expanded-and-path-remap-80832.pp b/tests/pretty/expanded-and-path-remap-80832.pp index 5b3922bb32946..63bc930e89276 100644 --- a/tests/pretty/expanded-and-path-remap-80832.pp +++ b/tests/pretty/expanded-and-path-remap-80832.pp @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; // Test for issue 80832 // diff --git a/tests/pretty/format-args-str-escape.pp b/tests/pretty/format-args-str-escape.pp index 277b608475cfd..2a1ca09e12603 100644 --- a/tests/pretty/format-args-str-escape.pp +++ b/tests/pretty/format-args-str-escape.pp @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-compare-only //@ pretty-mode:expanded diff --git a/tests/pretty/hir-fn-params.pp b/tests/pretty/hir-fn-params.pp index 3799c8a3c3b7c..335583592ce6e 100644 --- a/tests/pretty/hir-fn-params.pp +++ b/tests/pretty/hir-fn-params.pp @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir diff --git a/tests/pretty/hir-fn-variadic.pp b/tests/pretty/hir-fn-variadic.pp index dfbaff696440b..24555219ac388 100644 --- a/tests/pretty/hir-fn-variadic.pp +++ b/tests/pretty/hir-fn-variadic.pp @@ -5,7 +5,6 @@ #![feature(c_variadic)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; extern "C" { diff --git a/tests/pretty/hir-lifetimes.pp b/tests/pretty/hir-lifetimes.pp index 4d1ab9d383bf4..97a0b70e5908a 100644 --- a/tests/pretty/hir-lifetimes.pp +++ b/tests/pretty/hir-lifetimes.pp @@ -7,7 +7,6 @@ #![allow(unused)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; struct Foo<'a> { diff --git a/tests/pretty/hir-pretty-attr.pp b/tests/pretty/hir-pretty-attr.pp index d8cc8c424ca5f..44c4dd0f000ce 100644 --- a/tests/pretty/hir-pretty-attr.pp +++ b/tests/pretty/hir-pretty-attr.pp @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir diff --git a/tests/pretty/hir-pretty-loop.pp b/tests/pretty/hir-pretty-loop.pp index 15f1677885aee..ee3601042a0f3 100644 --- a/tests/pretty/hir-pretty-loop.pp +++ b/tests/pretty/hir-pretty-loop.pp @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir diff --git a/tests/pretty/hir-struct-expr.pp b/tests/pretty/hir-struct-expr.pp index f85d17542dffb..687432340b2ae 100644 --- a/tests/pretty/hir-struct-expr.pp +++ b/tests/pretty/hir-struct-expr.pp @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir diff --git a/tests/pretty/issue-12590-c.pp b/tests/pretty/issue-12590-c.pp index 691738a89ed86..67b1cb7b1f2d3 100644 --- a/tests/pretty/issue-12590-c.pp +++ b/tests/pretty/issue-12590-c.pp @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-compare-only //@ pretty-mode:expanded diff --git a/tests/pretty/issue-4264.pp b/tests/pretty/issue-4264.pp index fa958d9f1e8f8..a91909339f144 100644 --- a/tests/pretty/issue-4264.pp +++ b/tests/pretty/issue-4264.pp @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ pretty-compare-only //@ pretty-mode:hir,typed diff --git a/tests/pretty/issue-85089.pp b/tests/pretty/issue-85089.pp index f4e0eb3dd5ff1..81301adeccab1 100644 --- a/tests/pretty/issue-85089.pp +++ b/tests/pretty/issue-85089.pp @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; // Test to print lifetimes on HIR pretty-printing. diff --git a/tests/pretty/postfix-match/precedence.pp b/tests/pretty/postfix-match/precedence.pp index 967aa7bc39ef3..c6f5e2eff0a6a 100644 --- a/tests/pretty/postfix-match/precedence.pp +++ b/tests/pretty/postfix-match/precedence.pp @@ -3,7 +3,6 @@ #![feature(postfix_match)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; use std::ops::Add; diff --git a/tests/pretty/tests-are-sorted.pp b/tests/pretty/tests-are-sorted.pp index d6a2c0ff9796b..b93a30e45120c 100644 --- a/tests/pretty/tests-are-sorted.pp +++ b/tests/pretty/tests-are-sorted.pp @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ compile-flags: --crate-type=lib --test --remap-path-prefix={{src-base}}/=/the/src/ --remap-path-prefix={{src-base}}\=/the/src/ //@ pretty-compare-only diff --git a/tests/ui/asm/unpretty-expanded.stdout b/tests/ui/asm/unpretty-expanded.stdout index 80ccd127d506d..0de43ba63686c 100644 --- a/tests/ui/asm/unpretty-expanded.stdout +++ b/tests/ui/asm/unpretty-expanded.stdout @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ needs-asm-support //@ check-pass 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 87667553837f5..42e6cb2f67161 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,7 +1,6 @@ #![feature(prelude_import)] #[prelude_import] use std::prelude::rust_2021::*; -#[macro_use] extern crate std; //@ edition: 2021 //@ compile-flags: -Zunpretty=expanded diff --git a/tests/ui/codemap_tests/unicode.expanded.stdout b/tests/ui/codemap_tests/unicode.expanded.stdout index eb53d12e94f3c..93d0b83282fe0 100644 --- a/tests/ui/codemap_tests/unicode.expanded.stdout +++ b/tests/ui/codemap_tests/unicode.expanded.stdout @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ revisions: normal expanded //@[expanded] check-pass diff --git a/tests/ui/const-generics/defaults/pretty-printing-ast.stdout b/tests/ui/const-generics/defaults/pretty-printing-ast.stdout index f1cd1451700fa..592d2a9194cea 100644 --- a/tests/ui/const-generics/defaults/pretty-printing-ast.stdout +++ b/tests/ui/const-generics/defaults/pretty-printing-ast.stdout @@ -7,7 +7,6 @@ #![crate_type = "lib"] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; trait Foo {} diff --git a/tests/ui/deriving/built-in-proc-macro-scope.stdout b/tests/ui/deriving/built-in-proc-macro-scope.stdout index fa4e50968f4de..9b45ac583f02f 100644 --- a/tests/ui/deriving/built-in-proc-macro-scope.stdout +++ b/tests/ui/deriving/built-in-proc-macro-scope.stdout @@ -7,7 +7,6 @@ #![feature(derive_coerce_pointee)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; #[macro_use] diff --git a/tests/ui/deriving/deriving-all-codegen.stdout b/tests/ui/deriving/deriving-all-codegen.stdout index 6503c87099040..8b47964820e73 100644 --- a/tests/ui/deriving/deriving-all-codegen.stdout +++ b/tests/ui/deriving/deriving-all-codegen.stdout @@ -19,7 +19,6 @@ #![allow(deprecated)] #[prelude_import] use std::prelude::rust_2021::*; -#[macro_use] extern crate std; // Empty struct. diff --git a/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout b/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout index a774efbbe354b..9082647acbb95 100644 --- a/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout +++ b/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout @@ -5,7 +5,6 @@ #![feature(derive_coerce_pointee)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; use std::marker::CoercePointee; diff --git a/tests/ui/deriving/proc-macro-attribute-mixing.stdout b/tests/ui/deriving/proc-macro-attribute-mixing.stdout index ad743d013d25d..60d115ade2ec3 100644 --- a/tests/ui/deriving/proc-macro-attribute-mixing.stdout +++ b/tests/ui/deriving/proc-macro-attribute-mixing.stdout @@ -13,7 +13,6 @@ #![feature(derive_coerce_pointee)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; #[macro_use] 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..5b3c5de0aec28 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; + 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/impl-trait/where-allowed.stderr b/tests/ui/impl-trait/where-allowed.stderr index 052ae5a99315c..730899646976c 100644 --- a/tests/ui/impl-trait/where-allowed.stderr +++ b/tests/ui/impl-trait/where-allowed.stderr @@ -387,34 +387,6 @@ LL | impl T {} = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #36887 -error[E0283]: type annotations needed - --> $DIR/where-allowed.rs:46:57 - | -LL | fn in_dyn_Fn_return_in_return() -> &'static dyn Fn() -> impl Debug { panic!() } - | ^^^^^^^^^^ cannot infer type - | - = note: cannot satisfy `_: Debug` - -error[E0283]: type annotations needed - --> $DIR/where-allowed.rs:64:46 - | -LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() } - | ^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type - | - = note: multiple `impl`s satisfying `_: Fn()` found in the following crates: `alloc`, `core`: - - impl Fn for &F - where A: Tuple, F: Fn, F: ?Sized; - - impl Fn for Box - where Args: Tuple, F: Fn, A: Allocator, F: ?Sized; - -error[E0118]: no nominal type found for inherent implementation - --> $DIR/where-allowed.rs:239:1 - | -LL | impl T {} - | ^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type - | - = note: either implement a trait on it or create a newtype to wrap it instead - error: unconstrained opaque type --> $DIR/where-allowed.rs:121:16 | @@ -431,9 +403,17 @@ LL | type InTypeAlias = impl Debug; | = note: `InTypeAlias` must be used in combination with a concrete type within the same crate -error: aborting due to 50 previous errors +error[E0118]: no nominal type found for inherent implementation + --> $DIR/where-allowed.rs:239:1 + | +LL | impl T {} + | ^^^^^^^^^^^^^^^^^^^^^^^ impl requires a nominal type + | + = note: either implement a trait on it or create a newtype to wrap it instead + +error: aborting due to 48 previous errors -Some errors have detailed explanations: E0053, E0118, E0283, E0562, E0658, E0666. +Some errors have detailed explanations: E0053, E0118, E0562, E0658, E0666. For more information about an error, try `rustc --explain E0053`. Future incompatibility report: Future breakage diagnostic: error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions diff --git a/tests/ui/imports/glob-shadowing.stderr b/tests/ui/imports/glob-shadowing.stderr index aff2eff68ac86..a8c5aaed9f2fa 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 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 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 6ffb31c20e60a..9881f22746731 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 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 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 d804c1d2d200b..0e53430e9ee30 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 @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; // This ensures that ICEs like rust#94953 don't happen //@ check-pass 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 e8c88d2dcdf2c..baf43fcf3f759 100644 --- a/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout +++ b/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ compile-flags: -Zunpretty=hir 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 8065d0dff8fc1..2924ee1ed2d43 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 @@ -6,7 +6,6 @@ #![feature(core_intrinsics, generic_assert)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; fn arbitrary_consuming_method_for_demonstration_purposes() { diff --git a/tests/ui/match/issue-82392.stdout b/tests/ui/match/issue-82392.stdout index 8949611ac12f4..cb1b698949f4c 100644 --- a/tests/ui/match/issue-82392.stdout +++ b/tests/ui/match/issue-82392.stdout @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; // https://github.com/rust-lang/rust/issues/82329 //@ compile-flags: -Zunpretty=hir,typed diff --git a/tests/ui/proc-macro/meta-macro-hygiene.stdout b/tests/ui/proc-macro/meta-macro-hygiene.stdout index 1ee7179e84c04..0549e84fadd65 100644 --- a/tests/ui/proc-macro/meta-macro-hygiene.stdout +++ b/tests/ui/proc-macro/meta-macro-hygiene.stdout @@ -18,7 +18,6 @@ Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro #![no_std /* 0#0 */] #[prelude_import /* 0#1 */] use core /* 0#1 */::prelude /* 0#1 */::rust_2018 /* 0#1 */::*; -#[macro_use /* 0#1 */] extern crate core /* 0#1 */; // Don't load unnecessary hygiene information from std extern crate std /* 0#0 */; diff --git a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout index 6fd6cb474693b..6946a86a5668f 100644 --- a/tests/ui/proc-macro/nonterminal-token-hygiene.stdout +++ b/tests/ui/proc-macro/nonterminal-token-hygiene.stdout @@ -37,7 +37,6 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ #![no_std /* 0#0 */] #[prelude_import /* 0#1 */] use ::core /* 0#1 */::prelude /* 0#1 */::rust_2015 /* 0#1 */::*; -#[macro_use /* 0#1 */] extern crate core /* 0#2 */; // Don't load unnecessary hygiene information from std extern crate std /* 0#0 */; diff --git a/tests/ui/proc-macro/quote/debug.stdout b/tests/ui/proc-macro/quote/debug.stdout index 3eaad9eb96997..019ecff8e1225 100644 --- a/tests/ui/proc-macro/quote/debug.stdout +++ b/tests/ui/proc-macro/quote/debug.stdout @@ -13,7 +13,6 @@ #![crate_type = "proc-macro"] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; extern crate proc_macro; 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 1c103f03c3547..dd0bf87814e9e 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 @@ -2,7 +2,6 @@ #![no_std] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ check-pass //@ compile-flags: -Z unpretty=expanded diff --git a/tests/ui/stats/input-stats.stderr b/tests/ui/stats/input-stats.stderr index 24e3894864787..b60f6ccb3ff2e 100644 --- a/tests/ui/stats/input-stats.stderr +++ b/tests/ui/stats/input-stats.stderr @@ -61,18 +61,18 @@ ast-stats-2 ---------------------------------------------------------------- ast-stats-2 Crate 40 ( 0.5%) 1 40 ast-stats-2 GenericArgs 40 ( 0.5%) 1 40 ast-stats-2 - AngleBracketed 40 ( 0.5%) 1 -ast-stats-2 ExprField 48 ( 0.6%) 1 48 +ast-stats-2 ExprField 48 ( 0.7%) 1 48 ast-stats-2 WherePredicate 72 ( 1.0%) 1 72 ast-stats-2 - BoundPredicate 72 ( 1.0%) 1 ast-stats-2 ForeignItem 80 ( 1.1%) 1 80 ast-stats-2 - Fn 80 ( 1.1%) 1 ast-stats-2 Local 80 ( 1.1%) 1 80 ast-stats-2 Arm 96 ( 1.3%) 2 48 +ast-stats-2 Attribute 96 ( 1.3%) 3 32 +ast-stats-2 - DocComment 32 ( 0.4%) 1 +ast-stats-2 - Normal 64 ( 0.9%) 2 ast-stats-2 FnDecl 120 ( 1.6%) 5 24 ast-stats-2 InlineAsm 120 ( 1.6%) 1 120 -ast-stats-2 Attribute 128 ( 1.7%) 4 32 -ast-stats-2 - DocComment 32 ( 0.4%) 1 -ast-stats-2 - Normal 96 ( 1.3%) 3 ast-stats-2 Param 160 ( 2.2%) 4 40 ast-stats-2 Stmt 160 ( 2.2%) 5 32 ast-stats-2 - Let 32 ( 0.4%) 1 @@ -81,13 +81,13 @@ ast-stats-2 - Expr 96 ( 1.3%) 3 ast-stats-2 Block 192 ( 2.6%) 6 32 ast-stats-2 FieldDef 208 ( 2.8%) 2 104 ast-stats-2 Variant 208 ( 2.8%) 2 104 -ast-stats-2 AssocItem 320 ( 4.3%) 4 80 +ast-stats-2 AssocItem 320 ( 4.4%) 4 80 ast-stats-2 - Fn 160 ( 2.2%) 2 ast-stats-2 - Type 160 ( 2.2%) 2 ast-stats-2 GenericBound 352 ( 4.8%) 4 88 ast-stats-2 - Trait 352 ( 4.8%) 4 ast-stats-2 GenericParam 480 ( 6.5%) 5 96 -ast-stats-2 Pat 504 ( 6.8%) 7 72 +ast-stats-2 Pat 504 ( 6.9%) 7 72 ast-stats-2 - Struct 72 ( 1.0%) 1 ast-stats-2 - Wild 72 ( 1.0%) 1 ast-stats-2 - Ident 360 ( 4.9%) 5 @@ -96,24 +96,24 @@ ast-stats-2 - InlineAsm 72 ( 1.0%) 1 ast-stats-2 - Match 72 ( 1.0%) 1 ast-stats-2 - Path 72 ( 1.0%) 1 ast-stats-2 - Struct 72 ( 1.0%) 1 -ast-stats-2 - Lit 144 ( 1.9%) 2 +ast-stats-2 - Lit 144 ( 2.0%) 2 ast-stats-2 - Block 216 ( 2.9%) 3 -ast-stats-2 PathSegment 864 (11.7%) 36 24 -ast-stats-2 Ty 896 (12.1%) 14 64 +ast-stats-2 PathSegment 840 (11.4%) 35 24 +ast-stats-2 Ty 896 (12.2%) 14 64 ast-stats-2 - Ptr 64 ( 0.9%) 1 ast-stats-2 - Ref 64 ( 0.9%) 1 ast-stats-2 - ImplicitSelf 128 ( 1.7%) 2 -ast-stats-2 - Path 640 ( 8.6%) 10 -ast-stats-2 Item 1_584 (21.4%) 11 144 -ast-stats-2 - Enum 144 ( 1.9%) 1 -ast-stats-2 - ExternCrate 144 ( 1.9%) 1 -ast-stats-2 - ForeignMod 144 ( 1.9%) 1 -ast-stats-2 - Impl 144 ( 1.9%) 1 -ast-stats-2 - Trait 144 ( 1.9%) 1 +ast-stats-2 - Path 640 ( 8.7%) 10 +ast-stats-2 Item 1_584 (21.6%) 11 144 +ast-stats-2 - Enum 144 ( 2.0%) 1 +ast-stats-2 - ExternCrate 144 ( 2.0%) 1 +ast-stats-2 - ForeignMod 144 ( 2.0%) 1 +ast-stats-2 - Impl 144 ( 2.0%) 1 +ast-stats-2 - Trait 144 ( 2.0%) 1 ast-stats-2 - Fn 288 ( 3.9%) 2 ast-stats-2 - Use 576 ( 7.8%) 4 ast-stats-2 ---------------------------------------------------------------- -ast-stats-2 Total 7_400 127 +ast-stats-2 Total 7_344 125 ast-stats-2 hir-stats HIR STATS hir-stats Name Accumulated Size Count Item Size @@ -134,12 +134,12 @@ hir-stats InlineAsm 72 ( 0.8%) 1 72 hir-stats WherePredicate 72 ( 0.8%) 3 24 hir-stats - BoundPredicate 72 ( 0.8%) 3 hir-stats Arm 80 ( 0.9%) 2 40 +hir-stats Attribute 96 ( 1.1%) 3 32 hir-stats Stmt 96 ( 1.1%) 3 32 hir-stats - Expr 32 ( 0.4%) 1 hir-stats - Let 32 ( 0.4%) 1 hir-stats - Semi 32 ( 0.4%) 1 hir-stats FnDecl 120 ( 1.3%) 3 40 -hir-stats Attribute 128 ( 1.4%) 4 32 hir-stats FieldDef 128 ( 1.4%) 2 64 hir-stats GenericArgs 144 ( 1.6%) 3 48 hir-stats Variant 144 ( 1.6%) 2 72 @@ -151,11 +151,11 @@ hir-stats - Struct 72 ( 0.8%) 1 hir-stats - Wild 72 ( 0.8%) 1 hir-stats - Binding 216 ( 2.4%) 3 hir-stats GenericParam 400 ( 4.5%) 5 80 -hir-stats Generics 560 ( 6.2%) 10 56 +hir-stats Generics 560 ( 6.3%) 10 56 hir-stats Ty 720 ( 8.0%) 15 48 hir-stats - Ptr 48 ( 0.5%) 1 hir-stats - Ref 48 ( 0.5%) 1 -hir-stats - Path 624 ( 6.9%) 13 +hir-stats - Path 624 ( 7.0%) 13 hir-stats Expr 768 ( 8.6%) 12 64 hir-stats - InlineAsm 64 ( 0.7%) 1 hir-stats - Match 64 ( 0.7%) 1 @@ -171,8 +171,8 @@ hir-stats - Impl 88 ( 1.0%) 1 hir-stats - Trait 88 ( 1.0%) 1 hir-stats - Fn 176 ( 2.0%) 2 hir-stats - Use 352 ( 3.9%) 4 -hir-stats Path 1_240 (13.8%) 31 40 -hir-stats PathSegment 1_920 (21.4%) 40 48 +hir-stats Path 1_240 (13.9%) 31 40 +hir-stats PathSegment 1_920 (21.5%) 40 48 hir-stats ---------------------------------------------------------------- -hir-stats Total 8_980 180 +hir-stats Total 8_948 179 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 b541cbeb2279a..b8e66526235e5 100644 --- a/tests/ui/type-alias-impl-trait/issue-60662.stdout +++ b/tests/ui/type-alias-impl-trait/issue-60662.stdout @@ -4,7 +4,6 @@ #![feature(type_alias_impl_trait)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; trait Animal { } diff --git a/tests/ui/unpretty/bad-literal.stdout b/tests/ui/unpretty/bad-literal.stdout index c5272711d6e93..34f8aeab2a8fb 100644 --- a/tests/ui/unpretty/bad-literal.stdout +++ b/tests/ui/unpretty/bad-literal.stdout @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-fail diff --git a/tests/ui/unpretty/debug-fmt-hir.stdout b/tests/ui/unpretty/debug-fmt-hir.stdout index 2c9c96de9d142..5873b0ef7be30 100644 --- a/tests/ui/unpretty/debug-fmt-hir.stdout +++ b/tests/ui/unpretty/debug-fmt-hir.stdout @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/deprecated-attr.stdout b/tests/ui/unpretty/deprecated-attr.stdout index 42de7b4533e51..770ae5dd16a06 100644 --- a/tests/ui/unpretty/deprecated-attr.stdout +++ b/tests/ui/unpretty/deprecated-attr.stdout @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/diagnostic-attr.stdout b/tests/ui/unpretty/diagnostic-attr.stdout index e8696d04d38ab..e28238d8b0d6c 100644 --- a/tests/ui/unpretty/diagnostic-attr.stdout +++ b/tests/ui/unpretty/diagnostic-attr.stdout @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/expanded-exhaustive.stdout b/tests/ui/unpretty/expanded-exhaustive.stdout index 19ae66f7a07aa..7a87452d4113c 100644 --- a/tests/ui/unpretty/expanded-exhaustive.stdout +++ b/tests/ui/unpretty/expanded-exhaustive.stdout @@ -28,7 +28,6 @@ #![allow(incomplete_features)] #[prelude_import] use std::prelude::rust_2024::*; -#[macro_use] extern crate std; #[prelude_import] diff --git a/tests/ui/unpretty/expanded-interpolation.stdout b/tests/ui/unpretty/expanded-interpolation.stdout index 556e57dbd9210..0ccad0de3fd4e 100644 --- a/tests/ui/unpretty/expanded-interpolation.stdout +++ b/tests/ui/unpretty/expanded-interpolation.stdout @@ -13,7 +13,6 @@ #![feature(if_let_guard)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; macro_rules! expr { ($expr:expr) => { $expr }; } diff --git a/tests/ui/unpretty/flattened-format-args.stdout b/tests/ui/unpretty/flattened-format-args.stdout index 2de1cdd96b5b7..b08bf4eb6ec76 100644 --- a/tests/ui/unpretty/flattened-format-args.stdout +++ b/tests/ui/unpretty/flattened-format-args.stdout @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ compile-flags: -Zunpretty=hir -Zflatten-format-args=yes //@ check-pass diff --git a/tests/ui/unpretty/let-else-hir.stdout b/tests/ui/unpretty/let-else-hir.stdout index a2ffa5de5673c..0f664281dcdb5 100644 --- a/tests/ui/unpretty/let-else-hir.stdout +++ b/tests/ui/unpretty/let-else-hir.stdout @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/self-hir.stdout b/tests/ui/unpretty/self-hir.stdout index 4da080dc611e8..2b589d9b78192 100644 --- a/tests/ui/unpretty/self-hir.stdout +++ b/tests/ui/unpretty/self-hir.stdout @@ -1,6 +1,5 @@ #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; //@ compile-flags: -Zunpretty=hir //@ check-pass diff --git a/tests/ui/unpretty/unpretty-expr-fn-arg.stdout b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout index 43aa93c83bd31..2176b2130c019 100644 --- a/tests/ui/unpretty/unpretty-expr-fn-arg.stdout +++ b/tests/ui/unpretty/unpretty-expr-fn-arg.stdout @@ -9,7 +9,6 @@ #![allow(dead_code)] #[prelude_import] use ::std::prelude::rust_2015::*; -#[macro_use] extern crate std; fn main() ({ } as ())