summary refs log tree commit diff
path: root/tests/ui/macros
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-07-28 17:24:28 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2025-07-28 17:35:09 +0300
commitc56f49dc34f43568122f057d72f3472b3fcd4d8e (patch)
tree125c222938820b987e90ae0355df514d50a44a6b /tests/ui/macros
parent65b6cdb6a6d33987b9d642a4882283c71fbe3957 (diff)
downloadrust-c56f49dc34f43568122f057d72f3472b3fcd4d8e.tar.gz
rust-c56f49dc34f43568122f057d72f3472b3fcd4d8e.zip
expand: Micro-optimize prelude injection
Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.

Diffstat (limited to 'tests/ui/macros')
-rw-r--r--tests/ui/macros/genercs-in-path-with-prettry-hir.stdout4
-rw-r--r--tests/ui/macros/rfc-2011-nicer-assert-messages/non-consuming-methods-have-optimized-codegen.stdout4
2 files changed, 4 insertions, 4 deletions
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 6b0300132b5..ba93384644d 100644
--- a/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout
+++ b/tests/ui/macros/genercs-in-path-with-prettry-hir.stdout
@@ -1,7 +1,7 @@
-#[prelude_import]
-use ::std::prelude::rust_2015::*;
 #[attr = MacroUse {arguments: UseAll}]
 extern crate std;
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
 //@ compile-flags: -Zunpretty=hir
 //@ edition: 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 33193c78334..e29655faabe 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,10 +5,10 @@
 //@ edition: 2015
 
 #![feature(core_intrinsics, generic_assert)]
-#[prelude_import]
-use ::std::prelude::rust_2015::*;
 #[macro_use]
 extern crate std;
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
 
 fn arbitrary_consuming_method_for_demonstration_purposes() {
     let elem = 1i32;