From 660f585413943df8e5026310cc579047ca8d0cb5 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts Date: Thu, 4 Feb 2021 01:25:43 +0100 Subject: [PATCH 01/14] Add `core::stream::from_iter` --- library/core/src/stream/from_iter.rs | 38 ++++++++++++++++++++++++++++ library/core/src/stream/mod.rs | 2 ++ 2 files changed, 40 insertions(+) create mode 100644 library/core/src/stream/from_iter.rs diff --git a/library/core/src/stream/from_iter.rs b/library/core/src/stream/from_iter.rs new file mode 100644 index 0000000000000..eb9a0fd284257 --- /dev/null +++ b/library/core/src/stream/from_iter.rs @@ -0,0 +1,38 @@ +use crate::pin::Pin; + +use crate::stream::Stream; +use crate::task::{Context, Poll}; + +/// A stream that was created from iterator. +/// +/// This stream is created by the [`from_iter`] function. +/// See it documentation for more. +/// +/// [`from_iter`]: fn.from_iter.html +#[unstable(feature = "stream_from_iter", issue = "81798")] +#[derive(Clone, Debug)] +pub struct FromIter { + iter: I, +} + +#[unstable(feature = "stream_from_iter", issue = "81798")] +impl Unpin for FromIter {} + +/// Converts an iterator into a stream. +#[unstable(feature = "stream_from_iter", issue = "81798")] +pub fn from_iter(iter: I) -> FromIter { + FromIter { iter: iter.into_iter() } +} + +#[unstable(feature = "stream_from_iter", issue = "81798")] +impl Stream for FromIter { + type Item = I::Item; + + fn poll_next(mut self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(self.iter.next()) + } + + fn size_hint(&self) -> (usize, Option) { + self.iter.size_hint() + } +} diff --git a/library/core/src/stream/mod.rs b/library/core/src/stream/mod.rs index 0df18af65ebf0..58dc8e1e5e606 100644 --- a/library/core/src/stream/mod.rs +++ b/library/core/src/stream/mod.rs @@ -122,6 +122,8 @@ //! warning: unused result that must be used: streams do nothing unless polled //! ``` +mod from_iter; mod stream; +pub use from_iter::{from_iter, FromIter}; pub use stream::Stream; From ee300b684bb342c28094b3d8e492995b6a76a03c Mon Sep 17 00:00:00 2001 From: Fabian Wolff Date: Thu, 10 Jun 2021 13:52:00 +0200 Subject: [PATCH 02/14] Remove trailing whitespace from error messages --- compiler/rustc_errors/src/emitter.rs | 7 ++- .../bad-bounds-on-assoc-in-trait.stderr | 6 +-- .../bounds-on-assoc-in-trait.stderr | 4 +- .../ui/associated-types/defaults-wf.stderr | 2 +- ...with-supertraits-needing-sized-self.stderr | 2 +- src/test/ui/async-await/generator-desc.stderr | 2 +- src/test/ui/async-await/issue-72442.stderr | 2 +- .../ui/async-await/issues/issue-67893.stderr | 2 +- .../ui/async-await/pin-needed-to-poll.stderr | 2 +- .../ui/borrowck/move-error-snippets.stderr | 2 +- src/test/ui/bound-suggestions.stderr | 10 ++-- .../builtin-superkinds-in-metadata.stderr | 2 +- src/test/ui/c-variadic/issue-86053-1.stderr | 2 +- src/test/ui/closures/closure-move-sync.stderr | 4 +- .../const-argument-if-length.full.stderr | 2 +- .../cross_crate_predicate.stderr | 8 ++-- .../ui/const-ptr/out_of_bounds_read.stderr | 16 +++---- .../consts/const_unsafe_unreachable_ub.stderr | 2 +- src/test/ui/consts/miri_unleashed/drop.stderr | 2 +- src/test/ui/consts/offset_from_ub.stderr | 2 +- src/test/ui/consts/offset_ub.stderr | 24 +++++----- src/test/ui/consts/ptr_comparisons.stderr | 2 +- .../ui/cross/cross-file-errors/main.stderr | 4 +- ...derives-span-Eq-enum-struct-variant.stderr | 2 +- .../ui/derives/derives-span-Eq-enum.stderr | 2 +- .../ui/derives/derives-span-Eq-struct.stderr | 2 +- .../derives-span-Eq-tuple-struct.stderr | 2 +- ...rives-span-Hash-enum-struct-variant.stderr | 2 +- .../ui/derives/derives-span-Hash-enum.stderr | 2 +- .../derives/derives-span-Hash-struct.stderr | 2 +- .../derives-span-Hash-tuple-struct.stderr | 2 +- .../deriving-meta-unknown-trait.stderr | 4 +- .../edition-keywords-2018-2015-parsing.stderr | 2 +- .../edition-keywords-2018-2018-parsing.stderr | 2 +- .../ui/empty/empty-struct-braces-expr.stderr | 8 ++-- .../ui/empty/empty-struct-braces-pat-1.stderr | 2 +- .../ui/empty/empty-struct-braces-pat-2.stderr | 8 ++-- .../ui/empty/empty-struct-braces-pat-3.stderr | 4 +- .../ui/empty/empty-struct-tuple-pat.stderr | 2 +- .../ui/empty/empty-struct-unit-pat.stderr | 12 ++--- src/test/ui/error-codes/E0004-2.stderr | 2 +- src/test/ui/error-codes/E0005.stderr | 2 +- src/test/ui/error-codes/E0297.stderr | 2 +- src/test/ui/explore-issue-38412.stderr | 12 ++--- ...feature-gate-associated_type_bounds.stderr | 2 +- .../feature-gate-exhaustive-patterns.stderr | 2 +- src/test/ui/generator/sized-yield.stderr | 2 +- .../cross-crate-bounds.stderr | 2 +- .../impl-trait/impl-generic-mismatch.stderr | 2 +- .../ui/impl-trait/issues/issue-78722.stderr | 2 +- .../no-method-suggested-traits.stderr | 2 +- .../mismatched_trait_impl-2.stderr | 2 +- .../interior-mutability.stderr | 2 +- src/test/ui/issues/issue-17546.stderr | 4 +- src/test/ui/issues/issue-20433.stderr | 2 +- src/test/ui/issues/issue-21160.stderr | 2 +- src/test/ui/issues/issue-21202.stderr | 2 +- src/test/ui/issues/issue-27033.stderr | 2 +- src/test/ui/issues/issue-31173.stderr | 4 +- src/test/ui/issues/issue-43189.stderr | 2 +- src/test/ui/issues/issue-56175.stderr | 4 +- src/test/ui/issues/issue-60283.stderr | 2 +- src/test/ui/issues/issue-69725.stderr | 2 +- src/test/ui/issues/issue-7607-1.stderr | 2 +- src/test/ui/issues/issue-78720.stderr | 2 +- src/test/ui/limits/issue-55878.stderr | 2 +- .../main.-Zmacro-backtrace.stderr | 4 +- src/test/ui/macros/macro-name-typo.stderr | 2 +- .../macros/macro-path-prelude-fail-3.stderr | 2 +- .../ui/macros/macro-use-wrong-name.stderr | 2 +- .../malformed/malformed-derive-entry.stderr | 4 +- src/test/ui/mir/issue-80742.stderr | 6 +-- .../ui/mismatched_types/issue-36053-2.stderr | 2 +- src/test/ui/namespace/namespace-mix.stderr | 4 +- src/test/ui/no-send-res-ports.stderr | 2 +- src/test/ui/parser/issue-62894.stderr | 2 +- .../usefulness/match-arm-statics-2.stderr | 2 +- .../usefulness/match-privately-empty.stderr | 2 +- .../usefulness/non-exhaustive-match.stderr | 2 +- src/test/ui/privacy/privacy5.stderr | 48 +++++++++---------- .../privacy/private-method-cross-crate.stderr | 2 +- src/test/ui/privacy/restricted/test.stderr | 4 +- .../group-compat-hack.stderr | 20 ++++---- .../ui/proc-macro/parent-source-spans.stderr | 6 +-- src/test/ui/proc-macro/resolve-error.stderr | 16 +++---- .../ui/proc-macro/span-from-proc-macro.stderr | 8 ++-- src/test/ui/range/range-1.stderr | 2 +- ...recursive-types-are-not-uninhabited.stderr | 2 +- src/test/ui/resolve/issue-19452.stderr | 2 +- src/test/ui/resolve/levenshtein.stderr | 2 +- .../ui/resolve/privacy-struct-ctor.stderr | 4 +- .../termination-trait-test-wrong-type.stderr | 2 +- .../ui/rfc-2008-non-exhaustive/struct.stderr | 2 +- .../uninhabited/match.stderr | 2 +- .../match_with_exhaustive_patterns.stderr | 2 +- .../future-prelude-collision-shadow.stderr | 2 +- src/test/ui/span/transitive-dep-span.stderr | 2 +- .../ui/suggestions/attribute-typos.stderr | 2 +- ...-to-add-suggestions-with-no-changes.stderr | 2 +- .../expected-boxed-future-isnt-pinned.stderr | 2 +- .../suggestions/imm-ref-trait-object.stderr | 2 +- .../import-trait-for-method-call.stderr | 2 +- .../mut-borrow-needed-by-trait.stderr | 4 +- .../ui/suggestions/suggest-change-mut.stderr | 2 +- .../assoc_type_bound_with_struct.stderr | 8 ++-- src/test/ui/traits/bad-sized.stderr | 4 +- .../bound/on-structs-and-enums-xc.stderr | 4 +- .../bound/on-structs-and-enums-xc1.stderr | 2 +- .../ui/traits/bound/same-crate-name.stderr | 8 ++-- .../mutual-recursion-issue-75860.stderr | 2 +- .../suggest-deferences/issue-39029.stderr | 2 +- .../ui/traits/suggest-where-clause.stderr | 8 ++-- src/test/ui/typeck/issue-83693.stderr | 2 +- .../uninhabited-matches-feature-gated.stderr | 6 +-- .../union-derive-clone.mirunsafeck.stderr | 2 +- .../union-derive-clone.thirunsafeck.stderr | 2 +- .../union/union-derive-eq.mirunsafeck.stderr | 2 +- .../union/union-derive-eq.thirunsafeck.stderr | 2 +- src/test/ui/unique-object-noncopyable.stderr | 2 +- src/test/ui/unique-pinned-nocopy.stderr | 2 +- src/test/ui/wf/wf-impl-self-type.stderr | 2 +- src/test/ui/xc-private-method.stderr | 4 +- src/test/ui/xc-private-method2.stderr | 4 +- src/test/ui/xcrate/xcrate-unit-struct.stderr | 2 +- 124 files changed, 246 insertions(+), 243 deletions(-) diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index 87272b1605b79..050f3ae583371 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -954,7 +954,6 @@ impl EmitterWriter { // | for pos in 0..=line_len { draw_col_separator(buffer, line_offset + pos + 1, width_offset - 2); - buffer.putc(line_offset + pos + 1, width_offset - 2, '|', Style::LineNumber); } // Write the horizontal lines for multiline annotations @@ -1344,7 +1343,11 @@ impl EmitterWriter { let buffer_msg_line_offset = buffer.num_lines(); // Add spacing line - draw_col_separator(&mut buffer, buffer_msg_line_offset, max_line_num_len + 1); + draw_col_separator_no_space( + &mut buffer, + buffer_msg_line_offset, + max_line_num_len + 1, + ); // Then, the secondary file indicator buffer.prepend(buffer_msg_line_offset + 1, "::: ", Style::LineNumber); diff --git a/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr b/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr index a5ebb80c83620..bf18eee4e07ed 100644 --- a/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr +++ b/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr @@ -3,7 +3,7 @@ error[E0277]: `<::C as Iterator>::Item` cannot be sent between th | LL | type C: Clone + Iterator Lam<&'a u8, App: Debug>> + Sync>; | ^^^^ `<::C as Iterator>::Item` cannot be sent between threads safely - | + | ::: $SRC_DIR/core/src/marker.rs:LL:COL | LL | pub unsafe auto trait Send { @@ -20,7 +20,7 @@ error[E0277]: `<::C as Iterator>::Item` is not an iterator | LL | type C: Clone + Iterator Lam<&'a u8, App: Debug>> + Sync>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `<::C as Iterator>::Item` is not an iterator - | + | ::: $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | LL | pub trait Iterator { @@ -37,7 +37,7 @@ error[E0277]: `<::C as Iterator>::Item` cannot be shared between | LL | type C: Clone + Iterator Lam<&'a u8, App: Debug>> + Sync>; | ^^^^ `<::C as Iterator>::Item` cannot be shared between threads safely - | + | ::: $SRC_DIR/core/src/marker.rs:LL:COL | LL | pub unsafe auto trait Sync { diff --git a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr index 919b18632e61c..46d472cdf80db 100644 --- a/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr +++ b/src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.stderr @@ -3,7 +3,7 @@ error[E0277]: `<::A as Iterator>::Item` doesn't implement `Debug` | LL | type A: Iterator; | ^^^^^ `<::A as Iterator>::Item` cannot be formatted using `{:?}` because it doesn't implement `Debug` - | + | ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL | LL | pub trait Debug { @@ -20,7 +20,7 @@ error[E0277]: the trait bound `<::Out as Baz>::Assoc: Default` is n | LL | pub trait Foo { type Out: Baz; } | ^^^^^^^ the trait `Default` is not implemented for `<::Out as Baz>::Assoc` - | + | ::: $SRC_DIR/core/src/default.rs:LL:COL | LL | pub trait Default: Sized { diff --git a/src/test/ui/associated-types/defaults-wf.stderr b/src/test/ui/associated-types/defaults-wf.stderr index 73ef567ffae6d..e837150c05d8b 100644 --- a/src/test/ui/associated-types/defaults-wf.stderr +++ b/src/test/ui/associated-types/defaults-wf.stderr @@ -3,7 +3,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | LL | type Ty = Vec<[u8]>; | ^^^^^^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL | LL | pub struct Vec { diff --git a/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr b/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr index 8fdca54d2d8b8..0afc380293370 100644 --- a/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr +++ b/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.stderr @@ -3,7 +3,7 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation | LL | trait ArithmeticOps: Add + Sub + Mul + Div {} | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/ops/arith.rs:LL:COL | LL | pub trait Add { diff --git a/src/test/ui/async-await/generator-desc.stderr b/src/test/ui/async-await/generator-desc.stderr index a7aedbb2b322f..d75e927696e10 100644 --- a/src/test/ui/async-await/generator-desc.stderr +++ b/src/test/ui/async-await/generator-desc.stderr @@ -37,7 +37,7 @@ LL | fun((async || {})(), (async || {})()); | -- ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body | | | the expected `async` closure body - | + | ::: $SRC_DIR/core/src/future/mod.rs:LL:COL | LL | pub const fn from_generator(gen: T) -> impl Future diff --git a/src/test/ui/async-await/issue-72442.stderr b/src/test/ui/async-await/issue-72442.stderr index 52245b63128ab..b586207a25ffd 100644 --- a/src/test/ui/async-await/issue-72442.stderr +++ b/src/test/ui/async-await/issue-72442.stderr @@ -3,7 +3,7 @@ error[E0277]: the trait bound `Option<&str>: AsRef` is not satisfied | LL | let mut f = File::open(path.to_str())?; | ^^^^^^^^^^^^^ the trait `AsRef` is not implemented for `Option<&str>` - | + | ::: $SRC_DIR/std/src/fs.rs:LL:COL | LL | pub fn open>(path: P) -> io::Result { diff --git a/src/test/ui/async-await/issues/issue-67893.stderr b/src/test/ui/async-await/issues/issue-67893.stderr index ea5c90a81d4f9..39e50a106acab 100644 --- a/src/test/ui/async-await/issues/issue-67893.stderr +++ b/src/test/ui/async-await/issues/issue-67893.stderr @@ -6,7 +6,7 @@ LL | fn g(_: impl Send) {} ... LL | g(issue_67893::run()) | ^ `MutexGuard<'_, ()>` cannot be sent between threads safely - | + | ::: $DIR/auxiliary/issue_67893.rs:7:20 | LL | pub async fn run() { diff --git a/src/test/ui/async-await/pin-needed-to-poll.stderr b/src/test/ui/async-await/pin-needed-to-poll.stderr index 0756a4d59c19b..0714e666d387f 100644 --- a/src/test/ui/async-await/pin-needed-to-poll.stderr +++ b/src/test/ui/async-await/pin-needed-to-poll.stderr @@ -6,7 +6,7 @@ LL | struct Sleep; ... LL | self.sleep.poll(cx) | ^^^^ method not found in `Sleep` - | + | ::: $SRC_DIR/core/src/future/future.rs:LL:COL | LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll; diff --git a/src/test/ui/borrowck/move-error-snippets.stderr b/src/test/ui/borrowck/move-error-snippets.stderr index 7821dc02bde3c..e7ecd0079f08d 100644 --- a/src/test/ui/borrowck/move-error-snippets.stderr +++ b/src/test/ui/borrowck/move-error-snippets.stderr @@ -6,7 +6,7 @@ LL | let a = $c; | | | move occurs because `D` has type `A`, which does not implement the `Copy` trait | help: consider borrowing here: `&$c` - | + | ::: $DIR/move-error-snippets.rs:21:1 | LL | sss!(); diff --git a/src/test/ui/bound-suggestions.stderr b/src/test/ui/bound-suggestions.stderr index 78f62592960ff..14e28174a295d 100644 --- a/src/test/ui/bound-suggestions.stderr +++ b/src/test/ui/bound-suggestions.stderr @@ -75,7 +75,7 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { @@ -91,7 +91,7 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { @@ -107,7 +107,7 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { @@ -123,7 +123,7 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { @@ -139,7 +139,7 @@ error[E0277]: the size for values of type `Self` cannot be known at compilation | LL | const SIZE: usize = core::mem::size_of::(); | ^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { diff --git a/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr b/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr index 0d1d747272d18..64946c316cd1e 100644 --- a/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr +++ b/src/test/ui/builtin-superkinds/builtin-superkinds-in-metadata.stderr @@ -3,7 +3,7 @@ error[E0277]: `T` cannot be sent between threads safely | LL | impl RequiresRequiresShareAndSend for X { } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `T` cannot be sent between threads safely - | + | ::: $DIR/auxiliary/trait_superkinds_in_metadata.rs:7:58 | LL | pub trait RequiresRequiresShareAndSend : RequiresShare + Send { } diff --git a/src/test/ui/c-variadic/issue-86053-1.stderr b/src/test/ui/c-variadic/issue-86053-1.stderr index ec7ee74aef29a..b399f729f6506 100644 --- a/src/test/ui/c-variadic/issue-86053-1.stderr +++ b/src/test/ui/c-variadic/issue-86053-1.stderr @@ -63,7 +63,7 @@ error[E0412]: cannot find type `F` in this scope | LL | self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { | ^ - | + | ::: $SRC_DIR/core/src/ops/function.rs:LL:COL | LL | pub trait Fn: FnMut { diff --git a/src/test/ui/closures/closure-move-sync.stderr b/src/test/ui/closures/closure-move-sync.stderr index da5e25c0d18fa..b4e5db74e0348 100644 --- a/src/test/ui/closures/closure-move-sync.stderr +++ b/src/test/ui/closures/closure-move-sync.stderr @@ -3,7 +3,7 @@ error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads s | LL | let t = thread::spawn(|| { | ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely - | + | ::: $SRC_DIR/std/src/thread/mod.rs:LL:COL | LL | F: Send + 'static, @@ -18,7 +18,7 @@ error[E0277]: `Sender<()>` cannot be shared between threads safely | LL | thread::spawn(|| tx.send(()).unwrap()); | ^^^^^^^^^^^^^ `Sender<()>` cannot be shared between threads safely - | + | ::: $SRC_DIR/std/src/thread/mod.rs:LL:COL | LL | F: Send + 'static, diff --git a/src/test/ui/const-generics/const-argument-if-length.full.stderr b/src/test/ui/const-generics/const-argument-if-length.full.stderr index a9f1d0eb65718..cc2c9c8681bcc 100644 --- a/src/test/ui/const-generics/const-argument-if-length.full.stderr +++ b/src/test/ui/const-generics/const-argument-if-length.full.stderr @@ -5,7 +5,7 @@ LL | pub const fn is_zst() -> usize { | - this type parameter needs to be `std::marker::Sized` LL | if std::mem::size_of::() == 0 { | ^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { diff --git a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr b/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr index 84b2665d5bfed..ce7ec4d90b6bf 100644 --- a/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr +++ b/src/test/ui/const-generics/const_evaluatable_checked/cross_crate_predicate.stderr @@ -3,7 +3,7 @@ error: unconstrained generic constant | LL | let _ = const_evaluatable_lib::test1::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/const_evaluatable_lib.rs:6:10 | LL | [u8; std::mem::size_of::() - 1]: Sized, @@ -16,7 +16,7 @@ error: unconstrained generic constant | LL | let _ = const_evaluatable_lib::test1::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/const_evaluatable_lib.rs:4:27 | LL | pub fn test1() -> [u8; std::mem::size_of::() - 1] @@ -29,7 +29,7 @@ error: unconstrained generic constant | LL | let _ = const_evaluatable_lib::test1::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/const_evaluatable_lib.rs:6:10 | LL | [u8; std::mem::size_of::() - 1]: Sized, @@ -42,7 +42,7 @@ error: unconstrained generic constant | LL | let _ = const_evaluatable_lib::test1::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/const_evaluatable_lib.rs:4:27 | LL | pub fn test1() -> [u8; std::mem::size_of::() - 1] diff --git a/src/test/ui/const-ptr/out_of_bounds_read.stderr b/src/test/ui/const-ptr/out_of_bounds_read.stderr index 92541779213a4..04503495bc62a 100644 --- a/src/test/ui/const-ptr/out_of_bounds_read.stderr +++ b/src/test/ui/const-ptr/out_of_bounds_read.stderr @@ -6,12 +6,12 @@ LL | unsafe { copy_nonoverlapping(src, dst, count) } | | | memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds | inside `copy_nonoverlapping::` at $SRC_DIR/core/src/intrinsics.rs:LL:COL - | + | ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL | LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); | --------------------------------------------- inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | + | ::: $DIR/out_of_bounds_read.rs:13:33 | LL | const _READ: u32 = unsafe { ptr::read(PAST_END_PTR) }; @@ -25,17 +25,17 @@ LL | unsafe { copy_nonoverlapping(src, dst, count) } | | | memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds | inside `copy_nonoverlapping::` at $SRC_DIR/core/src/intrinsics.rs:LL:COL - | + | ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL | LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); | --------------------------------------------- inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | + | ::: $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL | LL | unsafe { read(self) } | ---------- inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/out_of_bounds_read.rs:14:39 | LL | const _CONST_READ: u32 = unsafe { PAST_END_PTR.read() }; @@ -49,17 +49,17 @@ LL | unsafe { copy_nonoverlapping(src, dst, count) } | | | memory access failed: alloc7 has size 4, so pointer to 4 bytes starting at offset 4 is out-of-bounds | inside `copy_nonoverlapping::` at $SRC_DIR/core/src/intrinsics.rs:LL:COL - | + | ::: $SRC_DIR/core/src/ptr/mod.rs:LL:COL | LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); | --------------------------------------------- inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | + | ::: $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL | LL | unsafe { read(self) } | ---------- inside `ptr::mut_ptr::::read` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - | + | ::: $DIR/out_of_bounds_read.rs:15:37 | LL | const _MUT_READ: u32 = unsafe { (PAST_END_PTR as *mut u32).read() }; diff --git a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr index ecdd0ca3f54c1..65cb3d74b233e 100644 --- a/src/test/ui/consts/const_unsafe_unreachable_ub.stderr +++ b/src/test/ui/consts/const_unsafe_unreachable_ub.stderr @@ -6,7 +6,7 @@ LL | unsafe { intrinsics::unreachable() } | | | entering unreachable code | inside `unreachable_unchecked` at $SRC_DIR/core/src/hint.rs:LL:COL - | + | ::: $DIR/const_unsafe_unreachable_ub.rs:7:18 | LL | false => std::hint::unreachable_unchecked(), diff --git a/src/test/ui/consts/miri_unleashed/drop.stderr b/src/test/ui/consts/miri_unleashed/drop.stderr index f79dc454a83a0..36db6b7865af2 100644 --- a/src/test/ui/consts/miri_unleashed/drop.stderr +++ b/src/test/ui/consts/miri_unleashed/drop.stderr @@ -6,7 +6,7 @@ LL | pub unsafe fn drop_in_place(to_drop: *mut T) { | | | calling non-const function ` as Drop>::drop` | inside `std::ptr::drop_in_place::> - shim(Some(Vec))` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL - | + | ::: $DIR/drop.rs:18:1 | LL | }; diff --git a/src/test/ui/consts/offset_from_ub.stderr b/src/test/ui/consts/offset_from_ub.stderr index 663bfbdade0ce..2478ff081d770 100644 --- a/src/test/ui/consts/offset_from_ub.stderr +++ b/src/test/ui/consts/offset_from_ub.stderr @@ -12,7 +12,7 @@ LL | unsafe { intrinsics::ptr_offset_from(self, origin) } | | | 0x2a is not a valid pointer | inside `ptr::const_ptr::::offset_from` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_from_ub.rs:24:14 | LL | unsafe { (42 as *const u8).offset_from(&5u8) as usize } diff --git a/src/test/ui/consts/offset_ub.stderr b/src/test/ui/consts/offset_ub.stderr index 66a2722ed4acd..4c3f373e0801c 100644 --- a/src/test/ui/consts/offset_ub.stderr +++ b/src/test/ui/consts/offset_ub.stderr @@ -6,7 +6,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | overflowing in-bounds pointer arithmetic | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:8:46 | LL | pub const BEFORE_START: *const u8 = unsafe { (&0u8 as *const u8).offset(-1) }; @@ -20,7 +20,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | pointer arithmetic failed: allocN has size 1, so pointer to 2 bytes starting at offset 0 is out-of-bounds | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:9:43 | LL | pub const AFTER_END: *const u8 = unsafe { (&0u8 as *const u8).offset(2) }; @@ -34,7 +34,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | pointer arithmetic failed: allocN has size 100, so pointer to 101 bytes starting at offset 0 is out-of-bounds | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:10:45 | LL | pub const AFTER_ARRAY: *const u8 = unsafe { [0u8; 100].as_ptr().offset(101) }; @@ -48,7 +48,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | overflowing in-bounds pointer arithmetic | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:12:43 | LL | pub const OVERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MAX) }; @@ -62,7 +62,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | overflowing in-bounds pointer arithmetic | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:13:44 | LL | pub const UNDERFLOW: *const u16 = unsafe { [0u16; 1].as_ptr().offset(isize::MIN) }; @@ -76,7 +76,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | overflowing in-bounds pointer arithmetic | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:14:56 | LL | pub const OVERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (usize::MAX as *const u8).offset(2) }; @@ -90,7 +90,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | overflowing in-bounds pointer arithmetic | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:15:57 | LL | pub const UNDERFLOW_ADDRESS_SPACE: *const u8 = unsafe { (1 as *const u8).offset(-2) }; @@ -104,7 +104,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | pointer arithmetic failed: allocN has size 1, so pointer to 2 bytes starting at offset -4 is out-of-bounds | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:16:49 | LL | pub const NEGATIVE_OFFSET: *const u8 = unsafe { [0u8; 1].as_ptr().wrapping_offset(-2).offset(-2) }; @@ -118,7 +118,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | pointer arithmetic failed: allocN has size 0, so pointer to 1 byte starting at offset 0 is out-of-bounds | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:18:50 | LL | pub const ZERO_SIZED_ALLOC: *const u8 = unsafe { [0u8; 0].as_ptr().offset(1) }; @@ -132,7 +132,7 @@ LL | unsafe { intrinsics::offset(self, count) as *mut T } | | | 0x1 is not a valid pointer | inside `ptr::mut_ptr::::offset` at $SRC_DIR/core/src/ptr/mut_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:19:42 | LL | pub const DANGLING: *const u8 = unsafe { ptr::NonNull::::dangling().as_ptr().offset(4) }; @@ -146,7 +146,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | pointer arithmetic failed: 0x0 is not a valid pointer | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:22:50 | LL | pub const NULL_OFFSET_ZERO: *const u8 = unsafe { ptr::null::().offset(0) }; @@ -160,7 +160,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | 0x7f..f is not a valid pointer | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/offset_ub.rs:25:47 | LL | pub const UNDERFLOW_ABS: *const u8 = unsafe { (usize::MAX as *const u8).offset(isize::MIN) }; diff --git a/src/test/ui/consts/ptr_comparisons.stderr b/src/test/ui/consts/ptr_comparisons.stderr index 6ae24c179ff1c..a28ae521d5b9a 100644 --- a/src/test/ui/consts/ptr_comparisons.stderr +++ b/src/test/ui/consts/ptr_comparisons.stderr @@ -6,7 +6,7 @@ LL | unsafe { intrinsics::offset(self, count) } | | | pointer arithmetic failed: alloc3 has size $WORD, so pointer to $TWO_WORDS bytes starting at offset 0 is out-of-bounds | inside `ptr::const_ptr::::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL - | + | ::: $DIR/ptr_comparisons.rs:61:34 | LL | const _: *const usize = unsafe { (FOO as *const usize).offset(2) }; diff --git a/src/test/ui/cross/cross-file-errors/main.stderr b/src/test/ui/cross/cross-file-errors/main.stderr index 4f015bf2148be..ff9e87250c75d 100644 --- a/src/test/ui/cross/cross-file-errors/main.stderr +++ b/src/test/ui/cross/cross-file-errors/main.stderr @@ -3,7 +3,7 @@ error[E0658]: destructuring assignments are unstable | LL | _ | ^ - | + | ::: $DIR/main.rs:5:5 | LL | underscore!(); @@ -18,7 +18,7 @@ error: in expressions, `_` can only be used on the left-hand side of an assignme | LL | _ | ^ `_` not allowed here - | + | ::: $DIR/main.rs:5:5 | LL | underscore!(); diff --git a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr index 0a76405382456..6267fad4372a4 100644 --- a/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Eq-enum-struct-variant.stderr @@ -6,7 +6,7 @@ LL | #[derive(Eq,PartialEq)] ... LL | x: Error | ^^^^^^^^ the trait `Eq` is not implemented for `Error` - | + | ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub struct AssertParamIsEq { diff --git a/src/test/ui/derives/derives-span-Eq-enum.stderr b/src/test/ui/derives/derives-span-Eq-enum.stderr index c17e2c518aa76..5dc4073400191 100644 --- a/src/test/ui/derives/derives-span-Eq-enum.stderr +++ b/src/test/ui/derives/derives-span-Eq-enum.stderr @@ -6,7 +6,7 @@ LL | #[derive(Eq,PartialEq)] ... LL | Error | ^^^^^ the trait `Eq` is not implemented for `Error` - | + | ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub struct AssertParamIsEq { diff --git a/src/test/ui/derives/derives-span-Eq-struct.stderr b/src/test/ui/derives/derives-span-Eq-struct.stderr index 7a7640b40f627..5fd21e2cd7900 100644 --- a/src/test/ui/derives/derives-span-Eq-struct.stderr +++ b/src/test/ui/derives/derives-span-Eq-struct.stderr @@ -6,7 +6,7 @@ LL | #[derive(Eq,PartialEq)] LL | struct Struct { LL | x: Error | ^^^^^^^^ the trait `Eq` is not implemented for `Error` - | + | ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub struct AssertParamIsEq { diff --git a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr index 35932986b0499..d96687f8bf2e2 100644 --- a/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Eq-tuple-struct.stderr @@ -6,7 +6,7 @@ LL | #[derive(Eq,PartialEq)] LL | struct Struct( LL | Error | ^^^^^ the trait `Eq` is not implemented for `Error` - | + | ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub struct AssertParamIsEq { diff --git a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr index 4616dadbe6bf7..557431ab5bc2a 100644 --- a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr @@ -6,7 +6,7 @@ LL | #[derive(Hash)] ... LL | x: Error | ^^^^^^^^ the trait `Hash` is not implemented for `Error` - | + | ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash(&self, state: &mut H); diff --git a/src/test/ui/derives/derives-span-Hash-enum.stderr b/src/test/ui/derives/derives-span-Hash-enum.stderr index ffc7f7bb7daaf..531ad59ca3bf9 100644 --- a/src/test/ui/derives/derives-span-Hash-enum.stderr +++ b/src/test/ui/derives/derives-span-Hash-enum.stderr @@ -6,7 +6,7 @@ LL | #[derive(Hash)] ... LL | Error | ^^^^^ the trait `Hash` is not implemented for `Error` - | + | ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash(&self, state: &mut H); diff --git a/src/test/ui/derives/derives-span-Hash-struct.stderr b/src/test/ui/derives/derives-span-Hash-struct.stderr index 14aebb4faace9..2852a448c43fc 100644 --- a/src/test/ui/derives/derives-span-Hash-struct.stderr +++ b/src/test/ui/derives/derives-span-Hash-struct.stderr @@ -6,7 +6,7 @@ LL | #[derive(Hash)] LL | struct Struct { LL | x: Error | ^^^^^^^^ the trait `Hash` is not implemented for `Error` - | + | ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash(&self, state: &mut H); diff --git a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr index 50139dc3f0a79..93ae1b29702e9 100644 --- a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr @@ -6,7 +6,7 @@ LL | #[derive(Hash)] LL | struct Struct( LL | Error | ^^^^^ the trait `Hash` is not implemented for `Error` - | + | ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash(&self, state: &mut H); diff --git a/src/test/ui/derives/deriving-meta-unknown-trait.stderr b/src/test/ui/derives/deriving-meta-unknown-trait.stderr index 485a91d02758a..bfb673f86f418 100644 --- a/src/test/ui/derives/deriving-meta-unknown-trait.stderr +++ b/src/test/ui/derives/deriving-meta-unknown-trait.stderr @@ -3,7 +3,7 @@ error: cannot find derive macro `Eqr` in this scope | LL | #[derive(Eqr)] | ^^^ help: a derive macro with a similar name exists: `Eq` - | + | ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub macro Eq($item:item) { @@ -14,7 +14,7 @@ error: cannot find derive macro `Eqr` in this scope | LL | #[derive(Eqr)] | ^^^ help: a derive macro with a similar name exists: `Eq` - | + | ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub macro Eq($item:item) { diff --git a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr index 28663563c6ccd..04d45758578a3 100644 --- a/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2018-2015-parsing.stderr @@ -37,7 +37,7 @@ error: macro expansion ends with an incomplete expression: expected one of `move | LL | ($i: ident) => ($i) | ^ expected one of `move`, `|`, or `||` - | + | ::: $DIR/edition-keywords-2018-2015-parsing.rs:24:8 | LL | if passes_ident!(async) == 1 {} diff --git a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr index cda7e65e437e8..af11a505ccf36 100644 --- a/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr +++ b/src/test/ui/editions/edition-keywords-2018-2018-parsing.stderr @@ -37,7 +37,7 @@ error: macro expansion ends with an incomplete expression: expected one of `move | LL | ($i: ident) => ($i) | ^ expected one of `move`, `|`, or `||` - | + | ::: $DIR/edition-keywords-2018-2018-parsing.rs:24:8 | LL | if passes_ident!(async) == 1 {} diff --git a/src/test/ui/empty/empty-struct-braces-expr.stderr b/src/test/ui/empty/empty-struct-braces-expr.stderr index 6292ed446978d..5ee8cbd912b0e 100644 --- a/src/test/ui/empty/empty-struct-braces-expr.stderr +++ b/src/test/ui/empty/empty-struct-braces-expr.stderr @@ -6,7 +6,7 @@ LL | struct Empty1 {} ... LL | let e1 = Empty1; | ^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:2:1 | LL | pub struct XEmpty2; @@ -29,7 +29,7 @@ LL | struct Empty1 {} ... LL | let e1 = Empty1(); | ^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:2:1 | LL | pub struct XEmpty2; @@ -67,7 +67,7 @@ error[E0423]: expected value, found struct `XEmpty1` | LL | let xe1 = XEmpty1; | ^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:1:1 | LL | pub struct XEmpty1 {} @@ -89,7 +89,7 @@ error[E0423]: expected function, tuple struct or tuple variant, found struct `XE | LL | let xe1 = XEmpty1(); | ^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:1:1 | LL | pub struct XEmpty1 {} diff --git a/src/test/ui/empty/empty-struct-braces-pat-1.stderr b/src/test/ui/empty/empty-struct-braces-pat-1.stderr index 3570012fc3752..5c02b62969fe7 100644 --- a/src/test/ui/empty/empty-struct-braces-pat-1.stderr +++ b/src/test/ui/empty/empty-struct-braces-pat-1.stderr @@ -12,7 +12,7 @@ error[E0532]: expected unit struct, unit variant or constant, found struct varia | LL | XE::XEmpty3 => () | ^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:6:5 | LL | XEmpty3 {}, diff --git a/src/test/ui/empty/empty-struct-braces-pat-2.stderr b/src/test/ui/empty/empty-struct-braces-pat-2.stderr index 3bd3f6a9644a1..4bac2dfe76f28 100644 --- a/src/test/ui/empty/empty-struct-braces-pat-2.stderr +++ b/src/test/ui/empty/empty-struct-braces-pat-2.stderr @@ -6,7 +6,7 @@ LL | struct Empty1 {} ... LL | Empty1() => () | ^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); @@ -26,7 +26,7 @@ error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1` | LL | XEmpty1() => () | ^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:1:1 | LL | pub struct XEmpty1 {} @@ -52,7 +52,7 @@ LL | struct Empty1 {} ... LL | Empty1(..) => () | ^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); @@ -72,7 +72,7 @@ error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1` | LL | XEmpty1(..) => () | ^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:1:1 | LL | pub struct XEmpty1 {} diff --git a/src/test/ui/empty/empty-struct-braces-pat-3.stderr b/src/test/ui/empty/empty-struct-braces-pat-3.stderr index aac872ba0ecca..cc2feb86d8e5b 100644 --- a/src/test/ui/empty/empty-struct-braces-pat-3.stderr +++ b/src/test/ui/empty/empty-struct-braces-pat-3.stderr @@ -12,7 +12,7 @@ error[E0532]: expected tuple struct or tuple variant, found struct variant `XE:: | LL | XE::XEmpty3() => () | ^^^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:6:5 | LL | XEmpty3 {}, @@ -44,7 +44,7 @@ error[E0532]: expected tuple struct or tuple variant, found struct variant `XE:: | LL | XE::XEmpty3(..) => () | ^^^^^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:6:5 | LL | XEmpty3 {}, diff --git a/src/test/ui/empty/empty-struct-tuple-pat.stderr b/src/test/ui/empty/empty-struct-tuple-pat.stderr index 7b0d9717e63a2..9b5c8422de55d 100644 --- a/src/test/ui/empty/empty-struct-tuple-pat.stderr +++ b/src/test/ui/empty/empty-struct-tuple-pat.stderr @@ -30,7 +30,7 @@ error[E0532]: expected unit struct, unit variant or constant, found tuple varian | LL | XE::XEmpty5 => (), | ^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:7:5 | LL | XEmpty4, diff --git a/src/test/ui/empty/empty-struct-unit-pat.stderr b/src/test/ui/empty/empty-struct-unit-pat.stderr index a704e1fae497c..839d3a84103fa 100644 --- a/src/test/ui/empty/empty-struct-unit-pat.stderr +++ b/src/test/ui/empty/empty-struct-unit-pat.stderr @@ -6,7 +6,7 @@ LL | struct Empty2; ... LL | Empty2() => () | ^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); @@ -26,7 +26,7 @@ error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2 | LL | XEmpty2() => () | ^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:2:1 | LL | pub struct XEmpty2; @@ -51,7 +51,7 @@ LL | struct Empty2; ... LL | Empty2(..) => () | ^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:3:1 | LL | pub struct XEmpty6(); @@ -71,7 +71,7 @@ error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2 | LL | XEmpty2(..) => () | ^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:2:1 | LL | pub struct XEmpty2; @@ -102,7 +102,7 @@ error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XE | LL | XE::XEmpty4() => (), | ^^^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:7:5 | LL | XEmpty4, @@ -133,7 +133,7 @@ error[E0532]: expected tuple struct or tuple variant, found unit variant `XE::XE | LL | XE::XEmpty4(..) => (), | ^^^^^^^^^^^^^^^ - | + | ::: $DIR/auxiliary/empty-struct.rs:7:5 | LL | XEmpty4, diff --git a/src/test/ui/error-codes/E0004-2.stderr b/src/test/ui/error-codes/E0004-2.stderr index 7b3deb1579aff..fd0215e72ee24 100644 --- a/src/test/ui/error-codes/E0004-2.stderr +++ b/src/test/ui/error-codes/E0004-2.stderr @@ -3,7 +3,7 @@ error[E0004]: non-exhaustive patterns: `None` and `Some(_)` not covered | LL | match x { } | ^ patterns `None` and `Some(_)` not covered - | + | ::: $SRC_DIR/core/src/option.rs:LL:COL | LL | None, diff --git a/src/test/ui/error-codes/E0005.stderr b/src/test/ui/error-codes/E0005.stderr index b9f2702e88876..a945a4be70854 100644 --- a/src/test/ui/error-codes/E0005.stderr +++ b/src/test/ui/error-codes/E0005.stderr @@ -3,7 +3,7 @@ error[E0005]: refutable pattern in local binding: `None` not covered | LL | let Some(y) = x; | ^^^^^^^ pattern `None` not covered - | + | ::: $SRC_DIR/core/src/option.rs:LL:COL | LL | None, diff --git a/src/test/ui/error-codes/E0297.stderr b/src/test/ui/error-codes/E0297.stderr index ec3452b1ddfa6..957e79a9f3981 100644 --- a/src/test/ui/error-codes/E0297.stderr +++ b/src/test/ui/error-codes/E0297.stderr @@ -3,7 +3,7 @@ error[E0005]: refutable pattern in `for` loop binding: `None` not covered | LL | for Some(x) in xs {} | ^^^^^^^ pattern `None` not covered - | + | ::: $SRC_DIR/core/src/option.rs:LL:COL | LL | None, diff --git a/src/test/ui/explore-issue-38412.stderr b/src/test/ui/explore-issue-38412.stderr index f4a2330da1773..2f5dab7eb0559 100644 --- a/src/test/ui/explore-issue-38412.stderr +++ b/src/test/ui/explore-issue-38412.stderr @@ -84,7 +84,7 @@ error[E0624]: associated function `pub_crate` is private | LL | r.pub_crate(); | ^^^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/pub-and-stability.rs:114:9 | LL | pub(crate) fn pub_crate(&self) -> i32 { self.d_priv } @@ -95,7 +95,7 @@ error[E0624]: associated function `pub_mod` is private | LL | r.pub_mod(); | ^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/pub-and-stability.rs:116:9 | LL | pub(in m) fn pub_mod(&self) -> i32 { self.d_priv } @@ -106,7 +106,7 @@ error[E0624]: associated function `private` is private | LL | r.private(); | ^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/pub-and-stability.rs:118:9 | LL | fn private(&self) -> i32 { self.d_priv } @@ -135,7 +135,7 @@ error[E0624]: associated function `pub_crate` is private | LL | t.pub_crate(); | ^^^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/pub-and-stability.rs:129:9 | LL | pub(crate) fn pub_crate(&self) -> i32 { self.0 } @@ -146,7 +146,7 @@ error[E0624]: associated function `pub_mod` is private | LL | t.pub_mod(); | ^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/pub-and-stability.rs:130:9 | LL | pub(in m) fn pub_mod(&self) -> i32 { self.0 } @@ -157,7 +157,7 @@ error[E0624]: associated function `private` is private | LL | t.private(); | ^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/pub-and-stability.rs:131:9 | LL | fn private(&self) -> i32 { self.0 } diff --git a/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr b/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr index 2dacb94bcc07a..912252fd34a2e 100644 --- a/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr +++ b/src/test/ui/feature-gates/feature-gate-associated_type_bounds.stderr @@ -138,7 +138,7 @@ error[E0277]: the trait bound `<::A as Iterator>::Item: Copy` is n | LL | type A: Iterator; | ^^^^ the trait `Copy` is not implemented for `<::A as Iterator>::Item` - | + | ::: $SRC_DIR/core/src/marker.rs:LL:COL | LL | pub trait Copy: Clone { diff --git a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr index e079c2ddcee26..74629d3e7e64a 100644 --- a/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr +++ b/src/test/ui/feature-gates/feature-gate-exhaustive-patterns.stderr @@ -3,7 +3,7 @@ error[E0005]: refutable pattern in local binding: `Err(_)` not covered | LL | let Ok(_x) = foo(); | ^^^^^^ pattern `Err(_)` not covered - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), diff --git a/src/test/ui/generator/sized-yield.stderr b/src/test/ui/generator/sized-yield.stderr index 8e3c2f67ed165..05cc6c012177b 100644 --- a/src/test/ui/generator/sized-yield.stderr +++ b/src/test/ui/generator/sized-yield.stderr @@ -16,7 +16,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t | LL | Pin::new(&mut gen).resume(()); | ^^^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/ops/generator.rs:LL:COL | LL | pub enum GeneratorState { diff --git a/src/test/ui/generic-associated-types/cross-crate-bounds.stderr b/src/test/ui/generic-associated-types/cross-crate-bounds.stderr index d96c5f4540ef5..57ccadc7b8d04 100644 --- a/src/test/ui/generic-associated-types/cross-crate-bounds.stderr +++ b/src/test/ui/generic-associated-types/cross-crate-bounds.stderr @@ -3,7 +3,7 @@ error[E0277]: the trait bound `(): AsRef<()>` is not satisfied | LL | type Bar = (); | ^^^^^^^^^^^^^^ the trait `AsRef<()>` is not implemented for `()` - | + | ::: $DIR/auxiliary/foo_defn.rs:6:15 | LL | type Bar: AsRef<()>; diff --git a/src/test/ui/impl-trait/impl-generic-mismatch.stderr b/src/test/ui/impl-trait/impl-generic-mismatch.stderr index 0e1ccd8d0d6d6..6af91480e3a6e 100644 --- a/src/test/ui/impl-trait/impl-generic-mismatch.stderr +++ b/src/test/ui/impl-trait/impl-generic-mismatch.stderr @@ -31,7 +31,7 @@ error[E0643]: method `hash` has incompatible signature for trait | LL | fn hash(&self, hasher: &mut impl Hasher) {} | ^^^^^^^^^^^ expected generic parameter, found `impl Trait` - | + | ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash(&self, state: &mut H); diff --git a/src/test/ui/impl-trait/issues/issue-78722.stderr b/src/test/ui/impl-trait/issues/issue-78722.stderr index f42d66d12435c..5e432e7649604 100644 --- a/src/test/ui/impl-trait/issues/issue-78722.stderr +++ b/src/test/ui/impl-trait/issues/issue-78722.stderr @@ -8,7 +8,7 @@ LL | let f: F = async { 1 }; | - ^^^^^^^^^^^ expected opaque type, found a different opaque type | | | expected due to this - | + | ::: $SRC_DIR/core/src/future/mod.rs:LL:COL | LL | pub const fn from_generator(gen: T) -> impl Future diff --git a/src/test/ui/impl-trait/no-method-suggested-traits.stderr b/src/test/ui/impl-trait/no-method-suggested-traits.stderr index b993115502fd5..30afc8646de3d 100644 --- a/src/test/ui/impl-trait/no-method-suggested-traits.stderr +++ b/src/test/ui/impl-trait/no-method-suggested-traits.stderr @@ -66,7 +66,7 @@ error[E0599]: no method named `method` found for type `i32` in the current scope | LL | 1i32.method(); | ^^^^^^ method not found in `i32` - | + | ::: $DIR/auxiliary/no_method_suggested_traits.rs:8:12 | LL | fn method(&self) {} diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr index bd58728335008..b15efd6c770eb 100644 --- a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr +++ b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr @@ -3,7 +3,7 @@ error: `impl` item signature doesn't match `trait` item signature | LL | fn deref(&self) -> &dyn Trait { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&Struct) -> &dyn Trait` - | + | ::: $SRC_DIR/core/src/ops/deref.rs:LL:COL | LL | fn deref(&self) -> &Self::Target; diff --git a/src/test/ui/interior-mutability/interior-mutability.stderr b/src/test/ui/interior-mutability/interior-mutability.stderr index dd43da1166445..af6e005311778 100644 --- a/src/test/ui/interior-mutability/interior-mutability.stderr +++ b/src/test/ui/interior-mutability/interior-mutability.stderr @@ -3,7 +3,7 @@ error[E0277]: the type `UnsafeCell` may contain interior mutability and a r | LL | catch_unwind(|| { x.set(23); }); | ^^^^^^^^^^^^ `UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary - | + | ::: $SRC_DIR/std/src/panic.rs:LL:COL | LL | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { diff --git a/src/test/ui/issues/issue-17546.stderr b/src/test/ui/issues/issue-17546.stderr index 6269ccb73e06f..42953bd8d2c2e 100644 --- a/src/test/ui/issues/issue-17546.stderr +++ b/src/test/ui/issues/issue-17546.stderr @@ -3,7 +3,7 @@ error[E0573]: expected type, found variant `NoResult` | LL | fn new() -> NoResult { | ^^^^^^^^^^^^^^^^^^^^^^^^ - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | pub enum Result { @@ -57,7 +57,7 @@ error[E0573]: expected type, found variant `NoResult` | LL | fn newer() -> NoResult { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | pub enum Result { diff --git a/src/test/ui/issues/issue-20433.stderr b/src/test/ui/issues/issue-20433.stderr index 5fed02164b5b7..b9e9bfe1b8cb1 100644 --- a/src/test/ui/issues/issue-20433.stderr +++ b/src/test/ui/issues/issue-20433.stderr @@ -3,7 +3,7 @@ error[E0277]: the size for values of type `[i32]` cannot be known at compilation | LL | fn iceman(c: Vec<[i32]>) {} | ^^^^^^^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL | LL | pub struct Vec { diff --git a/src/test/ui/issues/issue-21160.stderr b/src/test/ui/issues/issue-21160.stderr index c864381e6b0a6..e9aa8e27089aa 100644 --- a/src/test/ui/issues/issue-21160.stderr +++ b/src/test/ui/issues/issue-21160.stderr @@ -5,7 +5,7 @@ LL | #[derive(Hash)] | ---- in this derive macro expansion LL | struct Foo(Bar); | ^^^ the trait `Hash` is not implemented for `Bar` - | + | ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn hash(&self, state: &mut H); diff --git a/src/test/ui/issues/issue-21202.stderr b/src/test/ui/issues/issue-21202.stderr index 47f28d7c443fc..1d2816feda948 100644 --- a/src/test/ui/issues/issue-21202.stderr +++ b/src/test/ui/issues/issue-21202.stderr @@ -3,7 +3,7 @@ error[E0624]: associated function `foo` is private | LL | Foo::foo(&f); | ^^^ private associated function - | + | ::: $DIR/auxiliary/issue-21202.rs:4:9 | LL | fn foo(&self) { } diff --git a/src/test/ui/issues/issue-27033.stderr b/src/test/ui/issues/issue-27033.stderr index fa42611d0b32e..9a38d49cd0c96 100644 --- a/src/test/ui/issues/issue-27033.stderr +++ b/src/test/ui/issues/issue-27033.stderr @@ -3,7 +3,7 @@ error[E0530]: match bindings cannot shadow unit variants | LL | None @ _ => {} | ^^^^ cannot be named the same as a unit variant - | + | ::: $SRC_DIR/std/src/prelude/mod.rs:LL:COL | LL | pub use super::v1::*; diff --git a/src/test/ui/issues/issue-31173.stderr b/src/test/ui/issues/issue-31173.stderr index 0b7ffc39646a6..8b7871ce31186 100644 --- a/src/test/ui/issues/issue-31173.stderr +++ b/src/test/ui/issues/issue-31173.stderr @@ -12,12 +12,12 @@ error[E0599]: the method `collect` exists for struct `Cloned, [closure@$DIR/issue-31173.rs:6:39: 9:6]>>` due to unsatisfied trait bounds - | + | ::: $SRC_DIR/core/src/iter/adapters/cloned.rs:LL:COL | LL | pub struct Cloned { | -------------------- doesn't satisfy `_: Iterator` - | + | ::: $SRC_DIR/core/src/iter/adapters/take_while.rs:LL:COL | LL | pub struct TakeWhile { diff --git a/src/test/ui/issues/issue-43189.stderr b/src/test/ui/issues/issue-43189.stderr index 3a3767c349d65..caf7530b85af1 100644 --- a/src/test/ui/issues/issue-43189.stderr +++ b/src/test/ui/issues/issue-43189.stderr @@ -3,7 +3,7 @@ error[E0599]: no method named `a` found for unit type `()` in the current scope | LL | ().a(); | ^ method not found in `()` - | + | ::: $DIR/auxiliary/xcrate-issue-43189-a.rs:5:8 | LL | fn a(&self) {} diff --git a/src/test/ui/issues/issue-56175.stderr b/src/test/ui/issues/issue-56175.stderr index e6b0fffce663d..013a440ed0457 100644 --- a/src/test/ui/issues/issue-56175.stderr +++ b/src/test/ui/issues/issue-56175.stderr @@ -3,7 +3,7 @@ error[E0599]: no method named `trait_method` found for struct `FooStruct` in the | LL | reexported_trait::FooStruct.trait_method(); | ^^^^^^^^^^^^ method not found in `FooStruct` - | + | ::: $DIR/auxiliary/reexported-trait.rs:3:12 | LL | fn trait_method(&self) { @@ -20,7 +20,7 @@ error[E0599]: no method named `trait_method_b` found for struct `FooStruct` in t | LL | reexported_trait::FooStruct.trait_method_b(); | ^^^^^^^^^^^^^^ method not found in `FooStruct` - | + | ::: $DIR/auxiliary/reexported-trait.rs:7:12 | LL | fn trait_method_b(&self) { diff --git a/src/test/ui/issues/issue-60283.stderr b/src/test/ui/issues/issue-60283.stderr index 149562f8fb31c..9bddc2c41a310 100644 --- a/src/test/ui/issues/issue-60283.stderr +++ b/src/test/ui/issues/issue-60283.stderr @@ -18,7 +18,7 @@ error[E0277]: the size for values of type `<() as Trait<'_>>::Item` cannot be kn | LL | foo((), drop) | ^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub fn drop(_x: T) {} diff --git a/src/test/ui/issues/issue-69725.stderr b/src/test/ui/issues/issue-69725.stderr index 4dd6b4bbb68be..b1ba89f6cbecf 100644 --- a/src/test/ui/issues/issue-69725.stderr +++ b/src/test/ui/issues/issue-69725.stderr @@ -3,7 +3,7 @@ error[E0599]: the method `clone` exists for struct `Struct`, but its trait bo | LL | let _ = Struct::::new().clone(); | ^^^^^ method cannot be called on `Struct` due to unsatisfied trait bounds - | + | ::: $DIR/auxiliary/issue-69725.rs:2:1 | LL | pub struct Struct(A); diff --git a/src/test/ui/issues/issue-7607-1.stderr b/src/test/ui/issues/issue-7607-1.stderr index 0520eada499d9..ecff8b42b0ea7 100644 --- a/src/test/ui/issues/issue-7607-1.stderr +++ b/src/test/ui/issues/issue-7607-1.stderr @@ -3,7 +3,7 @@ error[E0412]: cannot find type `Fo` in this scope | LL | impl Fo { | ^^ help: a trait with a similar name exists: `Fn` - | + | ::: $SRC_DIR/core/src/ops/function.rs:LL:COL | LL | pub trait Fn: FnMut { diff --git a/src/test/ui/issues/issue-78720.stderr b/src/test/ui/issues/issue-78720.stderr index ee15826d18941..95b2f447102ad 100644 --- a/src/test/ui/issues/issue-78720.stderr +++ b/src/test/ui/issues/issue-78720.stderr @@ -9,7 +9,7 @@ error[E0412]: cannot find type `F` in this scope | LL | _func: F, | ^ - | + | ::: $SRC_DIR/core/src/ops/function.rs:LL:COL | LL | pub trait Fn: FnMut { diff --git a/src/test/ui/limits/issue-55878.stderr b/src/test/ui/limits/issue-55878.stderr index a0e8fc70b6acd..a7e382479021a 100644 --- a/src/test/ui/limits/issue-55878.stderr +++ b/src/test/ui/limits/issue-55878.stderr @@ -3,7 +3,7 @@ error[E0080]: values of the type `[u8; SIZE]` are too big for the current archit | LL | intrinsics::size_of::() | ^^^^^^^^^^^^^^^^^^^^^^^^^^ inside `std::mem::size_of::<[u8; SIZE]>` at $SRC_DIR/core/src/mem/mod.rs:LL:COL - | + | ::: $DIR/issue-55878.rs:7:26 | LL | println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>()); diff --git a/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr b/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr index 4d8a8edf4c9ea..438375951493b 100644 --- a/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr +++ b/src/test/ui/macro_backtrace/main.-Zmacro-backtrace.stderr @@ -21,7 +21,7 @@ LL | | } ... LL | ping!(); | -------- in this macro invocation (#1) - | + | ::: $DIR/auxiliary/ping.rs:5:1 | LL | / macro_rules! ping { @@ -43,7 +43,7 @@ LL | | } ... LL | deep!(); | -------- in this macro invocation (#1) - | + | ::: $DIR/auxiliary/ping.rs:5:1 | LL | / macro_rules! ping { diff --git a/src/test/ui/macros/macro-name-typo.stderr b/src/test/ui/macros/macro-name-typo.stderr index 94eb8dc0cd4cb..3e8cfb3f0e97f 100644 --- a/src/test/ui/macros/macro-name-typo.stderr +++ b/src/test/ui/macros/macro-name-typo.stderr @@ -3,7 +3,7 @@ error: cannot find macro `printlx` in this scope | LL | printlx!("oh noes!"); | ^^^^^^^ help: a macro with a similar name exists: `println` - | + | ::: $SRC_DIR/std/src/macros.rs:LL:COL | LL | macro_rules! println { diff --git a/src/test/ui/macros/macro-path-prelude-fail-3.stderr b/src/test/ui/macros/macro-path-prelude-fail-3.stderr index 523f08d547ebc..1abb501ec8051 100644 --- a/src/test/ui/macros/macro-path-prelude-fail-3.stderr +++ b/src/test/ui/macros/macro-path-prelude-fail-3.stderr @@ -3,7 +3,7 @@ error: cannot find macro `inline` in this scope | LL | inline!(); | ^^^^^^ help: a macro with a similar name exists: `line` - | + | ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL | LL | macro_rules! line { diff --git a/src/test/ui/macros/macro-use-wrong-name.stderr b/src/test/ui/macros/macro-use-wrong-name.stderr index 888fb913fb71c..326001fc15a9a 100644 --- a/src/test/ui/macros/macro-use-wrong-name.stderr +++ b/src/test/ui/macros/macro-use-wrong-name.stderr @@ -3,7 +3,7 @@ error: cannot find macro `macro_two` in this scope | LL | macro_two!(); | ^^^^^^^^^ help: a macro with a similar name exists: `macro_one` - | + | ::: $DIR/auxiliary/two_macros.rs:2:1 | LL | macro_rules! macro_one { () => ("one") } diff --git a/src/test/ui/malformed/malformed-derive-entry.stderr b/src/test/ui/malformed/malformed-derive-entry.stderr index ba096a9080ae2..0eafb2d7587db 100644 --- a/src/test/ui/malformed/malformed-derive-entry.stderr +++ b/src/test/ui/malformed/malformed-derive-entry.stderr @@ -21,7 +21,7 @@ error[E0277]: the trait bound `Test1: Clone` is not satisfied | LL | #[derive(Copy(Bad))] | ^^^^ the trait `Clone` is not implemented for `Test1` - | + | ::: $SRC_DIR/core/src/marker.rs:LL:COL | LL | pub trait Copy: Clone { @@ -34,7 +34,7 @@ error[E0277]: the trait bound `Test2: Clone` is not satisfied | LL | #[derive(Copy="bad")] | ^^^^ the trait `Clone` is not implemented for `Test2` - | + | ::: $SRC_DIR/core/src/marker.rs:LL:COL | LL | pub trait Copy: Clone { diff --git a/src/test/ui/mir/issue-80742.stderr b/src/test/ui/mir/issue-80742.stderr index 961234cf7e854..1ebd2b00aee0c 100644 --- a/src/test/ui/mir/issue-80742.stderr +++ b/src/test/ui/mir/issue-80742.stderr @@ -6,7 +6,7 @@ LL | intrinsics::size_of::() | | | size_of called on unsized type `dyn Debug` | inside `std::mem::size_of::` at $SRC_DIR/core/src/mem/mod.rs:LL:COL - | + | ::: $DIR/issue-80742.rs:23:10 | LL | [u8; size_of::() + 1]: , @@ -26,7 +26,7 @@ LL | | } ... LL | let dst = Inline::::new(0); | ^^^ function or associated item cannot be called on `Inline` due to unsatisfied trait bounds - | + | ::: $SRC_DIR/core/src/fmt/mod.rs:LL:COL | LL | pub trait Debug { @@ -43,7 +43,7 @@ LL | intrinsics::size_of::() | | | size_of called on unsized type `dyn Debug` | inside `std::mem::size_of::` at $SRC_DIR/core/src/mem/mod.rs:LL:COL - | + | ::: $DIR/issue-80742.rs:15:10 | LL | [u8; size_of::() + 1]: , diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr index 69ae3d8cbd0e5..67e8ee2283689 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.stderr +++ b/src/test/ui/mismatched_types/issue-36053-2.stderr @@ -14,7 +14,7 @@ LL | once::<&str>("str").fuse().filter(|a: &str| true).count(); | | | doesn't satisfy `<_ as FnOnce<(&&str,)>>::Output = bool` | doesn't satisfy `_: FnMut<(&&str,)>` - | + | ::: $SRC_DIR/core/src/iter/adapters/filter.rs:LL:COL | LL | pub struct Filter { diff --git a/src/test/ui/namespace/namespace-mix.stderr b/src/test/ui/namespace/namespace-mix.stderr index ded3173f45b2e..71e35b445ef81 100644 --- a/src/test/ui/namespace/namespace-mix.stderr +++ b/src/test/ui/namespace/namespace-mix.stderr @@ -24,7 +24,7 @@ error[E0423]: expected value, found type alias `xm1::S` | LL | check(xm1::S); | ^^^^^^ - | + | ::: $DIR/auxiliary/namespace-mix.rs:3:5 | LL | pub struct TS(); @@ -73,7 +73,7 @@ error[E0423]: expected value, found struct variant `xm7::V` | LL | check(xm7::V); | ^^^^^^ - | + | ::: $DIR/auxiliary/namespace-mix.rs:6:9 | LL | V {}, diff --git a/src/test/ui/no-send-res-ports.stderr b/src/test/ui/no-send-res-ports.stderr index 2ee32029b40dc..c35692d6eabc9 100644 --- a/src/test/ui/no-send-res-ports.stderr +++ b/src/test/ui/no-send-res-ports.stderr @@ -10,7 +10,7 @@ LL | | let y = x; LL | | println!("{:?}", y); LL | | }); | |_____- within this `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6]` - | + | ::: $SRC_DIR/std/src/thread/mod.rs:LL:COL | LL | F: Send + 'static, diff --git a/src/test/ui/parser/issue-62894.stderr b/src/test/ui/parser/issue-62894.stderr index cf3727c9d579d..9b7bd1559cddf 100644 --- a/src/test/ui/parser/issue-62894.stderr +++ b/src/test/ui/parser/issue-62894.stderr @@ -42,7 +42,7 @@ LL | fn f() { assert_eq!(f(), (), assert_eq!(assert_eq! LL | LL | fn main() {} | ^^ unexpected token - | + | ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL | LL | ($left:expr, $right:expr $(,)?) => ({ diff --git a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr index f515525123e03..4a987cb6c0311 100644 --- a/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr +++ b/src/test/ui/pattern/usefulness/match-arm-statics-2.stderr @@ -12,7 +12,7 @@ error[E0004]: non-exhaustive patterns: `Some(Some(West))` not covered | LL | match Some(Some(North)) { | ^^^^^^^^^^^^^^^^^ pattern `Some(Some(West))` not covered - | + | ::: $SRC_DIR/core/src/option.rs:LL:COL | LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), diff --git a/src/test/ui/pattern/usefulness/match-privately-empty.stderr b/src/test/ui/pattern/usefulness/match-privately-empty.stderr index cd157debcd4cf..4efb41978a241 100644 --- a/src/test/ui/pattern/usefulness/match-privately-empty.stderr +++ b/src/test/ui/pattern/usefulness/match-privately-empty.stderr @@ -3,7 +3,7 @@ error[E0004]: non-exhaustive patterns: `Some(Private { misc: true, .. })` not co | LL | match private::DATA { | ^^^^^^^^^^^^^ pattern `Some(Private { misc: true, .. })` not covered - | + | ::: $SRC_DIR/core/src/option.rs:LL:COL | LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), diff --git a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr index c953cd314406e..1ca0a33bf37d9 100644 --- a/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr +++ b/src/test/ui/pattern/usefulness/non-exhaustive-match.stderr @@ -27,7 +27,7 @@ error[E0004]: non-exhaustive patterns: `Some(_)` not covered | LL | match Some(10) { | ^^^^^^^^ pattern `Some(_)` not covered - | + | ::: $SRC_DIR/core/src/option.rs:LL:COL | LL | Some(#[stable(feature = "rust1", since = "1.0.0")] T), diff --git a/src/test/ui/privacy/privacy5.stderr b/src/test/ui/privacy/privacy5.stderr index 216abfc68b812..d0c0c6b8bb593 100644 --- a/src/test/ui/privacy/privacy5.stderr +++ b/src/test/ui/privacy/privacy5.stderr @@ -363,7 +363,7 @@ error[E0603]: tuple struct constructor `A` is private | LL | let a = other::A(()); | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); @@ -380,7 +380,7 @@ error[E0603]: tuple struct constructor `B` is private | LL | let b = other::B(2); | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); @@ -397,7 +397,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | let c = other::C(2, 3); | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); @@ -414,7 +414,7 @@ error[E0603]: tuple struct constructor `A` is private | LL | let other::A(()) = a; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); @@ -431,7 +431,7 @@ error[E0603]: tuple struct constructor `A` is private | LL | let other::A(_) = a; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); @@ -448,7 +448,7 @@ error[E0603]: tuple struct constructor `A` is private | LL | match a { other::A(()) => {} } | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); @@ -465,7 +465,7 @@ error[E0603]: tuple struct constructor `A` is private | LL | match a { other::A(_) => {} } | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); @@ -482,7 +482,7 @@ error[E0603]: tuple struct constructor `B` is private | LL | let other::B(_) = b; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); @@ -499,7 +499,7 @@ error[E0603]: tuple struct constructor `B` is private | LL | let other::B(_b) = b; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); @@ -516,7 +516,7 @@ error[E0603]: tuple struct constructor `B` is private | LL | match b { other::B(_) => {} } | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); @@ -533,7 +533,7 @@ error[E0603]: tuple struct constructor `B` is private | LL | match b { other::B(_b) => {} } | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); @@ -550,7 +550,7 @@ error[E0603]: tuple struct constructor `B` is private | LL | match b { other::B(1) => {} | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); @@ -567,7 +567,7 @@ error[E0603]: tuple struct constructor `B` is private | LL | other::B(_) => {} } | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); @@ -584,7 +584,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | let other::C(_, _) = c; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); @@ -601,7 +601,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | let other::C(_a, _) = c; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); @@ -618,7 +618,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | let other::C(_, _b) = c; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); @@ -635,7 +635,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | let other::C(_a, _b) = c; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); @@ -652,7 +652,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | match c { other::C(_, _) => {} } | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); @@ -669,7 +669,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | match c { other::C(_a, _) => {} } | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); @@ -686,7 +686,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | match c { other::C(_, _b) => {} } | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); @@ -703,7 +703,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | match c { other::C(_a, _b) => {} } | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); @@ -720,7 +720,7 @@ error[E0603]: tuple struct constructor `A` is private | LL | let a2 = other::A; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:1:14 | LL | pub struct A(()); @@ -737,7 +737,7 @@ error[E0603]: tuple struct constructor `B` is private | LL | let b2 = other::B; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:2:14 | LL | pub struct B(isize); @@ -754,7 +754,7 @@ error[E0603]: tuple struct constructor `C` is private | LL | let c2 = other::C; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy_tuple_struct.rs:3:14 | LL | pub struct C(pub isize, isize); diff --git a/src/test/ui/privacy/private-method-cross-crate.stderr b/src/test/ui/privacy/private-method-cross-crate.stderr index 6532932993363..93f6a7f2f6167 100644 --- a/src/test/ui/privacy/private-method-cross-crate.stderr +++ b/src/test/ui/privacy/private-method-cross-crate.stderr @@ -3,7 +3,7 @@ error[E0624]: associated function `nap` is private | LL | nyan.nap(); | ^^^ private associated function - | + | ::: $DIR/auxiliary/cci_class_5.rs:8:9 | LL | fn nap(&self) {} diff --git a/src/test/ui/privacy/restricted/test.stderr b/src/test/ui/privacy/restricted/test.stderr index 6950667f1ea0b..0f6003c424767 100644 --- a/src/test/ui/privacy/restricted/test.stderr +++ b/src/test/ui/privacy/restricted/test.stderr @@ -87,7 +87,7 @@ error[E0624]: associated function `g` is private | LL | u.g(); | ^ private associated function - | + | ::: $DIR/auxiliary/pub_restricted.rs:14:5 | LL | pub(crate) fn g(&self) {} @@ -98,7 +98,7 @@ error[E0624]: associated function `h` is private | LL | u.h(); | ^ private associated function - | + | ::: $DIR/auxiliary/pub_restricted.rs:15:5 | LL | crate fn h(&self) {} diff --git a/src/test/ui/proc-macro/group-compat-hack/group-compat-hack.stderr b/src/test/ui/proc-macro/group-compat-hack/group-compat-hack.stderr index 070b066721350..001b345204d34 100644 --- a/src/test/ui/proc-macro/group-compat-hack/group-compat-hack.stderr +++ b/src/test/ui/proc-macro/group-compat-hack/group-compat-hack.stderr @@ -3,7 +3,7 @@ warning: using an old version of `time-macros-impl` | LL | #[my_macro] struct One($name); | ^^^^^ - | + | ::: $DIR/group-compat-hack.rs:27:5 | LL | impl_macros!(Foo); @@ -20,7 +20,7 @@ warning: using an old version of `time-macros-impl` | LL | #[my_macro] struct One($name); | ^^^^^ - | + | ::: $DIR/group-compat-hack.rs:44:5 | LL | impl_macros!(Foo); @@ -36,7 +36,7 @@ warning: using an old version of `js-sys` | LL | #[my_macro] struct Two($name); | ^^^^^ - | + | ::: $DIR/group-compat-hack.rs:46:5 | LL | arrays!(Foo); @@ -52,7 +52,7 @@ warning: using an old version of `actix-web` | LL | #[my_macro] struct Three($T); | ^^ - | + | ::: $DIR/group-compat-hack.rs:55:5 | LL | tuple_from_req!(Foo); @@ -68,7 +68,7 @@ warning: using an old version of `actix-web` | LL | #[my_macro] struct Three($T); | ^^ - | + | ::: $DIR/group-compat-hack.rs:63:5 | LL | tuple_from_req!(Foo); @@ -87,7 +87,7 @@ warning: using an old version of `time-macros-impl` | LL | #[my_macro] struct One($name); | ^^^^^ - | + | ::: $DIR/group-compat-hack.rs:27:5 | LL | impl_macros!(Foo); @@ -105,7 +105,7 @@ warning: using an old version of `time-macros-impl` | LL | #[my_macro] struct One($name); | ^^^^^ - | + | ::: $DIR/group-compat-hack.rs:44:5 | LL | impl_macros!(Foo); @@ -122,7 +122,7 @@ warning: using an old version of `js-sys` | LL | #[my_macro] struct Two($name); | ^^^^^ - | + | ::: $DIR/group-compat-hack.rs:46:5 | LL | arrays!(Foo); @@ -139,7 +139,7 @@ warning: using an old version of `actix-web` | LL | #[my_macro] struct Three($T); | ^^ - | + | ::: $DIR/group-compat-hack.rs:55:5 | LL | tuple_from_req!(Foo); @@ -156,7 +156,7 @@ warning: using an old version of `actix-web` | LL | #[my_macro] struct Three($T); | ^^ - | + | ::: $DIR/group-compat-hack.rs:63:5 | LL | tuple_from_req!(Foo); diff --git a/src/test/ui/proc-macro/parent-source-spans.stderr b/src/test/ui/proc-macro/parent-source-spans.stderr index 0af1b4a182295..071e103742e66 100644 --- a/src/test/ui/proc-macro/parent-source-spans.stderr +++ b/src/test/ui/proc-macro/parent-source-spans.stderr @@ -144,7 +144,7 @@ LL | parent_source_spans!($($tokens)*); ... LL | one!("hello", "world"); | ----------------------- in this macro invocation - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), @@ -160,7 +160,7 @@ LL | parent_source_spans!($($tokens)*); ... LL | two!("yay", "rust"); | -------------------- in this macro invocation - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), @@ -176,7 +176,7 @@ LL | parent_source_spans!($($tokens)*); ... LL | three!("hip", "hop"); | --------------------- in this macro invocation - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T), diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr index c5fbf0d1d99a4..e518c6ab80032 100644 --- a/src/test/ui/proc-macro/resolve-error.stderr +++ b/src/test/ui/proc-macro/resolve-error.stderr @@ -3,7 +3,7 @@ error: cannot find macro `bang_proc_macrp` in this scope | LL | bang_proc_macrp!(); | ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro` - | + | ::: $DIR/auxiliary/test-macros.rs:15:1 | LL | pub fn empty(_: TokenStream) -> TokenStream { @@ -50,7 +50,7 @@ error: cannot find derive macro `Dlona` in this scope | LL | #[derive(Dlona)] | ^^^^^ help: a derive macro with a similar name exists: `Clona` - | + | ::: $DIR/auxiliary/derive-clona.rs:11:1 | LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { @@ -61,7 +61,7 @@ error: cannot find derive macro `Dlona` in this scope | LL | #[derive(Dlona)] | ^^^^^ help: a derive macro with a similar name exists: `Clona` - | + | ::: $DIR/auxiliary/derive-clona.rs:11:1 | LL | pub fn derive_clonea(input: TokenStream) -> TokenStream { @@ -72,7 +72,7 @@ error: cannot find derive macro `Dlone` in this scope | LL | #[derive(Dlone)] | ^^^^^ help: a derive macro with a similar name exists: `Clone` - | + | ::: $SRC_DIR/core/src/clone.rs:LL:COL | LL | pub macro Clone($item:item) { @@ -83,7 +83,7 @@ error: cannot find derive macro `Dlone` in this scope | LL | #[derive(Dlone)] | ^^^^^ help: a derive macro with a similar name exists: `Clone` - | + | ::: $SRC_DIR/core/src/clone.rs:LL:COL | LL | pub macro Clone($item:item) { @@ -100,7 +100,7 @@ error: cannot find attribute `attr_proc_macra` in this scope | LL | #[attr_proc_macra] | ^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `attr_proc_macro` - | + | ::: $DIR/auxiliary/test-macros.rs:20:1 | LL | pub fn empty_attr(_: TokenStream, _: TokenStream) -> TokenStream { @@ -111,7 +111,7 @@ error: cannot find derive macro `FooWithLongNan` in this scope | LL | #[derive(FooWithLongNan)] | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` - | + | ::: $DIR/auxiliary/derive-foo.rs:11:1 | LL | pub fn derive_foo(input: TokenStream) -> TokenStream { @@ -122,7 +122,7 @@ error: cannot find derive macro `FooWithLongNan` in this scope | LL | #[derive(FooWithLongNan)] | ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName` - | + | ::: $DIR/auxiliary/derive-foo.rs:11:1 | LL | pub fn derive_foo(input: TokenStream) -> TokenStream { diff --git a/src/test/ui/proc-macro/span-from-proc-macro.stderr b/src/test/ui/proc-macro/span-from-proc-macro.stderr index c3904d62c8df3..11ee20e846d32 100644 --- a/src/test/ui/proc-macro/span-from-proc-macro.stderr +++ b/src/test/ui/proc-macro/span-from-proc-macro.stderr @@ -6,7 +6,7 @@ LL | pub fn error_from_attribute(_args: TokenStream, _input: TokenStream) -> Tok ... LL | field: MissingType | ^^^^^^^^^^^ not found in this scope - | + | ::: $DIR/span-from-proc-macro.rs:8:1 | LL | #[error_from_attribute] @@ -20,7 +20,7 @@ LL | pub fn error_from_derive(_input: TokenStream) -> TokenStream { ... LL | Variant(OtherMissingType) | ^^^^^^^^^^^^^^^^ not found in this scope - | + | ::: $DIR/span-from-proc-macro.rs:11:10 | LL | #[derive(ErrorFromDerive)] @@ -34,7 +34,7 @@ LL | pub fn other_error_from_bang(_input: TokenStream) -> TokenStream { LL | custom_quote::custom_quote! { LL | my_ident | ^^^^^^^^ not found in this scope - | + | ::: $DIR/span-from-proc-macro.rs:16:5 | LL | other_error_from_bang!(); @@ -50,7 +50,7 @@ LL | let bang_error: bool = 25; ... LL | pub fn error_from_bang(_input: TokenStream) -> TokenStream { | ---------------------------------------------------------- in this expansion of `error_from_bang!` - | + | ::: $DIR/span-from-proc-macro.rs:15:5 | LL | error_from_bang!(); diff --git a/src/test/ui/range/range-1.stderr b/src/test/ui/range/range-1.stderr index b282fa7803f03..53453ea04ddb4 100644 --- a/src/test/ui/range/range-1.stderr +++ b/src/test/ui/range/range-1.stderr @@ -23,7 +23,7 @@ error[E0277]: the size for values of type `[{integer}]` cannot be known at compi | LL | let range = *arr..; | ^^^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/ops/range.rs:LL:COL | LL | pub struct RangeFrom { diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr index dfb69a3cc1b42..f904a0ecd11cd 100644 --- a/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr +++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.stderr @@ -3,7 +3,7 @@ error[E0005]: refutable pattern in local binding: `Err(_)` not covered | LL | let Ok(x) = res; | ^^^^^ pattern `Err(_)` not covered - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), diff --git a/src/test/ui/resolve/issue-19452.stderr b/src/test/ui/resolve/issue-19452.stderr index 6c519d7348025..8df84067e6741 100644 --- a/src/test/ui/resolve/issue-19452.stderr +++ b/src/test/ui/resolve/issue-19452.stderr @@ -12,7 +12,7 @@ error[E0423]: expected value, found struct variant `issue_19452_aux::Homura::Mad | LL | let homura = issue_19452_aux::Homura::Madoka; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `issue_19452_aux::Homura::Madoka { /* fields */ }` - | + | ::: $DIR/auxiliary/issue-19452-aux.rs:2:5 | LL | Madoka { age: u32 } diff --git a/src/test/ui/resolve/levenshtein.stderr b/src/test/ui/resolve/levenshtein.stderr index 3c76f2684a702..a7f10f7719eac 100644 --- a/src/test/ui/resolve/levenshtein.stderr +++ b/src/test/ui/resolve/levenshtein.stderr @@ -18,7 +18,7 @@ error[E0412]: cannot find type `Opiton` in this scope | LL | type B = Opiton; // Misspelled type name from the prelude. | ^^^^^^ help: an enum with a similar name exists: `Option` - | + | ::: $SRC_DIR/core/src/option.rs:LL:COL | LL | pub enum Option { diff --git a/src/test/ui/resolve/privacy-struct-ctor.stderr b/src/test/ui/resolve/privacy-struct-ctor.stderr index a72f69cf1cd8d..e5d6f7e9e24f0 100644 --- a/src/test/ui/resolve/privacy-struct-ctor.stderr +++ b/src/test/ui/resolve/privacy-struct-ctor.stderr @@ -103,7 +103,7 @@ error[E0603]: tuple struct constructor `S` is private | LL | xcrate::m::S; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy-struct-ctor.rs:2:18 | LL | pub struct S(u8); @@ -120,7 +120,7 @@ error[E0603]: tuple struct constructor `Z` is private | LL | xcrate::m::n::Z; | ^ private tuple struct constructor - | + | ::: $DIR/auxiliary/privacy-struct-ctor.rs:5:28 | LL | pub(in m) struct Z(pub(in m::n) u8); diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr index e33253b19c4bd..e32d89fe6beeb 100644 --- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr @@ -7,7 +7,7 @@ LL | / fn can_parse_zero_as_f32() -> Result { LL | | "0".parse() LL | | } | |_^ `main` can only return types that implement `Termination` - | + | ::: $SRC_DIR/test/src/lib.rs:LL:COL | LL | pub fn assert_test_result(result: T) { diff --git a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr index d023ba3096e68..141363fc32caa 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/struct.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/struct.stderr @@ -15,7 +15,7 @@ error[E0603]: tuple struct constructor `TupleStruct` is private | LL | let ts_explicit = structs::TupleStruct(640, 480); | ^^^^^^^^^^^ private tuple struct constructor - | + | ::: $DIR/auxiliary/structs.rs:11:24 | LL | pub struct TupleStruct(pub u16, pub u16); diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr index 746c1fd4aceb7..d21a94a0d6498 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr @@ -30,7 +30,7 @@ error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covere | LL | match x {} | ^ patterns `Tuple(_)` and `Struct { .. }` not covered - | + | ::: $DIR/auxiliary/uninhabited.rs:17:23 | LL | #[non_exhaustive] Tuple(!), diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr index 46e84dc09a3ea..cc3dc6c29b904 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr @@ -30,7 +30,7 @@ error[E0004]: non-exhaustive patterns: `Tuple(_)` and `Struct { .. }` not covere | LL | match x {} | ^ patterns `Tuple(_)` and `Struct { .. }` not covered - | + | ::: $DIR/auxiliary/uninhabited.rs:17:23 | LL | #[non_exhaustive] Tuple(!), diff --git a/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr b/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr index ad9b8af00e467..7a63e6f6e686a 100644 --- a/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr +++ b/src/test/ui/rust-2021/future-prelude-collision-shadow.stderr @@ -3,7 +3,7 @@ error[E0599]: no method named `try_into` found for type `u8` in the current scop | LL | let _: u32 = 3u8.try_into().unwrap(); | ^^^^^^^^ method not found in `u8` - | + | ::: $SRC_DIR/core/src/convert/mod.rs:LL:COL | LL | fn try_into(self) -> Result; diff --git a/src/test/ui/span/transitive-dep-span.stderr b/src/test/ui/span/transitive-dep-span.stderr index 68d8911a4351c..1787b0ee19ad6 100644 --- a/src/test/ui/span/transitive-dep-span.stderr +++ b/src/test/ui/span/transitive-dep-span.stderr @@ -6,7 +6,7 @@ LL | | () => { parse error } | | ^^^^^ expected one of `!` or `::` LL | | } | |_________- in this expansion of `transitive_dep_two::parse_error!` - | + | ::: $DIR/transitive-dep-span.rs:13:1 | LL | transitive_dep_two::parse_error!(); diff --git a/src/test/ui/suggestions/attribute-typos.stderr b/src/test/ui/suggestions/attribute-typos.stderr index 6a825c534b5e2..d6163a5a7cfe3 100644 --- a/src/test/ui/suggestions/attribute-typos.stderr +++ b/src/test/ui/suggestions/attribute-typos.stderr @@ -15,7 +15,7 @@ error: cannot find attribute `tests` in this scope | LL | #[tests] | ^^^^^ help: an attribute macro with a similar name exists: `test` - | + | ::: $SRC_DIR/core/src/macros/mod.rs:LL:COL | LL | pub macro test($item:item) { diff --git a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr b/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr index 59ccb29e0901a..7bdc8e00f447d 100644 --- a/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr +++ b/src/test/ui/suggestions/do-not-attempt-to-add-suggestions-with-no-changes.stderr @@ -3,7 +3,7 @@ error[E0573]: expected type, found module `result` | LL | impl result { | ^^^^^^ help: an enum with a similar name exists: `Result` - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | pub enum Result { diff --git a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr index 119599c22a63b..c4eeb3aaa5709 100644 --- a/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr +++ b/src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr @@ -77,7 +77,7 @@ LL | / async { LL | | 42 LL | | } | |_____^ expected struct `Pin`, found opaque type - | + | ::: $SRC_DIR/core/src/future/mod.rs:LL:COL | LL | pub const fn from_generator(gen: T) -> impl Future diff --git a/src/test/ui/suggestions/imm-ref-trait-object.stderr b/src/test/ui/suggestions/imm-ref-trait-object.stderr index 9f89dcd912e1d..42ca3a78d8f9f 100644 --- a/src/test/ui/suggestions/imm-ref-trait-object.stderr +++ b/src/test/ui/suggestions/imm-ref-trait-object.stderr @@ -3,7 +3,7 @@ error: the `min` method cannot be invoked on a trait object | LL | t.min().unwrap() | ^^^ - | + | ::: $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL | LL | Self: Sized, diff --git a/src/test/ui/suggestions/import-trait-for-method-call.stderr b/src/test/ui/suggestions/import-trait-for-method-call.stderr index a2b9b9d14ab09..bac8de7987256 100644 --- a/src/test/ui/suggestions/import-trait-for-method-call.stderr +++ b/src/test/ui/suggestions/import-trait-for-method-call.stderr @@ -3,7 +3,7 @@ error[E0599]: no method named `finish` found for struct `DefaultHasher` in the c | LL | h.finish() | ^^^^^^ method not found in `DefaultHasher` - | + | ::: $SRC_DIR/core/src/hash/mod.rs:LL:COL | LL | fn finish(&self) -> u64; diff --git a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr index 4d1b5306bb130..07fdffd8bedec 100644 --- a/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr +++ b/src/test/ui/suggestions/mut-borrow-needed-by-trait.stderr @@ -16,7 +16,7 @@ error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satis | LL | let fp = BufWriter::new(fp); | ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write` - | + | ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL | LL | pub struct BufWriter { @@ -29,7 +29,7 @@ error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn std::io:: | LL | writeln!(fp, "hello world").unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ method cannot be called on `BufWriter<&dyn std::io::Write>` due to unsatisfied trait bounds - | + | ::: $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL | LL | pub struct BufWriter { diff --git a/src/test/ui/suggestions/suggest-change-mut.stderr b/src/test/ui/suggestions/suggest-change-mut.stderr index e68152d5fc3aa..8384f952b6849 100644 --- a/src/test/ui/suggestions/suggest-change-mut.stderr +++ b/src/test/ui/suggestions/suggest-change-mut.stderr @@ -27,7 +27,7 @@ error[E0599]: the method `read_until` exists for struct `BufReader<&T>`, but its | LL | stream_reader.read_until(b'\n', &mut buffer).expect("Reading into buffer failed"); | ^^^^^^^^^^ method cannot be called on `BufReader<&T>` due to unsatisfied trait bounds - | + | ::: $SRC_DIR/std/src/io/buffered/bufreader.rs:LL:COL | LL | pub struct BufReader { diff --git a/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr b/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr index 7cf872eb6ac69..bfdd121012ae0 100644 --- a/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr +++ b/src/test/ui/traits/associated_type_bound/assoc_type_bound_with_struct.stderr @@ -3,7 +3,7 @@ error[E0404]: expected trait, found struct `String` | LL | struct Foo where T: Bar, ::Baz: String { | ^^^^^^ not a trait - | + | ::: $SRC_DIR/alloc/src/string.rs:LL:COL | LL | pub trait ToString { @@ -23,7 +23,7 @@ error[E0404]: expected trait, found struct `String` | LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: String { | ^^^^^^ not a trait - | + | ::: $SRC_DIR/alloc/src/string.rs:LL:COL | LL | pub trait ToString { @@ -43,7 +43,7 @@ error[E0404]: expected trait, found struct `String` | LL | fn foo(_: T) where ::Baz: String { | ^^^^^^ not a trait - | + | ::: $SRC_DIR/alloc/src/string.rs:LL:COL | LL | pub trait ToString { @@ -63,7 +63,7 @@ error[E0404]: expected trait, found struct `String` | LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: String { | ^^^^^^ not a trait - | + | ::: $SRC_DIR/alloc/src/string.rs:LL:COL | LL | pub trait ToString { diff --git a/src/test/ui/traits/bad-sized.stderr b/src/test/ui/traits/bad-sized.stderr index 5a9d4286ce6d1..58e34cfe15c3d 100644 --- a/src/test/ui/traits/bad-sized.stderr +++ b/src/test/ui/traits/bad-sized.stderr @@ -14,7 +14,7 @@ error[E0277]: the size for values of type `dyn Trait` cannot be known at compila | LL | let x: Vec = Vec::new(); | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL | LL | pub struct Vec { @@ -40,7 +40,7 @@ error[E0277]: the size for values of type `dyn Trait` cannot be known at compila | LL | let x: Vec = Vec::new(); | ^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/alloc/src/vec/mod.rs:LL:COL | LL | pub struct Vec { diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr b/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr index 0adb20d482877..91552d4ea07d4 100644 --- a/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-xc.stderr @@ -3,7 +3,7 @@ error[E0277]: the trait bound `usize: Trait` is not satisfied | LL | fn explode(x: Foo) {} | ^^^^^^^^^^ the trait `Trait` is not implemented for `usize` - | + | ::: $DIR/auxiliary/on_structs_and_enums_xc.rs:5:18 | LL | pub struct Foo { @@ -14,7 +14,7 @@ error[E0277]: the trait bound `f32: Trait` is not satisfied | LL | fn kaboom(y: Bar) {} | ^^^^^^^^ the trait `Trait` is not implemented for `f32` - | + | ::: $DIR/auxiliary/on_structs_and_enums_xc.rs:9:16 | LL | pub enum Bar { diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr index ada2445c1c962..7d54a559e8b7e 100644 --- a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr @@ -3,7 +3,7 @@ error[E0277]: the trait bound `f64: Trait` is not satisfied | LL | let bar: Bar = return; | ^^^^^^^^ the trait `Trait` is not implemented for `f64` - | + | ::: $DIR/auxiliary/on_structs_and_enums_xc.rs:9:16 | LL | pub enum Bar { diff --git a/src/test/ui/traits/bound/same-crate-name.stderr b/src/test/ui/traits/bound/same-crate-name.stderr index c48f2f0efcfb2..ce163b501b79b 100644 --- a/src/test/ui/traits/bound/same-crate-name.stderr +++ b/src/test/ui/traits/bound/same-crate-name.stderr @@ -3,7 +3,7 @@ error[E0277]: the trait bound `Foo: main::a::Bar` is not satisfied | LL | a::try_foo(foo); | ^^^ the trait `main::a::Bar` is not implemented for `Foo` - | + | ::: $DIR/auxiliary/crate_a1.rs:3:24 | LL | pub fn try_foo(x: impl Bar) {} @@ -21,7 +21,7 @@ error[E0277]: the trait bound `DoesNotImplementTrait: main::a::Bar` is not satis | LL | a::try_foo(implements_no_traits); | ^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `DoesNotImplementTrait` - | + | ::: $DIR/auxiliary/crate_a1.rs:3:24 | LL | pub fn try_foo(x: impl Bar) {} @@ -32,7 +32,7 @@ error[E0277]: the trait bound `ImplementsWrongTraitConditionally: main::a | LL | a::try_foo(other_variant_implements_mismatched_trait); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `ImplementsWrongTraitConditionally` - | + | ::: $DIR/auxiliary/crate_a1.rs:3:24 | LL | pub fn try_foo(x: impl Bar) {} @@ -50,7 +50,7 @@ error[E0277]: the trait bound `ImplementsTraitForUsize: main::a::Bar` is | LL | a::try_foo(other_variant_implements_correct_trait); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `ImplementsTraitForUsize` - | + | ::: $DIR/auxiliary/crate_a1.rs:3:24 | LL | pub fn try_foo(x: impl Bar) {} diff --git a/src/test/ui/traits/mutual-recursion-issue-75860.stderr b/src/test/ui/traits/mutual-recursion-issue-75860.stderr index cf867ef78c3b1..91c4136a752fb 100644 --- a/src/test/ui/traits/mutual-recursion-issue-75860.stderr +++ b/src/test/ui/traits/mutual-recursion-issue-75860.stderr @@ -3,7 +3,7 @@ error[E0275]: overflow evaluating the requirement `Option<_>: Sized` | LL | iso(left, right) | ^^^ - | + | ::: $SRC_DIR/core/src/option.rs:LL:COL | LL | pub enum Option { diff --git a/src/test/ui/traits/suggest-deferences/issue-39029.stderr b/src/test/ui/traits/suggest-deferences/issue-39029.stderr index 1005231d396e7..d1778a284dad8 100644 --- a/src/test/ui/traits/suggest-deferences/issue-39029.stderr +++ b/src/test/ui/traits/suggest-deferences/issue-39029.stderr @@ -6,7 +6,7 @@ LL | let _errors = TcpListener::bind(&bad); | | | the trait `ToSocketAddrs` is not implemented for `NoToSocketAddrs` | help: consider adding dereference here: `&*bad` - | + | ::: $SRC_DIR/std/src/net/tcp.rs:LL:COL | LL | pub fn bind(addr: A) -> io::Result { diff --git a/src/test/ui/traits/suggest-where-clause.stderr b/src/test/ui/traits/suggest-where-clause.stderr index 47f287807d4b9..c34e3261fe185 100644 --- a/src/test/ui/traits/suggest-where-clause.stderr +++ b/src/test/ui/traits/suggest-where-clause.stderr @@ -6,7 +6,7 @@ LL | fn check() { LL | // suggest a where-clause, if needed LL | mem::size_of::(); | ^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { @@ -25,7 +25,7 @@ LL | fn check() { ... LL | mem::size_of::>(); | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { @@ -90,7 +90,7 @@ error[E0277]: the size for values of type `[T]` cannot be known at compilation t | LL | mem::size_of::<[T]>(); | ^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { @@ -103,7 +103,7 @@ error[E0277]: the size for values of type `[&U]` cannot be known at compilation | LL | mem::size_of::<[&U]>(); | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/mem/mod.rs:LL:COL | LL | pub const fn size_of() -> usize { diff --git a/src/test/ui/typeck/issue-83693.stderr b/src/test/ui/typeck/issue-83693.stderr index e5ef0d0d59f73..0d8bbf1ce98c1 100644 --- a/src/test/ui/typeck/issue-83693.stderr +++ b/src/test/ui/typeck/issue-83693.stderr @@ -3,7 +3,7 @@ error[E0412]: cannot find type `F` in this scope | LL | impl F { | ^ help: a trait with a similar name exists: `Fn` - | + | ::: $SRC_DIR/core/src/ops/function.rs:LL:COL | LL | pub trait Fn: FnMut { diff --git a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr index 4f2f9e070fe52..b92ceb479bd3b 100644 --- a/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr +++ b/src/test/ui/uninhabited/uninhabited-matches-feature-gated.stderr @@ -3,7 +3,7 @@ error[E0004]: non-exhaustive patterns: `Err(_)` not covered | LL | let _ = match x { | ^ pattern `Err(_)` not covered - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), @@ -57,7 +57,7 @@ error[E0004]: non-exhaustive patterns: `Err(_)` not covered | LL | let _ = match x { | ^ pattern `Err(_)` not covered - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), @@ -71,7 +71,7 @@ error[E0005]: refutable pattern in local binding: `Err(_)` not covered | LL | let Ok(x) = x; | ^^^^^ pattern `Err(_)` not covered - | + | ::: $SRC_DIR/core/src/result.rs:LL:COL | LL | Err(#[stable(feature = "rust1", since = "1.0.0")] E), diff --git a/src/test/ui/union/union-derive-clone.mirunsafeck.stderr b/src/test/ui/union/union-derive-clone.mirunsafeck.stderr index 41e828c6d9515..9c4ee28a2adb4 100644 --- a/src/test/ui/union/union-derive-clone.mirunsafeck.stderr +++ b/src/test/ui/union/union-derive-clone.mirunsafeck.stderr @@ -3,7 +3,7 @@ error[E0277]: the trait bound `U1: Copy` is not satisfied | LL | #[derive(Clone)] | ^^^^^ the trait `Copy` is not implemented for `U1` - | + | ::: $SRC_DIR/core/src/clone.rs:LL:COL | LL | pub struct AssertParamIsCopy { diff --git a/src/test/ui/union/union-derive-clone.thirunsafeck.stderr b/src/test/ui/union/union-derive-clone.thirunsafeck.stderr index 41e828c6d9515..9c4ee28a2adb4 100644 --- a/src/test/ui/union/union-derive-clone.thirunsafeck.stderr +++ b/src/test/ui/union/union-derive-clone.thirunsafeck.stderr @@ -3,7 +3,7 @@ error[E0277]: the trait bound `U1: Copy` is not satisfied | LL | #[derive(Clone)] | ^^^^^ the trait `Copy` is not implemented for `U1` - | + | ::: $SRC_DIR/core/src/clone.rs:LL:COL | LL | pub struct AssertParamIsCopy { diff --git a/src/test/ui/union/union-derive-eq.mirunsafeck.stderr b/src/test/ui/union/union-derive-eq.mirunsafeck.stderr index c2fd8545f63ad..1d768315d9f65 100644 --- a/src/test/ui/union/union-derive-eq.mirunsafeck.stderr +++ b/src/test/ui/union/union-derive-eq.mirunsafeck.stderr @@ -6,7 +6,7 @@ LL | #[derive(Eq)] LL | union U2 { LL | a: PartialEqNotEq, | ^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `PartialEqNotEq` - | + | ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub struct AssertParamIsEq { diff --git a/src/test/ui/union/union-derive-eq.thirunsafeck.stderr b/src/test/ui/union/union-derive-eq.thirunsafeck.stderr index c2fd8545f63ad..1d768315d9f65 100644 --- a/src/test/ui/union/union-derive-eq.thirunsafeck.stderr +++ b/src/test/ui/union/union-derive-eq.thirunsafeck.stderr @@ -6,7 +6,7 @@ LL | #[derive(Eq)] LL | union U2 { LL | a: PartialEqNotEq, | ^^^^^^^^^^^^^^^^^ the trait `Eq` is not implemented for `PartialEqNotEq` - | + | ::: $SRC_DIR/core/src/cmp.rs:LL:COL | LL | pub struct AssertParamIsEq { diff --git a/src/test/ui/unique-object-noncopyable.stderr b/src/test/ui/unique-object-noncopyable.stderr index 6a355dd256286..5c40787febfb7 100644 --- a/src/test/ui/unique-object-noncopyable.stderr +++ b/src/test/ui/unique-object-noncopyable.stderr @@ -9,7 +9,7 @@ LL | trait Foo { ... LL | let _z = y.clone(); | ^^^^^ method cannot be called on `Box` due to unsatisfied trait bounds - | + | ::: $SRC_DIR/alloc/src/boxed.rs:LL:COL | LL | / pub struct Box< diff --git a/src/test/ui/unique-pinned-nocopy.stderr b/src/test/ui/unique-pinned-nocopy.stderr index a4421bcf8097e..8e0804ebf9be9 100644 --- a/src/test/ui/unique-pinned-nocopy.stderr +++ b/src/test/ui/unique-pinned-nocopy.stderr @@ -6,7 +6,7 @@ LL | struct R { ... LL | let _j = i.clone(); | ^^^^^ method cannot be called on `Box` due to unsatisfied trait bounds - | + | ::: $SRC_DIR/alloc/src/boxed.rs:LL:COL | LL | / pub struct Box< diff --git a/src/test/ui/wf/wf-impl-self-type.stderr b/src/test/ui/wf/wf-impl-self-type.stderr index bc30fc90f3a28..918e5feb28657 100644 --- a/src/test/ui/wf/wf-impl-self-type.stderr +++ b/src/test/ui/wf/wf-impl-self-type.stderr @@ -3,7 +3,7 @@ error[E0277]: the size for values of type `[u8]` cannot be known at compilation | LL | impl Foo for Option<[u8]> {} | ^^^^^^^^^^^^ doesn't have a size known at compile-time - | + | ::: $SRC_DIR/core/src/option.rs:LL:COL | LL | pub enum Option { diff --git a/src/test/ui/xc-private-method.stderr b/src/test/ui/xc-private-method.stderr index 69b414cc8f923..0eabc592aa41e 100644 --- a/src/test/ui/xc-private-method.stderr +++ b/src/test/ui/xc-private-method.stderr @@ -3,7 +3,7 @@ error[E0624]: associated function `static_meth_struct` is private | LL | let _ = xc_private_method_lib::Struct::static_meth_struct(); | ^^^^^^^^^^^^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/xc-private-method-lib.rs:8:5 | LL | fn static_meth_struct() -> Struct { @@ -14,7 +14,7 @@ error[E0624]: associated function `static_meth_enum` is private | LL | let _ = xc_private_method_lib::Enum::static_meth_enum(); | ^^^^^^^^^^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/xc-private-method-lib.rs:23:5 | LL | fn static_meth_enum() -> Enum { diff --git a/src/test/ui/xc-private-method2.stderr b/src/test/ui/xc-private-method2.stderr index 685ce0e0a186f..b569882f8c159 100644 --- a/src/test/ui/xc-private-method2.stderr +++ b/src/test/ui/xc-private-method2.stderr @@ -3,7 +3,7 @@ error[E0624]: associated function `meth_struct` is private | LL | let _ = xc_private_method_lib::Struct{ x: 10 }.meth_struct(); | ^^^^^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/xc-private-method-lib.rs:12:5 | LL | fn meth_struct(&self) -> isize { @@ -14,7 +14,7 @@ error[E0624]: associated function `meth_enum` is private | LL | let _ = xc_private_method_lib::Enum::Variant1(20).meth_enum(); | ^^^^^^^^^ private associated function - | + | ::: $DIR/auxiliary/xc-private-method-lib.rs:27:5 | LL | fn meth_enum(&self) -> isize { diff --git a/src/test/ui/xcrate/xcrate-unit-struct.stderr b/src/test/ui/xcrate/xcrate-unit-struct.stderr index 3dc8b90795c4d..cee314568887c 100644 --- a/src/test/ui/xcrate/xcrate-unit-struct.stderr +++ b/src/test/ui/xcrate/xcrate-unit-struct.stderr @@ -3,7 +3,7 @@ error[E0423]: expected value, found struct `xcrate_unit_struct::StructWithFields | LL | let _ = xcrate_unit_struct::StructWithFields; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use struct literal syntax instead: `xcrate_unit_struct::StructWithFields { foo: val }` - | + | ::: $DIR/auxiliary/xcrate_unit_struct.rs:20:1 | LL | pub struct StructWithFields { From 02b7754f9e7c01048581a283ced85183cc34a61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Tue, 3 Aug 2021 07:24:31 +0200 Subject: [PATCH 03/14] don't use .into() to convert types to identical types (clippy::useless_conversion) Example: let _x: String = String::from("hello world").into(); --- compiler/rustc_mir/src/interpret/operand.rs | 2 +- compiler/rustc_mir/src/interpret/terminator.rs | 2 +- .../src/transform/simplify_comparison_integral.rs | 2 +- src/librustdoc/clean/mod.rs | 9 ++++----- src/librustdoc/clean/types.rs | 2 +- src/librustdoc/formats/cache.rs | 2 +- src/librustdoc/html/format.rs | 4 ++-- src/librustdoc/html/render/cache.rs | 2 +- src/librustdoc/passes/collect_intra_doc_links.rs | 12 ++++++------ src/librustdoc/passes/collect_trait_impls.rs | 2 +- src/librustdoc/visit_ast.rs | 4 ++-- 11 files changed, 21 insertions(+), 22 deletions(-) diff --git a/compiler/rustc_mir/src/interpret/operand.rs b/compiler/rustc_mir/src/interpret/operand.rs index aba7db7816843..17aecfdc41da2 100644 --- a/compiler/rustc_mir/src/interpret/operand.rs +++ b/compiler/rustc_mir/src/interpret/operand.rs @@ -585,7 +585,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { let ptr = self.global_base_pointer(Pointer::new(id, offset))?; Operand::Indirect(MemPlace::from_ptr(ptr.into(), layout.align.abi)) } - ConstValue::Scalar(x) => Operand::Immediate(tag_scalar(x.into())?.into()), + ConstValue::Scalar(x) => Operand::Immediate(tag_scalar(x)?.into()), ConstValue::Slice { data, start, end } => { // We rely on mutability being set correctly in `data` to prevent writes // where none should happen. diff --git a/compiler/rustc_mir/src/interpret/terminator.rs b/compiler/rustc_mir/src/interpret/terminator.rs index f369480d959fe..35ae07e25cada 100644 --- a/compiler/rustc_mir/src/interpret/terminator.rs +++ b/compiler/rustc_mir/src/interpret/terminator.rs @@ -73,7 +73,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { ty::FnPtr(sig) => { let caller_abi = sig.abi(); let fn_ptr = self.read_pointer(&func)?; - let fn_val = self.memory.get_fn(fn_ptr.into())?; + let fn_val = self.memory.get_fn(fn_ptr)?; ( fn_val, caller_abi, diff --git a/compiler/rustc_mir/src/transform/simplify_comparison_integral.rs b/compiler/rustc_mir/src/transform/simplify_comparison_integral.rs index 1ddf7c9cd0c9e..948fcd9f4550f 100644 --- a/compiler/rustc_mir/src/transform/simplify_comparison_integral.rs +++ b/compiler/rustc_mir/src/transform/simplify_comparison_integral.rs @@ -211,7 +211,7 @@ fn find_branch_value_info<'tcx>( return None; }; let branch_value_scalar = branch_value.literal.try_to_scalar()?; - Some((branch_value_scalar.into(), branch_value_ty, *to_switch_on)) + Some((branch_value_scalar, branch_value_ty, *to_switch_on)) } _ => None, } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 75ea30bb565f1..b3fc1e73f7885 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -675,11 +675,10 @@ impl<'a, 'tcx> Clean for (&'a ty::Generics, ty::GenericPredicates<'tcx if let Some(((_, trait_did, name), rhs)) = proj.as_ref().and_then(|(lhs, rhs)| Some((lhs.projection()?, rhs))) { - impl_trait_proj.entry(param_idx).or_default().push(( - trait_did.into(), - name, - rhs, - )); + impl_trait_proj + .entry(param_idx) + .or_default() + .push((trait_did, name, rhs)); } return None; diff --git a/src/librustdoc/clean/types.rs b/src/librustdoc/clean/types.rs index 2460fa127f116..5c73d3de5b93f 100644 --- a/src/librustdoc/clean/types.rs +++ b/src/librustdoc/clean/types.rs @@ -1614,7 +1614,7 @@ impl Type { impl Type { fn inner_def_id(&self, cache: Option<&Cache>) -> Option { let t: PrimitiveType = match *self { - ResolvedPath { did, .. } => return Some(did.into()), + ResolvedPath { did, .. } => return Some(did), DynTrait(ref bounds, _) => return bounds[0].trait_.inner_def_id(cache), Primitive(p) => return cache.and_then(|c| c.primitive_locations.get(&p).cloned()), BorrowedRef { type_: box Generic(..), .. } => PrimitiveType::Reference, diff --git a/src/librustdoc/formats/cache.rs b/src/librustdoc/formats/cache.rs index 5ea2cdc2ad909..3d267ca50334d 100644 --- a/src/librustdoc/formats/cache.rs +++ b/src/librustdoc/formats/cache.rs @@ -228,7 +228,7 @@ impl<'a, 'tcx> DocFolder for CacheBuilder<'a, 'tcx> { if i.blanket_impl.is_none() { self.cache .implementors - .entry(did.into()) + .entry(did) .or_default() .push(Impl { impl_item: item.clone() }); } diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 0291236abdfa6..8ab6aa775d2e4 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -688,7 +688,7 @@ crate fn anchor<'a, 'cx: 'a>( text: &'a str, cx: &'cx Context<'_>, ) -> impl fmt::Display + 'a { - let parts = href(did.into(), cx); + let parts = href(did, cx); display_fn(move |f| { if let Ok((url, short_ty, fqp)) = parts { write!( @@ -921,7 +921,7 @@ fn fmt_type<'cx>( // everything comes in as a fully resolved QPath (hard to // look at). box clean::ResolvedPath { did, .. } => { - match href(did.into(), cx) { + match href(did, cx) { Ok((ref url, _, ref path)) if !f.alternate() => { write!( f, diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs index 0734d2670ccfa..1c083522beaa9 100644 --- a/src/librustdoc/html/render/cache.rs +++ b/src/librustdoc/html/render/cache.rs @@ -42,7 +42,7 @@ crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt< name: item.name.unwrap().to_string(), path: fqp[..fqp.len() - 1].join("::"), desc, - parent: Some(did.into()), + parent: Some(did), parent_idx: None, search_type: get_index_search_type(&item, tcx), aliases: item.attrs.get_doc_aliases(), diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs index ddb7b85d34a04..b36be9541d2b3 100644 --- a/src/librustdoc/passes/collect_intra_doc_links.rs +++ b/src/librustdoc/passes/collect_intra_doc_links.rs @@ -293,7 +293,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> { ) -> Result<(Res, Option), ErrorKind<'path>> { let tcx = self.cx.tcx; let no_res = || ResolutionFailure::NotResolved { - module_id: module_id.into(), + module_id: module_id, partial_res: None, unresolved: path_str.into(), }; @@ -521,7 +521,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> { // but the disambiguator logic expects the associated item. // Store the kind in a side channel so that only the disambiguator logic looks at it. if let Some((kind, id)) = side_channel { - self.kind_side_channel.set(Some((kind, id.into()))); + self.kind_side_channel.set(Some((kind, id))); } Ok((res, Some(fragment))) }; @@ -1268,7 +1268,7 @@ impl LinkCollector<'_, '_> { // doesn't allow statements like `use str::trim;`, making this a (hopefully) // valid omission. See https://github.com/rust-lang/rust/pull/80660#discussion_r551585677 // for discussion on the matter. - verify(kind, id.into())?; + verify(kind, id)?; // FIXME: it would be nice to check that the feature gate was enabled in the original crate, not just ignore it altogether. // However I'm not sure how to check that across crates. @@ -1306,9 +1306,9 @@ impl LinkCollector<'_, '_> { Some(ItemLink { link: ori_link.link, link_text, did: None, fragment }) } Res::Def(kind, id) => { - verify(kind, id.into())?; + verify(kind, id)?; let id = clean::register_res(self.cx, rustc_hir::def::Res::Def(kind, id)); - Some(ItemLink { link: ori_link.link, link_text, did: Some(id.into()), fragment }) + Some(ItemLink { link: ori_link.link, link_text, did: Some(id), fragment }) } } } @@ -1886,7 +1886,7 @@ fn resolution_failure( name = start; for ns in [TypeNS, ValueNS, MacroNS] { if let Some(res) = - collector.check_full_res(ns, &start, module_id.into(), &None) + collector.check_full_res(ns, &start, module_id, &None) { debug!("found partial_res={:?}", res); *partial_res = Some(res); diff --git a/src/librustdoc/passes/collect_trait_impls.rs b/src/librustdoc/passes/collect_trait_impls.rs index 91c495a2bbc06..eefe50caa345e 100644 --- a/src/librustdoc/passes/collect_trait_impls.rs +++ b/src/librustdoc/passes/collect_trait_impls.rs @@ -45,7 +45,7 @@ crate fn collect_trait_impls(krate: Crate, cx: &mut DocContext<'_>) -> Crate { // FIXME(eddyb) is this `doc(hidden)` check needed? if !cx.tcx.get_attrs(def_id).lists(sym::doc).has_word(sym::hidden) { - let impls = get_auto_trait_and_blanket_impls(cx, def_id.into()); + let impls = get_auto_trait_and_blanket_impls(cx, def_id); new_items.extend(impls.filter(|i| cx.inlined.insert(i.def_id))); } }); diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index d74b3b4627284..e28910355357b 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -192,7 +192,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { } else { // All items need to be handled here in case someone wishes to link // to them with intra-doc links - self.cx.cache.access_levels.map.insert(did.into(), AccessLevel::Public); + self.cx.cache.access_levels.map.insert(did, AccessLevel::Public); } } } @@ -204,7 +204,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { None => return false, }; - let is_private = !self.cx.cache.access_levels.is_public(res_did.into()); + let is_private = !self.cx.cache.access_levels.is_public(res_did); let is_hidden = inherits_doc_hidden(self.cx.tcx, res_hir_id); // Only inline if requested or if the item would otherwise be stripped. From 499758a285e57a9a2dd3d02a887d03772ebfc85e Mon Sep 17 00:00:00 2001 From: frogtd <31412003+frogtd@users.noreply.github.com> Date: Tue, 3 Aug 2021 04:30:44 -0400 Subject: [PATCH 04/14] Use .contains instead of manual reimplementation. It's also significantly easier to read. --- library/core/src/num/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index 6c43d6d62128e..9788404dd05bf 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -847,7 +847,7 @@ fn from_str_radix(src: &str, radix: u32) -> Result= 2 && radix <= 36, + (2..=36).contains(&radix), "from_str_radix_int: must lie in the range `[2, 36]` - found {}", radix ); From f9b168fdd8ad0fa846a124750de5953fa7390ea1 Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Fri, 30 Jul 2021 11:31:46 +0000 Subject: [PATCH 05/14] Update `stdarch` to deprecate `crypto` aarch64 target_feature --- library/stdarch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/stdarch b/library/stdarch index 3001c75a1d2a8..c158cfd38e20d 160000 --- a/library/stdarch +++ b/library/stdarch @@ -1 +1 @@ -Subproject commit 3001c75a1d2a81d2a76bef139c69387cb2ebb820 +Subproject commit c158cfd38e20d855f5d6ca8a5a101eefb82604a8 From 3be9261048854ce5b558b5edc45c2756f0a1a0dd Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Tue, 1 Jun 2021 17:00:19 +0100 Subject: [PATCH 06/14] Remove crypto composite feature from allowed aarch64 features. Prefer using AES/SHA2 features directly. --- compiler/rustc_codegen_ssa/src/target_features.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/compiler/rustc_codegen_ssa/src/target_features.rs b/compiler/rustc_codegen_ssa/src/target_features.rs index c89d42ecc58ac..8d7e9612f4749 100644 --- a/compiler/rustc_codegen_ssa/src/target_features.rs +++ b/compiler/rustc_codegen_ssa/src/target_features.rs @@ -47,8 +47,6 @@ const AARCH64_ALLOWED_FEATURES: &[(&str, Option)] = &[ ("sve", Some(sym::aarch64_target_feature)), // FEAT_CRC ("crc", Some(sym::aarch64_target_feature)), - // Cryptographic extension - ("crypto", Some(sym::aarch64_target_feature)), // FEAT_RAS ("ras", Some(sym::aarch64_target_feature)), // FEAT_LSE From e817b505415d8830c937e41633a7edfdd82208dd Mon Sep 17 00:00:00 2001 From: Adam Gemmell Date: Tue, 1 Jun 2021 17:01:47 +0100 Subject: [PATCH 07/14] Update aarch64 runtime feature detection tests --- library/std/tests/run-time-detect.rs | 38 ++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/library/std/tests/run-time-detect.rs b/library/std/tests/run-time-detect.rs index c7107b5d0a3ef..079f00a5753f1 100644 --- a/library/std/tests/run-time-detect.rs +++ b/library/std/tests/run-time-detect.rs @@ -16,22 +16,56 @@ fn arm_linux() { println!("neon: {}", is_arm_feature_detected!("neon")); println!("pmull: {}", is_arm_feature_detected!("pmull")); + println!("crypto: {}", is_arm_feature_detected!("crypto")); + println!("crc: {}", is_arm_feature_detected!("crc")); + println!("aes: {}", is_arm_feature_detected!("aes")); + println!("sha2: {}", is_arm_feature_detected!("sha2")); } #[test] #[cfg(all(target_arch = "aarch64", any(target_os = "linux", target_os = "android")))] fn aarch64_linux() { - println!("fp: {}", is_aarch64_feature_detected!("fp")); - println!("fp16: {}", is_aarch64_feature_detected!("fp16")); println!("neon: {}", is_aarch64_feature_detected!("neon")); println!("asimd: {}", is_aarch64_feature_detected!("asimd")); + println!("pmull: {}", is_aarch64_feature_detected!("pmull")); + println!("fp: {}", is_aarch64_feature_detected!("fp")); + println!("fp16: {}", is_aarch64_feature_detected!("fp16")); println!("sve: {}", is_aarch64_feature_detected!("sve")); println!("crc: {}", is_aarch64_feature_detected!("crc")); println!("lse: {}", is_aarch64_feature_detected!("lse")); + println!("lse2: {}", is_aarch64_feature_detected!("lse2")); println!("rdm: {}", is_aarch64_feature_detected!("rdm")); println!("rcpc: {}", is_aarch64_feature_detected!("rcpc")); + println!("rcpc2: {}", is_aarch64_feature_detected!("rcpc2")); println!("dotprod: {}", is_aarch64_feature_detected!("dotprod")); println!("tme: {}", is_aarch64_feature_detected!("tme")); + println!("fhm: {}", is_aarch64_feature_detected!("fhm")); + println!("dit: {}", is_aarch64_feature_detected!("dit")); + println!("flagm: {}", is_aarch64_feature_detected!("flagm")); + println!("ssbs: {}", is_aarch64_feature_detected!("ssbs")); + println!("sb: {}", is_aarch64_feature_detected!("sb")); + println!("pauth: {}", is_aarch64_feature_detected!("pauth")); + println!("dpb: {}", is_aarch64_feature_detected!("dpb")); + println!("dpb2: {}", is_aarch64_feature_detected!("dpb2")); + println!("sve2: {}", is_aarch64_feature_detected!("sve2")); + println!("sve2-aes: {}", is_aarch64_feature_detected!("sve2-aes")); + println!("sve2-sm4: {}", is_aarch64_feature_detected!("sve2-sm4")); + println!("sve2-sha3: {}", is_aarch64_feature_detected!("sve2-sha3")); + println!("sve2-bitperm: {}", is_aarch64_feature_detected!("sve2-bitperm")); + println!("frintts: {}", is_aarch64_feature_detected!("frintts")); + println!("i8mm: {}", is_aarch64_feature_detected!("i8mm")); + println!("f32mm: {}", is_aarch64_feature_detected!("f32mm")); + println!("f64mm: {}", is_aarch64_feature_detected!("f64mm")); + println!("bf16: {}", is_aarch64_feature_detected!("bf16")); + println!("rand: {}", is_aarch64_feature_detected!("rand")); + println!("bti: {}", is_aarch64_feature_detected!("bti")); + println!("mte: {}", is_aarch64_feature_detected!("mte")); + println!("jsconv: {}", is_aarch64_feature_detected!("jsconv")); + println!("fcma: {}", is_aarch64_feature_detected!("fcma")); + println!("aes: {}", is_aarch64_feature_detected!("aes")); + println!("sha2: {}", is_aarch64_feature_detected!("sha2")); + println!("sha3: {}", is_aarch64_feature_detected!("sha3")); + println!("sm4: {}", is_aarch64_feature_detected!("sm4")); } #[test] From c58246efe47bea09d4f3e70f536e4c9bb7770749 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 16 Jul 2021 17:24:35 -0700 Subject: [PATCH 08/14] Rustdoc accessibility: use an icon for the [-]/[+] controls This way, we can show the plus and minus buttons on screens, while voice control will read off actual words "Collapse" and "Expand" instead of reading "open brace minus close brace" and "open brace plus close brace". Part of #87059 --- src/librustdoc/html/render/write_shared.rs | 7 ++- src/librustdoc/html/static/css/rustdoc.css | 54 ++++++++++++++++-- src/librustdoc/html/static/css/themes/ayu.css | 5 ++ .../html/static/css/themes/dark.css | 5 ++ .../html/static/images/minus-17x17.png | Bin 0 -> 3183 bytes .../html/static/images/minus-17x17.png.url | 1 + .../html/static/images/plus-17x17.png | Bin 0 -> 3337 bytes .../html/static/images/plus-17x17.png.url | 1 + src/librustdoc/html/static_files.rs | 4 ++ 9 files changed, 69 insertions(+), 8 deletions(-) create mode 100644 src/librustdoc/html/static/images/minus-17x17.png create mode 100644 src/librustdoc/html/static/images/minus-17x17.png.url create mode 100644 src/librustdoc/html/static/images/plus-17x17.png create mode 100644 src/librustdoc/html/static/images/plus-17x17.png.url diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index 94a902a2d0522..f529b2f2bfcdc 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -126,13 +126,16 @@ impl Context<'_> { emit: &[EmitType], ) -> Result<(), Error> { let tmp; + let contents = + contents.replace("data-url(minus-17x17.png)", static_files::MINUS_PNG_DATAURL); + let contents = contents.replace("data-url(plus-17x17.png)", static_files::PLUS_PNG_DATAURL); let contents = if minify { tmp = if resource.extension() == Some(&OsStr::new("css")) { - minifier::css::minify(contents).map_err(|e| { + minifier::css::minify(&contents).map_err(|e| { Error::new(format!("failed to minify CSS file: {}", e), resource.path(self)) })? } else { - minifier::js::minify(contents) + minifier::js::minify(&contents) }; tmp.as_bytes() } else { diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 91243a4086ced..ae321be09e228 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1508,11 +1508,33 @@ details.rustdoc-toggle > summary.hideme > span { } details.rustdoc-toggle > summary::before { - content: "[+]"; + content: "Expand"; font-weight: 300; font-size: 0.8em; letter-spacing: 1px; cursor: pointer; + width: 17px; + height: max(17px, 1.1em); + background: data-url(plus-17x17.png) no-repeat top left; + display: inline-block; + vertical-align: middle; + opacity: .5; + text-indent: 17px; + overflow: hidden; +} + +details.rustdoc-toggle > summary.hideme::before { + /* "hideme" toggles already have a description when they're contracted */ + content: " "; +} + +details.rustdoc-toggle > summary:focus::before { + outline: dotted 1px; +} + +details.rustdoc-toggle > summary:focus::before, +details.rustdoc-toggle > summary:hover::before { + opacity: 1; } details.rustdoc-toggle.top-doc > summary, @@ -1560,20 +1582,40 @@ details.rustdoc-toggle[open] > summary.hideme > span { display: none; } -details.rustdoc-toggle[open] > summary::before { - content: "[−]"; - display: inline; +details.rustdoc-toggle[open] > summary::before, +details.rustdoc-toggle[open] > summary.hideme::before { + width: 17px; + height: max(17px, 1.1em); + background: data-url(minus-17x17.png) no-repeat top left; + display: inline-block; + content: "Collapse"; } details.undocumented > summary::before { - content: "[+] Show hidden undocumented items"; + padding-left: 17px; + height: max(17px, 1.1em); + background: data-url(plus-17x17.png) no-repeat top left; + content: "Show hidden undocumented items"; cursor: pointer; font-size: 16px; font-weight: 300; + opacity: .5; +} + +details.undocumented > summary:focus::before { + outline: dotted 1px; +} + +details.undocumented > summary:focus::before, +details.undocumented > summary:hover::before { + opacity: 1; } details.undocumented[open] > summary::before { - content: "[−] Hide undocumented items"; + padding-left: 17px; + height: max(17px, 1.1em); + background: data-url(minus-17x17.png) no-repeat top left; + content: "Hide undocumented items"; } /* Media Queries */ diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css index df386fb66a33f..849924ea5501e 100644 --- a/src/librustdoc/html/static/css/themes/ayu.css +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -229,6 +229,11 @@ details.undocumented > summary::before { color: #999; } +details.rustdoc-toggle > summary::before, +details.undocumented > summary::before { + filter: invert(100%); +} + #crate-search { color: #c5c5c5; background-color: #141920; diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css index c8a5dbdc66aaf..c26122e4bffb5 100644 --- a/src/librustdoc/html/static/css/themes/dark.css +++ b/src/librustdoc/html/static/css/themes/dark.css @@ -194,6 +194,11 @@ details.undocumented > summary::before { color: #999; } +details.rustdoc-toggle > summary::before, +details.undocumented > summary::before { + filter: invert(100%); +} + #crate-search { color: #111; background-color: #f0f0f0; diff --git a/src/librustdoc/html/static/images/minus-17x17.png b/src/librustdoc/html/static/images/minus-17x17.png new file mode 100644 index 0000000000000000000000000000000000000000..3cdbbf5033ec412df28970edfc6da26d578252bf GIT binary patch literal 3183 zcmV-#43P7QP)EX>4Tx04R}tkv&MmKpe$iQ>7vm1q+HeWT;LSL`5C73Pq?8YK2xEOfLNpnlvOS zE{=k0!NHHks)LKOt`4q(Aou~|=H{g6A|?JWDYS_3;J6>}?mh0_0Ya_BG^=eC&~)2O zCE{WxyCQ~O5ke38Fom$pEMr!ZlJFg0_XzOyF2=L`&;2>N)SShDfJi*U4AUlFC!XB2 z4bJ<-5muB{;&b8=lP*a7$aTfzH_io@1)do()2TV)2(egbVWovx(bR}1h@+~eQ@)V# zSmnIMSu0goAMvPXS6bmWZkNfxsT)#vvg`Uwzx2Cnp`zgz>RKS{4P zwdfJhy$xJkH#KDsxZDBypA6ZQT`5RY$mfCgGy0}1(0dDXu6n&S_Hp_Eq^Yaq4RCM> z3>PSS&F9@6t-bwwrqSOIhc$Aq`Q-Sa00006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNlirurSaechcOY8BBoXX=B?DRj@#@?6;*5z6R7s*sB zq&wO4Fl>`;Ho`F~T*cz58H2VhdXAgscvVM?+%%dRjm|W_@^Yhh8a>;_5G`p%4nZ)rI=!iE53xnC6-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cN zD~D26ZRBOG57@2h+ph#rZwKyAVV4A7-aF6go6bGsQk~T|d5siJBcoFnGVtq*cfos; zF+~8%*6P}QMMk%(Z%cK*2!$@MA6DM7XiG=s8$rY7;>*~TZ=|#iEmq}QRhzt#!ncAb zr0^}q9R+=txXPQFku{5^IP8jkU&>e6m0i&xM6*FkORQhHnDM_SC8ZoiRC{>{CtV>_FhNikmzF#YB~nB7?hy|2s{+b!2~}C zwbe#>DGJw@*lI^YvkCTwk`65KxVg~$g5`YG1h2V6DFSZmP16ZVl9x7TBr(+oEbjzA z=a*g(ToJ&mbH{r3j+WE002ovPDHLkV1fg@>rMaw literal 0 HcmV?d00001 diff --git a/src/librustdoc/html/static/images/minus-17x17.png.url b/src/librustdoc/html/static/images/minus-17x17.png.url new file mode 100644 index 0000000000000..a05bac5d875c5 --- /dev/null +++ b/src/librustdoc/html/static/images/minus-17x17.png.url @@ -0,0 +1 @@ +url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSIVBQuKOGSoThZERR21CkWoEGqFVh1MLv0QmjQkKS6OgmvBwY/FqoOLs64OroIg+AHi5uak6CIl/i8ptIjx4Lgf7+497t4BQq3ENKttFNB020wl4mImuyKGXhFCD/owhbDMLGNWkpLwHV/3CPD1Lsaz/M/9ObrUnMWAgEg8wwzTJl4nnty0Dc77xBFWlFXic+IRky5I/Mh1xeM3zgWXBZ4ZMdOpOeIIsVhoYaWFWdHUiCeIo6qmU76Q8VjlvMVZK1VY4578heGcvrzEdZqDSGABi5AgQkEFGyjBRoxWnRQLKdqP+/gHXL9ELoVcG2DkmEcZGmTXD/4Hv7u18uNjXlI4DrS/OM7HEBDaBepVx/k+dpz6CRB8Bq70pr9cA6Y/Sa82tegR0L0NXFw3NWUPuNwB+p8M2ZRdKUhTyOeB9zP6pizQewt0rnq9NfZx+gCkqavkDXBwCAwXKHvN590drb39e6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EvUtC0ZRf0eaX7kkwfBX3jaVf0fRcNt6Oin2ZFP5nbOxsjZVTX2yzo1znPbZS0h1HEt5c2vPKRZRjMYq+7LkOVEFvXullYqBqWDXg3ghRgCyG4YX13kAPA1jaxcaBXj+QRieU/R/x8ifL2XkfkkOhjDWo6BrUYlKEECDwUzMEEPwe11UZ5KQrXl9hqR0KzCfaGkg4s8bi50PyC5XzVBK+5QykCbutN0wlKkpc2ZyQx1Qcs7wQ/55deEFwRwKxzx3s9OJGDw03prBd7zIl1GIHWm72C6AP/5gTETCju81Ti332ZKf7aEp4v/g/U/dym1W9cAQAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAA0SURBVDjLY/j//z8DpZiBqoYAwX8YxqsBizoUSZJsHzWEdEOQYwAdjwbsQBlCcd4Z8KIAAA77Dh32fgsDAAAAAElFTkSuQmCC) diff --git a/src/librustdoc/html/static/images/plus-17x17.png b/src/librustdoc/html/static/images/plus-17x17.png new file mode 100644 index 0000000000000000000000000000000000000000..fa996a147a5274789f8be9a0261bf2d7b8b49514 GIT binary patch literal 3337 zcmV+k4fgVhP)EX>4Tx04R}tkv&MmKpe$iQ>7vm1q+HeWT;LSMMWL83Pq?8YK2xEOs=2Mq#;Rh zaTHt&4t^|F9bBAsb#N5~!4D8OHz!3GDe-?vp+$@b$NhMB?{W7I5Nai+nr&l%s#!)N z78O(JRWb020D91eX^hIu)aN8A4$tv*4lQkLO6NzV;Zdk+{#8aD= z&Uv3W#0qkT_?&pepbHW|a$RxxjdR{%foFz{WMZB;L@ef8SZQHaFjV46;&4XQC|^jq zoZ-C1SuIsq+kRU=q1x1u#AwsK0iirg6M?L%lj$a~|Larhh zITlcc3fb|4|H1EW&D_Men-q)!?Ju_dF$4s5fqK=pzmILZeggQPfh(=)FV}#XPtvPR zEqnxYZvz+CO-Ry}7|0e+nR5mTb#%*nZ1aCpHOG6~JVg z|NHNv|KKO&7%6bdvBYTb6G|wq;v}2>Q}x@Lpx^u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 literal 0 HcmV?d00001 diff --git a/src/librustdoc/html/static/images/plus-17x17.png.url b/src/librustdoc/html/static/images/plus-17x17.png.url new file mode 100644 index 0000000000000..dd0078d1ace7e --- /dev/null +++ b/src/librustdoc/html/static/images/plus-17x17.png.url @@ -0,0 +1 @@ +url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSIVBQuKOGSoThZFRR21CkWoEGqFVh1Mrp/QpCFJcXEUXAsOfixWHVycdXVwFQTBDxA3NydFFynxf0mhRYwHx/14d+9x9w4QaiWmmm1jgKpZRiIWFVPpVTHwigB60IdpjMrM1OckKQ7P8XUPH1/vIjzL+9yfoyuTNRngE4lnmW5YxBvEU5uWznmfOMQKcob4nHjEoAsSP3JdcfmNc95hgWeGjGRinjhELOZbWGlhVjBU4knicEbVKF9IuZzhvMVZLVVY4578hcGstrLMdZqDiGERS5AgQkEFRZRgIUKrRoqJBO1HPfwDjl8il0KuIhg5FlCGCtnxg//B727N3MS4mxSMAu0vtv0xBAR2gXrVtr+Pbbt+AvifgSut6S/XgJlP0qtNLXwEdG8DF9dNTdkDLneA/iddNmRH8tMUcjng/Yy+KQ303gKda25vjX2cPgBJ6ip+AxwcAsN5yl73eHdHa2//nmn09wPeTHLSxLH1TQAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAAuIwAALiMBeKU/dgAAAAd0SU1FB+UHEBc4AoicwzwAAAqGelRYdFJhdyBwcm9maWxlIHR5cGUgZXhpZgAAaIHtWkd2KzEO3OMUcwQmMByH8b25wRx/CiBblmzLcth+y1YnNglUFcBkmv/776L/4CfkGClwyrHEaPATSiiu4iSb/VP125qg3/viHHH9cJ9uDxxueRz9vszx3J+471Denfv91FNxn+8qKvM8aI8P6qnI5dPA1eBpyNvdgBmnonoq8u60HPZ1Oy3HktO9C+c9cd+eo/6RfAWfXORoU8B3cCalWHCenQkJuA0x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Ry2cEf80vfSC4LxFbuLZNIaIAxWno7H3TlEqycZ1904bkA30nKoDMxRZerny/OD5Zrfl1RaLXUej/oGZLryknVekAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAT0lEQVQ4y2P8//8/A6WAkaqGMDIywk37//8/I04NWNShGIJPMzbDiDakoqLif0dHByNFhhAjPsgNQY4BdICsZiSFCdXTCckpluK8M+BFAQAMF77feZ6qBgAAAABJRU5ErkJggg==) diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index 2ec7e66234ddd..db34d60638e8a 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -64,6 +64,10 @@ crate static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/images/favicon.svg crate static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/images/favicon-16x16.png"); crate static RUST_FAVICON_PNG_32: &[u8] = include_bytes!("static/images/favicon-32x32.png"); +/// The pixel art buttons +crate static MINUS_PNG_DATAURL: &str = include_str!("static/images/minus-17x17.png.url"); +crate static PLUS_PNG_DATAURL: &str = include_str!("static/images/plus-17x17.png.url"); + crate static PAGE: &str = include_str!("templates/page.html"); /// The built-in themes given to every documentation site. From 59460a655643b32fe2e1ac39279333bf5a574a82 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 17 Jul 2021 10:55:33 -0700 Subject: [PATCH 09/14] Pull the "Expand" / "Collapse" text to the end of the line, instead of start --- src/librustdoc/html/static/css/rustdoc.css | 24 +++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index ae321be09e228..531484f2105b9 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1508,10 +1508,7 @@ details.rustdoc-toggle > summary.hideme > span { } details.rustdoc-toggle > summary::before { - content: "Expand"; - font-weight: 300; - font-size: 0.8em; - letter-spacing: 1px; + content: " "; cursor: pointer; width: 17px; height: max(17px, 1.1em); @@ -1519,13 +1516,21 @@ details.rustdoc-toggle > summary::before { display: inline-block; vertical-align: middle; opacity: .5; - text-indent: 17px; +} + +/* Screen readers see the text version at the end the line. + Visual readers see the icon at the start of the line, but small and transparent. */ +details.rustdoc-toggle > summary::after { + content: "Expand"; overflow: hidden; + width: 0; + height: 0; + position: absolute; } -details.rustdoc-toggle > summary.hideme::before { +details.rustdoc-toggle > summary.hideme::after { /* "hideme" toggles already have a description when they're contracted */ - content: " "; + content: ""; } details.rustdoc-toggle > summary:focus::before { @@ -1588,6 +1593,11 @@ details.rustdoc-toggle[open] > summary.hideme::before { height: max(17px, 1.1em); background: data-url(minus-17x17.png) no-repeat top left; display: inline-block; + content: " "; +} + +details.rustdoc-toggle[open] > summary::after, +details.rustdoc-toggle[open] > summary.hideme::after { content: "Collapse"; } From 64c99036600735ef2d92fcbd7e9911617b064624 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 17 Jul 2021 11:28:26 -0700 Subject: [PATCH 10/14] Use empty string instead of single space --- src/librustdoc/html/static/css/rustdoc.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 531484f2105b9..0754eeb9900d1 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1508,7 +1508,7 @@ details.rustdoc-toggle > summary.hideme > span { } details.rustdoc-toggle > summary::before { - content: " "; + content: ""; cursor: pointer; width: 17px; height: max(17px, 1.1em); @@ -1593,7 +1593,7 @@ details.rustdoc-toggle[open] > summary.hideme::before { height: max(17px, 1.1em); background: data-url(minus-17x17.png) no-repeat top left; display: inline-block; - content: " "; + content: ""; } details.rustdoc-toggle[open] > summary::after, From 6698cdc5a506a3047a23497fa0d3b8f2d14b9bbe Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 3 Aug 2021 08:50:52 -0700 Subject: [PATCH 11/14] Update cargo --- Cargo.lock | 4 ++-- src/tools/cargo | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 094a738b4160f..39688b7b7ea7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -255,7 +255,7 @@ checksum = "81a18687293a1546b67c246452202bbbf143d239cb43494cc163da14979082da" [[package]] name = "cargo" -version = "0.56.0" +version = "0.57.0" dependencies = [ "anyhow", "atty", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "cargo-util" -version = "0.1.0" +version = "0.1.1" dependencies = [ "anyhow", "core-foundation", diff --git a/src/tools/cargo b/src/tools/cargo index d21c22870e584..cc17afbb0067b 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit d21c22870e58499d6c31f1bef3bf1255eb021666 +Subproject commit cc17afbb0067b1f57d8882640f63b2168d5b7624 From 3744dc868793e42200c5221ba4496ef5c17b8899 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 19 Jul 2021 01:16:36 -0700 Subject: [PATCH 12/14] Remove space after negative sign in Literal to_string --- compiler/rustc_expand/src/proc_macro_server.rs | 3 +++ library/proc_macro/src/bridge/mod.rs | 1 + library/proc_macro/src/lib.rs | 2 +- src/test/ui/proc-macro/auxiliary/api/parse.rs | 6 +++--- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_expand/src/proc_macro_server.rs b/compiler/rustc_expand/src/proc_macro_server.rs index 47cc2ecb4bfdd..42ae8e972c274 100644 --- a/compiler/rustc_expand/src/proc_macro_server.rs +++ b/compiler/rustc_expand/src/proc_macro_server.rs @@ -582,6 +582,9 @@ impl server::Literal for Rustc<'_> { Ok(Literal { lit, span: self.call_site }) } + fn to_string(&mut self, literal: &Self::Literal) -> String { + literal.lit.to_string() + } fn debug_kind(&mut self, literal: &Self::Literal) -> String { format!("{:?}", literal.lit.kind) } diff --git a/library/proc_macro/src/bridge/mod.rs b/library/proc_macro/src/bridge/mod.rs index b968d44fe488d..7001e827ad845 100644 --- a/library/proc_macro/src/bridge/mod.rs +++ b/library/proc_macro/src/bridge/mod.rs @@ -109,6 +109,7 @@ macro_rules! with_api { fn drop($self: $S::Literal); fn clone($self: &$S::Literal) -> $S::Literal; fn from_str(s: &str) -> Result<$S::Literal, ()>; + fn to_string($self: &$S::Literal) -> String; fn debug_kind($self: &$S::Literal) -> String; fn symbol($self: &$S::Literal) -> String; fn suffix($self: &$S::Literal) -> Option; diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index 8138c3882fc14..46f564199d0c2 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -1195,7 +1195,7 @@ impl FromStr for Literal { #[stable(feature = "proc_macro_lib", since = "1.15.0")] impl ToString for Literal { fn to_string(&self) -> String { - TokenStream::from(TokenTree::from(self.clone())).to_string() + self.0.to_string() } } diff --git a/src/test/ui/proc-macro/auxiliary/api/parse.rs b/src/test/ui/proc-macro/auxiliary/api/parse.rs index a304c5e81a4bb..93551ebaf82d5 100644 --- a/src/test/ui/proc-macro/auxiliary/api/parse.rs +++ b/src/test/ui/proc-macro/auxiliary/api/parse.rs @@ -6,8 +6,8 @@ pub fn test() { } fn test_display_literal() { - assert_eq!(Literal::isize_unsuffixed(-10).to_string(), "- 10"); - assert_eq!(Literal::isize_suffixed(-10).to_string(), "- 10isize"); + assert_eq!(Literal::isize_unsuffixed(-10).to_string(), "-10"); + assert_eq!(Literal::isize_suffixed(-10).to_string(), "-10isize"); } fn test_parse_literal() { @@ -18,7 +18,7 @@ fn test_parse_literal() { assert_eq!("b\"\"".parse::().unwrap().to_string(), "b\"\""); assert_eq!("r##\"\"##".parse::().unwrap().to_string(), "r##\"\"##"); assert_eq!("10ulong".parse::().unwrap().to_string(), "10ulong"); - assert_eq!("-10ulong".parse::().unwrap().to_string(), "- 10ulong"); + assert_eq!("-10ulong".parse::().unwrap().to_string(), "-10ulong"); assert!("true".parse::().is_err()); assert!(".8".parse::().is_err()); From 6fe09722ea0762405558b6ea5eb5f765a24af9df Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 31 Jul 2021 16:23:51 +0200 Subject: [PATCH 13/14] Simplify usage of CSS background-image --- src/librustdoc/html/render/write_shared.rs | 47 +++++++++++++++--- src/librustdoc/html/static/css/rustdoc.css | 20 +++----- .../html/static/images/minus-17x17.png | Bin 3183 -> 0 bytes .../html/static/images/minus-17x17.png.url | 1 - .../html/static/images/plus-17x17.png | Bin 3337 -> 0 bytes .../html/static/images/plus-17x17.png.url | 1 - .../html/static/images/toggle-minus.svg | 1 + .../html/static/images/toggle-plus.svg | 1 + src/librustdoc/html/static_files.rs | 10 ++-- 9 files changed, 57 insertions(+), 24 deletions(-) delete mode 100644 src/librustdoc/html/static/images/minus-17x17.png delete mode 100644 src/librustdoc/html/static/images/minus-17x17.png.url delete mode 100644 src/librustdoc/html/static/images/plus-17x17.png delete mode 100644 src/librustdoc/html/static/images/plus-17x17.png.url create mode 100644 src/librustdoc/html/static/images/toggle-minus.svg create mode 100644 src/librustdoc/html/static/images/toggle-plus.svg diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index f529b2f2bfcdc..4411b7771eda7 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -126,16 +126,13 @@ impl Context<'_> { emit: &[EmitType], ) -> Result<(), Error> { let tmp; - let contents = - contents.replace("data-url(minus-17x17.png)", static_files::MINUS_PNG_DATAURL); - let contents = contents.replace("data-url(plus-17x17.png)", static_files::PLUS_PNG_DATAURL); let contents = if minify { tmp = if resource.extension() == Some(&OsStr::new("css")) { - minifier::css::minify(&contents).map_err(|e| { + minifier::css::minify(contents).map_err(|e| { Error::new(format!("failed to minify CSS file: {}", e), resource.path(self)) })? } else { - minifier::js::minify(&contents) + minifier::js::minify(contents) }; tmp.as_bytes() } else { @@ -178,9 +175,45 @@ pub(super) fn write_shared( cx.write_shared(SharedResource::InvocationSpecific { basename: p }, content, &options.emit) }; + fn add_background_image_to_css( + cx: &Context<'_>, + css: &mut String, + rule: &str, + file: &'static str, + ) { + css.push_str(&format!( + "{} {{ background-image: url({}); }}", + rule, + SharedResource::ToolchainSpecific { basename: file } + .path(cx) + .file_name() + .unwrap() + .to_str() + .unwrap() + )) + } + + // Add all the static files. These may already exist, but we just + // overwrite them anyway to make sure that they're fresh and up-to-date. + let mut rustdoc_css = static_files::RUSTDOC_CSS.to_owned(); + add_background_image_to_css( + cx, + &mut rustdoc_css, + "details.undocumented[open] > summary::before, \ + details.rustdoc-toggle[open] > summary::before, \ + details.rustdoc-toggle[open] > summary.hideme::before", + "toggle-minus.svg", + ); + add_background_image_to_css( + cx, + &mut rustdoc_css, + "details.undocumented > summary::before, details.rustdoc-toggle > summary::before", + "toggle-plus.svg", + ); + write_minify("rustdoc.css", &rustdoc_css)?; + // Add all the static files. These may already exist, but we just // overwrite them anyway to make sure that they're fresh and up-to-date. - write_minify("rustdoc.css", static_files::RUSTDOC_CSS)?; write_minify("settings.css", static_files::SETTINGS_CSS)?; write_minify("noscript.css", static_files::NOSCRIPT_CSS)?; @@ -220,6 +253,8 @@ pub(super) fn write_shared( write_toolchain("wheel.svg", static_files::WHEEL_SVG)?; write_toolchain("clipboard.svg", static_files::CLIPBOARD_SVG)?; write_toolchain("down-arrow.svg", static_files::DOWN_ARROW_SVG)?; + write_toolchain("toggle-minus.svg", static_files::TOGGLE_MINUS_PNG)?; + write_toolchain("toggle-plus.svg", static_files::TOGGLE_PLUS_PNG)?; let mut themes: Vec<&String> = themes.iter().collect(); themes.sort(); diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 0754eeb9900d1..4e33eab565006 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -1512,7 +1512,8 @@ details.rustdoc-toggle > summary::before { cursor: pointer; width: 17px; height: max(17px, 1.1em); - background: data-url(plus-17x17.png) no-repeat top left; + background-repeat: no-repeat; + background-position: top left; display: inline-block; vertical-align: middle; opacity: .5; @@ -1533,10 +1534,6 @@ details.rustdoc-toggle > summary.hideme::after { content: ""; } -details.rustdoc-toggle > summary:focus::before { - outline: dotted 1px; -} - details.rustdoc-toggle > summary:focus::before, details.rustdoc-toggle > summary:hover::before { opacity: 1; @@ -1591,7 +1588,8 @@ details.rustdoc-toggle[open] > summary::before, details.rustdoc-toggle[open] > summary.hideme::before { width: 17px; height: max(17px, 1.1em); - background: data-url(minus-17x17.png) no-repeat top left; + background-repeat: no-repeat; + background-position: top left; display: inline-block; content: ""; } @@ -1604,7 +1602,8 @@ details.rustdoc-toggle[open] > summary.hideme::after { details.undocumented > summary::before { padding-left: 17px; height: max(17px, 1.1em); - background: data-url(plus-17x17.png) no-repeat top left; + background-repeat: no-repeat; + background-position: top left; content: "Show hidden undocumented items"; cursor: pointer; font-size: 16px; @@ -1612,10 +1611,6 @@ details.undocumented > summary::before { opacity: .5; } -details.undocumented > summary:focus::before { - outline: dotted 1px; -} - details.undocumented > summary:focus::before, details.undocumented > summary:hover::before { opacity: 1; @@ -1624,7 +1619,8 @@ details.undocumented > summary:hover::before { details.undocumented[open] > summary::before { padding-left: 17px; height: max(17px, 1.1em); - background: data-url(minus-17x17.png) no-repeat top left; + background-repeat: no-repeat + background-position: top left; content: "Hide undocumented items"; } diff --git a/src/librustdoc/html/static/images/minus-17x17.png b/src/librustdoc/html/static/images/minus-17x17.png deleted file mode 100644 index 3cdbbf5033ec412df28970edfc6da26d578252bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3183 zcmV-#43P7QP)EX>4Tx04R}tkv&MmKpe$iQ>7vm1q+HeWT;LSL`5C73Pq?8YK2xEOfLNpnlvOS zE{=k0!NHHks)LKOt`4q(Aou~|=H{g6A|?JWDYS_3;J6>}?m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p&{0G%E0NH93?NMiZpsxm2}UPYz|VPz&$+f|r9ihYh;GBX z)SC&ZBLE-@dI|-RHF%Y=ULdPtlT++JGb?WfN+crCh0nvxO=yGL~_U1wfbv%f+-wKa5KO zx<9x;>=8B&F2Dp$FFBKOreZTOL4C@F#B8DCfef+n6tQNEE^Bn*VlpuYf8c^1$(S=1 zIu0`KT)bd{{+V24cJ!SJOm0!J{NxuVK*8c-GC?OQK9`0F|S+~E0ISH$)^xYKl+ zwjY*nyD?)3Z4INf@SQarl$$TXh# z*_AgWP_*knq0c%{H?s^>X5|g2t>TX^NAV}l;!mGB*u5w8)9I)Kt)7tn&Aw#rPz5|l zrBXw=6|dOC_MF7_Rl6FYOJzOMDqa~IT<>8PuM&(;e(3IB)%v6!8^15vFZNxHZYuP^ z^EJ(gKH$(b(^YXP6Q?k|X>gaGbV|-7$DziSYi64q($FT31XDB|vP$XKsn#YSeN+cN zD~D26ZRBOG57@2h+ph#rZwKyAVV4A7-aF6go6bGsQk~T|d5siJBcoFnGVtq*cfos; zF+~8%*6P}QMMk%(Z%cK*2!$@MA6DM7XiG=s8$rY7;>*~TZ=|#iEmq}QRhzt#!ncAb zr0^}q9R+=txXPQFku{5^IP8jkU&>e6m0i&xM6*FkORQhHnDM_SC8ZoiRC{>{CtV>_FhNikmzF#YB~nB7?hy|2s{+b!2~}C zwbe#>DGJw@*lI^YvkCTwk`65KxVg~$g5`YG1h2V6DFSZmP16ZVl9x7TBr(+oEbjzA z=a*g(ToJ&mbH{r3j+WE002ovPDHLkV1fg@>rMaw diff --git a/src/librustdoc/html/static/images/minus-17x17.png.url b/src/librustdoc/html/static/images/minus-17x17.png.url deleted file mode 100644 index a05bac5d875c5..0000000000000 --- a/src/librustdoc/html/static/images/minus-17x17.png.url +++ /dev/null @@ -1 +0,0 @@ -url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0Acx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dfZY9mKCrz7KfPdO+kbTT1WfZQxV09Vn2UAVdkcWuvFnfXKGqeJbeckisfHbN1hJ6C70WdrHWrF0xJbjQgrepZtVHL17qblKT2ZU3JFC060ChzzpQN7MMVGblDait4o8uR/EnzuJPnznYvSf00+moA62ekP7NvmTuUAU8SKVSQ7kVr9jD9pzE9lW7GqFLZT3SKl4ZG1zvYRavEoxPfujuX9X6pB4bvy/ZL/ZdjW4q9MDzNc2IPuDQNdNVcSkTpzC8aXCXnnRKziTHocaWa2abHNLQJo4EUzQcskrp16nWJiB9VAc+K4dSVm3kZa0P2K3q268EUG8H7k9hlwRf3jvP6pvOPeNSndU3eY0UTSOjUxcy8OuLd8F7kzFFAMrW6tp9RUa3qm9Ldb8IhS6vH1besmhLR+UbQcPm4svYlW+ktA4tVuVbVZu8kcK3giik8C3GHQV9l7jKm5qRNYumOOyKfl/KV9mVXdEvUtC0ZRf0eaX7kkwfBX3jaVf0fRcNt6Oin2ZFP5nbOxsjZVTX2yzo1znPbZS0h1HEt5c2vPKRZRjMYq+7LkOVEFvXullYqBqWDXg3ghRgCyG4YX13kAPA1jaxcaBXj+QRieU/R/x8ifL2XkfkkOhjDWo6BrUYlKEECDwUzMEEPwe11UZ5KQrXl9hqR0KzCfaGkg4s8bi50PyC5XzVBK+5QykCbutN0wlKkpc2ZyQx1Qcs7wQ/55deEFwRwKxzx3s9OJGDw03prBd7zIl1GIHWm72C6AP/5gTETCju81Ti332ZKf7aEp4v/g/U/dym1W9cAQAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAA0SURBVDjLY/j//z8DpZiBqoYAwX8YxqsBizoUSZJsHzWEdEOQYwAdjwbsQBlCcd4Z8KIAAA77Dh32fgsDAAAAAElFTkSuQmCC) diff --git a/src/librustdoc/html/static/images/plus-17x17.png b/src/librustdoc/html/static/images/plus-17x17.png deleted file mode 100644 index fa996a147a5274789f8be9a0261bf2d7b8b49514..0000000000000000000000000000000000000000 GIT binary patch literal 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}&u@!nZwi&IzGXgXbGYr3!r*!J3*ZP(gb*0r^% zL&mq7u6ksZZPx@rCap_+2NTepDXqtLTN_La<7+W|Ee)uO6)>(0@>*A*D(q%WCEmOF_FE_^Qh}l(J3II*s+djEt0J;}9chr3=Q0N!^n3qi~ z>#uzU-`NkS^clWOzak#A~f zXTzk)da-Y3za;I+iKeKtUjk3}ehE(r;X&7iNzo0H;%-}FPFAVI9J*i9)z4#;l)o7z zTViQ1jj3fqCnvVkwq;t(V_G{rEHne-Jg6H<3b4f(!}2@>!T~c!Uy=)8*RDd0{4M{O z!@5WH?W4_5eK>8pIXpp{W+X%c0z5YO;38|IzWXeD&XB(3R=*00DcJ9zMBfZBNw$_A zvDBTs2P`Fk$KJ?$gz^qZW$h8mX9R!EFMS}mFA-a~woM_T0L5wO?0wUeO0sdCeba{I z1AQkdfXu}fUaow5FUuN Td7i2U00000NkvXXu0mjf{gOu@ diff --git a/src/librustdoc/html/static/images/plus-17x17.png.url b/src/librustdoc/html/static/images/plus-17x17.png.url deleted file mode 100644 index dd0078d1ace7e..0000000000000 --- a/src/librustdoc/html/static/images/plus-17x17.png.url +++ /dev/null @@ -1 +0,0 @@ -url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAYAAAA7bUf6AAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSIVBQuKOGSoThZFRR21CkWoEGqFVh1Mrp/QpCFJcXEUXAsOfixWHVycdXVwFQTBDxA3NydFFynxf0mhRYwHx/14d+9x9w4QaiWmmm1jgKpZRiIWFVPpVTHwigB60IdpjMrM1OckKQ7P8XUPH1/vIjzL+9yfoyuTNRngE4lnmW5YxBvEU5uWznmfOMQKcob4nHjEoAsSP3JdcfmNc95hgWeGjGRinjhELOZbWGlhVjBU4knicEbVKF9IuZzhvMVZLVVY4578hcGstrLMdZqDiGERS5AgQkEFRZRgIUKrRoqJBO1HPfwDjl8il0KuIhg5FlCGCtnxg//B727N3MS4mxSMA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pi8XOadZ0HR1Y0l0wSDPiNAw3TQulphIXuwG1zGILdORKSLHnUXtNvgSMmocICaZYCLLLynowYygic/UAPnuKTTX2tpJKz5ZSgd1e3PyCgHvY6Q33d7DLZES29XVx09ZZcavr4qbs0mU3nC1TuMAvN8bsiNlVWwoATd7bPrljALoXN3fUfStQ6Bf9mJdNLOuvfQXkGl8bIUecjQWMwANK7I0F031hJ/sKBkEh+wpi3LVfEko6+yVJQirFk2rz3JFvamhnw6TJerFvZ78k7cmJpqizXwJP934JTwnhQdeGSdENk+JuW2JOVqnDHLpf0tXPY5SUvxklW2JpL42pZUInJ7bTtmVazGNaOzwsNAPjPKgbSQqwxRjD8jwDwgEzR1+SC2DXrkKM/C3/mMO6R/Xto81QfThtujk8QZpmJEQCAjw2+OAia6O++yx7zpC+5Fa/Coop2O+gRN8MMEm2lh6x1J28BywlgMfeyHuE8g5IZe0Ry2cEf80vfSC4LxFbuLZNIaIAxWno7H3TlEqycZ1904bkA30nKoDMxRZerny/OD5Zrfl1RaLXUej/oGZLryknVekAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAT0lEQVQ4y2P8//8/A6WAkaqGMDIywk37//8/I04NWNShGIJPMzbDiDakoqLif0dHByNFhhAjPsgNQY4BdICsZiSFCdXTCckpluK8M+BFAQAMF77feZ6qBgAAAABJRU5ErkJggg==) diff --git a/src/librustdoc/html/static/images/toggle-minus.svg b/src/librustdoc/html/static/images/toggle-minus.svg new file mode 100644 index 0000000000000..73154788a0e8e --- /dev/null +++ b/src/librustdoc/html/static/images/toggle-minus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/librustdoc/html/static/images/toggle-plus.svg b/src/librustdoc/html/static/images/toggle-plus.svg new file mode 100644 index 0000000000000..08b17033e164b --- /dev/null +++ b/src/librustdoc/html/static/images/toggle-plus.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index db34d60638e8a..6f3d08ea65569 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -47,6 +47,12 @@ crate static CLIPBOARD_SVG: &[u8] = include_bytes!("static/images/clipboard.svg" /// The file contents of `down-arrow.svg`, the icon used for the crate choice combobox. crate static DOWN_ARROW_SVG: &[u8] = include_bytes!("static/images/down-arrow.svg"); +/// The file contents of `toggle-minus.svg`, the icon used for opened toggles. +crate static TOGGLE_MINUS_PNG: &[u8] = include_bytes!("static/images/toggle-minus.svg"); + +/// The file contents of `toggle-plus.svg`, the icon used for closed toggles. +crate static TOGGLE_PLUS_PNG: &[u8] = include_bytes!("static/images/toggle-plus.svg"); + /// The contents of `COPYRIGHT.txt`, the license listing for files distributed with documentation /// output. crate static COPYRIGHT: &[u8] = include_bytes!("static/COPYRIGHT.txt"); @@ -64,10 +70,6 @@ crate static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/images/favicon.svg crate static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/images/favicon-16x16.png"); crate static RUST_FAVICON_PNG_32: &[u8] = include_bytes!("static/images/favicon-32x32.png"); -/// The pixel art buttons -crate static MINUS_PNG_DATAURL: &str = include_str!("static/images/minus-17x17.png.url"); -crate static PLUS_PNG_DATAURL: &str = include_str!("static/images/plus-17x17.png.url"); - crate static PAGE: &str = include_str!("templates/page.html"); /// The built-in themes given to every documentation site. From 6953f17aec75c83985db6861ddf4d3cfaa10f042 Mon Sep 17 00:00:00 2001 From: Smitty Date: Tue, 3 Aug 2021 15:11:04 -0400 Subject: [PATCH 14/14] Test dropping union fields more --- src/test/ui/union/union-drop.rs | 3 + .../ui/union/union-drop.thirunsafeck.stderr | 22 ------- .../unsafe/union-assignop.mirunsafeck.stderr | 59 +++++++++++++++++++ src/test/ui/unsafe/union-assignop.rs | 30 ++++++++++ .../unsafe/union-assignop.thirunsafeck.stderr | 59 +++++++++++++++++++ 5 files changed, 151 insertions(+), 22 deletions(-) delete mode 100644 src/test/ui/union/union-drop.thirunsafeck.stderr create mode 100644 src/test/ui/unsafe/union-assignop.mirunsafeck.stderr create mode 100644 src/test/ui/unsafe/union-assignop.rs create mode 100644 src/test/ui/unsafe/union-assignop.thirunsafeck.stderr diff --git a/src/test/ui/union/union-drop.rs b/src/test/ui/union/union-drop.rs index 9edf582751152..c3d7d41ca35fb 100644 --- a/src/test/ui/union/union-drop.rs +++ b/src/test/ui/union/union-drop.rs @@ -1,4 +1,7 @@ // run-pass +// revisions: mirunsafeck thirunsafeck +// [thirunsafeck]compile-flags: -Z thir-unsafeck + #![allow(dead_code)] #![allow(unused_variables)] diff --git a/src/test/ui/union/union-drop.thirunsafeck.stderr b/src/test/ui/union/union-drop.thirunsafeck.stderr deleted file mode 100644 index 9766ae4e435f2..0000000000000 --- a/src/test/ui/union/union-drop.thirunsafeck.stderr +++ /dev/null @@ -1,22 +0,0 @@ -warning: unnecessary `unsafe` block - --> $DIR/union-drop.rs:27:9 - | -LL | unsafe { CHECK += 1; } - | ^^^^^^ unnecessary `unsafe` block - | - = note: `#[warn(unused_unsafe)]` on by default - -warning: unnecessary `unsafe` block - --> $DIR/union-drop.rs:33:9 - | -LL | unsafe { CHECK += 1; } - | ^^^^^^ unnecessary `unsafe` block - -warning: unnecessary `unsafe` block - --> $DIR/union-drop.rs:40:5 - | -LL | unsafe { - | ^^^^^^ unnecessary `unsafe` block - -warning: 3 warnings emitted - diff --git a/src/test/ui/unsafe/union-assignop.mirunsafeck.stderr b/src/test/ui/unsafe/union-assignop.mirunsafeck.stderr new file mode 100644 index 0000000000000..cd338ac9e3a27 --- /dev/null +++ b/src/test/ui/unsafe/union-assignop.mirunsafeck.stderr @@ -0,0 +1,59 @@ +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:20:5 + | +LL | foo.a += 5; + | ^^^^^^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:21:5 + | +LL | foo.b += Dropping; + | ^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:22:5 + | +LL | foo.b = Dropping; + | ^^^^^^^^^^^^^^^^ assignment to union field that might need dropping + | + = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:23:5 + | +LL | foo.a; + | ^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:25:5 + | +LL | foo.b; + | ^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:27:13 + | +LL | foo.b = foo.b; + | ^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:27:5 + | +LL | foo.b = foo.b; + | ^^^^^^^^^^^^^ assignment to union field that might need dropping + | + = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0133`. diff --git a/src/test/ui/unsafe/union-assignop.rs b/src/test/ui/unsafe/union-assignop.rs new file mode 100644 index 0000000000000..c4be20aa567b7 --- /dev/null +++ b/src/test/ui/unsafe/union-assignop.rs @@ -0,0 +1,30 @@ +// revisions: mirunsafeck thirunsafeck +// [thirunsafeck]compile-flags: -Z thir-unsafeck + +#![feature(untagged_unions)] + +use std::ops::AddAssign; + +struct Dropping; +impl AddAssign for Dropping { + fn add_assign(&mut self, _: Self) {} +} + +union Foo { + a: u8, // non-dropping + b: Dropping, // treated as dropping +} + +fn main() { + let mut foo = Foo { a: 42 }; + foo.a += 5; //~ ERROR access to union field is unsafe + foo.b += Dropping; //~ ERROR access to union field is unsafe + foo.b = Dropping; //~ ERROR assignment to union field that might need dropping is unsafe + foo.a; //~ ERROR access to union field is unsafe + let foo = Foo { a: 42 }; + foo.b; //~ ERROR access to union field is unsafe + let mut foo = Foo { a: 42 }; + foo.b = foo.b; + //~^ ERROR access to union field is unsafe + //~| ERROR assignment to union field that might need dropping +} diff --git a/src/test/ui/unsafe/union-assignop.thirunsafeck.stderr b/src/test/ui/unsafe/union-assignop.thirunsafeck.stderr new file mode 100644 index 0000000000000..71de421a2553e --- /dev/null +++ b/src/test/ui/unsafe/union-assignop.thirunsafeck.stderr @@ -0,0 +1,59 @@ +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:20:5 + | +LL | foo.a += 5; + | ^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:21:5 + | +LL | foo.b += Dropping; + | ^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:22:5 + | +LL | foo.b = Dropping; + | ^^^^^^^^^^^^^^^^ assignment to union field that might need dropping + | + = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:23:5 + | +LL | foo.a; + | ^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:25:5 + | +LL | foo.b; + | ^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error[E0133]: assignment to union field that might need dropping is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:27:5 + | +LL | foo.b = foo.b; + | ^^^^^^^^^^^^^ assignment to union field that might need dropping + | + = note: the previous content of the field will be dropped, which causes undefined behavior if the field was not properly initialized + +error[E0133]: access to union field is unsafe and requires unsafe function or block + --> $DIR/union-assignop.rs:27:13 + | +LL | foo.b = foo.b; + | ^^^^^ access to union field + | + = note: the field may not be properly initialized: using uninitialized data will cause undefined behavior + +error: aborting due to 7 previous errors + +For more information about this error, try `rustc --explain E0133`.