diff options
| author | bors <bors@rust-lang.org> | 2023-07-13 06:45:56 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-07-13 06:45:56 +0000 |
| commit | ad9b7b56a4888badde7c1516d7e8a2b3fb994fe4 (patch) | |
| tree | 372def94b2dccd8426c23773bfa4541c73dc2026 /src | |
| parent | 5085fe3bd2c4d45cfdffb572c5ac21c653a67192 (diff) | |
| parent | 461baf24f662232f33c307b8109dc17b09a11719 (diff) | |
| download | rust-ad9b7b56a4888badde7c1516d7e8a2b3fb994fe4.tar.gz rust-ad9b7b56a4888badde7c1516d7e8a2b3fb994fe4.zip | |
Auto merge of #2979 - rust-lang:rustup2023-07-13, r=RalfJung
Automatic sync from rustc
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/download.rs | 2 | ||||
| -rw-r--r-- | src/bootstrap/run.rs | 11 | ||||
| -rw-r--r-- | src/bootstrap/test.rs | 36 | ||||
| -rw-r--r-- | src/tools/miri/rust-version | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/box-cell-alias.stderr | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr | 11 |
11 files changed, 31 insertions, 43 deletions
diff --git a/src/bootstrap/download.rs b/src/bootstrap/download.rs index a081f6189d7..eb1941cd889 100644 --- a/src/bootstrap/download.rs +++ b/src/bootstrap/download.rs @@ -188,7 +188,7 @@ impl Config { patchelf.args(&["--set-interpreter", dynamic_linker.trim_end()]); } - self.try_run(patchelf.arg(fname)).unwrap(); + let _ = self.try_run(patchelf.arg(fname)); } fn download_file(&self, url: &str, dest_path: &Path, help_on_error: &str) { diff --git a/src/bootstrap/run.rs b/src/bootstrap/run.rs index c97b7592737..70b91700043 100644 --- a/src/bootstrap/run.rs +++ b/src/bootstrap/run.rs @@ -27,8 +27,7 @@ impl Step for ExpandYamlAnchors { try_run( builder, &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("generate").arg(&builder.src), - ) - .unwrap(); + ); } fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -40,17 +39,17 @@ impl Step for ExpandYamlAnchors { } } -fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { +fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { if !builder.fail_fast { - if let Err(e) = builder.try_run(cmd) { + if builder.try_run(cmd).is_err() { let mut failures = builder.delayed_failures.borrow_mut(); failures.push(format!("{:?}", cmd)); - return Err(e); + return false; } } else { builder.run(cmd); } - Ok(()) + true } #[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)] diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index a34465ebffb..d7303427c3b 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -48,17 +48,17 @@ const MIR_OPT_BLESS_TARGET_MAPPING: &[(&str, &str)] = &[ // build for, so there is no entry for "aarch64-apple-darwin" here. ]; -fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> Result<(), ()> { +fn try_run(builder: &Builder<'_>, cmd: &mut Command) -> bool { if !builder.fail_fast { - if let Err(e) = builder.try_run(cmd) { + if builder.try_run(cmd).is_err() { let mut failures = builder.delayed_failures.borrow_mut(); failures.push(format!("{:?}", cmd)); - return Err(e); + return false; } } else { builder.run(cmd); } - Ok(()) + true } fn try_run_quiet(builder: &Builder<'_>, cmd: &mut Command) -> bool { @@ -187,8 +187,7 @@ You can skip linkcheck with --exclude src/tools/linkchecker" try_run( builder, builder.tool_cmd(Tool::Linkchecker).arg(builder.out.join(host.triple).join("doc")), - ) - .unwrap(); + ); } fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -241,8 +240,7 @@ impl Step for HtmlCheck { builder.default_doc(&[]); builder.ensure(crate::doc::Rustc::new(builder.top_stage, self.target, builder)); - try_run(builder, builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target))) - .unwrap(); + try_run(builder, builder.tool_cmd(Tool::HtmlChecker).arg(builder.doc_out(self.target))); } } @@ -288,8 +286,7 @@ impl Step for Cargotest { .args(builder.config.test_args()) .env("RUSTC", builder.rustc(compiler)) .env("RUSTDOC", builder.rustdoc(compiler)), - ) - .unwrap(); + ); } } @@ -855,7 +852,7 @@ impl Step for RustdocTheme { util::lld_flag_no_threads(self.compiler.host.contains("windows")), ); } - try_run(builder, &mut cmd).unwrap(); + try_run(builder, &mut cmd); } } @@ -1106,7 +1103,7 @@ help: to skip test's attempt to check tidiness, pass `--exclude src/tools/tidy` } builder.info("tidy check"); - try_run(builder, &mut cmd).unwrap(); + try_run(builder, &mut cmd); builder.ensure(ExpandYamlAnchors); @@ -1154,8 +1151,7 @@ impl Step for ExpandYamlAnchors { try_run( builder, &mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src), - ) - .unwrap(); + ); } fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -1948,7 +1944,7 @@ impl BookTest { compiler.host, ); let _time = util::timeit(&builder); - let toolstate = if try_run(builder, &mut rustbook_cmd).is_ok() { + let toolstate = if try_run(builder, &mut rustbook_cmd) { ToolState::TestPass } else { ToolState::TestFail @@ -2106,7 +2102,7 @@ fn markdown_test(builder: &Builder<'_>, compiler: Compiler, markdown: &Path) -> cmd.arg("--test-args").arg(test_args); if builder.config.verbose_tests { - try_run(builder, &mut cmd).is_ok() + try_run(builder, &mut cmd) } else { try_run_quiet(builder, &mut cmd) } @@ -2134,7 +2130,7 @@ impl Step for RustcGuide { let src = builder.src.join(relative_path); let mut rustbook_cmd = builder.tool_cmd(Tool::Rustbook); - let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)).is_ok() { + let toolstate = if try_run(builder, rustbook_cmd.arg("linkcheck").arg(&src)) { ToolState::TestPass } else { ToolState::TestFail @@ -2684,7 +2680,7 @@ impl Step for Bootstrap { .current_dir(builder.src.join("src/bootstrap/")); // NOTE: we intentionally don't pass test_args here because the args for unittest and cargo test are mutually incompatible. // Use `python -m unittest` manually if you want to pass arguments. - try_run(builder, &mut check_bootstrap).unwrap(); + try_run(builder, &mut check_bootstrap); let host = builder.config.build; let compiler = builder.compiler(0, host); @@ -2756,7 +2752,7 @@ impl Step for TierCheck { } builder.info("platform support check"); - try_run(builder, &mut cargo.into()).unwrap(); + try_run(builder, &mut cargo.into()); } } @@ -2836,7 +2832,7 @@ impl Step for RustInstaller { cmd.env("CARGO", &builder.initial_cargo); cmd.env("RUSTC", &builder.initial_rustc); cmd.env("TMP_DIR", &tmpdir); - try_run(builder, &mut cmd).unwrap(); + try_run(builder, &mut cmd); } fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { diff --git a/src/tools/miri/rust-version b/src/tools/miri/rust-version index c0c2abfb5ec..3bef3be2a53 100644 --- a/src/tools/miri/rust-version +++ b/src/tools/miri/rust-version @@ -1 +1 @@ -136dab66142115d9de16b4cfe2d8395d71a8ab6d +33a2c2487ac5d9927830ea4c1844335c6b9f77db diff --git a/src/tools/miri/tests/fail/box-cell-alias.stderr b/src/tools/miri/tests/fail/box-cell-alias.stderr index fc946d6d39b..8c68261aaf7 100644 --- a/src/tools/miri/tests/fail/box-cell-alias.stderr +++ b/src/tools/miri/tests/fail/box-cell-alias.stderr @@ -2,7 +2,7 @@ error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permis --> $DIR/box-cell-alias.rs:LL:CC | LL | unsafe { (*ptr).set(20) }; - | ^^^^^^^^^^^^^^ + | ^^^^^^ | | | trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of retag at ALLOC[0x0..0x1] diff --git a/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr b/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr index b76446d60f6..1a9d551431c 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/illegal_read7.stderr @@ -2,7 +2,7 @@ error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permis --> $DIR/illegal_read7.rs:LL:CC | LL | let _val = *x.get_mut(); - | ^^^^^^^^^^^ + | ^ | | | trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of two-phase retag at ALLOC[0x0..0x4] diff --git a/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr b/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr index da55e724fd8..ba8977c5674 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/interior_mut1.stderr @@ -2,7 +2,7 @@ error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permis --> $DIR/interior_mut1.rs:LL:CC | LL | let _val = *inner_shr.get(); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | | | trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of retag at ALLOC[0x0..0x4] diff --git a/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr b/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr index 8c8a96cbbbd..97ebe72bf29 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/interior_mut2.stderr @@ -2,7 +2,7 @@ error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permis --> $DIR/interior_mut2.rs:LL:CC | LL | let _val = *inner_shr.get(); - | ^^^^^^^^^^^^^^^ + | ^^^^^^^^^ | | | trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of retag at ALLOC[0x0..0x4] diff --git a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr index 589e1291ba7..10f97180b75 100644 --- a/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr +++ b/src/tools/miri/tests/fail/stacked_borrows/shared_rw_borrows_are_weak1.stderr @@ -2,7 +2,7 @@ error: Undefined Behavior: trying to retag from <TAG> for SharedReadWrite permis --> $DIR/shared_rw_borrows_are_weak1.rs:LL:CC | LL | y.get_mut(); - | ^^^^^^^^^^^ + | ^ | | | trying to retag from <TAG> for SharedReadWrite permission at ALLOC[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of two-phase retag at ALLOC[0x0..0x4] diff --git a/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr b/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr index 227c465b8f0..0f1e7735a0e 100644 --- a/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/fnentry_invalidation.stderr @@ -21,7 +21,7 @@ help: the accessed tag <TAG> later transitioned to Frozen due to a reborrow (act --> $DIR/fnentry_invalidation.rs:LL:CC | LL | x.do_bad(); - | ^^^^^^^^^^ + | ^ = help: this transition corresponds to a loss of write permissions = note: BACKTRACE (of the first span): = note: inside `main` at $DIR/fnentry_invalidation.rs:LL:CC diff --git a/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr b/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr index ce71468425f..3a82d028704 100644 --- a/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr +++ b/src/tools/miri/tests/fail/tree_borrows/write-during-2phase.stderr @@ -9,15 +9,8 @@ LL | fn add(&mut self, n: u64) -> u64 { help: the accessed tag <TAG> was created here, in the initial state Reserved --> $DIR/write-during-2phase.rs:LL:CC | -LL | let _res = f.add(unsafe { - | ________________^ -LL | | let n = f.0; -LL | | // This is the access at fault, but it's not immediately apparent because -LL | | // the reference that got invalidated is not under a Protector. -LL | | *inner = 42; -LL | | n -LL | | }); - | |______^ +LL | let _res = f.add(unsafe { + | ^ help: the accessed tag <TAG> later transitioned to Disabled due to a foreign write access at offsets [0x0..0x8] --> $DIR/write-during-2phase.rs:LL:CC | |
