Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 4 pull requests #95999

Merged
merged 9 commits into from
Apr 13, 2022
2 changes: 1 addition & 1 deletion library/core/src/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ macro_rules! impl_helper_for {
}
impl_helper_for! { i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize }

/// Determins if a string of text of that length of that radix could be guaranteed to be
/// Determines if a string of text of that length of that radix could be guaranteed to be
/// stored in the given type T.
/// Note that if the radix is known to the compiler, it is just the check of digits.len that
/// is done at runtime.
Expand Down
12 changes: 11 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 3 additions & 1 deletion src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 1 addition & 8 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/instrument-coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/>

Expand Down
15 changes: 15 additions & 0 deletions src/test/ui/box/issue-82446.rs
Original file line number Diff line number Diff line change
@@ -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() {}
12 changes: 12 additions & 0 deletions src/test/ui/box/issue-82446.stderr
Original file line number Diff line number Diff line change
@@ -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`.