Skip to content

Commit 0d6a806

Browse files
committed
Auto merge of #146205 - matthiaskrgr:rollup-fxt43oq, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - #145976 (Add bootstrap.toml option to control debug breaking on ICEs on windows) - #146151 (fixes auto-run js checks in tidy) - #146194 (fix path str eq) - #146197 (triagebot: fix rustc_allow_const_fn_unstable matcher) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 71289c3 + a038e28 commit 0d6a806

File tree

9 files changed

+35
-15
lines changed

9 files changed

+35
-15
lines changed

bootstrap.example.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,9 @@
856856
# as libstd features, this option can also be used to configure features such as optimize_for_size.
857857
#rust.std-features = ["panic_unwind"]
858858

859+
# Trigger a `DebugBreak` after an internal compiler error during bootstrap on Windows
860+
#rust.break-on-ice = true
861+
859862
# =============================================================================
860863
# Distribution options
861864
#

library/std/src/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,7 @@ impl PartialEq for PathBuf {
21072107
impl cmp::PartialEq<str> for PathBuf {
21082108
#[inline]
21092109
fn eq(&self, other: &str) -> bool {
2110-
&*self == other
2110+
Path::eq(self, other)
21112111
}
21122112
}
21132113

library/std/tests/path.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,3 +2526,9 @@ fn normalize_lexically() {
25262526
check_err(r"\\?\UNC\server\share\a\..\..");
25272527
}
25282528
}
2529+
2530+
#[test]
2531+
/// See issue#146183
2532+
fn compare_path_to_str() {
2533+
assert!(&PathBuf::from("x") == "x");
2534+
}

src/bootstrap/src/core/builder/cargo.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -878,8 +878,11 @@ impl Builder<'_> {
878878
.env("RUSTC_LIBDIR", libdir)
879879
.env("RUSTDOC", self.bootstrap_out.join("rustdoc"))
880880
.env("RUSTDOC_REAL", rustdoc_path)
881-
.env("RUSTC_ERROR_METADATA_DST", self.extended_error_dir())
882-
.env("RUSTC_BREAK_ON_ICE", "1");
881+
.env("RUSTC_ERROR_METADATA_DST", self.extended_error_dir());
882+
883+
if self.config.rust_break_on_ice {
884+
cargo.env("RUSTC_BREAK_ON_ICE", "1");
885+
}
883886

884887
// Set RUSTC_WRAPPER to the bootstrap shim, which switches between beta and in-tree
885888
// sysroot depending on whether we're building build scripts.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ pub struct Config {
221221
pub rust_lto: RustcLto,
222222
pub rust_validate_mir_opts: Option<u32>,
223223
pub rust_std_features: BTreeSet<String>,
224+
pub rust_break_on_ice: bool,
224225
pub llvm_profile_use: Option<String>,
225226
pub llvm_profile_generate: bool,
226227
pub llvm_libunwind_default: Option<LlvmLibunwind>,
@@ -550,6 +551,7 @@ impl Config {
550551
strip: rust_strip,
551552
lld_mode: rust_lld_mode,
552553
std_features: rust_std_features,
554+
break_on_ice: rust_break_on_ice,
553555
} = toml.rust.unwrap_or_default();
554556

555557
let Llvm {
@@ -1269,6 +1271,7 @@ impl Config {
12691271
reproducible_artifacts: flags_reproducible_artifact,
12701272
reuse: build_reuse.map(PathBuf::from),
12711273
rust_analyzer_info,
1274+
rust_break_on_ice: rust_break_on_ice.unwrap_or(true),
12721275
rust_codegen_backends: rust_codegen_backends
12731276
.map(|backends| parse_codegen_backends(backends, "rust"))
12741277
.unwrap_or(vec![CodegenBackendKind::Llvm]),

src/bootstrap/src/core/config/toml/rust.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ define_config! {
6565
lto: Option<String> = "lto",
6666
validate_mir_opts: Option<u32> = "validate-mir-opts",
6767
std_features: Option<BTreeSet<String>> = "std-features",
68+
break_on_ice: Option<bool> = "break-on-ice",
6869
}
6970
}
7071

@@ -355,6 +356,7 @@ pub fn check_incompatible_options_for_ci_rustc(
355356
download_rustc: _,
356357
validate_mir_opts: _,
357358
frame_pointers: _,
359+
break_on_ice: _,
358360
} = ci_rust_config;
359361

360362
// There are two kinds of checks for CI rustc incompatible options:

src/bootstrap/src/utils/change_tracker.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,4 +536,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
536536
severity: ChangeSeverity::Warning,
537537
summary: "It is no longer possible to `x test` with stage 0, except for running compiletest and opting into `build.compiletest-allow-stage0`.",
538538
},
539+
ChangeInfo {
540+
change_id: 145976,
541+
severity: ChangeSeverity::Info,
542+
summary: "Added a new option `rust.break-on-ice` to control if internal compiler errors cause a debug break on Windows.",
543+
},
539544
];

src/tools/tidy/src/extra_checks/mod.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -720,21 +720,19 @@ impl ExtraCheckArg {
720720
if !self.auto {
721721
return true;
722722
}
723-
let ext = match self.lang {
724-
ExtraCheckLang::Py => ".py",
725-
ExtraCheckLang::Cpp => ".cpp",
726-
ExtraCheckLang::Shell => ".sh",
727-
ExtraCheckLang::Js => ".js",
723+
let exts: &[&str] = match self.lang {
724+
ExtraCheckLang::Py => &[".py"],
725+
ExtraCheckLang::Cpp => &[".cpp"],
726+
ExtraCheckLang::Shell => &[".sh"],
727+
ExtraCheckLang::Js => &[".js", ".ts"],
728728
ExtraCheckLang::Spellcheck => {
729-
for dir in SPELLCHECK_DIRS {
730-
if Path::new(filepath).starts_with(dir) {
731-
return true;
732-
}
729+
if SPELLCHECK_DIRS.iter().any(|dir| Path::new(filepath).starts_with(dir)) {
730+
return true;
733731
}
734-
return false;
732+
&[]
735733
}
736734
};
737-
filepath.ends_with(ext)
735+
exts.iter().any(|ext| filepath.ends_with(ext))
738736
}
739737

740738
fn has_supported_kind(&self) -> bool {

triagebot.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1313,7 +1313,7 @@ message = """
13131313
and explores the possible non-determinism of the intrinsic.
13141314
"""
13151315
cc = ["@rust-lang/miri"]
1316-
[mentions."#[rustc_allow_const_fn_unstable]"]
1316+
[mentions."#[rustc_allow_const_fn_unstable"]
13171317
type = "content"
13181318
message = """
13191319
`#[rustc_allow_const_fn_unstable]` needs careful audit to avoid accidentally exposing unstable

0 commit comments

Comments
 (0)