Skip to content

Commit c9c0006

Browse files
authored
Rollup merge of rust-lang#145322 - LorrensP-2158466:early-prelude-processing, r=petrochenkov
Resolve the prelude import in `build_reduced_graph` This pr tries to resolve the prelude import at the `build_reduced_graph` stage. Part of batched import resolution in rust-lang#145108 (cherry picked commit) and maybe needed for rust-lang#139493. r? petrochenkov
2 parents 1b3a70c + 03dba69 commit c9c0006

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

core/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@
208208
#[allow(unused_extern_crates)]
209209
extern crate self as core;
210210

211+
/* The core prelude, not as all-encompassing as the std prelude */
212+
// The compiler expects the prelude definition to be defined before it's use statement.
213+
pub mod prelude;
214+
211215
#[prelude_import]
212216
#[allow(unused)]
213217
use prelude::rust_2024::*;
@@ -293,10 +297,6 @@ pub mod f64;
293297
#[macro_use]
294298
pub mod num;
295299

296-
/* The core prelude, not as all-encompassing as the std prelude */
297-
298-
pub mod prelude;
299-
300300
/* Core modules for ownership management */
301301

302302
pub mod hint;

std/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,10 @@
428428
//
429429
#![default_lib_allocator]
430430

431+
// The Rust prelude
432+
// The compiler expects the prelude definition to be defined before it's use statement.
433+
pub mod prelude;
434+
431435
// Explicitly import the prelude. The compiler uses this same unstable attribute
432436
// to import the prelude implicitly when building crates that depend on std.
433437
#[prelude_import]
@@ -483,9 +487,6 @@ mod macros;
483487
#[macro_use]
484488
pub mod rt;
485489

486-
// The Rust prelude
487-
pub mod prelude;
488-
489490
#[stable(feature = "rust1", since = "1.0.0")]
490491
pub use core::any;
491492
#[stable(feature = "core_array", since = "1.35.0")]

0 commit comments

Comments
 (0)