diff --git a/Cargo.lock b/Cargo.lock index 5e83513af5b37..872d682ce4e01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1823,9 +1823,9 @@ checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" [[package]] name = "libc" -version = "0.2.64" +version = "0.2.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74dfca3d9957906e8d1e6a0b641dc9a59848e793f1da2165889fd4f62d10d79c" +checksum = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" dependencies = [ "rustc-std-workspace-core", ] diff --git a/src/ci/run.sh b/src/ci/run.sh index ae5b22493ab07..38d1d2baf2507 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -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 diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 4c941e2dfe6de..e2f49ee25a756 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -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) /// } /// } /// diff --git a/src/libcore/iter/traits/collect.rs b/src/libcore/iter/traits/collect.rs index bbdb169cac0fc..d6ae5cfe9e00e 100644 --- a/src/libcore/iter/traits/collect.rs +++ b/src/libcore/iter/traits/collect.rs @@ -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`", + label="value of type `{Self}` cannot be built from `std::iter::Iterator`", )] pub trait FromIterator: Sized { /// Creates a value from an iterator. diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 251d49db06253..6e1aac00c7bc5 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -27,7 +27,7 @@ //! //! Atomic variables are safe to share between threads (they implement [`Sync`]) //! but they do not themselves provide the mechanism for sharing and follow the -//! [threading model](../../../std/thread/index.html#the-threading-model) of rust. +//! [threading model](../../../std/thread/index.html#the-threading-model) of Rust. //! The most common way to share an atomic variable is to put it into an [`Arc`][arc] (an //! atomically-reference-counted shared pointer). //! diff --git a/src/libpanic_unwind/gcc.rs b/src/libpanic_unwind/gcc.rs index 4f572fe21b30b..5eaacc0c90be8 100644 --- a/src/libpanic_unwind/gcc.rs +++ b/src/libpanic_unwind/gcc.rs @@ -129,6 +129,9 @@ const UNWIND_DATA_REG: (i32, i32) = (24, 25); // I0, I1 #[cfg(target_arch = "hexagon")] const UNWIND_DATA_REG: (i32, i32) = (0, 1); // R0, R1 +#[cfg(target_arch = "riscv64")] +const UNWIND_DATA_REG: (i32, i32) = (10, 11); // x10, x11 + // The following code is based on GCC's C and C++ personality routines. For reference, see: // https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/libsupc++/eh_personality.cc // https://github.com/gcc-mirror/gcc/blob/trunk/libgcc/unwind-c.c diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index 5a940f2f80aa2..58c1498faa9de 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -1809,12 +1809,17 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { sub_region, "...", ); - err.note(&format!( - "...so that the {}:\nexpected {}\n found {}", - sup_trace.cause.as_requirement_str(), - sup_expected.content(), - sup_found.content() + err.span_note(sup_trace.cause.span, &format!( + "...so that the {}", + sup_trace.cause.as_requirement_str() )); + + err.note_expected_found( + &"", + sup_expected, + &"", + sup_found + ); err.emit(); return; } diff --git a/src/librustc/infer/error_reporting/note.rs b/src/librustc/infer/error_reporting/note.rs index c1f840ad67815..4b933735fc75f 100644 --- a/src/librustc/infer/error_reporting/note.rs +++ b/src/librustc/infer/error_reporting/note.rs @@ -13,12 +13,20 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { match *origin { infer::Subtype(ref trace) => { if let Some((expected, found)) = self.values_str(&trace.values) { - let expected = expected.content(); - let found = found.content(); - err.note(&format!("...so that the {}:\nexpected {}\n found {}", - trace.cause.as_requirement_str(), - expected, - found)); + err.span_note( + trace.cause.span, + &format!( + "...so that the {}", + trace.cause.as_requirement_str() + ) + ); + + err.note_expected_found( + &"", + expected, + &"", + found + ); } else { // FIXME: this really should be handled at some earlier stage. Our // handling of region checking when type errors are present is diff --git a/src/librustc/ty/print/pretty.rs b/src/librustc/ty/print/pretty.rs index fff2f06e87b8e..745f7d0276d80 100644 --- a/src/librustc/ty/print/pretty.rs +++ b/src/librustc/ty/print/pretty.rs @@ -1282,6 +1282,9 @@ impl Printer<'tcx> for FmtPrinter<'_, 'tcx, F> { if !self.empty_path { write!(self, "::")?; } + if ast::Ident::from_str(&name).is_raw_guess() { + write!(self, "r#")?; + } write!(self, "{}", name)?; // FIXME(eddyb) this will print e.g. `{{closure}}#3`, but it diff --git a/src/librustc_data_structures/obligation_forest/mod.rs b/src/librustc_data_structures/obligation_forest/mod.rs index 8a5badd0afc69..0d1db72e6f7cb 100644 --- a/src/librustc_data_structures/obligation_forest/mod.rs +++ b/src/librustc_data_structures/obligation_forest/mod.rs @@ -130,12 +130,11 @@ type ObligationTreeIdGenerator = pub struct ObligationForest { /// The list of obligations. In between calls to /// `process_obligations`, this list only contains nodes in the - /// `Pending` or `Success` state (with a non-zero number of + /// `Pending` or `Waiting` state (with a non-zero number of /// incomplete children). During processing, some of those nodes /// may be changed to the error state, or we may find that they - /// are completed (That is, `num_incomplete_children` drops to 0). - /// At the end of processing, those nodes will be removed by a - /// call to `compress`. + /// are completed. At the end of processing, those nodes will be + /// removed by a call to `compress`. /// /// `usize` indices are used here and throughout this module, rather than /// `rustc_index::newtype_index!` indices, because this code is hot enough that the @@ -211,28 +210,56 @@ impl Node { /// represents the current state of processing for the obligation (of /// type `O`) associated with this node. /// -/// Outside of ObligationForest methods, nodes should be either Pending -/// or Waiting. +/// The non-`Error` state transitions are as follows. +/// ``` +/// (Pre-creation) +/// | +/// | register_obligation_at() (called by process_obligations() and +/// v from outside the crate) +/// Pending +/// | +/// | process_obligations() +/// v +/// Success +/// | ^ +/// | | update_waiting_and_success_states() +/// | v +/// | Waiting +/// | +/// | process_cycles() +/// v +/// Done +/// | +/// | compress() +/// v +/// (Removed) +/// ``` +/// The `Error` state can be introduced in several places, via `error_at()`. +/// +/// Outside of `ObligationForest` methods, nodes should be either `Pending` or +/// `Waiting`. #[derive(Debug, Copy, Clone, PartialEq, Eq)] enum NodeState { - /// Obligations for which selection had not yet returned a - /// non-ambiguous result. + /// This obligation has not yet been selected successfully. Cannot have + /// subobligations. Pending, - /// This obligation was selected successfully, but may or - /// may not have subobligations. + /// This obligation was selected successfully, but the state of any + /// subobligations are current unknown. It will be converted to `Waiting` + /// or `Done` once the states of the subobligations become known. Success, - /// This obligation was selected successfully, but it has - /// a pending subobligation. + /// This obligation was selected successfully, but it has one or more + /// pending subobligations. Waiting, - /// This obligation, along with its subobligations, are complete, - /// and will be removed in the next collection. + /// This obligation was selected successfully, as were all of its + /// subobligations (of which there may be none). It will be removed by the + /// next compression step. Done, - /// This obligation was resolved to an error. Error nodes are - /// removed from the vector by the compression step. + /// This obligation was resolved to an error. It will be removed by the + /// next compression step. Error, } @@ -464,7 +491,7 @@ impl ObligationForest { }; } - self.mark_as_waiting(); + self.update_waiting_and_success_states(); self.process_cycles(processor); let completed = self.compress(do_completed); @@ -477,10 +504,9 @@ impl ObligationForest { } } - /// Mark all `NodeState::Success` nodes as `NodeState::Done` and - /// report all cycles between them. This should be called - /// after `mark_as_waiting` marks all nodes with pending - /// subobligations as NodeState::Waiting. + /// Mark all `Success` nodes as `Done` and report all cycles between them. + /// This should be called after `update_waiting_and_success_states` updates + /// the status of all `Waiting` and `Success` nodes. fn process_cycles

