Skip to content

Commit d0126e8

Browse files
committed
Auto merge of #67080 - JohnTitor:rollup-2t6fm3u, r=JohnTitor
Rollup of 10 pull requests Successful merges: - #66649 (VxWorks: fix issues in accessing environment variables) - #66764 (Tweak wording of `collect()` on bad target type) - #66900 (Clean up error codes) - #66974 ([CI] fix the `! isCI` check in src/ci/run.sh) - #66979 (Add long error for E0631 and update ui tests.) - #67017 (cleanup long error explanations) - #67021 (Fix docs for formatting delegations) - #67041 (add ExitStatusExt into prelude) - #67065 (Fix fetching arguments on the wasm32-wasi target) - #67066 (Update the revision of wasi-libc used in wasm32-wasi) Failed merges: r? @ghost
2 parents 7b482cd + acd2b08 commit d0126e8

37 files changed

+148
-59
lines changed

src/ci/docker/dist-various-2/build-wasi-toolchain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export PATH=`pwd`/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04/bin:$PATH
1212
git clone https://github.com/CraneStation/wasi-libc
1313

1414
cd wasi-libc
15-
git reset --hard a94d2d04e7722b323573da2bd04e909a5763d35b
15+
git reset --hard f645f498dfbbbc00a7a97874d33082d3605c3f21
1616
make -j$(nproc) INSTALL_DIR=/wasm32-wasi install
1717

1818
cd ..

src/ci/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fi
2323
ci_dir=`cd $(dirname $0) && pwd`
2424
source "$ci_dir/shared.sh"
2525

26-
if [ ! isCI ] || isCiBranch auto || isCiBranch beta; then
26+
if ! isCI || isCiBranch auto || isCiBranch beta; then
2727
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
2828
fi
2929

