Skip to content

Rollup of 10 pull requests #67080

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

Merged
merged 28 commits into from
Dec 6, 2019
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e20f630
pass the captured environment variables to rtpSpawn
BaoshanPang Nov 4, 2019
de362b4
ensure that access to the environment is synchronized
BaoshanPang Nov 20, 2019
481b18a
Small error codes explanation cleanup (E0092, E0093 and E0094)
GuillaumeGomez Nov 30, 2019
b1ececa
[CI] fix the `! isCI` check in src/ci/run.sh
cuviper Dec 2, 2019
7693bb9
Add long error for E0631 and update ui tests.
reese Dec 3, 2019
26a1ba8
Use simpler code example for E0631 long error.
reese Dec 3, 2019
3091b82
Tweak wording of `collect()` on bad target type
estebank Nov 26, 2019
79849ee
add ExitStatusExt into prelude
BaoshanPang Dec 3, 2019
911b7d6
Update missed test.
reese Dec 3, 2019
c911bb1
clean up E0107 error explanation
GuillaumeGomez Nov 30, 2019
c2ce7dd
Clean up E0116 error code long explanation
GuillaumeGomez Dec 4, 2019
1e5450d
Clean up E0117 error code long explanation
GuillaumeGomez Dec 4, 2019
9eaea4d
Clean up E0118 error code long explanation
GuillaumeGomez Dec 4, 2019
ae753a5
some error codes long explanation
GuillaumeGomez Dec 4, 2019
8be7223
Fix docs for formatting delegations
elichai Dec 4, 2019
28b37a2
Merge pull request #46 from Wind-River/master_base_V7LIBC-1069
n-salim Dec 5, 2019
f7789ad
Fix fetching arguments on the wasm32-wasi target
alexcrichton Dec 5, 2019
db7b0f8
Update the revision of wasi-libc used in wasm32-wasi
alexcrichton Dec 5, 2019
617b07e
Rollup merge of #66649 - Wind-River:master_xyz, r=alexcrichton
JohnTitor Dec 6, 2019
3d2cb55
Rollup merge of #66764 - estebank:reword-bad-collect, r=alexcrichton
JohnTitor Dec 6, 2019
c31773c
Rollup merge of #66900 - GuillaumeGomez:clean-up-err-codes, r=Dylan-DPC
JohnTitor Dec 6, 2019
3b878aa
Rollup merge of #66974 - cuviper:not-isCI, r=alexcrichton
JohnTitor Dec 6, 2019
6c0165f
Rollup merge of #66979 - reese:E0631-long-error, r=GuillaumeGomez
JohnTitor Dec 6, 2019
662a225
Rollup merge of #67017 - GuillaumeGomez:long-err-explanations-2, r=Dy…
JohnTitor Dec 6, 2019
f7c2631
Rollup merge of #67021 - elichai:2019-12-fmt, r=QuietMisdreavus
JohnTitor Dec 6, 2019
1bb868c
Rollup merge of #67041 - Wind-River:master_base, r=alexcrichton
JohnTitor Dec 6, 2019
f77b8d3
Rollup merge of #67065 - alexcrichton:update-wasi, r=sfackler
JohnTitor Dec 6, 2019
acd2b08
Rollup merge of #67066 - alexcrichton:update-wasi-libc, r=Mark-Simula…
JohnTitor Dec 6, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ci/docker/dist-various-2/build-wasi-toolchain.sh
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ export PATH=`pwd`/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-14.04/bin:$PATH
git clone https://github.com/CraneStation/wasi-libc

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

cd ..
2 changes: 1 addition & 1 deletion src/ci/run.sh
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ fi
ci_dir=`cd $(dirname $0) && pwd`
source "$ci_dir/shared.sh"

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

