Skip to content

Commit

Permalink
./x miri: fix sysroot build
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Dec 3, 2024
1 parent 3a9bc76 commit 7ac7b4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ use crate::ops::Index;
/// As explained above, `HashMap` is randomly seeded: each `HashMap` instance uses a different seed,
/// which means that `HashMap::new` cannot be used in const context. To construct a `HashMap` in the
/// initializer of a `const` or `static` item, you will have to use a different hasher that does not
/// involve a random seed, as demonstrated in the following example. **`HashMap` constructed this
/// way are not resistant against HashDoS!**
/// involve a random seed, as demonstrated in the following example. **A `HashMap` constructed this
/// way is not resistant against HashDoS!**
///
/// ```rust
/// use std::collections::HashMap;
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ use crate::ops::{BitAnd, BitOr, BitXor, Sub};
/// Like `HashMap`, `HashSet` is randomly seeded: each `HashSet` instance uses a different seed,
/// which means that `HashSet::new` cannot be used in const context. To construct a `HashSet` in the
/// initializer of a `const` or `static` item, you will have to use a different hasher that does not
/// involve a random seed, as demonstrated in the following example. **`HashSet` constructed this
/// way are not resistant against HashDoS!**
/// involve a random seed, as demonstrated in the following example. **A `HashSet` constructed this
/// way is not resistant against HashDoS!**
///
/// ```rust
/// use std::collections::HashSet;
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2756,6 +2756,10 @@ impl Step for Crate {
// `lib.rs` file, and a `lib.miri.rs` file exists in the same folder, we build that
// instead. But crucially we only do that for the library, not the test builds.
cargo.env("MIRI_REPLACE_LIBRS_IF_NOT_TEST", "1");
// std needs to be built with `-Zforce-unstable-if-unmarked`. For some reason the builder
// does not set this directly, but relies on the rustc wrapper to set it, and we are not using
// the wrapper -- hence we have to set it ourselves.
cargo.rustflag("-Zforce-unstable-if-unmarked");
cargo
} else {
// Also prepare a sysroot for the target.
Expand Down

0 comments on commit 7ac7b4c

Please sign in to comment.