(&self, processor: &mut P) where P: ObligationProcessor { @@ -562,7 +588,7 @@ impl ObligationForest { // This always-inlined function is for the hot call site. #[inline(always)] - fn inlined_mark_neighbors_as_waiting_from(&self, node: &Node) { + fn inlined_mark_dependents_as_waiting(&self, node: &Node) { for &index in node.dependents.iter() { let node = &self.nodes[index]; match node.state.get() { @@ -570,11 +596,11 @@ impl ObligationForest { NodeState::Success => { node.state.set(NodeState::Waiting); // This call site is cold. - self.uninlined_mark_neighbors_as_waiting_from(node); + self.uninlined_mark_dependents_as_waiting(node); } NodeState::Pending | NodeState::Done => { // This call site is cold. - self.uninlined_mark_neighbors_as_waiting_from(node); + self.uninlined_mark_dependents_as_waiting(node); } } } @@ -582,22 +608,27 @@ impl ObligationForest { // This never-inlined function is for the cold call site. #[inline(never)] - fn uninlined_mark_neighbors_as_waiting_from(&self, node: &Node) { - self.inlined_mark_neighbors_as_waiting_from(node) + fn uninlined_mark_dependents_as_waiting(&self, node: &Node) { + self.inlined_mark_dependents_as_waiting(node) } - /// Marks all nodes that depend on a pending node as `NodeState::Waiting`. - fn mark_as_waiting(&self) { + /// Updates the states of all `Waiting` and `Success` nodes. Upon + /// completion, all such nodes that depend on a pending node will be marked + /// as `Waiting`, and all others will be marked as `Success`. + fn update_waiting_and_success_states(&self) { + // Optimistically mark all `Waiting` nodes as `Success`. for node in &self.nodes { if node.state.get() == NodeState::Waiting { node.state.set(NodeState::Success); } } + // Convert all `Success` nodes that still depend on a pending node to + // `Waiting`. This may undo some of the changes done in the loop above. for node in &self.nodes { if node.state.get() == NodeState::Pending { // This call site is hot. - self.inlined_mark_neighbors_as_waiting_from(node); + self.inlined_mark_dependents_as_waiting(node); } } } diff --git a/src/librustc_error_codes/error_codes.rs b/src/librustc_error_codes/error_codes.rs index 7f111b42403b5..9e4b704170b9b 100644 --- a/src/librustc_error_codes/error_codes.rs +++ b/src/librustc_error_codes/error_codes.rs @@ -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 diff --git a/src/librustc_error_codes/error_codes/E0092.md b/src/librustc_error_codes/error_codes/E0092.md index 2750a7d45b48e..e289534bf7abd 100644 --- a/src/librustc_error_codes/error_codes/E0092.md +++ b/src/librustc_error_codes/error_codes/E0092.md @@ -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)] diff --git a/src/librustc_error_codes/error_codes/E0093.md b/src/librustc_error_codes/error_codes/E0093.md index 9633f794d8bb7..8e7de1a9d37b3 100644 --- a/src/librustc_error_codes/error_codes/E0093.md +++ b/src/librustc_error_codes/error_codes/E0093.md @@ -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)] diff --git a/src/librustc_error_codes/error_codes/E0094.md b/src/librustc_error_codes/error_codes/E0094.md index 4d27f616d2d84..42baa65bf9faf 100644 --- a/src/librustc_error_codes/error_codes/E0094.md +++ b/src/librustc_error_codes/error_codes/E0094.md @@ -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 diff --git a/src/librustc_error_codes/error_codes/E0106.md b/src/librustc_error_codes/error_codes/E0106.md index 8a49c1f79e475..60ca1ddc2830c 100644 --- a/src/librustc_error_codes/error_codes/E0106.md +++ b/src/librustc_error_codes/error_codes/E0106.md @@ -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 diff --git a/src/librustc_error_codes/error_codes/E0107.md b/src/librustc_error_codes/error_codes/E0107.md index bfe0d21f3129b..4d22b17fe1016 100644 --- a/src/librustc_error_codes/error_codes/E0107.md +++ b/src/librustc_error_codes/error_codes/E0107.md @@ -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 { x: T } @@ -9,6 +11,7 @@ struct Baz { x: Foo } // error: wrong number of type arguments: // expected 1, found 2 fn foo(x: T, y: U) {} +fn f() {} fn main() { let x: bool = true; @@ -16,12 +19,26 @@ fn main() { // expected 2, found 1 foo::(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 { x: T } + +struct Bar { x: Foo } // ok! +struct Baz { x: Foo, y: Foo } // ok! +fn foo(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::(x, 12); // ok! + f(); // ok! } ``` diff --git a/src/librustc_error_codes/error_codes/E0109.md b/src/librustc_error_codes/error_codes/E0109.md index 5bc229ade52f4..2eab9725a6f59 100644 --- a/src/librustc_error_codes/error_codes/E0109.md +++ b/src/librustc_error_codes/error_codes/E0109.md @@ -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 diff --git a/src/librustc_error_codes/error_codes/E0116.md b/src/librustc_error_codes/error_codes/E0116.md index 27759a423433f..ca849c2a128f4 100644 --- a/src/librustc_error_codes/error_codes/E0116.md +++ b/src/librustc_error_codes/error_codes/E0116.md @@ -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 { } // 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 diff --git a/src/librustc_error_codes/error_codes/E0117.md b/src/librustc_error_codes/error_codes/E0117.md index bd36230566262..7fa211d4a27d4 100644 --- a/src/librustc_error_codes/error_codes/E0117.md +++ b/src/librustc_error_codes/error_codes/E0117.md @@ -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`: diff --git a/src/librustc_error_codes/error_codes/E0118.md b/src/librustc_error_codes/error_codes/E0118.md index baf35ffbb0b53..5cb5f506e0a4b 100644 --- a/src/librustc_error_codes/error_codes/E0118.md +++ b/src/librustc_error_codes/error_codes/E0118.md @@ -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 diff --git a/src/librustc_error_codes/error_codes/E0119.md b/src/librustc_error_codes/error_codes/E0119.md index 0af3bd4a0de79..e596349e5e2d1 100644 --- a/src/librustc_error_codes/error_codes/E0119.md +++ b/src/librustc_error_codes/error_codes/E0119.md @@ -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 { diff --git a/src/librustc_error_codes/error_codes/E0631.md b/src/librustc_error_codes/error_codes/E0631.md new file mode 100644 index 0000000000000..6188d5f61a7f9 --- /dev/null +++ b/src/librustc_error_codes/error_codes/E0631.md @@ -0,0 +1,27 @@ +This error indicates a type mismatch in closure arguments. + +Erroneous code example: + +```compile_fail,E0631 +fn foo(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: F) { +} + +fn main() { + foo(|x: i32| {}); +} +``` diff --git a/src/librustc_parse/parser/module.rs b/src/librustc_parse/parser/module.rs index 59d7c2b423972..807defc51c1d3 100644 --- a/src/librustc_parse/parser/module.rs +++ b/src/librustc_parse/parser/module.rs @@ -212,13 +212,13 @@ impl<'a> Parser<'a> { // `./.rs` and `.//mod.rs`. let relative_prefix_string; let relative_prefix = if let Some(ident) = relative { - relative_prefix_string = format!("{}{}", ident, path::MAIN_SEPARATOR); + relative_prefix_string = format!("{}{}", ident.name, path::MAIN_SEPARATOR); &relative_prefix_string } else { "" }; - let mod_name = id.to_string(); + let mod_name = id.name.to_string(); let default_path_str = format!("{}{}.rs", relative_prefix, mod_name); let secondary_path_str = format!("{}{}{}mod.rs", relative_prefix, mod_name, path::MAIN_SEPARATOR); diff --git a/src/libstd/build.rs b/src/libstd/build.rs index 1f839f165320f..8db7bc12cd308 100644 --- a/src/libstd/build.rs +++ b/src/libstd/build.rs @@ -54,7 +54,5 @@ fn main() { } println!("cargo:rustc-link-lib=c"); println!("cargo:rustc-link-lib=compiler_rt"); - } else if target.contains("hermit") { - println!("cargo:rustc-link-lib=hermit"); } } diff --git a/src/libstd/env.rs b/src/libstd/env.rs index cf71b61b917a7..b5867e400026e 100644 --- a/src/libstd/env.rs +++ b/src/libstd/env.rs @@ -1033,6 +1033,11 @@ mod arch { pub const ARCH: &'static str = "hexagon"; } +#[cfg(target_arch = "riscv64")] +mod arch { + pub const ARCH: &'static str = "riscv64"; +} + #[cfg(test)] mod tests { use super::*; diff --git a/src/libstd/os/linux/raw.rs b/src/libstd/os/linux/raw.rs index d9b2236047bdf..0caec97bb7b90 100644 --- a/src/libstd/os/linux/raw.rs +++ b/src/libstd/os/linux/raw.rs @@ -230,7 +230,12 @@ mod arch { } } -#[cfg(any(target_arch = "mips64", target_arch = "s390x", target_arch = "sparc64"))] +#[cfg(any( + target_arch = "mips64", + target_arch = "s390x", + target_arch = "sparc64", + target_arch = "riscv64" +))] mod arch { pub use libc::{blkcnt_t, blksize_t, ino_t, nlink_t, off_t, stat, time_t}; } diff --git a/src/libstd/os/raw/mod.rs b/src/libstd/os/raw/mod.rs index e09012007f2d4..47daf0cce1b37 100644 --- a/src/libstd/os/raw/mod.rs +++ b/src/libstd/os/raw/mod.rs @@ -18,7 +18,8 @@ target_arch = "hexagon", target_arch = "powerpc", target_arch = "powerpc64", - target_arch = "s390x" + target_arch = "s390x", + target_arch = "riscv64" ) ), all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")), @@ -60,7 +61,8 @@ pub type c_char = u8; target_arch = "hexagon", target_arch = "powerpc", target_arch = "powerpc64", - target_arch = "s390x" + target_arch = "s390x", + target_arch = "riscv64" ) ), all(target_os = "android", any(target_arch = "aarch64", target_arch = "arm")), diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 8669c48e3bb50..08fb088c86103 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -57,6 +57,7 @@ macro_rules! cfg_has_statx { // target_arch = "mips64", // target_arch = "s390x", target_arch = "sparc64", + target_arch = "riscv64", )))] { $($then_tt)* } else { @@ -76,6 +77,7 @@ macro_rules! cfg_has_statx { // target_arch = "mips64", // target_arch = "s390x", target_arch = "sparc64", + target_arch = "riscv64", )))] { $($block_inner)* diff --git a/src/libstd/sys/vxworks/ext/mod.rs b/src/libstd/sys/vxworks/ext/mod.rs index 251a198f821d6..8fa9bd9d1e27f 100644 --- a/src/libstd/sys/vxworks/ext/mod.rs +++ b/src/libstd/sys/vxworks/ext/mod.rs @@ -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; } diff --git a/src/libstd/sys_common/alloc.rs b/src/libstd/sys_common/alloc.rs index 713b9949f6461..c669410078592 100644 --- a/src/libstd/sys_common/alloc.rs +++ b/src/libstd/sys_common/alloc.rs @@ -22,7 +22,8 @@ pub const MIN_ALIGN: usize = 8; target_arch = "aarch64", target_arch = "mips64", target_arch = "s390x", - target_arch = "sparc64" + target_arch = "sparc64", + target_arch = "riscv64" )))] pub const MIN_ALIGN: usize = 16; diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs index 2af66711d3cd0..c68e03be88c04 100644 --- a/src/libsyntax_pos/symbol.rs +++ b/src/libsyntax_pos/symbol.rs @@ -869,12 +869,18 @@ impl Hash for Ident { impl fmt::Debug for Ident { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.is_raw_guess() { + write!(f, "r#")?; + } write!(f, "{}{:?}", self.name, self.span.ctxt()) } } impl fmt::Display for Ident { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if self.is_raw_guess() { + write!(f, "r#")?; + } fmt::Display::fmt(&self.name, f) } } diff --git a/src/libunwind/libunwind.rs b/src/libunwind/libunwind.rs index 0b39503c0d034..4867a0f7f92b7 100644 --- a/src/libunwind/libunwind.rs +++ b/src/libunwind/libunwind.rs @@ -53,6 +53,9 @@ pub const unwinder_private_data_size: usize = 2; #[cfg(target_arch = "sparc64")] pub const unwinder_private_data_size: usize = 2; +#[cfg(target_arch = "riscv64")] +pub const unwinder_private_data_size: usize = 2; + #[cfg(target_os = "emscripten")] pub const unwinder_private_data_size: usize = 20; diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.stderr b/src/test/ui/anonymous-higher-ranked-lifetime.stderr index 9be44c7f44807..c6d9a61bdd95a 100644 --- a/src/test/ui/anonymous-higher-ranked-lifetime.stderr +++ b/src/test/ui/anonymous-higher-ranked-lifetime.stderr @@ -121,3 +121,4 @@ LL | fn h2(_: F) where F: for<'t0> Fn(&(), Box, &'t0 (), fn(&(), error: aborting due to 11 previous errors +For more information about this error, try `rustc --explain E0631`. diff --git a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr index 627609c4a9c00..3e39c8a792446 100644 --- a/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr +++ b/src/test/ui/associated-types/cache/project-fn-ret-invariant.transmute.stderr @@ -9,13 +9,21 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun | LL | fn baz<'a,'b>(x: Type<'a>) -> Type<'static> { | ^^ - = note: ...so that the expression is assignable: - expected Type<'_> - found Type<'a> +note: ...so that the expression is assignable + --> $DIR/project-fn-ret-invariant.rs:48:13 + | +LL | bar(foo, x) + | ^ + = note: expected `Type<'_>` + found `Type<'a>` = note: but, the lifetime must be valid for the static lifetime... - = note: ...so that the expression is assignable: - expected Type<'static> - found Type<'_> +note: ...so that the expression is assignable + --> $DIR/project-fn-ret-invariant.rs:48:4 + | +LL | bar(foo, x) + | ^^^^^^^^^^^ + = note: expected `Type<'static>` + found `Type<'_>` error: aborting due to previous error diff --git a/src/test/ui/c-variadic/variadic-ffi-4.stderr b/src/test/ui/c-variadic/variadic-ffi-4.stderr index c80ed5ebf5cef..cd4cd8b198de8 100644 --- a/src/test/ui/c-variadic/variadic-ffi-4.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-4.stderr @@ -49,9 +49,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th | LL | let _ = ap.with_copy(|ap| { ap }); | ^^^^^^^^^^^ - = note: ...so that the expression is assignable: - expected core::ffi::VaList<'_, '_> - found core::ffi::VaList<'_, '_> +note: ...so that the expression is assignable + --> $DIR/variadic-ffi-4.rs:16:33 + | +LL | let _ = ap.with_copy(|ap| { ap }); + | ^^ + = note: expected `core::ffi::VaList<'_, '_>` + found `core::ffi::VaList<'_, '_>` note: but, the lifetime must be valid for the method call at 16:13... --> $DIR/variadic-ffi-4.rs:16:13 | diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr index a6b52b258f005..7141c047d7f53 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr @@ -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`. diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr index a15444207f5cd..0033395846815 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr @@ -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`. diff --git a/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr b/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr index 9fbe95a9c3945..1c6564ee426e5 100644 --- a/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr +++ b/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr @@ -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`. diff --git a/src/test/ui/closures/issue-41366.stderr b/src/test/ui/closures/issue-41366.stderr index 91d26efbc4f35..2f2871e9f0e90 100644 --- a/src/test/ui/closures/issue-41366.stderr +++ b/src/test/ui/closures/issue-41366.stderr @@ -19,4 +19,5 @@ LL | (&|_|()) as &dyn for<'x> Fn(>::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`. diff --git a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr index 5e80c673258b8..3300293bb36ca 100644 --- a/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr +++ b/src/test/ui/impl-header-lifetime-elision/dyn-trait.stderr @@ -9,13 +9,21 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun | LL | fn with_dyn_debug_static<'a>(x: Box) { | ^^ - = note: ...so that the expression is assignable: - expected std::boxed::Box - found std::boxed::Box<(dyn std::fmt::Debug + 'a)> +note: ...so that the expression is assignable + --> $DIR/dyn-trait.rs:20:16 + | +LL | static_val(x); + | ^ + = note: expected `std::boxed::Box` + found `std::boxed::Box<(dyn std::fmt::Debug + 'a)>` = note: but, the lifetime must be valid for the static lifetime... - = note: ...so that the types are compatible: - expected StaticTrait - found StaticTrait +note: ...so that the types are compatible + --> $DIR/dyn-trait.rs:20:5 + | +LL | static_val(x); + | ^^^^^^^^^^ + = note: expected `StaticTrait` + found `StaticTrait` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-16683.stderr b/src/test/ui/issues/issue-16683.stderr index b663e213ed05e..99700f2084e4a 100644 --- a/src/test/ui/issues/issue-16683.stderr +++ b/src/test/ui/issues/issue-16683.stderr @@ -21,9 +21,13 @@ note: but, the lifetime must be valid for the lifetime `'a` as defined on the tr | LL | trait T<'a> { | ^^ - = note: ...so that the types are compatible: - expected &'a Self - found &Self +note: ...so that the types are compatible + --> $DIR/issue-16683.rs:4:14 + | +LL | self.a(); + | ^ + = note: expected `&'a Self` + found `&Self` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17758.stderr b/src/test/ui/issues/issue-17758.stderr index adcbb62e3d5bd..adfc3f5085826 100644 --- a/src/test/ui/issues/issue-17758.stderr +++ b/src/test/ui/issues/issue-17758.stderr @@ -22,9 +22,13 @@ note: but, the lifetime must be valid for the lifetime `'a` as defined on the tr | LL | trait Foo<'a> { | ^^ - = note: ...so that the types are compatible: - expected &'a Self - found &Self +note: ...so that the types are compatible + --> $DIR/issue-17758.rs:7:14 + | +LL | self.foo(); + | ^^^ + = note: expected `&'a Self` + found `&Self` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-20831-debruijn.stderr b/src/test/ui/issues/issue-20831-debruijn.stderr index 13c9c09461eae..c7fd134a129de 100644 --- a/src/test/ui/issues/issue-20831-debruijn.stderr +++ b/src/test/ui/issues/issue-20831-debruijn.stderr @@ -88,9 +88,19 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined on | LL | impl<'a> Publisher<'a> for MyStruct<'a> { | ^^ - = note: ...so that the types are compatible: - expected Publisher<'_> - found Publisher<'_> +note: ...so that the types are compatible + --> $DIR/issue-20831-debruijn.rs:28:5 + | +LL | / fn subscribe(&mut self, t : Box::Output> + 'a>) { +LL | | // Not obvious, but there is an implicit lifetime here -------^ +LL | | +LL | | +... | +LL | | self.sub = t; +LL | | } + | |_____^ + = note: expected `Publisher<'_>` + found `Publisher<'_>` error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-43623.stderr b/src/test/ui/issues/issue-43623.stderr index 2c57b8585d924..d90eb53f9006f 100644 --- a/src/test/ui/issues/issue-43623.stderr +++ b/src/test/ui/issues/issue-43623.stderr @@ -25,4 +25,5 @@ LL | break_me::; 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`. diff --git a/src/test/ui/issues/issue-52213.stderr b/src/test/ui/issues/issue-52213.stderr index b79a5ddf3e1bf..a8960f7756367 100644 --- a/src/test/ui/issues/issue-52213.stderr +++ b/src/test/ui/issues/issue-52213.stderr @@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun | LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T { | ^^ - = note: ...so that the types are compatible: - expected (&&(T,),) - found (&&'a (T,),) +note: ...so that the types are compatible + --> $DIR/issue-52213.rs:2:11 + | +LL | match (&t,) { + | ^^^^^ + = note: expected `(&&(T,),)` + found `(&&'a (T,),)` note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 1:27... --> $DIR/issue-52213.rs:1:27 | diff --git a/src/test/ui/issues/issue-55796.stderr b/src/test/ui/issues/issue-55796.stderr index 7b910f5e3e5a6..b8cafdc5c14b5 100644 --- a/src/test/ui/issues/issue-55796.stderr +++ b/src/test/ui/issues/issue-55796.stderr @@ -15,9 +15,13 @@ note: ...so that the type `std::iter::Map<>::EdgesIter, [closu LL | Box::new(self.out_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: but, the lifetime must be valid for the static lifetime... - = note: ...so that the expression is assignable: - expected std::boxed::Box<(dyn std::iter::Iterator>::Node> + 'static)> - found std::boxed::Box>::Node>> +note: ...so that the expression is assignable + --> $DIR/issue-55796.rs:16:9 + | +LL | Box::new(self.out_edges(u).map(|e| e.target())) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `std::boxed::Box<(dyn std::iter::Iterator>::Node> + 'static)>` + found `std::boxed::Box>::Node>>` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> $DIR/issue-55796.rs:21:9 @@ -36,9 +40,13 @@ note: ...so that the type `std::iter::Map<>::EdgesIter, [closu LL | Box::new(self.in_edges(u).map(|e| e.target())) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: but, the lifetime must be valid for the static lifetime... - = note: ...so that the expression is assignable: - expected std::boxed::Box<(dyn std::iter::Iterator>::Node> + 'static)> - found std::boxed::Box>::Node>> +note: ...so that the expression is assignable + --> $DIR/issue-55796.rs:21:9 + | +LL | Box::new(self.in_edges(u).map(|e| e.target())) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `std::boxed::Box<(dyn std::iter::Iterator>::Node> + 'static)>` + found `std::boxed::Box>::Node>>` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-60283.stderr b/src/test/ui/issues/issue-60283.stderr index 69c1d85e4e12d..d13dcd54a479a 100644 --- a/src/test/ui/issues/issue-60283.stderr +++ b/src/test/ui/issues/issue-60283.stderr @@ -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`. diff --git a/src/test/ui/issues/issue-65634-raw-ident-suggestion.rs b/src/test/ui/issues/issue-65634-raw-ident-suggestion.rs new file mode 100644 index 0000000000000..b928510258b2f --- /dev/null +++ b/src/test/ui/issues/issue-65634-raw-ident-suggestion.rs @@ -0,0 +1,22 @@ +#![allow(non_camel_case_types)] + +trait r#async { + fn r#struct(&self) { + println!("async"); + } +} + +trait r#await { + fn r#struct(&self) { + println!("await"); + } +} + +struct r#fn {} + +impl r#async for r#fn {} +impl r#await for r#fn {} + +fn main() { + r#fn {}.r#struct(); //~ ERROR multiple applicable items in scope +} diff --git a/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr b/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr new file mode 100644 index 0000000000000..c7bb653dc1f14 --- /dev/null +++ b/src/test/ui/issues/issue-65634-raw-ident-suggestion.stderr @@ -0,0 +1,22 @@ +error[E0034]: multiple applicable items in scope + --> $DIR/issue-65634-raw-ident-suggestion.rs:21:13 + | +LL | r#fn {}.r#struct(); + | ^^^^^^^^ multiple `r#struct` found + | +note: candidate #1 is defined in an impl of the trait `async` for the type `r#fn` + --> $DIR/issue-65634-raw-ident-suggestion.rs:4:5 + | +LL | fn r#struct(&self) { + | ^^^^^^^^^^^^^^^^^^ + = help: to disambiguate the method call, write `async::r#struct(r#fn {})` instead +note: candidate #2 is defined in an impl of the trait `await` for the type `r#fn` + --> $DIR/issue-65634-raw-ident-suggestion.rs:10:5 + | +LL | fn r#struct(&self) { + | ^^^^^^^^^^^^^^^^^^ + = help: to disambiguate the method call, write `await::r#struct(r#fn {})` instead + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0034`. diff --git a/src/test/ui/mismatched_types/E0631.stderr b/src/test/ui/mismatched_types/E0631.stderr index 88c1efdbb90f4..06f5c058f81f5 100644 --- a/src/test/ui/mismatched_types/E0631.stderr +++ b/src/test/ui/mismatched_types/E0631.stderr @@ -46,3 +46,4 @@ LL | bar(f); error: aborting due to 4 previous errors +For more information about this error, try `rustc --explain E0631`. diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr index 85cad61210ebf..ed5028247124f 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr @@ -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`. diff --git a/src/test/ui/mismatched_types/closure-mismatch.stderr b/src/test/ui/mismatched_types/closure-mismatch.stderr index fd2b9f3c66b04..f3874c0907be0 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-mismatch.stderr @@ -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`. diff --git a/src/test/ui/mismatched_types/fn-variance-1.stderr b/src/test/ui/mismatched_types/fn-variance-1.stderr index 1a82dd53edc70..88c92661994cb 100644 --- a/src/test/ui/mismatched_types/fn-variance-1.stderr +++ b/src/test/ui/mismatched_types/fn-variance-1.stderr @@ -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`. diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr index 72f3220cc1aba..da018aa89482c 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.stderr +++ b/src/test/ui/mismatched_types/issue-36053-2.stderr @@ -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`. diff --git a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr index 2daf4781c7e6f..3c999f200d9c7 100644 --- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr +++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr @@ -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`. diff --git a/src/test/ui/nll/issue-55394.stderr b/src/test/ui/nll/issue-55394.stderr index 714a63b670c66..69a6ab004fd91 100644 --- a/src/test/ui/nll/issue-55394.stderr +++ b/src/test/ui/nll/issue-55394.stderr @@ -21,9 +21,13 @@ note: but, the lifetime must be valid for the lifetime `'_` as defined on the im | LL | impl Foo<'_> { | ^^ - = note: ...so that the expression is assignable: - expected Foo<'_> - found Foo<'_> +note: ...so that the expression is assignable + --> $DIR/issue-55394.rs:9:9 + | +LL | Foo { bar } + | ^^^^^^^^^^^ + = note: expected `Foo<'_>` + found `Foo<'_>` error: aborting due to previous error diff --git a/src/test/ui/nll/normalization-bounds-error.stderr b/src/test/ui/nll/normalization-bounds-error.stderr index 3a152fbc6fce8..58f206742f4f5 100644 --- a/src/test/ui/nll/normalization-bounds-error.stderr +++ b/src/test/ui/nll/normalization-bounds-error.stderr @@ -14,9 +14,13 @@ note: ...but the lifetime must also be valid for the lifetime `'a` as defined on | LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} | ^^ - = note: ...so that the types are compatible: - expected Visitor<'d> - found Visitor<'_> +note: ...so that the types are compatible + --> $DIR/normalization-bounds-error.rs:12:1 + | +LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `Visitor<'d>` + found `Visitor<'_>` error: aborting due to previous error diff --git a/src/test/ui/nll/type-alias-free-regions.stderr b/src/test/ui/nll/type-alias-free-regions.stderr index 6986389af8814..5191deca281cc 100644 --- a/src/test/ui/nll/type-alias-free-regions.stderr +++ b/src/test/ui/nll/type-alias-free-regions.stderr @@ -11,17 +11,25 @@ LL | / fn from_box(b: Box) -> Self { LL | | C { f: b } LL | | } | |_____^ - = note: ...so that the expression is assignable: - expected std::boxed::Box> - found std::boxed::Box> +note: ...so that the expression is assignable + --> $DIR/type-alias-free-regions.rs:17:16 + | +LL | C { f: b } + | ^ + = note: expected `std::boxed::Box>` + found `std::boxed::Box>` note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 15:6... --> $DIR/type-alias-free-regions.rs:15:6 | LL | impl<'a> FromBox<'a> for C<'a> { | ^^ - = note: ...so that the expression is assignable: - expected C<'a> - found C<'_> +note: ...so that the expression is assignable + --> $DIR/type-alias-free-regions.rs:17:9 + | +LL | C { f: b } + | ^^^^^^^^^^ + = note: expected `C<'a>` + found `C<'_>` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> $DIR/type-alias-free-regions.rs:27:16 @@ -36,17 +44,25 @@ LL | / fn from_tuple(b: (B,)) -> Self { LL | | C { f: Box::new(b.0) } LL | | } | |_____^ - = note: ...so that the expression is assignable: - expected std::boxed::Box<&isize> - found std::boxed::Box<&isize> +note: ...so that the expression is assignable + --> $DIR/type-alias-free-regions.rs:27:25 + | +LL | C { f: Box::new(b.0) } + | ^^^ + = note: expected `std::boxed::Box<&isize>` + found `std::boxed::Box<&isize>` note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 25:6... --> $DIR/type-alias-free-regions.rs:25:6 | LL | impl<'a> FromTuple<'a> for C<'a> { | ^^ - = note: ...so that the expression is assignable: - expected C<'a> - found C<'_> +note: ...so that the expression is assignable + --> $DIR/type-alias-free-regions.rs:27:9 + | +LL | C { f: Box::new(b.0) } + | ^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `C<'a>` + found `C<'_>` error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr index 4ebd991078864..37be450fd0a79 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr @@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { | ^^ - = note: ...so that the types are compatible: - expected Foo<'_> - found Foo<'a> +note: ...so that the types are compatible + --> $DIR/constant-in-expr-inherent-1.rs:8:5 + | +LL | >::C + | ^^^^^^^^^^^^ + = note: expected `Foo<'_>` + found `Foo<'a>` = note: but, the lifetime must be valid for the static lifetime... note: ...so that reference does not outlive borrowed content --> $DIR/constant-in-expr-inherent-1.rs:8:5 diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr index d61659e7e9afc..4ee32847c5ec8 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr @@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun | LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { | ^^ - = note: ...so that the types are compatible: - expected Foo<'_> - found Foo<'a> +note: ...so that the types are compatible + --> $DIR/constant-in-expr-trait-item-3.rs:10:5 + | +LL | T::C + | ^^^^ + = note: expected `Foo<'_>` + found `Foo<'a>` = note: but, the lifetime must be valid for the static lifetime... note: ...so that reference does not outlive borrowed content --> $DIR/constant-in-expr-trait-item-3.rs:10:5 diff --git a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr index d66322c48ec98..1952ee8269d5b 100644 --- a/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr +++ b/src/test/ui/object-lifetime/object-lifetime-default-elision.stderr @@ -19,9 +19,13 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu | LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { | ^^ - = note: ...so that the expression is assignable: - expected &'b (dyn SomeTrait + 'b) - found &dyn SomeTrait +note: ...so that the expression is assignable + --> $DIR/object-lifetime-default-elision.rs:71:5 + | +LL | ss + | ^^ + = note: expected `&'b (dyn SomeTrait + 'b)` + found `&dyn SomeTrait` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> $DIR/object-lifetime-default-elision.rs:71:5 @@ -44,9 +48,13 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu | LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait { | ^^ - = note: ...so that the expression is assignable: - expected &'b (dyn SomeTrait + 'b) - found &dyn SomeTrait +note: ...so that the expression is assignable + --> $DIR/object-lifetime-default-elision.rs:71:5 + | +LL | ss + | ^^ + = note: expected `&'b (dyn SomeTrait + 'b)` + found `&dyn SomeTrait` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/raw/raw-literal-keywords.rs b/src/test/ui/parser/raw/raw-literal-keywords.rs index bf9cbcdab2e89..a986980fab97b 100644 --- a/src/test/ui/parser/raw/raw-literal-keywords.rs +++ b/src/test/ui/parser/raw/raw-literal-keywords.rs @@ -11,11 +11,11 @@ fn test_union() { } fn test_if_2() { - let _ = r#if; //~ ERROR cannot find value `if` in this scope + let _ = r#if; //~ ERROR cannot find value `r#if` in this scope } fn test_struct_2() { - let _ = r#struct; //~ ERROR cannot find value `struct` in this scope + let _ = r#struct; //~ ERROR cannot find value `r#struct` in this scope } fn test_union_2() { diff --git a/src/test/ui/parser/raw/raw-literal-keywords.stderr b/src/test/ui/parser/raw/raw-literal-keywords.stderr index fd8eda3770d27..f7b6c894a90fe 100644 --- a/src/test/ui/parser/raw/raw-literal-keywords.stderr +++ b/src/test/ui/parser/raw/raw-literal-keywords.stderr @@ -16,13 +16,13 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found LL | r#union Test; | ^^^^ expected one of 8 possible tokens -error[E0425]: cannot find value `if` in this scope +error[E0425]: cannot find value `r#if` in this scope --> $DIR/raw-literal-keywords.rs:14:13 | LL | let _ = r#if; | ^^^^ not found in this scope -error[E0425]: cannot find value `struct` in this scope +error[E0425]: cannot find value `r#struct` in this scope --> $DIR/raw-literal-keywords.rs:18:13 | LL | let _ = r#struct; diff --git a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr index 14934d6fa4899..e889651647034 100644 --- a/src/test/ui/regions/region-object-lifetime-in-coercion.stderr +++ b/src/test/ui/regions/region-object-lifetime-in-coercion.stderr @@ -34,17 +34,25 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun | LL | fn d<'a,'b>(v: &'a [u8]) -> Box { | ^^ - = note: ...so that the expression is assignable: - expected &[u8] - found &'a [u8] +note: ...so that the expression is assignable + --> $DIR/region-object-lifetime-in-coercion.rs:26:14 + | +LL | Box::new(v) + | ^ + = note: expected `&[u8]` + found `&'a [u8]` note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 25:9... --> $DIR/region-object-lifetime-in-coercion.rs:25:9 | LL | fn d<'a,'b>(v: &'a [u8]) -> Box { | ^^ - = note: ...so that the expression is assignable: - expected std::boxed::Box<(dyn Foo + 'b)> - found std::boxed::Box +note: ...so that the expression is assignable + --> $DIR/region-object-lifetime-in-coercion.rs:26:5 + | +LL | Box::new(v) + | ^^^^^^^^^^^ + = note: expected `std::boxed::Box<(dyn Foo + 'b)>` + found `std::boxed::Box` error: aborting due to 4 previous errors diff --git a/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr index a636c9ef22c83..865e967fba32e 100644 --- a/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr +++ b/src/test/ui/regions/regions-assoc-type-region-bound-in-trait-not-met.stderr @@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the imp | LL | impl<'a> Foo<'static> for &'a i32 { | ^^ - = note: ...so that the types are compatible: - expected Foo<'static> - found Foo<'static> +note: ...so that the types are compatible + --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10 + | +LL | impl<'a> Foo<'static> for &'a i32 { + | ^^^^^^^^^^^^ + = note: expected `Foo<'static>` + found `Foo<'static>` = note: but, the lifetime must be valid for the static lifetime... note: ...so that the type `&i32` will meet its required lifetime bounds --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:14:10 @@ -30,9 +34,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the imp | LL | impl<'a,'b> Foo<'b> for &'a i64 { | ^^ - = note: ...so that the types are compatible: - expected Foo<'b> - found Foo<'_> +note: ...so that the types are compatible + --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:13 + | +LL | impl<'a,'b> Foo<'b> for &'a i64 { + | ^^^^^^^ + = note: expected `Foo<'b>` + found `Foo<'_>` note: but, the lifetime must be valid for the lifetime `'b` as defined on the impl at 19:9... --> $DIR/regions-assoc-type-region-bound-in-trait-not-met.rs:19:9 | diff --git a/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr b/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr index 81256e3b46cbb..6a34871c07efd 100644 --- a/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr +++ b/src/test/ui/regions/regions-assoc-type-static-bound-in-trait-not-met.stderr @@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the imp | LL | impl<'a> Foo for &'a i32 { | ^^ - = note: ...so that the types are compatible: - expected Foo - found Foo +note: ...so that the types are compatible + --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:9:10 + | +LL | impl<'a> Foo for &'a i32 { + | ^^^ + = note: expected `Foo` + found `Foo` = note: but, the lifetime must be valid for the static lifetime... note: ...so that the type `&i32` will meet its required lifetime bounds --> $DIR/regions-assoc-type-static-bound-in-trait-not-met.rs:9:10 diff --git a/src/test/ui/regions/regions-close-object-into-object-2.stderr b/src/test/ui/regions/regions-close-object-into-object-2.stderr index 8e473dad69341..28873ab807f8d 100644 --- a/src/test/ui/regions/regions-close-object-into-object-2.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-2.stderr @@ -15,9 +15,13 @@ note: ...so that the type `(dyn A + 'a)` is not borrowed for too long LL | box B(&*v) as Box | ^^^ = note: but, the lifetime must be valid for the static lifetime... - = note: ...so that the expression is assignable: - expected std::boxed::Box<(dyn X + 'static)> - found std::boxed::Box +note: ...so that the expression is assignable + --> $DIR/regions-close-object-into-object-2.rs:10:5 + | +LL | box B(&*v) as Box + | ^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `std::boxed::Box<(dyn X + 'static)>` + found `std::boxed::Box` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-close-object-into-object-4.stderr b/src/test/ui/regions/regions-close-object-into-object-4.stderr index c80d13e15b147..449a5b5fdd4d6 100644 --- a/src/test/ui/regions/regions-close-object-into-object-4.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-4.stderr @@ -15,9 +15,13 @@ note: ...so that the type `(dyn A + 'a)` is not borrowed for too long LL | box B(&*v) as Box | ^^^ = note: but, the lifetime must be valid for the static lifetime... - = note: ...so that the expression is assignable: - expected std::boxed::Box<(dyn X + 'static)> - found std::boxed::Box +note: ...so that the expression is assignable + --> $DIR/regions-close-object-into-object-4.rs:10:5 + | +LL | box B(&*v) as Box + | ^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `std::boxed::Box<(dyn X + 'static)>` + found `std::boxed::Box` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr index ef21316ea83ae..b2a7afaf1b452 100644 --- a/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr +++ b/src/test/ui/regions/regions-close-over-type-parameter-multiple.stderr @@ -19,9 +19,13 @@ note: but, the lifetime must be valid for the lifetime `'c` as defined on the fu | LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box { | ^^ - = note: ...so that the expression is assignable: - expected std::boxed::Box<(dyn SomeTrait + 'c)> - found std::boxed::Box +note: ...so that the expression is assignable + --> $DIR/regions-close-over-type-parameter-multiple.rs:20:5 + | +LL | box v as Box + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `std::boxed::Box<(dyn SomeTrait + 'c)>` + found `std::boxed::Box` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-creating-enums4.stderr b/src/test/ui/regions/regions-creating-enums4.stderr index 12b89787d5f18..58f74e4ee142d 100644 --- a/src/test/ui/regions/regions-creating-enums4.stderr +++ b/src/test/ui/regions/regions-creating-enums4.stderr @@ -9,17 +9,25 @@ note: first, the lifetime cannot outlive the lifetime `'a` as defined on the fun | LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { | ^^ - = note: ...so that the expression is assignable: - expected &Ast<'_> - found &Ast<'a> +note: ...so that the expression is assignable + --> $DIR/regions-creating-enums4.rs:7:14 + | +LL | Ast::Add(x, y) + | ^ + = note: expected `&Ast<'_>` + found `&Ast<'a>` note: but, the lifetime must be valid for the lifetime `'b` as defined on the function body at 6:19... --> $DIR/regions-creating-enums4.rs:6:19 | LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> { | ^^ - = note: ...so that the expression is assignable: - expected Ast<'b> - found Ast<'_> +note: ...so that the expression is assignable + --> $DIR/regions-creating-enums4.rs:7:5 + | +LL | Ast::Add(x, y) + | ^^^^^^^^^^^^^^ + = note: expected `Ast<'b>` + found `Ast<'_>` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-escape-method.stderr b/src/test/ui/regions/regions-escape-method.stderr index b93dd0d4c57c9..ffc2a259485aa 100644 --- a/src/test/ui/regions/regions-escape-method.stderr +++ b/src/test/ui/regions/regions-escape-method.stderr @@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th | LL | s.f(|p| p) | ^^^^^ - = note: ...so that the expression is assignable: - expected &i32 - found &i32 +note: ...so that the expression is assignable + --> $DIR/regions-escape-method.rs:15:13 + | +LL | s.f(|p| p) + | ^ + = note: expected `&i32` + found `&i32` note: but, the lifetime must be valid for the method call at 15:5... --> $DIR/regions-escape-method.rs:15:5 | diff --git a/src/test/ui/regions/regions-escape-via-trait-or-not.stderr b/src/test/ui/regions/regions-escape-via-trait-or-not.stderr index a6b165e2d4444..90823464c56d2 100644 --- a/src/test/ui/regions/regions-escape-via-trait-or-not.stderr +++ b/src/test/ui/regions/regions-escape-via-trait-or-not.stderr @@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th | LL | with(|o| o) | ^^^^^ - = note: ...so that the expression is assignable: - expected &isize - found &isize +note: ...so that the expression is assignable + --> $DIR/regions-escape-via-trait-or-not.rs:18:14 + | +LL | with(|o| o) + | ^ + = note: expected `&isize` + found `&isize` note: but, the lifetime must be valid for the expression at 18:5... --> $DIR/regions-escape-via-trait-or-not.rs:18:5 | diff --git a/src/test/ui/regions/regions-nested-fns.stderr b/src/test/ui/regions/regions-nested-fns.stderr index f4eb5c8644f03..8fce1609d7830 100644 --- a/src/test/ui/regions/regions-nested-fns.stderr +++ b/src/test/ui/regions/regions-nested-fns.stderr @@ -29,9 +29,18 @@ LL | | if false { return ay; } LL | | return z; LL | | })); | |_____^ - = note: ...so that the types are compatible: - expected &isize - found &isize +note: ...so that the types are compatible + --> $DIR/regions-nested-fns.rs:13:76 + | +LL | ignore::< Box FnMut(&'z isize) -> &'z isize>>(Box::new(|z| { + | ____________________________________________________________________________^ +LL | | if false { return x; } +LL | | if false { return ay; } +LL | | return z; +LL | | })); + | |_____^ + = note: expected `&isize` + found `&isize` error[E0312]: lifetime of reference outlives lifetime of borrowed content... --> $DIR/regions-nested-fns.rs:14:27 diff --git a/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr b/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr index d29fd80943f73..8a600d2a1e695 100644 --- a/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr +++ b/src/test/ui/regions/regions-normalize-in-where-clause-list.stderr @@ -17,9 +17,16 @@ note: ...but the lifetime must also be valid for the lifetime `'b` as defined on | LL | fn bar<'a, 'b>() | ^^ - = note: ...so that the types are compatible: - expected Project<'a, 'b> - found Project<'_, '_> +note: ...so that the types are compatible + --> $DIR/regions-normalize-in-where-clause-list.rs:22:1 + | +LL | / fn bar<'a, 'b>() +LL | | where <() as Project<'a, 'b>>::Item : Eq +LL | | { +LL | | } + | |_^ + = note: expected `Project<'a, 'b>` + found `Project<'_, '_>` error: aborting due to previous error diff --git a/src/test/ui/regions/regions-ret-borrowed-1.stderr b/src/test/ui/regions/regions-ret-borrowed-1.stderr index 49076673ad398..2895a0ccdeec8 100644 --- a/src/test/ui/regions/regions-ret-borrowed-1.stderr +++ b/src/test/ui/regions/regions-ret-borrowed-1.stderr @@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th | LL | with(|o| o) | ^^^^^ - = note: ...so that the expression is assignable: - expected &isize - found &isize +note: ...so that the expression is assignable + --> $DIR/regions-ret-borrowed-1.rs:10:14 + | +LL | with(|o| o) + | ^ + = note: expected `&isize` + found `&isize` note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 9:14... --> $DIR/regions-ret-borrowed-1.rs:9:14 | diff --git a/src/test/ui/regions/regions-ret-borrowed.stderr b/src/test/ui/regions/regions-ret-borrowed.stderr index eb1ade27acea7..b74f10f5075eb 100644 --- a/src/test/ui/regions/regions-ret-borrowed.stderr +++ b/src/test/ui/regions/regions-ret-borrowed.stderr @@ -9,9 +9,13 @@ note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on th | LL | with(|o| o) | ^^^^^ - = note: ...so that the expression is assignable: - expected &isize - found &isize +note: ...so that the expression is assignable + --> $DIR/regions-ret-borrowed.rs:13:14 + | +LL | with(|o| o) + | ^ + = note: expected `&isize` + found `&isize` note: but, the lifetime must be valid for the lifetime `'a` as defined on the function body at 12:14... --> $DIR/regions-ret-borrowed.rs:12:14 | diff --git a/src/test/ui/regions/regions-trait-object-subtyping.stderr b/src/test/ui/regions/regions-trait-object-subtyping.stderr index ef69f2535dc1e..58b79d212700c 100644 --- a/src/test/ui/regions/regions-trait-object-subtyping.stderr +++ b/src/test/ui/regions/regions-trait-object-subtyping.stderr @@ -36,9 +36,13 @@ note: but, the lifetime must be valid for the lifetime `'b` as defined on the fu | LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy { | ^^ - = note: ...so that the expression is assignable: - expected &'b mut (dyn Dummy + 'b) - found &mut (dyn Dummy + 'b) +note: ...so that the expression is assignable + --> $DIR/regions-trait-object-subtyping.rs:15:5 + | +LL | x + | ^ + = note: expected `&'b mut (dyn Dummy + 'b)` + found `&mut (dyn Dummy + 'b)` error[E0308]: mismatched types --> $DIR/regions-trait-object-subtyping.rs:22:5 diff --git a/src/test/ui/reject-specialized-drops-8142.stderr b/src/test/ui/reject-specialized-drops-8142.stderr index e55f0232ff94b..527babb01208f 100644 --- a/src/test/ui/reject-specialized-drops-8142.stderr +++ b/src/test/ui/reject-specialized-drops-8142.stderr @@ -105,9 +105,13 @@ note: ...but the lifetime must also be valid for the lifetime `'l2` as defined o | LL | struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 } | ^^^ - = note: ...so that the types are compatible: - expected W<'l1, 'l2> - found W<'_, '_> +note: ...so that the types are compatible + --> $DIR/reject-specialized-drops-8142.rs:54:1 + | +LL | impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `W<'l1, 'l2>` + found `W<'_, '_>` error: aborting due to 8 previous errors diff --git a/src/test/ui/suggestions/raw-name-use-suggestion.rs b/src/test/ui/suggestions/raw-name-use-suggestion.rs index 6c01383d9610d..0a8073c0be2ea 100644 --- a/src/test/ui/suggestions/raw-name-use-suggestion.rs +++ b/src/test/ui/suggestions/raw-name-use-suggestion.rs @@ -5,5 +5,5 @@ mod foo { fn main() { foo::let(); //~ ERROR expected identifier, found keyword `let` - r#break(); //~ ERROR cannot find function `break` in this scope + r#break(); //~ ERROR cannot find function `r#break` in this scope } diff --git a/src/test/ui/suggestions/raw-name-use-suggestion.stderr b/src/test/ui/suggestions/raw-name-use-suggestion.stderr index 58eb87c00a411..62b76318e09b5 100644 --- a/src/test/ui/suggestions/raw-name-use-suggestion.stderr +++ b/src/test/ui/suggestions/raw-name-use-suggestion.stderr @@ -20,7 +20,7 @@ help: you can escape reserved keywords to use them as identifiers LL | foo::r#let(); | ^^^^^ -error[E0425]: cannot find function `break` in this scope +error[E0425]: cannot find function `r#break` in this scope --> $DIR/raw-name-use-suggestion.rs:8:5 | LL | r#break(); diff --git a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr b/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr index 88c9c473eb0c7..9fdcd4de495c0 100644 --- a/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr +++ b/src/test/ui/traits/trait-impl-of-supertrait-has-wrong-lifetime-parameters.stderr @@ -14,9 +14,13 @@ note: ...but the lifetime must also be valid for the lifetime `'b` as defined on | LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { | ^^ - = note: ...so that the types are compatible: - expected T1<'a> - found T1<'_> +note: ...so that the types are compatible + --> $DIR/trait-impl-of-supertrait-has-wrong-lifetime-parameters.rs:24:13 + | +LL | impl<'a,'b> T2<'a, 'b> for S<'a, 'b> { + | ^^^^^^^^^^ + = note: expected `T1<'a>` + found `T1<'_>` error: aborting due to previous error diff --git a/src/test/ui/type/type-check-defaults.rs b/src/test/ui/type/type-check-defaults.rs index 5748c9bcff8cb..5380fae5417e4 100644 --- a/src/test/ui/type/type-check-defaults.rs +++ b/src/test/ui/type/type-check-defaults.rs @@ -4,9 +4,9 @@ use std::ops::Add; struct Foo>(T, U); struct WellFormed>(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); -//~^ 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); //~^ ERROR the trait bound `std::string::String: std::marker::Copy` is not satisfied [E0277] diff --git a/src/test/ui/type/type-check-defaults.stderr b/src/test/ui/type/type-check-defaults.stderr index 6802bc38b89c9..6f84b37d61249 100644 --- a/src/test/ui/type/type-check-defaults.stderr +++ b/src/test/ui/type/type-check-defaults.stderr @@ -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); | ---------------------------------------- required by `Foo` LL | struct WellFormed>(Z); - | ^ a collection of type `i32` cannot be built from `std::iter::Iterator` + | ^ value of type `i32` cannot be built from `std::iter::Iterator` | = help: the trait `std::iter::FromIterator` 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); | ---------------------------------------- required by `Foo` ... LL | struct WellFormedNoBounds>(Z); - | ^ a collection of type `i32` cannot be built from `std::iter::Iterator` + | ^ value of type `i32` cannot be built from `std::iter::Iterator` | = help: the trait `std::iter::FromIterator` is not implemented for `i32` diff --git a/src/test/ui/type/type-dependent-def-issue-49241.rs b/src/test/ui/type/type-dependent-def-issue-49241.rs index 5ad50ffcbc389..a25e3ba5fa89f 100644 --- a/src/test/ui/type/type-dependent-def-issue-49241.rs +++ b/src/test/ui/type/type-dependent-def-issue-49241.rs @@ -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 } diff --git a/src/test/ui/type/type-dependent-def-issue-49241.stderr b/src/test/ui/type/type-dependent-def-issue-49241.stderr index 851004d105897..18a69c50ebd6d 100644 --- a/src/test/ui/type/type-dependent-def-issue-49241.stderr +++ b/src/test/ui/type/type-dependent-def-issue-49241.stderr @@ -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` + | ^^^^^^^ value of type `[u32; _]` cannot be built from `std::iter::Iterator` | = help: the trait `std::iter::FromIterator<{integer}>` is not implemented for `[u32; _]` diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr index d0475bf08c38d..e6029e0d4623a 100644 --- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr +++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr @@ -18,9 +18,13 @@ note: ...so that reference does not outlive borrowed content LL | Box::new(items.iter()) | ^^^^^ = note: but, the lifetime must be valid for the static lifetime... - = note: ...so that the expression is assignable: - expected std::boxed::Box<(dyn std::iter::Iterator + 'static)> - found std::boxed::Box> +note: ...so that the expression is assignable + --> $DIR/dyn-trait-underscore.rs:8:5 + | +LL | Box::new(items.iter()) + | ^^^^^^^^^^^^^^^^^^^^^^ + = note: expected `std::boxed::Box<(dyn std::iter::Iterator + 'static)>` + found `std::boxed::Box>` error: aborting due to previous error