Skip to content

Commit

Permalink
Auto merge of rust-lang#131662 - matthiaskrgr:rollup-r1wkfxw, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

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
  • Loading branch information
bors committed Oct 13, 2024
2 parents 3678036 + 0e00a70 commit 47017dd
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 29 deletions.
10 changes: 2 additions & 8 deletions compiler/rustc_ast_lowering/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,14 +1327,8 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
// takes care of rejecting invalid modifier combinations and
// const trait bounds in trait object types.
GenericBound::Trait(ty, modifiers) => {
// Still, don't pass along the constness here; we don't want to
// synthesize any host effect args, it'd only cause problems.
let modifiers = TraitBoundModifiers {
constness: BoundConstness::Never,
..*modifiers
};
let trait_ref = this.lower_poly_trait_ref(ty, itctx, modifiers);
let polarity = this.lower_trait_bound_modifiers(modifiers);
let trait_ref = this.lower_poly_trait_ref(ty, itctx, *modifiers);
let polarity = this.lower_trait_bound_modifiers(*modifiers);
Some((trait_ref, polarity))
}
GenericBound::Outlives(lifetime) => {
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ impl DirEntry {
target_os = "android",
target_os = "hurd"
),
not(miri)
not(miri) // no dirfd on Miri
))]
pub fn metadata(&self) -> io::Result<FileAttr> {
let fd = cvt(unsafe { dirfd(self.dir.dirp.0) })?;
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/pal/windows/c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ extern "system" {
pub fn WakeByAddressAll(address: *const c_void);
}

// These are loaded by `load_synch_functions`.
#[cfg(target_vendor = "win7")]
compat_fn_optional! {
crate::sys::compat::load_synch_functions();
pub fn WaitOnAddress(
address: *const c_void,
compareaddress: *const c_void,
Expand Down
8 changes: 2 additions & 6 deletions library/std/src/sys/pal/windows/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,10 @@ macro_rules! compat_fn_with_fallback {

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

#[inline(always)]
pub fn option() -> Option<F> {
// Miri does not understand the way we do preloading
// therefore load the function here instead.
#[cfg(miri)] $load_functions;
NonNull::new(PTR.load(Ordering::Relaxed)).map(|f| unsafe { mem::transmute(f) })
}
}
Expand Down
1 change: 0 additions & 1 deletion library/std/src/sys/pal/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,6 @@ pub fn abort_internal() -> ! {
}
}

// miri is sensitive to changes here so check that miri is happy if touching this
#[cfg(miri)]
pub fn abort_internal() -> ! {
crate::intrinsics::abort();
Expand Down
1 change: 1 addition & 0 deletions library/std/src/sys/sync/thread_parking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cfg_if::cfg_if! {
mod windows7;
pub use windows7::Parker;
} else if #[cfg(all(target_vendor = "apple", not(miri)))] {
// Doesn't work in Miri, see <https://github.com/rust-lang/miri/issues/2589>.
mod darwin;
pub use darwin::Parker;
} else if #[cfg(target_os = "xous")] {
Expand Down
10 changes: 7 additions & 3 deletions src/bootstrap/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use bootstrap::{
Build, CONFIG_CHANGE_HISTORY, Config, Flags, Subcommand, find_recent_config_change_ids,
human_readable_changes, t,
};
use build_helper::ci::CiEnv;

fn main() {
let args = env::args().skip(1).collect::<Vec<_>>();
Expand Down Expand Up @@ -54,9 +55,12 @@ fn main() {
};
}

// check_version warnings are not printed during setup
let changelog_suggestion =
if matches!(config.cmd, Subcommand::Setup { .. }) { None } else { check_version(&config) };
// check_version warnings are not printed during setup, or during CI
let changelog_suggestion = if matches!(config.cmd, Subcommand::Setup { .. }) || CiEnv::is_ci() {
None
} else {
check_version(&config)
};

// NOTE: Since `./configure` generates a `config.toml`, distro maintainers will see the
// changelog warning, not the `x.py setup` message.
Expand Down
6 changes: 5 additions & 1 deletion src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ book!(
EditionGuide, "src/doc/edition-guide", "edition-guide", &[], submodule;
EmbeddedBook, "src/doc/embedded-book", "embedded-book", &[], submodule;
Nomicon, "src/doc/nomicon", "nomicon", &[], submodule;
RustByExample, "src/doc/rust-by-example", "rust-by-example", &["ja"], submodule;
RustByExample, "src/doc/rust-by-example", "rust-by-example", &["ja", "zh"], submodule;
RustdocBook, "src/doc/rustdoc", "rustdoc", &[];
StyleGuide, "src/doc/style-guide", "style-guide", &[];
);
Expand Down Expand Up @@ -718,6 +718,10 @@ fn doc_std(
.arg("--target-dir")
.arg(&*target_dir.to_string_lossy())
.arg("-Zskip-rustdoc-fingerprint")
.arg("-Zrustdoc-map")
.rustdocflag("--extern-html-root-url")
.rustdocflag("std_detect=https://docs.rs/std_detect/latest/")
.rustdocflag("--extern-html-root-takes-precedence")
.rustdocflag("--resource-suffix")
.rustdocflag(&builder.version);
for arg in extra_args {
Expand Down
20 changes: 15 additions & 5 deletions src/bootstrap/src/core/config/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use serde::Deserialize;
use super::flags::Flags;
use super::{ChangeIdWrapper, Config};
use crate::core::build_steps::clippy::get_clippy_rules_in_order;
use crate::core::build_steps::llvm;
use crate::core::config::{LldMode, Target, TargetSelection, TomlConfig};

pub(crate) fn parse(config: &str) -> Config {
Expand All @@ -19,13 +20,22 @@ pub(crate) fn parse(config: &str) -> Config {
)
}

// FIXME: Resume this test after establishing a stabilized change tracking logic.
#[ignore]
#[test]
fn download_ci_llvm() {
assert!(parse("").llvm_from_ci);
assert!(parse("llvm.download-ci-llvm = true").llvm_from_ci);
assert!(!parse("llvm.download-ci-llvm = false").llvm_from_ci);
let config = parse("");
let is_available = llvm::is_ci_llvm_available(&config, config.llvm_assertions);
if is_available {
assert!(config.llvm_from_ci);
}

let config = parse("llvm.download-ci-llvm = true");
let is_available = llvm::is_ci_llvm_available(&config, config.llvm_assertions);
if is_available {
assert!(config.llvm_from_ci);
}

let config = parse("llvm.download-ci-llvm = false");
assert!(!config.llvm_from_ci);

let if_unchanged_config = parse("llvm.download-ci-llvm = \"if-unchanged\"");
if if_unchanged_config.llvm_from_ci {
Expand Down
8 changes: 5 additions & 3 deletions src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1575,9 +1575,11 @@ Executed at: {executed_at}"#,
fn rust_version(&self) -> String {
let mut version = self.rust_info().version(self, &self.version);
if let Some(ref s) = self.config.description {
version.push_str(" (");
version.push_str(s);
version.push(')');
if !s.is_empty() {
version.push_str(" (");
version.push_str(s);
version.push(')');
}
}
version
}
Expand Down

0 comments on commit 47017dd

Please sign in to comment.