Skip to content

Commit 6a55f4f

Browse files
committed
Auto merge of #32787 - Manishearth:rollup, r=Manishearth
Rollup of 11 pull requests - Successful merges: #32016, #32583, #32699, #32729, #32731, #32738, #32741, #32745, #32748, #32757, #32786 - Failed merges: #32773
2 parents a9f34c8 + 903b4c2 commit 6a55f4f

File tree

189 files changed

+1307
-800
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+1307
-800
lines changed

configure

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -717,18 +717,6 @@ if [ -n "$CFG_ENABLE_DEBUG_JEMALLOC" ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; f
717717

718718
if [ -n "$CFG_ENABLE_ORBIT" ]; then putvar CFG_ENABLE_ORBIT; fi
719719

720-
# A magic value that allows the compiler to use unstable features
721-
# during the bootstrap even when doing so would normally be an error
722-
# because of feature staging or because the build turns on
723-
# warnings-as-errors and unstable features default to warnings. The
724-
# build has to match this key in an env var. Meant to be a mild
725-
# deterrent from users just turning on unstable features on the stable
726-
# channel.
727-
# Basing CFG_BOOTSTRAP_KEY on CFG_BOOTSTRAP_KEY lets it get picked up
728-
# during a Makefile reconfig.
729-
CFG_BOOTSTRAP_KEY="${CFG_BOOTSTRAP_KEY-`date +%H:%M:%S`}"
730-
putvar CFG_BOOTSTRAP_KEY
731-
732720
step_msg "looking for build programs"
733721

734722
probe_need CFG_CURLORWGET curl wget

mk/main.mk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ CFG_PRERELEASE_VERSION=.1
2424
# versions in the same place
2525
CFG_FILENAME_EXTRA=$(shell printf '%s' $(CFG_RELEASE)$(CFG_EXTRA_FILENAME) | $(CFG_HASH_COMMAND))
2626

27+
# A magic value that allows the compiler to use unstable features during the
28+
# bootstrap even when doing so would normally be an error because of feature
29+
# staging or because the build turns on warnings-as-errors and unstable features
30+
# default to warnings. The build has to match this key in an env var.
31+
#
32+
# This value is keyed off the release to ensure that all compilers for one
33+
# particular release have the same bootstrap key. Note that this is
34+
# intentionally not "secure" by any definition, this is largely just a deterrent
35+
# from users enabling unstable features on the stable compiler.
36+
CFG_BOOTSTRAP_KEY=$(CFG_FILENAME_EXTRA)
37+
2738
ifeq ($(CFG_RELEASE_CHANNEL),stable)
2839
# This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly"
2940
CFG_RELEASE=$(CFG_RELEASE_NUM)

src/bootstrap/build/check.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,18 @@ pub fn linkcheck(build: &Build, stage: u32, host: &str) {
1818
}
1919

2020
pub fn cargotest(build: &Build, stage: u32, host: &str) {
21+
2122
let ref compiler = Compiler::new(stage, host);
23+
24+
// Configure PATH to find the right rustc. NB. we have to use PATH
25+
// and not RUSTC because the Cargo test suite has tests that will
26+
// fail if rustc is not spelled `rustc`.
27+
let path = build.sysroot(compiler).join("bin");
28+
let old_path = ::std::env::var("PATH").expect("");
29+
let sep = if cfg!(windows) { ";" } else {":" };
30+
let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
31+
2232
build.run(build.tool_cmd(compiler, "cargotest")
23-
.env("RUSTC", build.compiler_path(compiler))
24-
.env("RUSTDOC", build.rustdoc(compiler))
33+
.env("PATH", newpath)
2534
.arg(&build.cargo));
2635
}

src/bootstrap/build/step.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl<'a> Step<'a> {
319319
vec![self.librustc(self.compiler(stage))]
320320
}
321321
Source::ToolCargoTest { stage } => {
322-
vec![self.libstd(self.compiler(stage))]
322+
vec![self.libtest(self.compiler(stage))]
323323
}
324324

325325
Source::DistDocs { stage } => vec![self.doc(stage)],

src/build_helper/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,16 @@ pub fn cc2ar(cc: &Path, target: &str) -> PathBuf {
4343
if target.contains("musl") || target.contains("msvc") {
4444
PathBuf::from("ar")
4545
} else {
46+
let parent = cc.parent().unwrap();
4647
let file = cc.file_name().unwrap().to_str().unwrap();
47-
cc.parent().unwrap().join(file.replace("gcc", "ar")
48-
.replace("cc", "ar")
49-
.replace("clang", "ar"))
48+
for suffix in &["gcc", "cc", "clang"] {
49+
if let Some(idx) = file.rfind(suffix) {
50+
let mut file = file[..idx].to_owned();
51+
file.push_str("ar");
52+
return parent.join(&file);
53+
}
54+
}
55+
parent.join(file)
5056
}
5157
}
5258

src/doc/book/closures.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,13 @@ assert_eq!(6, answer);
371371
This gives us these long, related errors:
372372

373373
```text
374-
error: the trait `core::marker::Sized` is not implemented for the type
375-
`core::ops::Fn(i32) -> i32` [E0277]
374+
error: the trait bound `core::ops::Fn(i32) -> i32 : core::marker::Sized` is not satisfied [E0277]
376375
fn factory() -> (Fn(i32) -> i32) {
377376
^~~~~~~~~~~~~~~~
378377
note: `core::ops::Fn(i32) -> i32` does not have a constant size known at compile-time
379378
fn factory() -> (Fn(i32) -> i32) {
380379
^~~~~~~~~~~~~~~~
381-
error: the trait `core::marker::Sized` is not implemented for the type `core::ops::Fn(i32) -> i32` [E0277]
380+
error: the trait bound `core::ops::Fn(i32) -> i32 : core::marker::Sized` is not satisfied [E0277]
382381
let f = factory();
383382
^
384383
note: `core::ops::Fn(i32) -> i32` does not have a constant size known at compile-time

src/doc/book/concurrency.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ fn main() {
234234
This won't work, however, and will give us the error:
235235

236236
```text
237-
13:9: 13:22 error: the trait `core::marker::Send` is not
238-
implemented for the type `alloc::rc::Rc<collections::vec::Vec<i32>>`
237+
13:9: 13:22 error: the trait bound `alloc::rc::Rc<collections::vec::Vec<i32>> : core::marker::Send`
238+
is not satisfied
239239
...
240240
13:9: 13:22 note: `alloc::rc::Rc<collections::vec::Vec<i32>>`
241241
cannot be sent between threads safely

src/doc/book/traits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ print_area(5);
154154
We get a compile-time error:
155155

156156
```text
157-
error: the trait `HasArea` is not implemented for the type `_` [E0277]
157+
error: the trait bound `_ : HasArea` is not satisfied [E0277]
158158
```
159159

160160
## Trait bounds on generic structs
@@ -496,7 +496,7 @@ impl FooBar for Baz {
496496
If we forget to implement `Foo`, Rust will tell us:
497497

498498
```text
499-
error: the trait `main::Foo` is not implemented for the type `main::Baz` [E0277]
499+
error: the trait bound `main::Baz : main::Foo` is not satisfied [E0277]
500500
```
501501

502502
# Deriving

src/doc/book/vectors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ v[j];
5656
Indexing with a non-`usize` type gives an error that looks like this:
5757

5858
```text
59-
error: the trait `core::ops::Index<i32>` is not implemented for the type
60-
`collections::vec::Vec<_>` [E0277]
59+
error: the trait bound `collections::vec::Vec<_> : core::ops::Index<i32>`
60+
is not satisfied [E0277]
6161
v[j];
6262
^~~~
6363
note: the type `collections::vec::Vec<_>` cannot be indexed by `i32`

src/doc/nomicon/coercions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn main() {
6464
```
6565

6666
```text
67-
<anon>:10:5: 10:8 error: the trait `Trait` is not implemented for the type `&mut i32` [E0277]
67+
<anon>:10:5: 10:8 error: the trait bound `&mut i32 : Trait` is not satisfied [E0277]
6868
<anon>:10 foo(t);
6969
^~~
7070
```

0 commit comments

Comments
 (0)