about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-13 05:36:26 +0000
committerbors <bors@rust-lang.org>2022-04-13 05:36:26 +0000
commitb768f248e99688a2d7649731a99b2f2ad962abf5 (patch)
tree7d1d325394278ae705321e6e2b323b2c9eab06a4 /src
parent1491e5cc148391f7679542b8e9b4e6d2430a7b69 (diff)
parent2b4c4dfcfdf2e2cc5a17e4165c81399460b3644a (diff)
downloadrust-b768f248e99688a2d7649731a99b2f2ad962abf5.tar.gz
rust-b768f248e99688a2d7649731a99b2f2ad962abf5.zip
Auto merge of #95999 - Dylan-DPC:rollup-k2r3k11, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #95441 (Always use system `python3` on MacOS)
 - #95954 (Fix broken link in coverage tools docs)
 - #95984 (Fix spelling in docs for `can_not_overflow`)
 - #95989 (diagnostics: regression test for spurrious "help: store this in the heap")

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/lib.rs12
-rw-r--r--src/bootstrap/sanity.rs4
-rw-r--r--src/bootstrap/test.rs9
-rw-r--r--src/doc/rustc/src/images/llvm-cov-show-01.png (renamed from src/doc/unstable-book/src/compiler-flags/img/llvm-cov-show-01.png)bin416748 -> 416748 bytes
-rw-r--r--src/doc/rustc/src/instrument-coverage.md2
-rw-r--r--src/test/ui/box/issue-82446.rs15
-rw-r--r--src/test/ui/box/issue-82446.stderr12
7 files changed, 43 insertions, 11 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 7b496e6c669..59102ad9f50 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -1176,7 +1176,17 @@ impl Build {
 
     /// Path to the python interpreter to use
     fn python(&self) -> &Path {
-        self.config.python.as_ref().unwrap()
+        if self.config.build.ends_with("apple-darwin") {
+            // Force /usr/bin/python3 on macOS for LLDB tests because we're loading the
+            // LLDB plugin's compiled module which only works with the system python
+            // (namely not Homebrew-installed python)
+            Path::new("/usr/bin/python3")
+        } else {
+            self.config
+                .python
+                .as_ref()
+                .expect("python is required for running LLDB or rustdoc tests")
+        }
     }
 
     /// Temporary directory that extended error information is emitted to.
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index 8c2899c1ac0..c96e6f9a367 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -103,7 +103,9 @@ pub fn check(build: &mut Build) {
         .take()
         .map(|p| cmd_finder.must_have(p))
         .or_else(|| env::var_os("BOOTSTRAP_PYTHON").map(PathBuf::from)) // set by bootstrap.py
-        .or_else(|| Some(cmd_finder.must_have("python")));
+        .or_else(|| cmd_finder.maybe_have("python"))
+        .or_else(|| cmd_finder.maybe_have("python3"))
+        .or_else(|| cmd_finder.maybe_have("python2"));
 
     build.config.nodejs = build
         .config
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index b88684791bc..f60766bde72 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -1402,14 +1402,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
 
         cmd.arg("--docck-python").arg(builder.python());
 
-        if builder.config.build.ends_with("apple-darwin") {
-            // Force /usr/bin/python3 on macOS for LLDB tests because we're loading the
-            // LLDB plugin's compiled module which only works with the system python
-            // (namely not Homebrew-installed python)
-            cmd.arg("--lldb-python").arg("/usr/bin/python3");
-        } else {
-            cmd.arg("--lldb-python").arg(builder.python());
-        }
+        cmd.arg("--lldb-python").arg(builder.python());
 
         if let Some(ref gdb) = builder.config.gdb {
             cmd.arg("--gdb").arg(gdb);
diff --git a/src/doc/unstable-book/src/compiler-flags/img/llvm-cov-show-01.png b/src/doc/rustc/src/images/llvm-cov-show-01.png
index 35f04594347..35f04594347 100644
--- a/src/doc/unstable-book/src/compiler-flags/img/llvm-cov-show-01.png
+++ b/src/doc/rustc/src/images/llvm-cov-show-01.png
Binary files differdiff --git a/src/doc/rustc/src/instrument-coverage.md b/src/doc/rustc/src/instrument-coverage.md
index b94989161cc..108b0ffe99b 100644
--- a/src/doc/rustc/src/instrument-coverage.md
+++ b/src/doc/rustc/src/instrument-coverage.md
@@ -145,7 +145,7 @@ $ llvm-cov show -Xdemangler=rustfilt target/debug/examples/formatjson5 \
     -name=add_quoted_string
 ```
 
-<img alt="Screenshot of sample `llvm-cov show` result, for function add_quoted_string" src="img/llvm-cov-show-01.png" class="center"/>
+<img alt="Screenshot of sample `llvm-cov show` result, for function add_quoted_string" src="images/llvm-cov-show-01.png" class="center"/>
 <br/>
 <br/>
 
diff --git a/src/test/ui/box/issue-82446.rs b/src/test/ui/box/issue-82446.rs
new file mode 100644
index 00000000000..2960f7fbc21
--- /dev/null
+++ b/src/test/ui/box/issue-82446.rs
@@ -0,0 +1,15 @@
+// https://github.com/rust-lang/rust/issues/82446
+// Spurious 'help: store this in the heap' regression test
+trait MyTrait {}
+
+struct Foo {
+    val: Box<dyn MyTrait>
+}
+
+fn make_it(val: &Box<dyn MyTrait>) {
+    Foo {
+        val //~ ERROR [E0308]
+    };
+}
+
+fn main() {}
diff --git a/src/test/ui/box/issue-82446.stderr b/src/test/ui/box/issue-82446.stderr
new file mode 100644
index 00000000000..0374737957e
--- /dev/null
+++ b/src/test/ui/box/issue-82446.stderr
@@ -0,0 +1,12 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-82446.rs:11:9
+   |
+LL |         val
+   |         ^^^ expected struct `Box`, found reference
+   |
+   = note: expected struct `Box<(dyn MyTrait + 'static)>`
+           found reference `&Box<(dyn MyTrait + 'static)>`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.