Auto merge of #131662 - matthiaskrgr:rollup-r1wkfxw, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #130356 (don't warn about a missing change-id in CI)
 - #130900 (Do not output () on empty description)
 - #131066 (Add the Chinese translation entry to the RustByExample build process)
 - #131067 (Fix std_detect links)
 - #131644 (Clean up some Miri things in `sys/windows`)
 - #131646 (sys/unix: add comments for some Miri fallbacks)
 - #131653 (Remove const trait bound modifier hack)
 - #131659 (enable `download_ci_llvm` test)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-10-13 22:38:44 +00:00
commit 5ceb623a4a
10 changed files with 39 additions and 29 deletions

View File

@ -1327,14 +1327,8 @@ fn lower_ty_direct(&mut self, t: &Ty, itctx: ImplTraitContext) -> hir::Ty<'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) => {

View File

@ -899,7 +899,7 @@ pub fn file_name(&self) -> OsString {
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) })?;

View File

@ -175,9 +175,9 @@ pub fn WaitOnAddress(
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,

View File

@ -198,11 +198,10 @@ pub unsafe fn call($($argname: $argtype),*) -> $rettype {
/// 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)?;
)+) => (
@ -221,9 +220,6 @@ pub mod $symbol {
#[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) })
}
}

View File

@ -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();

View File

@ -23,6 +23,7 @@
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")] {

View File

@ -14,6 +14,7 @@
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<_>>();
@ -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.

View File

@ -82,7 +82,7 @@ fn run(self, builder: &Builder<'_>) {
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", &[];
);
@ -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 {

View File

@ -10,6 +10,7 @@
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 {
@ -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 {

View File

@ -1575,10 +1575,12 @@ fn rust_package_vers(&self) -> String {
fn rust_version(&self) -> String {
let mut version = self.rust_info().version(self, &self.version);
if let Some(ref s) = self.config.description {
if !s.is_empty() {
version.push_str(" (");
version.push_str(s);
version.push(')');
}
}
version
}