11 changes: 6 additions & 5 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
@@ -662,7 +662,7 @@ pub trait Display {
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// let val = self.0;
///
/// write!(f, "{:o}", val) // delegate to i32's implementation
/// fmt::Octal::fmt(&val, f) // delegate to i32's implementation
/// }
/// }
///
@@ -712,7 +712,7 @@ pub trait Octal {
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// let val = self.0;
///
/// write!(f, "{:b}", val) // delegate to i32's implementation
/// fmt::Binary::fmt(&val, f) // delegate to i32's implementation
/// }
/// }
///
@@ -771,7 +771,7 @@ pub trait Binary {
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// let val = self.0;
///
/// write!(f, "{:x}", val) // delegate to i32's implementation
/// fmt::LowerHex::fmt(&val, f) // delegate to i32's implementation
/// }
/// }
///
@@ -824,7 +824,7 @@ pub trait LowerHex {
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// let val = self.0;
///
/// write!(f, "{:X}", val) // delegate to i32's implementation
/// fmt::UpperHex::fmt(&val, f) // delegate to i32's implementation
/// }
/// }
///
@@ -869,7 +869,8 @@ pub trait UpperHex {
/// fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
/// // use `as` to convert to a `*const T`, which implements Pointer, which we can use
///
/// write!(f, "{:p}", self as *const Length)
/// let ptr = self as *const Self;
/// fmt::Pointer::fmt(&ptr, f)
/// }
/// }
///
4 changes: 2 additions & 2 deletions src/libcore/iter/traits/collect.rs
Original file line number Diff line number Diff line change
@@ -91,9 +91,9 @@
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_on_unimplemented(
message="a collection of type `{Self}` cannot be built from an iterator \
message="a value of type `{Self}` cannot be built from an iterator \
over elements of type `{A}`",
label="a collection of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`",
label="value of type `{Self}` cannot be built from `std::iter::Iterator<Item={A}>`",
)]
pub trait FromIterator<A>: Sized {
/// Creates a value from an iterator.
2 changes: 1 addition & 1 deletion src/librustc_error_codes/error_codes.rs
Original file line number Diff line number Diff line change
@@ -347,6 +347,7 @@ E0622: include_str!("./error_codes/E0622.md"),
E0623: include_str!("./error_codes/E0623.md"),
E0624: include_str!("./error_codes/E0624.md"),
E0626: include_str!("./error_codes/E0626.md"),
E0631: include_str!("./error_codes/E0631.md"),
E0633: include_str!("./error_codes/E0633.md"),
E0635: include_str!("./error_codes/E0635.md"),
E0636: include_str!("./error_codes/E0636.md"),
@@ -580,7 +581,6 @@ E0745: include_str!("./error_codes/E0745.md"),
// rustc_const_unstable attribute must be paired with stable/unstable
// attribute
E0630,
E0631, // type mismatch in closure arguments
E0632, // cannot provide explicit generic arguments when `impl Trait` is
// used in argument position
E0634, // type has conflicting packed representaton hints
7 changes: 4 additions & 3 deletions src/librustc_error_codes/error_codes/E0092.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
You tried to declare an undefined atomic operation function.
An undefined atomic operation function was declared.

Erroneous code example:

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

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

```
#![feature(intrinsics)]
8 changes: 5 additions & 3 deletions src/librustc_error_codes/error_codes/E0093.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
You declared an unknown intrinsic function. Erroneous code example:
An unknown intrinsic function was declared.

Erroneous code example:

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

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

```
#![feature(intrinsics)]
3 changes: 2 additions & 1 deletion src/librustc_error_codes/error_codes/E0094.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
You gave an invalid number of type parameters to an intrinsic function.
An invalid number of type parameters was given to an intrinsic function.

Erroneous code example:

```compile_fail,E0094
4 changes: 2 additions & 2 deletions src/librustc_error_codes/error_codes/E0106.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ This error indicates that a lifetime is missing from a type. If it is an error
inside a function signature, the problem may be with failing to adhere to the
lifetime elision rules (see below).

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

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

The lifetime elision rules require that any function signature with an elided
output lifetime must either have
output lifetime must either have:

- exactly one input lifetime
- or, multiple input lifetimes, but the function must also be a method with a
23 changes: 20 additions & 3 deletions src/librustc_error_codes/error_codes/E0107.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
This error means that an incorrect number of generic arguments were provided:
An incorrect number of generic arguments were provided.

Erroneous code example:

```compile_fail,E0107
struct Foo<T> { x: T }
@@ -9,19 +11,34 @@ struct Baz<S, T> { x: Foo<S, T> } // error: wrong number of type arguments:
// expected 1, found 2

fn foo<T, U>(x: T, y: U) {}
fn f() {}

fn main() {
let x: bool = true;
foo::<bool>(x); // error: wrong number of type arguments:
// expected 2, found 1
foo::<bool, i32, i32>(x, 2, 4); // error: wrong number of type arguments:
// expected 2, found 3
f::<'static>(); // error: wrong number of lifetime arguments
// expected 0, found 1
}
```

When using/declaring an item with generic arguments, you must provide the exact
same number:

```
struct Foo<T> { x: T }

struct Bar<T> { x: Foo<T> } // ok!
struct Baz<S, T> { x: Foo<S>, y: Foo<T> } // ok!

fn foo<T, U>(x: T, y: U) {}
fn f() {}

fn main() {
f::<'static>(); // error: wrong number of lifetime arguments:
// expected 0, found 1
let x: bool = true;
foo::<bool, u32>(x, 12); // ok!
f(); // ok!
}
```
1 change: 1 addition & 0 deletions src/librustc_error_codes/error_codes/E0109.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
You tried to provide a generic argument to a type which doesn't need it.

Erroneous code example:

```compile_fail,E0109
10 changes: 7 additions & 3 deletions src/librustc_error_codes/error_codes/E0116.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
You can only define an inherent implementation for a type in the same crate
where the type was defined. For example, an `impl` block as below is not allowed
since `Vec` is defined in the standard library:
An inherent implementation was defined for a type outside the current crate.

Erroneous code example:

```compile_fail,E0116
impl Vec<u8> { } // error
```

You can only define an inherent implementation for a type in the same crate
where the type was defined. For example, an `impl` block as above is not allowed
since `Vec` is defined in the standard library.

To fix this problem, you can do either of these things:

- define a trait that has the desired associated functions/types/constants and
14 changes: 8 additions & 6 deletions src/librustc_error_codes/error_codes/E0117.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
The `Drop` trait was implemented on a non-struct type.

Erroneous code example:

```compile_fail,E0117
impl Drop for u32 {}
```

This error indicates a violation of one of Rust's orphan rules for trait
implementations. The rule prohibits any implementation of a foreign trait (a
trait defined in another crate) where
@@ -6,12 +14,6 @@ trait defined in another crate) where
- all of the parameters being passed to the trait (if there are any) are also
foreign.

Here's one example of this error:

```compile_fail,E0117
impl Drop for u32 {}
```

To avoid this kind of error, ensure that at least one local type is referenced
by the `impl`:

6 changes: 4 additions & 2 deletions src/librustc_error_codes/error_codes/E0118.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
You're trying to write an inherent implementation for something which isn't a
struct nor an enum. Erroneous code example:
An inherent implementation was defined for something which isn't a struct nor
an enum.

Erroneous code example:

```compile_fail,E0118
impl (u8, u8) { // error: no base type found for inherent implementation
3 changes: 2 additions & 1 deletion src/librustc_error_codes/error_codes/E0119.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
There are conflicting trait implementations for the same type.
Example of erroneous code:

Erroneous code example:

```compile_fail,E0119
trait MyTrait {
27 changes: 27 additions & 0 deletions src/librustc_error_codes/error_codes/E0631.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
This error indicates a type mismatch in closure arguments.

Erroneous code example:

```compile_fail,E0631
fn foo<F: Fn(i32)>(f: F) {
}

fn main() {
foo(|x: &str| {});
}
```

The error occurs because `foo` accepts a closure that takes an `i32` argument,
but in `main`, it is passed a closure with a `&str` argument.

This can be resolved by changing the type annotation or removing it entirely
if it can be inferred.

```
fn foo<F: Fn(i32)>(f: F) {
}

fn main() {
foo(|x: i32| {});
}
```
3 changes: 3 additions & 0 deletions src/libstd/sys/vxworks/ext/mod.rs
Original file line number Diff line number Diff line change
@@ -18,4 +18,7 @@ pub mod prelude {
#[doc(no_inline)]
#[stable(feature = "rust1", since = "1.0.0")]
pub use super::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
#[doc(no_inline)]
#[stable(feature = "rust1", since = "1.0.0")]
pub use super::process::ExitStatusExt;
}
19 changes: 12 additions & 7 deletions src/libstd/sys/vxworks/os.rs
Original file line number Diff line number Diff line change
@@ -11,14 +11,12 @@ use crate::path::{self, PathBuf, Path};
use crate::ptr;
use crate::slice;
use crate::str;
use crate::sys_common::mutex::Mutex;
use crate::sys_common::mutex::{Mutex, MutexGuard};
use crate::sys::cvt;
/*use sys::fd; this one is probably important */
use crate::vec;

const TMPBUF_SZ: usize = 128;
static ENV_LOCK: Mutex = Mutex::new();


// This is a terrible fix
use crate::sys::os_str::Buf;
@@ -200,11 +198,18 @@ pub unsafe fn environ() -> *mut *const *const c_char {
&mut environ
}

pub unsafe fn env_lock() -> MutexGuard<'static> {
// We never call `ENV_LOCK.init()`, so it is UB to attempt to
// acquire this mutex reentrantly!
static ENV_LOCK: Mutex = Mutex::new();
ENV_LOCK.lock()
}

/// Returns a vector of (variable, value) byte-vector pairs for all the
/// environment variables of the current process.
pub fn env() -> Env {
unsafe {
let _guard = ENV_LOCK.lock();
let _guard = env_lock();
let mut environ = *environ();
if environ == ptr::null() {
panic!("os::env() failure getting env string from OS: {}",
@@ -244,7 +249,7 @@ pub fn getenv(k: &OsStr) -> io::Result<Option<OsString>> {
// always None as well
let k = CString::new(k.as_bytes())?;
unsafe {
let _guard = ENV_LOCK.lock();
let _guard = env_lock();
let s = libc::getenv(k.as_ptr()) as *const libc::c_char;
let ret = if s.is_null() {
None
@@ -260,7 +265,7 @@ pub fn setenv(k: &OsStr, v: &OsStr) -> io::Result<()> {
let v = CString::new(v.as_bytes())?;

unsafe {
let _guard = ENV_LOCK.lock();
let _guard = env_lock();
cvt(libc::setenv(k.as_ptr(), v.as_ptr(), 1)).map(|_| ())
}
}
@@ -269,7 +274,7 @@ pub fn unsetenv(n: &OsStr) -> io::Result<()> {
let nbuf = CString::new(n.as_bytes())?;

unsafe {
let _guard = ENV_LOCK.lock();
let _guard = env_lock();
cvt(libc::unsetenv(nbuf.as_ptr())).map(|_| ())
}
}
12 changes: 10 additions & 2 deletions src/libstd/sys/vxworks/process/process_vxworks.rs
Original file line number Diff line number Diff line change
@@ -15,6 +15,7 @@ impl Command {
-> io::Result<(Process, StdioPipes)> {
use crate::sys::{cvt_r};
const CLOEXEC_MSG_FOOTER: &'static [u8] = b"NOEX";
let envp = self.capture_env();

if self.saw_nul() {
return Err(io::Error::new(ErrorKind::InvalidInput,
@@ -52,12 +53,19 @@ impl Command {
t!(cvt(libc::chdir(cwd.as_ptr())));
}

let c_envp = envp.as_ref().map(|c| c.as_ptr())
.unwrap_or_else(|| *sys::os::environ() as *const _);
let stack_size = thread::min_stack();

// ensure that access to the environment is synchronized
let _lock = sys::os::env_lock();

let ret = libc::rtpSpawn(
self.get_argv()[0], // executing program
self.get_argv().as_ptr() as *mut *const c_char, // argv
*sys::os::environ() as *mut *const c_char,
c_envp as *mut *const c_char,
100 as c_int, // initial priority
thread::min_stack(), // initial stack size.
stack_size, // initial stack size.
0, // options
0 // task options
);
1 change: 1 addition & 0 deletions src/libstd/sys/wasi/args.rs
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ fn maybe_args() -> Option<Vec<OsString>> {
let mut argv = Vec::with_capacity(argc);
let mut buf = Vec::with_capacity(buf_size);
wasi::args_get(argv.as_mut_ptr(), buf.as_mut_ptr()).ok()?;
argv.set_len(argc);
let mut ret = Vec::with_capacity(argc);
for ptr in argv {
let s = CStr::from_ptr(ptr.cast());
1 change: 1 addition & 0 deletions src/test/ui/anonymous-higher-ranked-lifetime.stderr
Original file line number Diff line number Diff line change
@@ -121,3 +121,4 @@ LL | fn h2<F>(_: F) where F: for<'t0> Fn(&(), Box<dyn Fn(&())>, &'t0 (), fn(&(),

error: aborting due to 11 previous errors

For more information about this error, try `rustc --explain E0631`.
Original file line number Diff line number Diff line change
@@ -39,3 +39,4 @@ LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0631`.
3 changes: 2 additions & 1 deletion src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr
Original file line number Diff line number Diff line change
@@ -77,4 +77,5 @@ LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| {

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0308`.
Some errors have detailed explanations: E0308, E0631.
For more information about an error, try `rustc --explain E0308`.
Original file line number Diff line number Diff line change
@@ -13,3 +13,4 @@ LL | with_closure(|x: u32, y: i32| {

error: aborting due to previous error

For more information about this error, try `rustc --explain E0631`.
3 changes: 2 additions & 1 deletion src/test/ui/closures/issue-41366.stderr
Original file line number Diff line number Diff line change
@@ -19,4 +19,5 @@ LL | (&|_|()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.
Some errors have detailed explanations: E0271, E0631.
For more information about an error, try `rustc --explain E0271`.
3 changes: 2 additions & 1 deletion src/test/ui/issues/issue-43623.stderr
Original file line number Diff line number Diff line change
@@ -25,4 +25,5 @@ LL | break_me::<Type, fn(_)>;

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.
Some errors have detailed explanations: E0271, E0631.
For more information about an error, try `rustc --explain E0271`.
3 changes: 2 additions & 1 deletion src/test/ui/issues/issue-60283.stderr
Original file line number Diff line number Diff line change
@@ -27,4 +27,5 @@ LL | foo((), drop)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.
Some errors have detailed explanations: E0271, E0631.
For more information about an error, try `rustc --explain E0271`.
1 change: 1 addition & 0 deletions src/test/ui/mismatched_types/E0631.stderr
Original file line number Diff line number Diff line change
@@ -46,3 +46,4 @@ LL | bar(f);

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0631`.
Original file line number Diff line number Diff line change
@@ -45,4 +45,5 @@ LL | baz(f);

error: aborting due to 5 previous errors

For more information about this error, try `rustc --explain E0271`.
Some errors have detailed explanations: E0271, E0631.
For more information about an error, try `rustc --explain E0271`.
3 changes: 2 additions & 1 deletion src/test/ui/mismatched_types/closure-mismatch.stderr
Original file line number Diff line number Diff line change
@@ -24,4 +24,5 @@ LL | baz(|_| ());

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.
Some errors have detailed explanations: E0271, E0631.
For more information about an error, try `rustc --explain E0271`.
1 change: 1 addition & 0 deletions src/test/ui/mismatched_types/fn-variance-1.stderr
Original file line number Diff line number Diff line change
@@ -24,3 +24,4 @@ LL | apply(&mut 3, takes_imm);

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0631`.
3 changes: 2 additions & 1 deletion src/test/ui/mismatched_types/issue-36053-2.stderr
Original file line number Diff line number Diff line change
@@ -18,4 +18,5 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count();

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
Some errors have detailed explanations: E0599, E0631.
For more information about an error, try `rustc --explain E0599`.
Original file line number Diff line number Diff line change
@@ -12,3 +12,4 @@ LL | let z = call_it(3, f);

error: aborting due to previous error

For more information about this error, try `rustc --explain E0631`.
4 changes: 2 additions & 2 deletions src/test/ui/type/type-check-defaults.rs
Original file line number Diff line number Diff line change
@@ -4,9 +4,9 @@ use std::ops::Add;

struct Foo<T, U: FromIterator<T>>(T, U);
struct WellFormed<Z = Foo<i32, i32>>(Z);
//~^ ERROR a collection of type `i32` cannot be built from an iterator over elements of type `i32`
//~^ ERROR a value of type `i32` cannot be built from an iterator over elements of type `i32`
struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
//~^ ERROR a collection of type `i32` cannot be built from an iterator over elements of type `i32`
//~^ ERROR a value of type `i32` cannot be built from an iterator over elements of type `i32`

struct Bounds<T:Copy=String>(T);
//~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277]
8 changes: 4 additions & 4 deletions src/test/ui/type/type-check-defaults.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
--> $DIR/type-check-defaults.rs:6:19
|
LL | struct Foo<T, U: FromIterator<T>>(T, U);
| ---------------------------------------- required by `Foo`
LL | struct WellFormed<Z = Foo<i32, i32>>(Z);
| ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
| ^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
|
= help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`

error[E0277]: a collection of type `i32` cannot be built from an iterator over elements of type `i32`
error[E0277]: a value of type `i32` cannot be built from an iterator over elements of type `i32`
--> $DIR/type-check-defaults.rs:8:27
|
LL | struct Foo<T, U: FromIterator<T>>(T, U);
| ---------------------------------------- required by `Foo`
...
LL | struct WellFormedNoBounds<Z:?Sized = Foo<i32, i32>>(Z);
| ^ a collection of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
| ^ value of type `i32` cannot be built from `std::iter::Iterator<Item=i32>`
|
= help: the trait `std::iter::FromIterator<i32>` is not implemented for `i32`

2 changes: 1 addition & 1 deletion src/test/ui/type/type-dependent-def-issue-49241.rs
Original file line number Diff line number Diff line change
@@ -3,5 +3,5 @@ fn main() {
const l: usize = v.count(); //~ ERROR attempt to use a non-constant value in a constant
let s: [u32; l] = v.into_iter().collect();
//~^ ERROR evaluation of constant value failed
//~^^ ERROR a collection of type
//~^^ ERROR a value of type
}
4 changes: 2 additions & 2 deletions src/test/ui/type/type-dependent-def-issue-49241.stderr
Original file line number Diff line number Diff line change
@@ -10,11 +10,11 @@ error[E0080]: evaluation of constant value failed
LL | let s: [u32; l] = v.into_iter().collect();
| ^ referenced constant has errors

error[E0277]: a collection of type `[u32; _]` cannot be built from an iterator over elements of type `{integer}`
error[E0277]: a value of type `[u32; _]` cannot be built from an iterator over elements of type `{integer}`
--> $DIR/type-dependent-def-issue-49241.rs:4:37
|
LL | let s: [u32; l] = v.into_iter().collect();
| ^^^^^^^ a collection of type `[u32; _]` cannot be built from `std::iter::Iterator<Item={integer}>`
| ^^^^^^^ value of type `[u32; _]` cannot be built from `std::iter::Iterator<Item={integer}>`
|
= help: the trait `std::iter::FromIterator<{integer}>` is not implemented for `[u32; _]`