src/libcore/fmt/mod.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ pub trait Display {
662662
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
663663
/// let val = self.0;
664664
///
665-
/// write!(f, "{:o}", val) // delegate to i32's implementation
665+
/// fmt::Octal::fmt(&val, f) // delegate to i32's implementation
666666
/// }
667667
/// }
668668
///
@@ -712,7 +712,7 @@ pub trait Octal {
712712
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
713713
/// let val = self.0;
714714
///
715-
/// write!(f, "{:b}", val) // delegate to i32's implementation
715+
/// fmt::Binary::fmt(&val, f) // delegate to i32's implementation
716716
/// }
717717
/// }
718718
///
@@ -771,7 +771,7 @@ pub trait Binary {
771771
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
772772
/// let val = self.0;
773773
///
774-
/// write!(f, "{:x}", val) // delegate to i32's implementation
774+
/// fmt::LowerHex::fmt(&val, f) // delegate to i32's implementation
775775
/// }
776776
/// }
777777
///
@@ -824,7 +824,7 @@ pub trait LowerHex {
824824
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
825825
/// let val = self.0;
826826
///
827-
/// write!(f, "{:X}", val) // delegate to i32's implementation
827+
/// fmt::UpperHex::fmt(&val, f) // delegate to i32's implementation
828828
/// }
829829
/// }
830830
///
@@ -869,7 +869,8 @@ pub trait UpperHex {
869869
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
870870
/// // use `as` to convert to a `*const T`, which implements Pointer, which we can use
871871
///
872-
/// write!(f, "{:p}", self as *const Length)
872+
/// let ptr = self as *const Self;
873+
/// fmt::Pointer::fmt(&ptr, f)
873874
/// }
874875
/// }
875876
///

src/libcore/iter/traits/collect.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@
9191
/// ```
9292
#[stable(feature = "rust1", since = "1.0.0")]
9393
#[rustc_on_unimplemented(
94-
message="a collection of type `{Self}` cannot be built from an iterator \
94+
message="a value of type `{Self}` cannot be built from an iterator \
9595
over elements of type `{A}`",
96-
label="a collection of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`",
96+
label="value of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`",
9797
)]
9898
pub trait FromIterator<A>: Sized {
9999
/// Creates a value from an iterator.

src/librustc_error_codes/error_codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ E0622: include_str!("./error_codes/E0622.md"),
347347
E0623: include_str!("./error_codes/E0623.md"),
348348
E0624: include_str!("./error_codes/E0624.md"),
349349
E0626: include_str!("./error_codes/E0626.md"),
350+
E0631: include_str!("./error_codes/E0631.md"),
350351
E0633: include_str!("./error_codes/E0633.md"),
351352
E0635: include_str!("./error_codes/E0635.md"),
352353
E0636: include_str!("./error_codes/E0636.md"),
@@ -580,7 +581,6 @@ E0745: include_str!("./error_codes/E0745.md"),
580581
// rustc_const_unstable attribute must be paired with stable/unstable
581582
// attribute
582583
E0630,
583-
E0631, // type mismatch in closure arguments
584584
E0632, // cannot provide explicit generic arguments when `impl Trait` is
585585
// used in argument position
586586
E0634, // type has conflicting packed representaton hints

src/librustc_error_codes/error_codes/E0092.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
You tried to declare an undefined atomic operation function.
1+
An undefined atomic operation function was declared.
2+
23
Erroneous code example:
34

45
```compile_fail,E0092
@@ -11,8 +12,8 @@ extern "rust-intrinsic" {
1112
```
1213

1314
Please check you didn't make a mistake in the function's name. All intrinsic
14-
functions are defined in librustc_codegen_llvm/intrinsic.rs and in
15-
libcore/intrinsics.rs in the Rust source code. Example:
15+
functions are defined in `librustc_codegen_llvm/intrinsic.rs` and in
16+
`libcore/intrinsics.rs` in the Rust source code. Example:
1617

1718
```
1819
#![feature(intrinsics)]

src/librustc_error_codes/error_codes/E0093.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
You declared an unknown intrinsic function. Erroneous code example:
1+
An unknown intrinsic function was declared.
2+
3+
Erroneous code example:
24

35
```compile_fail,E0093
46
#![feature(intrinsics)]
@@ -15,8 +17,8 @@ fn main() {
1517
```
1618

1719
Please check you didn't make a mistake in the function's name. All intrinsic
18-
functions are defined in librustc_codegen_llvm/intrinsic.rs and in
19-
libcore/intrinsics.rs in the Rust source code. Example:
20+
functions are defined in `librustc_codegen_llvm/intrinsic.rs` and in
21+
`libcore/intrinsics.rs` in the Rust source code. Example:
2022

2123
```
2224
#![feature(intrinsics)]

src/librustc_error_codes/error_codes/E0094.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
You gave an invalid number of type parameters to an intrinsic function.
1+
An invalid number of type parameters was given to an intrinsic function.
2+
23
Erroneous code example:
34

45
```compile_fail,E0094

src/librustc_error_codes/error_codes/E0106.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ This error indicates that a lifetime is missing from a type. If it is an error
22
inside a function signature, the problem may be with failing to adhere to the
33
lifetime elision rules (see below).
44

5-
Here are some simple examples of where you'll run into this error:
5+
Erroneous code examples:
66

77
```compile_fail,E0106
88
struct Foo1 { x: &bool }
@@ -27,7 +27,7 @@ function signatures which allows you to leave out lifetimes in certain cases.
2727
For more background on lifetime elision see [the book][book-le].
2828

2929
The lifetime elision rules require that any function signature with an elided
30-
output lifetime must either have
30+
output lifetime must either have:
3131

3232
- exactly one input lifetime
3333
- or, multiple input lifetimes, but the function must also be a method with a
Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
This error means that an incorrect number of generic arguments were provided:
1+
An incorrect number of generic arguments were provided.
2+
3+
Erroneous code example:
24

35
```compile_fail,E0107
46
struct Foo<T> { x: T }
@@ -9,19 +11,34 @@ struct Baz<S, T> { x: Foo<S, T> } // error: wrong number of type arguments:
911
// expected 1, found 2
1012
1113
fn foo<T, U>(x: T, y: U) {}
14+
fn f() {}
1215
1316
fn main() {
1417
let x: bool = true;
1518
foo::<bool>(x); // error: wrong number of type arguments:
1619
// expected 2, found 1
1720
foo::<bool, i32, i32>(x, 2, 4); // error: wrong number of type arguments:
1821
// expected 2, found 3
22+
f::<'static>(); // error: wrong number of lifetime arguments
23+
// expected 0, found 1
1924
}
25+
```
26+
27+
When using/declaring an item with generic arguments, you must provide the exact
28+
same number:
29+
30+
```
31+
struct Foo<T> { x: T }
32+
33+
struct Bar<T> { x: Foo<T> } // ok!
34+
struct Baz<S, T> { x: Foo<S>, y: Foo<T> } // ok!
2035
36+
fn foo<T, U>(x: T, y: U) {}
2137
fn f() {}
2238
2339
fn main() {
24-
f::<'static>(); // error: wrong number of lifetime arguments:
25-
// expected 0, found 1
40+
let x: bool = true;
41+
foo::<bool, u32>(x, 12); // ok!
42+
f(); // ok!
2643
}
2744
```

0 commit comments

Comments
 (0)