Skip to content

Commit 5ceb623

Browse files
committed
Auto merge of rust-lang#131662 - matthiaskrgr:rollup-r1wkfxw, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#130356 (don't warn about a missing change-id in CI) - rust-lang#130900 (Do not output () on empty description) - rust-lang#131066 (Add the Chinese translation entry to the RustByExample build process) - rust-lang#131067 (Fix std_detect links) - rust-lang#131644 (Clean up some Miri things in `sys/windows`) - rust-lang#131646 (sys/unix: add comments for some Miri fallbacks) - rust-lang#131653 (Remove const trait bound modifier hack) - rust-lang#131659 (enable `download_ci_llvm` test) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 27861c4 + 0e00a70 commit 5ceb623

File tree

10 files changed

+39
-29
lines changed

10 files changed

+39
-29
lines changed

compiler/rustc_ast_lowering/src/lib.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -1327,14 +1327,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
13271327
// takes care of rejecting invalid modifier combinations and
13281328
// const trait bounds in trait object types.
13291329
GenericBound::Trait(ty, modifiers) => {
1330-
// Still, don't pass along the constness here; we don't want to
1331-
// synthesize any host effect args, it'd only cause problems.
1332-
let modifiers = TraitBoundModifiers {
1333-
constness: BoundConstness::Never,
1334-
..*modifiers
1335-
};
1336-
let trait_ref = this.lower_poly_trait_ref(ty, itctx, modifiers);
1337-
let polarity = this.lower_trait_bound_modifiers(modifiers);
1330+
let trait_ref = this.lower_poly_trait_ref(ty, itctx, *modifiers);
1331+
let polarity = this.lower_trait_bound_modifiers(*modifiers);
13381332
Some((trait_ref, polarity))
13391333
}
13401334
GenericBound::Outlives(lifetime) => {

library/std/src/sys/pal/unix/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ impl DirEntry {
899899
target_os = "android",
900900
target_os = "hurd"
901901
),
902-
not(miri)
902+
not(miri) // no dirfd on Miri
903903
))]
904904
pub fn metadata(&self) -> io::Result<FileAttr> {
905905
let fd = cvt(unsafe { dirfd(self.dir.dirp.0) })?;

library/std/src/sys/pal/windows/c.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ extern "system" {
175175
pub fn WakeByAddressAll(address: *const c_void);
176176
}
177177

178+
// These are loaded by `load_synch_functions`.
178179
#[cfg(target_vendor = "win7")]
179180
compat_fn_optional! {
180-
crate::sys::compat::load_synch_functions();
181181
pub fn WaitOnAddress(
182182
address: *const c_void,
183183
compareaddress: *const c_void,

library/std/src/sys/pal/windows/compat.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,10 @@ macro_rules! compat_fn_with_fallback {
198198

199199
/// Optionally loaded functions.
200200
///
201-
/// Actual loading of the function defers to $load_functions.
201+
/// Relies on the functions being pre-loaded elsewhere.
202202
#[cfg(target_vendor = "win7")]
203203
macro_rules! compat_fn_optional {
204-
($load_functions:expr;
205-
$(
204+
($(
206205
$(#[$meta:meta])*
207206
$vis:vis fn $symbol:ident($($argname:ident: $argtype:ty),*) $(-> $rettype:ty)?;
208207
)+) => (
@@ -221,9 +220,6 @@ macro_rules! compat_fn_optional {
221220

222221
#[inline(always)]
223222
pub fn option() -> Option<F> {
224-
// Miri does not understand the way we do preloading
225-
// therefore load the function here instead.
226-
#[cfg(miri)] $load_functions;
227223
NonNull::new(PTR.load(Ordering::Relaxed)).map(|f| unsafe { mem::transmute(f) })
228224
}
229225
}

library/std/src/sys/pal/windows/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ pub fn abort_internal() -> ! {
346346
}
347347
}
348348

349-
// miri is sensitive to changes here so check that miri is happy if touching this
350349
#[cfg(miri)]
351350
pub fn abort_internal() -> ! {
352351
crate::intrinsics::abort();

library/std/src/sys/sync/thread_parking/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ cfg_if::cfg_if! {
2323
mod windows7;
2424
pub use windows7::Parker;
2525
} else if #[cfg(all(target_vendor = "apple", not(miri)))] {
26+
// Doesn't work in Miri, see <https://github.com/rust-lang/miri/issues/2589>.
2627
mod darwin;
2728
pub use darwin::Parker;
2829
} else if #[cfg(target_os = "xous")] {

src/bootstrap/src/bin/main.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use bootstrap::{
1414
Build, CONFIG_CHANGE_HISTORY, Config, Flags, Subcommand, find_recent_config_change_ids,
1515
human_readable_changes, t,
1616
};
17+
use build_helper::ci::CiEnv;
1718

1819
fn main() {
1920
let args = env::args().skip(1).collect::<Vec<_>>();
@@ -54,9 +55,12 @@ fn main() {
5455
};
5556
}
5657

57-
// check_version warnings are not printed during setup
58-
let changelog_suggestion =
59-
if matches!(config.cmd, Subcommand::Setup { .. }) { None } else { check_version(&config) };
58+
// check_version warnings are not printed during setup, or during CI
59+
let changelog_suggestion = if matches!(config.cmd, Subcommand::Setup { .. }) || CiEnv::is_ci() {
60+
None
61+
} else {
62+
check_version(&config)
63+
};
6064

6165
// NOTE: Since `./configure` generates a `config.toml`, distro maintainers will see the
6266
// changelog warning, not the `x.py setup` message.

src/bootstrap/src/core/build_steps/doc.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ book!(
8282
EditionGuide, "src/doc/edition-guide", "edition-guide", &[], submodule;
8383
EmbeddedBook, "src/doc/embedded-book", "embedded-book", &[], submodule;
8484
Nomicon, "src/doc/nomicon", "nomicon", &[], submodule;
85-
RustByExample, "src/doc/rust-by-example", "rust-by-example", &["ja"], submodule;
85+
RustByExample, "src/doc/rust-by-example", "rust-by-example", &["ja", "zh"], submodule;
8686
RustdocBook, "src/doc/rustdoc", "rustdoc", &[];
8787
StyleGuide, "src/doc/style-guide", "style-guide", &[];
8888
);
@@ -718,6 +718,10 @@ fn doc_std(
718718
.arg("--target-dir")
719719
.arg(&*target_dir.to_string_lossy())
720720
.arg("-Zskip-rustdoc-fingerprint")
721+
.arg("-Zrustdoc-map")
722+
.rustdocflag("--extern-html-root-url")
723+
.rustdocflag("std_detect=https://docs.rs/std_detect/latest/")
724+
.rustdocflag("--extern-html-root-takes-precedence")
721725
.rustdocflag("--resource-suffix")
722726
.rustdocflag(&builder.version);
723727
for arg in extra_args {

src/bootstrap/src/core/config/tests.rs

+15-5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use serde::Deserialize;
1010
use super::flags::Flags;
1111
use super::{ChangeIdWrapper, Config};
1212
use crate::core::build_steps::clippy::get_clippy_rules_in_order;
13+
use crate::core::build_steps::llvm;
1314
use crate::core::config::{LldMode, Target, TargetSelection, TomlConfig};
1415

1516
pub(crate) fn parse(config: &str) -> Config {
@@ -19,13 +20,22 @@ pub(crate) fn parse(config: &str) -> Config {
1920
)
2021
}
2122

22-
// FIXME: Resume this test after establishing a stabilized change tracking logic.
23-
#[ignore]
2423
#[test]
2524
fn download_ci_llvm() {
26-
assert!(parse("").llvm_from_ci);
27-
assert!(parse("llvm.download-ci-llvm = true").llvm_from_ci);
28-
assert!(!parse("llvm.download-ci-llvm = false").llvm_from_ci);
25+
let config = parse("");
26+
let is_available = llvm::is_ci_llvm_available(&config, config.llvm_assertions);
27+
if is_available {
28+
assert!(config.llvm_from_ci);
29+
}
30+
31+
let config = parse("llvm.download-ci-llvm = true");
32+
let is_available = llvm::is_ci_llvm_available(&config, config.llvm_assertions);
33+
if is_available {
34+
assert!(config.llvm_from_ci);
35+
}
36+
37+
let config = parse("llvm.download-ci-llvm = false");
38+
assert!(!config.llvm_from_ci);
2939

3040
let if_unchanged_config = parse("llvm.download-ci-llvm = \"if-unchanged\"");
3141
if if_unchanged_config.llvm_from_ci {

src/bootstrap/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1575,9 +1575,11 @@ Executed at: {executed_at}"#,
15751575
fn rust_version(&self) -> String {
15761576
let mut version = self.rust_info().version(self, &self.version);
15771577
if let Some(ref s) = self.config.description {
1578-
version.push_str(" (");
1579-
version.push_str(s);
1580-
version.push(')');
1578+
if !s.is_empty() {
1579+
version.push_str(" (");
1580+
version.push_str(s);
1581+
version.push(')');
1582+
}
15811583
}
15821584
version
15831585
}

0 commit comments

Comments
 (0)