From 2e8c14174cb29325bcd7e6ac8ee38dcb110c640b Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 10 Oct 2019 01:57:54 +0900 Subject: [PATCH 1/4] Tweak CI config --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6658a12..f7541ec5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,6 @@ jobs: env: RUSTFLAGS: -Dwarnings strategy: - fail-fast: false matrix: build: # This is the minimum Rust version supported by pin-project. @@ -117,7 +116,7 @@ jobs: run: | set -e rustup update nightly && rustup default nightly - - name: Install ${{ matrix.component }} + - name: Install component if: matrix.component != 'rustdoc' run: | set +e @@ -138,12 +137,10 @@ jobs: - name: cargo clippy if: matrix.component == 'clippy' run: | - cargo clippy -V cargo clippy --all --all-features - name: cargo fmt -- --check if: matrix.component == 'rustfmt' run: | - rustfmt -V cargo fmt --all -- --check - name: cargo doc if: matrix.component == 'rustdoc' From f395542c028b7a3f02e6a313df34227664564fa1 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 10 Oct 2019 06:43:04 +0900 Subject: [PATCH 2/4] Add more tests for trivial_bounds --- tests/ui/unsafe_unpin/proper_unpin.rs | 4 +- tests/ui/unsafe_unpin/proper_unpin.stderr | 10 ++-- .../run-pass/trivial_bounds-feature-gate.rs | 16 ------ .../run-pass/trivial_bounds.rs | 20 ------- .../unstable-features/trivial_bounds-bug.rs | 35 ++++++++++++ .../trivial_bounds-bug.stderr | 9 ++++ .../trivial_bounds-feature-gate.rs | 54 +++++++++++++++++++ .../trivial_bounds-feature-gate.stderr | 47 ++++++++++++++++ tests/ui/unstable-features/trivial_bounds.rs | 36 +++++++++++++ .../unstable-features/trivial_bounds.stderr | 17 ++++++ 10 files changed, 205 insertions(+), 43 deletions(-) delete mode 100644 tests/ui/unstable-features/run-pass/trivial_bounds-feature-gate.rs delete mode 100644 tests/ui/unstable-features/run-pass/trivial_bounds.rs create mode 100644 tests/ui/unstable-features/trivial_bounds-bug.rs create mode 100644 tests/ui/unstable-features/trivial_bounds-bug.stderr create mode 100644 tests/ui/unstable-features/trivial_bounds-feature-gate.rs create mode 100644 tests/ui/unstable-features/trivial_bounds-feature-gate.stderr create mode 100644 tests/ui/unstable-features/trivial_bounds.rs create mode 100644 tests/ui/unstable-features/trivial_bounds.stderr diff --git a/tests/ui/unsafe_unpin/proper_unpin.rs b/tests/ui/unsafe_unpin/proper_unpin.rs index 52d08694..19663bc8 100644 --- a/tests/ui/unsafe_unpin/proper_unpin.rs +++ b/tests/ui/unsafe_unpin/proper_unpin.rs @@ -16,7 +16,7 @@ pub struct Blah { unsafe impl UnsafeUnpin for Blah {} #[pin_project(UnsafeUnpin)] -pub struct NotImplementUnsafUnpin { +pub struct TrivialBounds { #[pin] field1: PhantomPinned, } @@ -38,7 +38,7 @@ fn unsafe_unpin() { is_unpin::>(); // Ok is_unpin::>(); //~ ERROR E0277 - is_unpin::(); //~ ERROR E0277 + is_unpin::(); //~ ERROR E0277 is_unpin::>(); //~ ERROR E0277 is_unpin::>(); //~ ERROR E0277 diff --git a/tests/ui/unsafe_unpin/proper_unpin.stderr b/tests/ui/unsafe_unpin/proper_unpin.stderr index 113d5c5a..93174e95 100644 --- a/tests/ui/unsafe_unpin/proper_unpin.stderr +++ b/tests/ui/unsafe_unpin/proper_unpin.stderr @@ -28,17 +28,17 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` i = note: required because of the requirements on the impl of `pin_project::UnsafeUnpin` for `pin_project::__private::Wrapper<'_, Blah>` = note: required because of the requirements on the impl of `std::marker::Unpin` for `Blah` -error[E0277]: the trait bound `NotImplementUnsafUnpin: pin_project::UnsafeUnpin` is not satisfied +error[E0277]: the trait bound `TrivialBounds: pin_project::UnsafeUnpin` is not satisfied --> $DIR/proper_unpin.rs:41:16 | 6 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -41 | is_unpin::(); //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `pin_project::UnsafeUnpin` is not implemented for `NotImplementUnsafUnpin` +41 | is_unpin::(); //~ ERROR E0277 + | ^^^^^^^^^^^^^ the trait `pin_project::UnsafeUnpin` is not implemented for `TrivialBounds` | - = note: required because of the requirements on the impl of `pin_project::UnsafeUnpin` for `pin_project::__private::Wrapper<'_, NotImplementUnsafUnpin>` - = note: required because of the requirements on the impl of `std::marker::Unpin` for `NotImplementUnsafUnpin` + = note: required because of the requirements on the impl of `pin_project::UnsafeUnpin` for `pin_project::__private::Wrapper<'_, TrivialBounds>` + = note: required because of the requirements on the impl of `std::marker::Unpin` for `TrivialBounds` error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied --> $DIR/proper_unpin.rs:43:5 diff --git a/tests/ui/unstable-features/run-pass/trivial_bounds-feature-gate.rs b/tests/ui/unstable-features/run-pass/trivial_bounds-feature-gate.rs deleted file mode 100644 index 54889557..00000000 --- a/tests/ui/unstable-features/run-pass/trivial_bounds-feature-gate.rs +++ /dev/null @@ -1,16 +0,0 @@ -// run-pass - -// NB: If you change this test, change 'trivial_bounds.rs' at the same time. - -use pin_project::pin_project; -use std::marker::PhantomPinned; - -struct Inner(PhantomPinned); - -#[pin_project] -struct Foo(#[pin] Inner); - -#[pin_project(UnsafeUnpin)] -struct Bar(#[pin] Inner); - -fn main() {} diff --git a/tests/ui/unstable-features/run-pass/trivial_bounds.rs b/tests/ui/unstable-features/run-pass/trivial_bounds.rs deleted file mode 100644 index 279fae1d..00000000 --- a/tests/ui/unstable-features/run-pass/trivial_bounds.rs +++ /dev/null @@ -1,20 +0,0 @@ -// run-pass - -// NB: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time. - -// trivial_bounds -// Tracking issue: https://github.com/rust-lang/rust/issues/48214 -#![feature(trivial_bounds)] - -use pin_project::pin_project; -use std::marker::PhantomPinned; - -struct Inner(PhantomPinned); - -#[pin_project] -struct Foo(#[pin] Inner); - -#[pin_project(UnsafeUnpin)] -struct Bar(#[pin] Inner); - -fn main() {} diff --git a/tests/ui/unstable-features/trivial_bounds-bug.rs b/tests/ui/unstable-features/trivial_bounds-bug.rs new file mode 100644 index 00000000..37147a17 --- /dev/null +++ b/tests/ui/unstable-features/trivial_bounds-bug.rs @@ -0,0 +1,35 @@ +// compile-fail + +// NB: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time. + +// trivial_bounds +// Tracking issue: https://github.com/rust-lang/rust/issues/48214 +#![feature(trivial_bounds)] + +use std::marker::{PhantomData, PhantomPinned}; + +fn phantom_pinned() { + struct Foo(PhantomPinned); + + // bug of trivial_bounds? + impl Unpin for Foo where PhantomPinned: Unpin {} //~ ERROR E0277 + + struct Wrapper(T); + + impl Unpin for Wrapper where T: Unpin {} + + struct Bar(PhantomPinned); + + impl Unpin for Bar where Wrapper: Unpin {} //~ Ok + + struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T); + + impl Unpin for WrapperWithLifetime<'_, T> where T: Unpin {} + + struct Baz(PhantomPinned); + + impl<'a> Unpin for Baz where WrapperWithLifetime<'a, PhantomPinned>: Unpin {} + // Ok +} + +fn main() {} diff --git a/tests/ui/unstable-features/trivial_bounds-bug.stderr b/tests/ui/unstable-features/trivial_bounds-bug.stderr new file mode 100644 index 00000000..f6c45aec --- /dev/null +++ b/tests/ui/unstable-features/trivial_bounds-bug.stderr @@ -0,0 +1,9 @@ +error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied + --> $DIR/trivial_bounds-bug.rs:15:5 + | +15 | impl Unpin for Foo where PhantomPinned: Unpin {} //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` + | + = help: the following implementations were found: + + = note: required by `std::marker::Unpin` diff --git a/tests/ui/unstable-features/trivial_bounds-feature-gate.rs b/tests/ui/unstable-features/trivial_bounds-feature-gate.rs new file mode 100644 index 00000000..bb390b31 --- /dev/null +++ b/tests/ui/unstable-features/trivial_bounds-feature-gate.rs @@ -0,0 +1,54 @@ +// compile-fail + +// NB: If you change this test, change 'trivial_bounds.rs' at the same time. + +use std::marker::{PhantomData, PhantomPinned}; + +fn phantom_pinned() { + struct Foo(PhantomPinned); + + impl Unpin for Foo where PhantomPinned: Unpin {} //~ ERROR E0277 + + struct Wrapper(T); + + impl Unpin for Wrapper where T: Unpin {} + + struct Bar(PhantomPinned); + + impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR E0277 + + struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T); + + impl Unpin for WrapperWithLifetime<'_, T> where T: Unpin {} + + struct Baz(PhantomPinned); + + impl<'a> Unpin for Baz where WrapperWithLifetime<'a, PhantomPinned>: Unpin {} + // Ok +} + +fn inner() { + struct Inner(PhantomPinned); + + struct Foo(Inner); + + impl Unpin for Foo where Inner: Unpin {} //~ ERROR E0277 + + struct Wrapper(T); + + impl Unpin for Wrapper where T: Unpin {} + + struct Bar(Inner); + + impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR E0277 + + struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T); + + impl Unpin for WrapperWithLifetime<'_, T> where T: Unpin {} + + struct Baz(Inner); + + impl<'a> Unpin for Baz where WrapperWithLifetime<'a, Inner>: Unpin {} // Ok +} + +fn main() {} diff --git a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr new file mode 100644 index 00000000..2872f21c --- /dev/null +++ b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr @@ -0,0 +1,47 @@ +error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied + --> $DIR/trivial_bounds-feature-gate.rs:10:5 + | +10 | impl Unpin for Foo where PhantomPinned: Unpin {} //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` + | + = help: the following implementations were found: + + = help: see issue #48214 + = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + +error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied + --> $DIR/trivial_bounds-feature-gate.rs:18:5 + | +18 | impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` + | + = help: the following implementations were found: + + = note: required because of the requirements on the impl of `std::marker::Unpin` for `phantom_pinned::Wrapper` + = help: see issue #48214 + = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + +error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied in `inner::Inner` + --> $DIR/trivial_bounds-feature-gate.rs:35:5 + | +35 | impl Unpin for Foo where Inner: Unpin {} //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `inner::Inner`, the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` + | + = help: the following implementations were found: + + = note: required because it appears within the type `inner::Inner` + = help: see issue #48214 + = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + +error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied in `inner::Inner` + --> $DIR/trivial_bounds-feature-gate.rs:43:5 + | +43 | impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `inner::Inner`, the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` + | + = help: the following implementations were found: + + = note: required because it appears within the type `inner::Inner` + = note: required because of the requirements on the impl of `std::marker::Unpin` for `inner::Wrapper` + = help: see issue #48214 + = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable diff --git a/tests/ui/unstable-features/trivial_bounds.rs b/tests/ui/unstable-features/trivial_bounds.rs new file mode 100644 index 00000000..07d70d14 --- /dev/null +++ b/tests/ui/unstable-features/trivial_bounds.rs @@ -0,0 +1,36 @@ +// run-pass + +// NB: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time. + +// trivial_bounds +// Tracking issue: https://github.com/rust-lang/rust/issues/48214 +#![feature(trivial_bounds)] +#![deny(trivial_bounds)] + +use std::marker::{PhantomData, PhantomPinned}; + +fn inner() { + struct Inner(PhantomPinned); + + struct Foo(Inner); + + impl Unpin for Foo where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters + + struct Wrapper(T); + + impl Unpin for Wrapper where T: Unpin {} + + struct Bar(Inner); + + impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters + + struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T); + + impl Unpin for WrapperWithLifetime<'_, T> where T: Unpin {} + + struct Baz(Inner); + + impl<'a> Unpin for Baz where WrapperWithLifetime<'a, Inner>: Unpin {} // Ok +} + +fn main() {} diff --git a/tests/ui/unstable-features/trivial_bounds.stderr b/tests/ui/unstable-features/trivial_bounds.stderr new file mode 100644 index 00000000..cea34155 --- /dev/null +++ b/tests/ui/unstable-features/trivial_bounds.stderr @@ -0,0 +1,17 @@ +error: Trait bound inner::Inner: std::marker::Unpin does not depend on any type or lifetime parameters + --> $DIR/trivial_bounds.rs:17:37 + | +17 | impl Unpin for Foo where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters + | ^^^^^ + | +note: lint level defined here + --> $DIR/trivial_bounds.rs:8:9 + | +8 | #![deny(trivial_bounds)] + | ^^^^^^^^^^^^^^ + +error: Trait bound inner::Wrapper: std::marker::Unpin does not depend on any type or lifetime parameters + --> $DIR/trivial_bounds.rs:25:46 + | +25 | impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters + | ^^^^^ From c6be1ba244284d1c94a4e12d194dc71901882ca9 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 10 Oct 2019 06:45:25 +0900 Subject: [PATCH 3/4] Allow clippy::needless_doctest_main --- pin-project-internal/src/lib.rs | 6 +++--- src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pin-project-internal/src/lib.rs b/pin-project-internal/src/lib.rs index 935c0d40..da4cd9b4 100644 --- a/pin-project-internal/src/lib.rs +++ b/pin-project-internal/src/lib.rs @@ -9,7 +9,7 @@ #![warn(unsafe_code)] #![warn(rust_2018_idioms, single_use_lifetimes, unreachable_pub)] #![warn(clippy::all, clippy::pedantic)] -#![allow(clippy::use_self)] +#![allow(clippy::use_self, clippy::needless_doctest_main)] #![cfg_attr(proc_macro_def_site, feature(proc_macro_def_site))] extern crate proc_macro; @@ -216,7 +216,7 @@ use utils::{Immutable, Mutable}; /// } /// /// fn main() { -/// Foo { pinned_field: true, unpin_field: 40 }; +/// let _x = Foo { pinned_field: true, unpin_field: 40 }; /// } /// ``` /// @@ -352,7 +352,7 @@ pub fn pin_project(args: TokenStream, input: TokenStream) -> TokenStream { /// } /// /// fn main() { -/// Foo { field: 50 }; +/// let _x = Foo { field: 50 }; /// } /// ``` /// diff --git a/src/lib.rs b/src/lib.rs index 4e17c887..736b06b0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -48,7 +48,7 @@ #![warn(unsafe_code)] #![warn(missing_docs, rust_2018_idioms, single_use_lifetimes, unreachable_pub)] #![warn(clippy::all, clippy::pedantic)] -#![allow(clippy::use_self)] +#![allow(clippy::use_self, clippy::needless_doctest_main)] #[doc(inline)] pub use pin_project_internal::pin_project; From 3f73e34dceca075c05c64ca710001e95acc89c3b Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 10 Oct 2019 06:53:25 +0900 Subject: [PATCH 4/4] Remove header commands from compiletest trybuild doesn't need this. --- tests/ui/cfg/field_sneaky.rs | 2 - tests/ui/cfg/field_sneaky.stderr | 8 +-- tests/ui/cfg/packed_sneaky-1.rs | 2 - tests/ui/cfg/packed_sneaky-1.stderr | 8 +-- tests/ui/cfg/packed_sneaky-2.rs | 2 - tests/ui/cfg/packed_sneaky-2.stderr | 8 +-- tests/ui/cfg/proper_unpin.rs | 2 - tests/ui/cfg/proper_unpin.stderr | 6 +- tests/ui/cfg/run-pass/packed_sneaky.rs | 2 - tests/ui/cfg/tuple-struct.rs | 2 - tests/ui/cfg/tuple-struct.stderr | 4 +- tests/ui/cfg/tuple-variant.rs | 2 - tests/ui/cfg/tuple-variant.stderr | 4 +- tests/ui/cfg/unsupported.rs | 2 - tests/ui/cfg/unsupported.stderr | 4 +- tests/ui/pin_project/conflict-drop.rs | 2 - tests/ui/pin_project/conflict-drop.stderr | 10 ++-- tests/ui/pin_project/conflict-unpin.rs | 2 - tests/ui/pin_project/conflict-unpin.stderr | 18 +++--- tests/ui/pin_project/invalid.rs | 2 - tests/ui/pin_project/invalid.stderr | 36 ++++++------ tests/ui/pin_project/packed.rs | 2 - tests/ui/pin_project/packed.stderr | 12 ++-- tests/ui/pin_project/packed_sneaky-1.rs | 2 - tests/ui/pin_project/packed_sneaky-1.stderr | 24 ++++---- tests/ui/pin_project/packed_sneaky-2.rs | 2 - tests/ui/pin_project/packed_sneaky-2.stderr | 16 +++--- .../ui/pin_project/private_in_public-enum.rs | 2 - .../pin_project/private_in_public-enum.stderr | 18 +++--- tests/ui/pin_project/proper_unpin.rs | 2 - tests/ui/pin_project/proper_unpin.stderr | 18 +++--- tests/ui/pin_project/safe_packed_borrows.rs | 2 - .../ui/pin_project/safe_packed_borrows.stderr | 12 ++-- tests/ui/pin_project/unpin_sneaky.rs | 2 - tests/ui/pin_project/unpin_sneaky.stderr | 22 ++++---- tests/ui/pin_project/unsupported.rs | 2 - tests/ui/pin_project/unsupported.stderr | 26 ++++----- tests/ui/pinned_drop/forget-pinned-drop.rs | 2 - .../ui/pinned_drop/forget-pinned-drop.stderr | 4 +- tests/ui/pinned_drop/invalid.rs | 2 - tests/ui/pinned_drop/invalid.stderr | 56 +++++++++---------- tests/ui/project/ambiguous-let.rs | 2 - tests/ui/project/ambiguous-let.stderr | 8 +-- tests/ui/project/invalid.rs | 2 - tests/ui/project/invalid.stderr | 4 +- tests/ui/project/type-mismatch.rs | 2 - tests/ui/project/type-mismatch.stderr | 4 +- tests/ui/project/use-public.rs | 2 - tests/ui/project/use-public.stderr | 4 +- tests/ui/project/use.rs | 2 - tests/ui/project/use.stderr | 8 +-- .../not-implement-unsafe-unpin.rs | 2 - .../not-implement-unsafe-unpin.stderr | 6 +- tests/ui/unsafe_unpin/proper_unpin.rs | 2 - tests/ui/unsafe_unpin/proper_unpin.stderr | 30 +++++----- .../marker_trait_attr-feature-gate.rs | 2 - .../marker_trait_attr-feature-gate.stderr | 6 +- .../ui/unstable-features/marker_trait_attr.rs | 2 - .../marker_trait_attr.stderr | 6 +- .../overlapping_marker_traits-feature-gate.rs | 2 - ...rlapping_marker_traits-feature-gate.stderr | 6 +- .../run-pass/overlapping_marker_traits.rs | 2 - .../run-pass/stmt_expr_attributes.rs | 2 - .../stmt_expr_attributes-feature-gate.rs | 2 - .../stmt_expr_attributes-feature-gate.stderr | 16 +++--- .../unstable-features/trivial_bounds-bug.rs | 2 - .../trivial_bounds-bug.stderr | 4 +- .../trivial_bounds-feature-gate.rs | 2 - .../trivial_bounds-feature-gate.stderr | 30 +++++----- tests/ui/unstable-features/trivial_bounds.rs | 2 - .../unstable-features/trivial_bounds.stderr | 12 ++-- 71 files changed, 229 insertions(+), 303 deletions(-) diff --git a/tests/ui/cfg/field_sneaky.rs b/tests/ui/cfg/field_sneaky.rs index 2dcb4222..6fa3809a 100644 --- a/tests/ui/cfg/field_sneaky.rs +++ b/tests/ui/cfg/field_sneaky.rs @@ -1,5 +1,3 @@ -// compile-fail - #![feature(optin_builtin_traits)] #![feature(trivial_bounds)] diff --git a/tests/ui/cfg/field_sneaky.stderr b/tests/ui/cfg/field_sneaky.stderr index a237d822..653be705 100644 --- a/tests/ui/cfg/field_sneaky.stderr +++ b/tests/ui/cfg/field_sneaky.stderr @@ -1,5 +1,5 @@ error[E0027]: pattern does not mention field `__field` - --> $DIR/field_sneaky.rs:11:14 - | -11 | #[pin_project] //~ ERROR pattern does not mention field `__field` - | ^ missing field `__field` + --> $DIR/field_sneaky.rs:9:14 + | +9 | #[pin_project] //~ ERROR pattern does not mention field `__field` + | ^ missing field `__field` diff --git a/tests/ui/cfg/packed_sneaky-1.rs b/tests/ui/cfg/packed_sneaky-1.rs index dda3db46..ee3fc29f 100644 --- a/tests/ui/cfg/packed_sneaky-1.rs +++ b/tests/ui/cfg/packed_sneaky-1.rs @@ -1,5 +1,3 @@ -// compile-fail - #[macro_use] extern crate auxiliary_macros; diff --git a/tests/ui/cfg/packed_sneaky-1.stderr b/tests/ui/cfg/packed_sneaky-1.stderr index 120b7bea..3d68bd70 100644 --- a/tests/ui/cfg/packed_sneaky-1.stderr +++ b/tests/ui/cfg/packed_sneaky-1.stderr @@ -1,13 +1,13 @@ error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/packed_sneaky-1.rs:19:1 + --> $DIR/packed_sneaky-1.rs:17:1 | -19 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +17 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^ | note: lint level defined here - --> $DIR/packed_sneaky-1.rs:19:1 + --> $DIR/packed_sneaky-1.rs:17:1 | -19 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +17 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 diff --git a/tests/ui/cfg/packed_sneaky-2.rs b/tests/ui/cfg/packed_sneaky-2.rs index 3c8bb31e..5458f688 100644 --- a/tests/ui/cfg/packed_sneaky-2.rs +++ b/tests/ui/cfg/packed_sneaky-2.rs @@ -1,5 +1,3 @@ -// compile-fail - #[macro_use] extern crate auxiliary_macros; diff --git a/tests/ui/cfg/packed_sneaky-2.stderr b/tests/ui/cfg/packed_sneaky-2.stderr index 8b68bd8e..5c6bbf3b 100644 --- a/tests/ui/cfg/packed_sneaky-2.stderr +++ b/tests/ui/cfg/packed_sneaky-2.stderr @@ -1,13 +1,13 @@ error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/packed_sneaky-2.rs:9:1 + --> $DIR/packed_sneaky-2.rs:7:1 | -9 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +7 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^ | note: lint level defined here - --> $DIR/packed_sneaky-2.rs:9:1 + --> $DIR/packed_sneaky-2.rs:7:1 | -9 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +7 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 diff --git a/tests/ui/cfg/proper_unpin.rs b/tests/ui/cfg/proper_unpin.rs index 568ede4e..517ea6eb 100644 --- a/tests/ui/cfg/proper_unpin.rs +++ b/tests/ui/cfg/proper_unpin.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; use std::marker::PhantomPinned; diff --git a/tests/ui/cfg/proper_unpin.stderr b/tests/ui/cfg/proper_unpin.stderr index fea27b61..8ee7048f 100644 --- a/tests/ui/cfg/proper_unpin.stderr +++ b/tests/ui/cfg/proper_unpin.stderr @@ -1,10 +1,10 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied in `UnpinStructBar<'_, std::marker::PhantomPinned>` - --> $DIR/proper_unpin.rs:29:5 + --> $DIR/proper_unpin.rs:27:5 | -24 | fn is_unpin() {} +22 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -29 | is_unpin::>(); //~ ERROR E0277 +27 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `UnpinStructBar<'_, std::marker::PhantomPinned>`, the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: diff --git a/tests/ui/cfg/run-pass/packed_sneaky.rs b/tests/ui/cfg/run-pass/packed_sneaky.rs index 8c10b99b..b6ba688b 100644 --- a/tests/ui/cfg/run-pass/packed_sneaky.rs +++ b/tests/ui/cfg/run-pass/packed_sneaky.rs @@ -1,5 +1,3 @@ -// run-pass - #[macro_use] extern crate auxiliary_macros; diff --git a/tests/ui/cfg/tuple-struct.rs b/tests/ui/cfg/tuple-struct.rs index a0bce0fb..c5abd730 100644 --- a/tests/ui/cfg/tuple-struct.rs +++ b/tests/ui/cfg/tuple-struct.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[cfg(not(any()))] diff --git a/tests/ui/cfg/tuple-struct.stderr b/tests/ui/cfg/tuple-struct.stderr index 3fe82993..d270be50 100644 --- a/tests/ui/cfg/tuple-struct.stderr +++ b/tests/ui/cfg/tuple-struct.stderr @@ -1,5 +1,5 @@ error: `cfg` attributes on the field of tuple structs are not supported - --> $DIR/tuple-struct.rs:12:5 + --> $DIR/tuple-struct.rs:10:5 | -12 | #[cfg(not(any()))] //~ ERROR `cfg` attributes on the field of tuple structs are not supported +10 | #[cfg(not(any()))] //~ ERROR `cfg` attributes on the field of tuple structs are not supported | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/cfg/tuple-variant.rs b/tests/ui/cfg/tuple-variant.rs index 5af7876c..08395a19 100644 --- a/tests/ui/cfg/tuple-variant.rs +++ b/tests/ui/cfg/tuple-variant.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[cfg(not(any()))] diff --git a/tests/ui/cfg/tuple-variant.stderr b/tests/ui/cfg/tuple-variant.stderr index c6b76e71..495ac5d9 100644 --- a/tests/ui/cfg/tuple-variant.stderr +++ b/tests/ui/cfg/tuple-variant.stderr @@ -1,5 +1,5 @@ error: `cfg` attributes on the field of tuple variants are not supported - --> $DIR/tuple-variant.rs:13:9 + --> $DIR/tuple-variant.rs:11:9 | -13 | #[cfg(not(any()))] //~ ERROR `cfg` attributes on the field of tuple variants are not supported +11 | #[cfg(not(any()))] //~ ERROR `cfg` attributes on the field of tuple variants are not supported | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/cfg/unsupported.rs b/tests/ui/cfg/unsupported.rs index db6fda72..d443a037 100644 --- a/tests/ui/cfg/unsupported.rs +++ b/tests/ui/cfg/unsupported.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[pin_project] diff --git a/tests/ui/cfg/unsupported.stderr b/tests/ui/cfg/unsupported.stderr index 09f6219a..082575ce 100644 --- a/tests/ui/cfg/unsupported.stderr +++ b/tests/ui/cfg/unsupported.stderr @@ -1,9 +1,9 @@ error: #[pin_project] attribute may not be used on structs with zero fields error[E0392]: parameter `'_pin` is never used - --> $DIR/unsupported.rs:5:1 + --> $DIR/unsupported.rs:3:1 | -5 | #[pin_project] +3 | #[pin_project] | ^^^^^^^^^^^^^^ unused parameter | = help: consider removing `'_pin`, referring to it in a field, or using a marker such as `std::marker::PhantomData` diff --git a/tests/ui/pin_project/conflict-drop.rs b/tests/ui/pin_project/conflict-drop.rs index 8785b28e..c9651848 100644 --- a/tests/ui/pin_project/conflict-drop.rs +++ b/tests/ui/pin_project/conflict-drop.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::{pin_project, pinned_drop}; use std::pin::Pin; diff --git a/tests/ui/pin_project/conflict-drop.stderr b/tests/ui/pin_project/conflict-drop.stderr index 6e4230dc..828bb9e1 100644 --- a/tests/ui/pin_project/conflict-drop.stderr +++ b/tests/ui/pin_project/conflict-drop.stderr @@ -1,17 +1,17 @@ error[E0119]: conflicting implementations of trait `FooMustNotImplDrop` for type `Foo<_, _>`: - --> $DIR/conflict-drop.rs:6:1 + --> $DIR/conflict-drop.rs:4:1 | -6 | #[pin_project] //~ ERROR E0119 +4 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ | | | first implementation here | conflicting implementation for `Foo<_, _>` error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>`: - --> $DIR/conflict-drop.rs:17:1 + --> $DIR/conflict-drop.rs:15:1 | -17 | #[pin_project(PinnedDrop)] //~ ERROR E0119 +15 | #[pin_project(PinnedDrop)] //~ ERROR E0119 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>` ... -29 | impl Drop for Bar { +27 | impl Drop for Bar { | ----------------------------- first implementation here diff --git a/tests/ui/pin_project/conflict-unpin.rs b/tests/ui/pin_project/conflict-unpin.rs index 91d6ad8b..0c48d279 100644 --- a/tests/ui/pin_project/conflict-unpin.rs +++ b/tests/ui/pin_project/conflict-unpin.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; // The same implementation. diff --git a/tests/ui/pin_project/conflict-unpin.stderr b/tests/ui/pin_project/conflict-unpin.stderr index a271bff5..8f98a48a 100644 --- a/tests/ui/pin_project/conflict-unpin.stderr +++ b/tests/ui/pin_project/conflict-unpin.stderr @@ -1,26 +1,26 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`: - --> $DIR/conflict-unpin.rs:7:1 + --> $DIR/conflict-unpin.rs:5:1 | -7 | #[pin_project] //~ ERROR E0119 +5 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>` ... -15 | impl Unpin for Foo where T: Unpin {} // Conditional Unpin impl +13 | impl Unpin for Foo where T: Unpin {} // Conditional Unpin impl | --------------------------------------------- first implementation here error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`: - --> $DIR/conflict-unpin.rs:19:1 + --> $DIR/conflict-unpin.rs:17:1 | -19 | #[pin_project] //~ ERROR E0119 +17 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>` ... -27 | impl Unpin for Bar {} // Non-conditional Unpin impl +25 | impl Unpin for Bar {} // Non-conditional Unpin impl | ------------------------------ first implementation here error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`: - --> $DIR/conflict-unpin.rs:29:1 + --> $DIR/conflict-unpin.rs:27:1 | -29 | #[pin_project] //~ ERROR E0119 +27 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>` ... -37 | impl Unpin for Baz {} // Conditional Unpin impl +35 | impl Unpin for Baz {} // Conditional Unpin impl | -------------------------------------------- first implementation here diff --git a/tests/ui/pin_project/invalid.rs b/tests/ui/pin_project/invalid.rs index 267999c9..e9cd4baf 100644 --- a/tests/ui/pin_project/invalid.rs +++ b/tests/ui/pin_project/invalid.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[pin_project] diff --git a/tests/ui/pin_project/invalid.stderr b/tests/ui/pin_project/invalid.stderr index 50f295a7..b4a6c5fe 100644 --- a/tests/ui/pin_project/invalid.stderr +++ b/tests/ui/pin_project/invalid.stderr @@ -1,53 +1,53 @@ error: unexpected token - --> $DIR/invalid.rs:7:10 + --> $DIR/invalid.rs:5:10 | -7 | #[pin()] //~ ERROR unexpected token +5 | #[pin()] //~ ERROR unexpected token | ^ error: unexpected token - --> $DIR/invalid.rs:12:18 + --> $DIR/invalid.rs:10:18 | -12 | struct B(#[pin(foo)] T); //~ ERROR unexpected token +10 | struct B(#[pin(foo)] T); //~ ERROR unexpected token | ^ error: unexpected token - --> $DIR/invalid.rs:16:12 + --> $DIR/invalid.rs:14:12 | -16 | A(#[pin(foo)] T), //~ ERROR unexpected token +14 | A(#[pin(foo)] T), //~ ERROR unexpected token | ^ error: unexpected token - --> $DIR/invalid.rs:22:14 + --> $DIR/invalid.rs:20:14 | -22 | #[pin(foo)] //~ ERROR unexpected token +20 | #[pin(foo)] //~ ERROR unexpected token | ^ error: expected identifier - --> $DIR/invalid.rs:27:27 + --> $DIR/invalid.rs:25:27 | -27 | #[pin_project(UnsafeUnpin,,)] //~ ERROR expected identifier +25 | #[pin_project(UnsafeUnpin,,)] //~ ERROR expected identifier | ^ error: duplicate `UnsafeUnpin` argument - --> $DIR/invalid.rs:33:28 + --> $DIR/invalid.rs:31:28 | -33 | #[pin_project(UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument +31 | #[pin_project(UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument | ^^^^^^^^^^^ error: duplicate `PinnedDrop` argument - --> $DIR/invalid.rs:39:27 + --> $DIR/invalid.rs:37:27 | -39 | #[pin_project(PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument +37 | #[pin_project(PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument | ^^^^^^^^^^ error: duplicate `UnsafeUnpin` argument - --> $DIR/invalid.rs:45:40 + --> $DIR/invalid.rs:43:40 | -45 | #[pin_project(PinnedDrop, UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument +43 | #[pin_project(PinnedDrop, UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument | ^^^^^^^^^^^ error: duplicate `PinnedDrop` argument - --> $DIR/invalid.rs:51:40 + --> $DIR/invalid.rs:49:40 | -51 | #[pin_project(PinnedDrop, UnsafeUnpin, PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument +49 | #[pin_project(PinnedDrop, UnsafeUnpin, PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument | ^^^^^^^^^^ diff --git a/tests/ui/pin_project/packed.rs b/tests/ui/pin_project/packed.rs index 7d1ff2b6..86f3ecf3 100644 --- a/tests/ui/pin_project/packed.rs +++ b/tests/ui/pin_project/packed.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[pin_project] diff --git a/tests/ui/pin_project/packed.stderr b/tests/ui/pin_project/packed.stderr index d57f548b..969faea2 100644 --- a/tests/ui/pin_project/packed.stderr +++ b/tests/ui/pin_project/packed.stderr @@ -1,17 +1,17 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed.rs:6:8 + --> $DIR/packed.rs:4:8 | -6 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types +4 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types | ^^^^^^ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed.rs:13:8 + --> $DIR/packed.rs:11:8 | -13 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types +11 | #[repr(packed, C)] //~ ERROR may not be used on #[repr(packed)] types | ^^^^^^ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed.rs:21:8 + --> $DIR/packed.rs:19:8 | -21 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types +19 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types | ^^^^^^^^^ diff --git a/tests/ui/pin_project/packed_sneaky-1.rs b/tests/ui/pin_project/packed_sneaky-1.rs index e68cab98..9de3b02a 100644 --- a/tests/ui/pin_project/packed_sneaky-1.rs +++ b/tests/ui/pin_project/packed_sneaky-1.rs @@ -1,5 +1,3 @@ -// compile-fail - #[macro_use] extern crate auxiliary_macros; diff --git a/tests/ui/pin_project/packed_sneaky-1.stderr b/tests/ui/pin_project/packed_sneaky-1.stderr index 4258ce99..ff6ab388 100644 --- a/tests/ui/pin_project/packed_sneaky-1.stderr +++ b/tests/ui/pin_project/packed_sneaky-1.stderr @@ -1,43 +1,43 @@ error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/packed_sneaky-1.rs:9:1 + --> $DIR/packed_sneaky-1.rs:7:1 | -9 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +7 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^ | note: lint level defined here - --> $DIR/packed_sneaky-1.rs:9:1 + --> $DIR/packed_sneaky-1.rs:7:1 | -9 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +7 | #[pin_project] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/packed_sneaky-1.rs:16:1 + --> $DIR/packed_sneaky-1.rs:14:1 | -16 | #[pin_project(UnsafeUnpin)] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +14 | #[pin_project(UnsafeUnpin)] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: lint level defined here - --> $DIR/packed_sneaky-1.rs:16:1 + --> $DIR/packed_sneaky-1.rs:14:1 | -16 | #[pin_project(UnsafeUnpin)] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +14 | #[pin_project(UnsafeUnpin)] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/packed_sneaky-1.rs:25:1 + --> $DIR/packed_sneaky-1.rs:23:1 | -25 | #[pin_project(PinnedDrop)] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +23 | #[pin_project(PinnedDrop)] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: lint level defined here - --> $DIR/packed_sneaky-1.rs:25:1 + --> $DIR/packed_sneaky-1.rs:23:1 | -25 | #[pin_project(PinnedDrop)] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +23 | #[pin_project(PinnedDrop)] //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 diff --git a/tests/ui/pin_project/packed_sneaky-2.rs b/tests/ui/pin_project/packed_sneaky-2.rs index 4d5460a5..4adc924e 100644 --- a/tests/ui/pin_project/packed_sneaky-2.rs +++ b/tests/ui/pin_project/packed_sneaky-2.rs @@ -1,5 +1,3 @@ -// compile-fail - #[macro_use] extern crate auxiliary_macros; diff --git a/tests/ui/pin_project/packed_sneaky-2.stderr b/tests/ui/pin_project/packed_sneaky-2.stderr index 5cdb9c51..e836ef69 100644 --- a/tests/ui/pin_project/packed_sneaky-2.stderr +++ b/tests/ui/pin_project/packed_sneaky-2.stderr @@ -1,13 +1,13 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-2.rs:8:1 + --> $DIR/packed_sneaky-2.rs:6:1 | -8 | / hidden_repr_macro! { //~ ERROR may not be used on #[repr(packed)] types -9 | | #[pin_project] -10 | | struct B { -11 | | #[pin] -12 | | field: u32, -13 | | } -14 | | } +6 | / hidden_repr_macro! { //~ ERROR may not be used on #[repr(packed)] types +7 | | #[pin_project] +8 | | struct B { +9 | | #[pin] +10 | | field: u32, +11 | | } +12 | | } | | ^ in this macro invocation | |_| | diff --git a/tests/ui/pin_project/private_in_public-enum.rs b/tests/ui/pin_project/private_in_public-enum.rs index f84930bf..66ddefa4 100644 --- a/tests/ui/pin_project/private_in_public-enum.rs +++ b/tests/ui/pin_project/private_in_public-enum.rs @@ -1,5 +1,3 @@ -// compile-fail - // Even if allows private_in_public, these are errors. #![allow(private_in_public)] diff --git a/tests/ui/pin_project/private_in_public-enum.stderr b/tests/ui/pin_project/private_in_public-enum.stderr index d487eada..2a5ae992 100644 --- a/tests/ui/pin_project/private_in_public-enum.stderr +++ b/tests/ui/pin_project/private_in_public-enum.stderr @@ -1,17 +1,17 @@ error[E0446]: private type `PrivateEnum` in public interface - --> $DIR/private_in_public-enum.rs:8:13 - | -8 | Variant(PrivateEnum), - | ^^^^^^^^^^^ can't leak private type + --> $DIR/private_in_public-enum.rs:6:13 + | +6 | Variant(PrivateEnum), + | ^^^^^^^^^^^ can't leak private type ... -11 | enum PrivateEnum { - | - `PrivateEnum` declared as private +9 | enum PrivateEnum { + | - `PrivateEnum` declared as private error[E0446]: private type `foo::PrivateEnum` in public interface - --> $DIR/private_in_public-enum.rs:17:17 + --> $DIR/private_in_public-enum.rs:15:17 | -17 | Variant(PrivateEnum), +15 | Variant(PrivateEnum), | ^^^^^^^^^^^ can't leak private type ... -20 | enum PrivateEnum { +18 | enum PrivateEnum { | - `foo::PrivateEnum` declared as private diff --git a/tests/ui/pin_project/proper_unpin.rs b/tests/ui/pin_project/proper_unpin.rs index 5299f601..b4808a10 100644 --- a/tests/ui/pin_project/proper_unpin.rs +++ b/tests/ui/pin_project/proper_unpin.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; use std::marker::PhantomPinned; diff --git a/tests/ui/pin_project/proper_unpin.stderr b/tests/ui/pin_project/proper_unpin.stderr index b8960235..b5dfb700 100644 --- a/tests/ui/pin_project/proper_unpin.stderr +++ b/tests/ui/pin_project/proper_unpin.stderr @@ -1,10 +1,10 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied in `UnpinStructFoo<'_, std::marker::PhantomPinned, ()>` - --> $DIR/proper_unpin.rs:33:5 + --> $DIR/proper_unpin.rs:31:5 | -30 | fn is_unpin() {} +28 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -33 | is_unpin::>(); //~ ERROR E0277 +31 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `UnpinStructFoo<'_, std::marker::PhantomPinned, ()>`, the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: @@ -14,12 +14,12 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` i = note: required because of the requirements on the impl of `std::marker::Unpin` for `Foo` error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied in `UnpinStructFoo<'_, std::marker::PhantomPinned, std::marker::PhantomPinned>` - --> $DIR/proper_unpin.rs:35:5 + --> $DIR/proper_unpin.rs:33:5 | -30 | fn is_unpin() {} +28 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -35 | is_unpin::>(); //~ ERROR E0277 +33 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `UnpinStructFoo<'_, std::marker::PhantomPinned, std::marker::PhantomPinned>`, the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: @@ -29,12 +29,12 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` i = note: required because of the requirements on the impl of `std::marker::Unpin` for `Foo` error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied in `UnpinStructTrivialBounds<'_>` - --> $DIR/proper_unpin.rs:37:5 + --> $DIR/proper_unpin.rs:35:5 | -30 | fn is_unpin() {} +28 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -37 | is_unpin::(); //~ ERROR E0277 +35 | is_unpin::(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^ within `UnpinStructTrivialBounds<'_>`, the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: diff --git a/tests/ui/pin_project/safe_packed_borrows.rs b/tests/ui/pin_project/safe_packed_borrows.rs index 8ae06119..1b2bea39 100644 --- a/tests/ui/pin_project/safe_packed_borrows.rs +++ b/tests/ui/pin_project/safe_packed_borrows.rs @@ -1,5 +1,3 @@ -// compile-fail - #![deny(safe_packed_borrows)] // Refs: https://github.com/rust-lang/rust/issues/46043 diff --git a/tests/ui/pin_project/safe_packed_borrows.stderr b/tests/ui/pin_project/safe_packed_borrows.stderr index 3666ccb9..cc4b9078 100644 --- a/tests/ui/pin_project/safe_packed_borrows.stderr +++ b/tests/ui/pin_project/safe_packed_borrows.stderr @@ -1,22 +1,22 @@ error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/safe_packed_borrows.rs:19:5 + --> $DIR/safe_packed_borrows.rs:17:5 | -19 | &a.field; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +17 | &a.field; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^ | note: lint level defined here - --> $DIR/safe_packed_borrows.rs:3:9 + --> $DIR/safe_packed_borrows.rs:1:9 | -3 | #![deny(safe_packed_borrows)] +1 | #![deny(safe_packed_borrows)] | ^^^^^^^^^^^^^^^^^^^ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #46043 = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/safe_packed_borrows.rs:22:5 + --> $DIR/safe_packed_borrows.rs:20:5 | -22 | &b.field; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block +20 | &b.field; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block | ^^^^^^^^ | = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! diff --git a/tests/ui/pin_project/unpin_sneaky.rs b/tests/ui/pin_project/unpin_sneaky.rs index a3e6078c..61d067de 100644 --- a/tests/ui/pin_project/unpin_sneaky.rs +++ b/tests/ui/pin_project/unpin_sneaky.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[pin_project] diff --git a/tests/ui/pin_project/unpin_sneaky.stderr b/tests/ui/pin_project/unpin_sneaky.stderr index a2a05b4a..c4beecb6 100644 --- a/tests/ui/pin_project/unpin_sneaky.stderr +++ b/tests/ui/pin_project/unpin_sneaky.stderr @@ -1,15 +1,15 @@ error[E0412]: cannot find type `UnpinStructFoo` in this scope - --> $DIR/unpin_sneaky.rs:11:16 - | -11 | impl Unpin for UnpinStructFoo {} //~ ERROR E0412,E0321 - | ^^^^^^^^^^^^^^ not found in this scope + --> $DIR/unpin_sneaky.rs:9:16 + | +9 | impl Unpin for UnpinStructFoo {} //~ ERROR E0412,E0321 + | ^^^^^^^^^^^^^^ not found in this scope help: possible candidate is found in another module, you can import it into scope - | -3 | use crate::UnpinStructFoo; - | + | +1 | use crate::UnpinStructFoo; + | error[E0321]: cross-crate traits with a default impl, like `std::marker::Unpin`, can only be implemented for a struct/enum type, not `[type error]` - --> $DIR/unpin_sneaky.rs:11:1 - | -11 | impl Unpin for UnpinStructFoo {} //~ ERROR E0412,E0321 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type + --> $DIR/unpin_sneaky.rs:9:1 + | +9 | impl Unpin for UnpinStructFoo {} //~ ERROR E0412,E0321 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type diff --git a/tests/ui/pin_project/unsupported.rs b/tests/ui/pin_project/unsupported.rs index f73342d4..35bc4e74 100644 --- a/tests/ui/pin_project/unsupported.rs +++ b/tests/ui/pin_project/unsupported.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[pin_project] diff --git a/tests/ui/pin_project/unsupported.stderr b/tests/ui/pin_project/unsupported.stderr index fca47e1d..e1196b39 100644 --- a/tests/ui/pin_project/unsupported.stderr +++ b/tests/ui/pin_project/unsupported.stderr @@ -1,36 +1,36 @@ error: #[pin_project] attribute may not be used on structs with zero fields - --> $DIR/unsupported.rs:6:16 + --> $DIR/unsupported.rs:4:16 | -6 | struct Struct1 {} //~ ERROR may not be used on structs with zero fields +4 | struct Struct1 {} //~ ERROR may not be used on structs with zero fields | ^^ error: #[pin_project] attribute may not be used on structs with zero fields - --> $DIR/unsupported.rs:9:15 + --> $DIR/unsupported.rs:7:15 | -9 | struct Struct2(); //~ ERROR may not be used on structs with zero fields +7 | struct Struct2(); //~ ERROR may not be used on structs with zero fields | ^^ error: #[pin_project] attribute may not be used on structs with units - --> $DIR/unsupported.rs:12:8 + --> $DIR/unsupported.rs:10:8 | -12 | struct Struct3; //~ ERROR may not be used on structs with units +10 | struct Struct3; //~ ERROR may not be used on structs with units | ^^^^^^^ error: #[pin_project] attribute may not be used on enums without variants - --> $DIR/unsupported.rs:15:12 + --> $DIR/unsupported.rs:13:12 | -15 | enum Enum1 {} //~ ERROR may not be used on enums without variants +13 | enum Enum1 {} //~ ERROR may not be used on enums without variants | ^^ error: #[pin_project] attribute may not be used on enums with discriminants - --> $DIR/unsupported.rs:19:9 + --> $DIR/unsupported.rs:17:9 | -19 | A = 2, //~ ERROR may not be used on enums with discriminants +17 | A = 2, //~ ERROR may not be used on enums with discriminants | ^ error: #[pin_project] attribute may not be used on enums that have no field - --> $DIR/unsupported.rs:24:5 + --> $DIR/unsupported.rs:22:5 | -24 | / A, //~ ERROR may not be used on enums that have no field -25 | | B, +22 | / A, //~ ERROR may not be used on enums that have no field +23 | | B, | |______^ diff --git a/tests/ui/pinned_drop/forget-pinned-drop.rs b/tests/ui/pinned_drop/forget-pinned-drop.rs index e9c2f8b3..5d8aada8 100644 --- a/tests/ui/pinned_drop/forget-pinned-drop.rs +++ b/tests/ui/pinned_drop/forget-pinned-drop.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[pin_project(PinnedDrop)] //~ ERROR E0277 diff --git a/tests/ui/pinned_drop/forget-pinned-drop.stderr b/tests/ui/pinned_drop/forget-pinned-drop.stderr index fd8510c7..9c0a7456 100644 --- a/tests/ui/pinned_drop/forget-pinned-drop.stderr +++ b/tests/ui/pinned_drop/forget-pinned-drop.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `Foo: pin_project::__private::PinnedDrop` is not satisfied - --> $DIR/forget-pinned-drop.rs:5:15 + --> $DIR/forget-pinned-drop.rs:3:15 | -5 | #[pin_project(PinnedDrop)] //~ ERROR E0277 +3 | #[pin_project(PinnedDrop)] //~ ERROR E0277 | ^^^^^^^^^^ the trait `pin_project::__private::PinnedDrop` is not implemented for `Foo` | = note: required by `pin_project::__private::PinnedDrop::drop` diff --git a/tests/ui/pinned_drop/invalid.rs b/tests/ui/pinned_drop/invalid.rs index aeeec3b8..1f66fb6f 100644 --- a/tests/ui/pinned_drop/invalid.rs +++ b/tests/ui/pinned_drop/invalid.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::{pin_project, pinned_drop}; #[pin_project(PinnedDrop)] //~ ERROR E0277 diff --git a/tests/ui/pinned_drop/invalid.stderr b/tests/ui/pinned_drop/invalid.stderr index 4b523292..eaa31442 100644 --- a/tests/ui/pinned_drop/invalid.stderr +++ b/tests/ui/pinned_drop/invalid.stderr @@ -1,79 +1,79 @@ error: unexpected token - --> $DIR/invalid.rs:11:15 - | -11 | #[pinned_drop(foo)] //~ ERROR unexpected token - | ^^^ + --> $DIR/invalid.rs:9:15 + | +9 | #[pinned_drop(foo)] //~ ERROR unexpected token + | ^^^ error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait - --> $DIR/invalid.rs:23:6 + --> $DIR/invalid.rs:21:6 | -23 | impl Drop for B { +21 | impl Drop for B { | ^^^^ error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait - --> $DIR/invalid.rs:35:6 + --> $DIR/invalid.rs:33:6 | -35 | impl C { +33 | impl C { | ^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:48:13 + --> $DIR/invalid.rs:46:13 | -48 | fn drop(&mut self) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` +46 | fn drop(&mut self) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^ error: method `drop_baz` is not a member of trait `PinnedDrop - --> $DIR/invalid.rs:59:8 + --> $DIR/invalid.rs:57:8 | -59 | fn drop_baz(&mut self) {} //~ ERROR method `drop_baz` is not a member of trait `PinnedDrop +57 | fn drop_baz(&mut self) {} //~ ERROR method `drop_baz` is not a member of trait `PinnedDrop | ^^^^^^^^ error: implementing the trait `PinnedDrop` is not unsafe - --> $DIR/invalid.rs:69:1 + --> $DIR/invalid.rs:67:1 | -69 | unsafe impl PinnedDrop for F { +67 | unsafe impl PinnedDrop for F { | ^^^^^^ error: implementing the method `drop` is not unsafe - --> $DIR/invalid.rs:82:5 + --> $DIR/invalid.rs:80:5 | -82 | unsafe fn drop(self: Pin<&mut Self>) {} //~ ERROR implementing the method `drop` is not unsafe +80 | unsafe fn drop(self: Pin<&mut Self>) {} //~ ERROR implementing the method `drop` is not unsafe | ^^^^^^ error: const `A` is not a member of trait `PinnedDrop` - --> $DIR/invalid.rs:93:5 + --> $DIR/invalid.rs:91:5 | -93 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop` +91 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop` | ^^^^^^^^^^^^^^^^ error: const `A` is not a member of trait `PinnedDrop` - --> $DIR/invalid.rs:106:5 + --> $DIR/invalid.rs:104:5 | -106 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop` +104 | const A: u8 = 0; //~ ERROR const `A` is not a member of trait `PinnedDrop` | ^^^^^^^^^^^^^^^^ error: type `A` is not a member of trait `PinnedDrop` - --> $DIR/invalid.rs:117:5 + --> $DIR/invalid.rs:115:5 | -117 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop` +115 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop` | ^^^^^^^^^^^^ error: type `A` is not a member of trait `PinnedDrop` - --> $DIR/invalid.rs:130:5 + --> $DIR/invalid.rs:128:5 | -130 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop` +128 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop` | ^^^^^^^^^^^^ error: duplicate definitions with name `drop` - --> $DIR/invalid.rs:142:5 + --> $DIR/invalid.rs:140:5 | -142 | fn drop(self: Pin<&mut Self>) {} //~ ERROR duplicate definitions with name `drop` +140 | fn drop(self: Pin<&mut Self>) {} //~ ERROR duplicate definitions with name `drop` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0277]: the trait bound `A: pin_project::__private::PinnedDrop` is not satisfied - --> $DIR/invalid.rs:5:15 + --> $DIR/invalid.rs:3:15 | -5 | #[pin_project(PinnedDrop)] //~ ERROR E0277 +3 | #[pin_project(PinnedDrop)] //~ ERROR E0277 | ^^^^^^^^^^ the trait `pin_project::__private::PinnedDrop` is not implemented for `A` | = note: required by `pin_project::__private::PinnedDrop::drop` diff --git a/tests/ui/project/ambiguous-let.rs b/tests/ui/project/ambiguous-let.rs index b27e0b37..a7067494 100644 --- a/tests/ui/project/ambiguous-let.rs +++ b/tests/ui/project/ambiguous-let.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::{pin_project, project}; #[pin_project] diff --git a/tests/ui/project/ambiguous-let.stderr b/tests/ui/project/ambiguous-let.stderr index 1813783b..42703f70 100644 --- a/tests/ui/project/ambiguous-let.stderr +++ b/tests/ui/project/ambiguous-let.stderr @@ -1,11 +1,11 @@ error: Both initializer expression and pattern are replaceable, you need to split the initializer expression into separate let bindings to avoid ambiguity - --> $DIR/ambiguous-let.rs:18:9 + --> $DIR/ambiguous-let.rs:16:9 | -18 | let Struct(x) = match Pin::new(&mut foo).project() { +16 | let Struct(x) = match Pin::new(&mut foo).project() { | ^^^^^^^^^ error[E0425]: cannot find value `x` in this scope - --> $DIR/ambiguous-let.rs:23:13 + --> $DIR/ambiguous-let.rs:21:13 | -23 | assert!(x); +21 | assert!(x); | ^ not found in this scope diff --git a/tests/ui/project/invalid.rs b/tests/ui/project/invalid.rs index 3bf10320..e9229863 100644 --- a/tests/ui/project/invalid.rs +++ b/tests/ui/project/invalid.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::{pin_project, project}; #[pin_project] diff --git a/tests/ui/project/invalid.stderr b/tests/ui/project/invalid.stderr index acbd60dc..238e8e9f 100644 --- a/tests/ui/project/invalid.stderr +++ b/tests/ui/project/invalid.stderr @@ -1,5 +1,5 @@ error: unexpected token - --> $DIR/invalid.rs:14:14 + --> $DIR/invalid.rs:12:14 | -14 | #[project(foo)] //~ ERROR unexpected token +12 | #[project(foo)] //~ ERROR unexpected token | ^ diff --git a/tests/ui/project/type-mismatch.rs b/tests/ui/project/type-mismatch.rs index 54938125..25280505 100644 --- a/tests/ui/project/type-mismatch.rs +++ b/tests/ui/project/type-mismatch.rs @@ -1,5 +1,3 @@ -// compile-fail - #![feature(proc_macro_hygiene, stmt_expr_attributes)] use pin_project::{pin_project, project}; diff --git a/tests/ui/project/type-mismatch.stderr b/tests/ui/project/type-mismatch.stderr index b4d053fc..0537283b 100644 --- a/tests/ui/project/type-mismatch.stderr +++ b/tests/ui/project/type-mismatch.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:40:9 + --> $DIR/type-mismatch.rs:38:9 | -40 | None => {} //~ ERROR mismatched types +38 | None => {} //~ ERROR mismatched types | ^^^^ expected enum `span::__FooProjection`, found enum `std::option::Option` | = note: expected type `span::__FooProjection<'_, {integer}, {integer}, _, _>` diff --git a/tests/ui/project/use-public.rs b/tests/ui/project/use-public.rs index cc3f09d2..23c9b89d 100644 --- a/tests/ui/project/use-public.rs +++ b/tests/ui/project/use-public.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[pin_project] diff --git a/tests/ui/project/use-public.stderr b/tests/ui/project/use-public.stderr index 6956656c..7919d65c 100644 --- a/tests/ui/project/use-public.stderr +++ b/tests/ui/project/use-public.stderr @@ -1,7 +1,7 @@ error[E0365]: `__AProjection` is private, and cannot be re-exported - --> $DIR/use-public.rs:14:13 + --> $DIR/use-public.rs:12:13 | -14 | pub use crate::A; //~ ERROR E0365 +12 | pub use crate::A; //~ ERROR E0365 | ^^^^^^^^ re-export of private `__AProjection` | = note: consider declaring type or module `__AProjection` with `pub` diff --git a/tests/ui/project/use.rs b/tests/ui/project/use.rs index adf2bb91..d4b02c1d 100644 --- a/tests/ui/project/use.rs +++ b/tests/ui/project/use.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[pin_project] diff --git a/tests/ui/project/use.stderr b/tests/ui/project/use.stderr index daddb16d..07d02416 100644 --- a/tests/ui/project/use.stderr +++ b/tests/ui/project/use.stderr @@ -1,11 +1,11 @@ error: #[project] attribute may not be used on renamed imports - --> $DIR/use.rs:14:16 + --> $DIR/use.rs:12:16 | -14 | use crate::A as B; //~ ERROR #[project] attribute may not be used on renamed imports +12 | use crate::A as B; //~ ERROR #[project] attribute may not be used on renamed imports | ^^^^^^ error: #[project] attribute may not be used on glob imports - --> $DIR/use.rs:16:16 + --> $DIR/use.rs:14:16 | -16 | use crate::*; //~ ERROR #[project] attribute may not be used on glob imports +14 | use crate::*; //~ ERROR #[project] attribute may not be used on glob imports | ^ diff --git a/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs b/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs index c94d365f..93514eee 100644 --- a/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs +++ b/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::pin_project; #[pin_project(UnsafeUnpin)] diff --git a/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.stderr b/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.stderr index 6a667eca..0f9ba200 100644 --- a/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.stderr +++ b/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.stderr @@ -1,10 +1,10 @@ error[E0277]: the trait bound `Foo<(), ()>: pin_project::UnsafeUnpin` is not satisfied - --> $DIR/not-implement-unsafe-unpin.rs:15:16 + --> $DIR/not-implement-unsafe-unpin.rs:13:16 | -12 | fn is_unpin() {} +10 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -15 | is_unpin::>(); //~ ERROR E0277 +13 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^ the trait `pin_project::UnsafeUnpin` is not implemented for `Foo<(), ()>` | = note: required because of the requirements on the impl of `pin_project::UnsafeUnpin` for `pin_project::__private::Wrapper<'_, Foo<(), ()>>` diff --git a/tests/ui/unsafe_unpin/proper_unpin.rs b/tests/ui/unsafe_unpin/proper_unpin.rs index 19663bc8..d743cd69 100644 --- a/tests/ui/unsafe_unpin/proper_unpin.rs +++ b/tests/ui/unsafe_unpin/proper_unpin.rs @@ -1,5 +1,3 @@ -// compile-fail - use pin_project::{pin_project, UnsafeUnpin}; use std::marker::PhantomPinned; diff --git a/tests/ui/unsafe_unpin/proper_unpin.stderr b/tests/ui/unsafe_unpin/proper_unpin.stderr index 93174e95..7dfad598 100644 --- a/tests/ui/unsafe_unpin/proper_unpin.stderr +++ b/tests/ui/unsafe_unpin/proper_unpin.stderr @@ -1,10 +1,10 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied - --> $DIR/proper_unpin.rs:37:5 + --> $DIR/proper_unpin.rs:35:5 | -6 | fn is_unpin() {} +4 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -37 | is_unpin::>(); //~ ERROR E0277 +35 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: @@ -14,12 +14,12 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` i = note: required because of the requirements on the impl of `std::marker::Unpin` for `Blah` error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied - --> $DIR/proper_unpin.rs:39:5 + --> $DIR/proper_unpin.rs:37:5 | -6 | fn is_unpin() {} +4 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -39 | is_unpin::>(); //~ ERROR E0277 +37 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: @@ -29,24 +29,24 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` i = note: required because of the requirements on the impl of `std::marker::Unpin` for `Blah` error[E0277]: the trait bound `TrivialBounds: pin_project::UnsafeUnpin` is not satisfied - --> $DIR/proper_unpin.rs:41:16 + --> $DIR/proper_unpin.rs:39:16 | -6 | fn is_unpin() {} +4 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -41 | is_unpin::(); //~ ERROR E0277 +39 | is_unpin::(); //~ ERROR E0277 | ^^^^^^^^^^^^^ the trait `pin_project::UnsafeUnpin` is not implemented for `TrivialBounds` | = note: required because of the requirements on the impl of `pin_project::UnsafeUnpin` for `pin_project::__private::Wrapper<'_, TrivialBounds>` = note: required because of the requirements on the impl of `std::marker::Unpin` for `TrivialBounds` error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied - --> $DIR/proper_unpin.rs:43:5 + --> $DIR/proper_unpin.rs:41:5 | -6 | fn is_unpin() {} +4 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -43 | is_unpin::>(); //~ ERROR E0277 +41 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: @@ -56,12 +56,12 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` i = note: required because of the requirements on the impl of `std::marker::Unpin` for `OverlappingLifetimeNames<'_, std::marker::PhantomPinned, ()>` error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied - --> $DIR/proper_unpin.rs:44:5 + --> $DIR/proper_unpin.rs:42:5 | -6 | fn is_unpin() {} +4 | fn is_unpin() {} | -------- ----- required by this bound in `is_unpin` ... -44 | is_unpin::>(); //~ ERROR E0277 +42 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: diff --git a/tests/ui/unstable-features/marker_trait_attr-feature-gate.rs b/tests/ui/unstable-features/marker_trait_attr-feature-gate.rs index 86aca920..24fd3006 100644 --- a/tests/ui/unstable-features/marker_trait_attr-feature-gate.rs +++ b/tests/ui/unstable-features/marker_trait_attr-feature-gate.rs @@ -1,5 +1,3 @@ -// compile-fail - // NB: If you change this test, change 'marker_trait_attr.rs' at the same time. use pin_project::pin_project; diff --git a/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr b/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr index efffafa8..9e1a8539 100644 --- a/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr +++ b/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr @@ -1,8 +1,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_>`: - --> $DIR/marker_trait_attr-feature-gate.rs:8:1 + --> $DIR/marker_trait_attr-feature-gate.rs:6:1 | -8 | #[pin_project] //~ ERROR E0119 +6 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_>` ... -15 | impl Unpin for Foo {} +13 | impl Unpin for Foo {} | ------------------------ first implementation here diff --git a/tests/ui/unstable-features/marker_trait_attr.rs b/tests/ui/unstable-features/marker_trait_attr.rs index 4484bcba..9086c9d6 100644 --- a/tests/ui/unstable-features/marker_trait_attr.rs +++ b/tests/ui/unstable-features/marker_trait_attr.rs @@ -1,5 +1,3 @@ -// compile-fail - // NB: If you change this test, change 'marker_trait_attr-feature-gate.rs' at the same time. // marker_trait_attr diff --git a/tests/ui/unstable-features/marker_trait_attr.stderr b/tests/ui/unstable-features/marker_trait_attr.stderr index 4292ebfb..e9f31790 100644 --- a/tests/ui/unstable-features/marker_trait_attr.stderr +++ b/tests/ui/unstable-features/marker_trait_attr.stderr @@ -1,8 +1,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_>`: - --> $DIR/marker_trait_attr.rs:14:1 + --> $DIR/marker_trait_attr.rs:12:1 | -14 | #[pin_project] //~ ERROR E0119 +12 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_>` ... -21 | impl Unpin for Foo {} +19 | impl Unpin for Foo {} | ------------------------ first implementation here diff --git a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs index 1cb6fff7..b09a4368 100644 --- a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs +++ b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs @@ -1,5 +1,3 @@ -// compile-fail - // NB: If you change this test, change 'overlapping_marker_traits.rs' at the same time. use pin_project::pin_project; diff --git a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr index 6c1f569b..a621a69b 100644 --- a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr +++ b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr @@ -1,8 +1,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_>`: - --> $DIR/overlapping_marker_traits-feature-gate.rs:8:1 + --> $DIR/overlapping_marker_traits-feature-gate.rs:6:1 | -8 | #[pin_project] //~ ERROR E0119 +6 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_>` ... -15 | impl Unpin for Foo {} +13 | impl Unpin for Foo {} | ------------------------ first implementation here diff --git a/tests/ui/unstable-features/run-pass/overlapping_marker_traits.rs b/tests/ui/unstable-features/run-pass/overlapping_marker_traits.rs index 0d68de02..fa9683a8 100644 --- a/tests/ui/unstable-features/run-pass/overlapping_marker_traits.rs +++ b/tests/ui/unstable-features/run-pass/overlapping_marker_traits.rs @@ -1,5 +1,3 @@ -// run-pass - // NB: If you change this test, change 'overlapping_marker_traits-feature-gate.rs' at the same time. // overlapping_marker_traits diff --git a/tests/ui/unstable-features/run-pass/stmt_expr_attributes.rs b/tests/ui/unstable-features/run-pass/stmt_expr_attributes.rs index c5e5713b..8ad8e41b 100644 --- a/tests/ui/unstable-features/run-pass/stmt_expr_attributes.rs +++ b/tests/ui/unstable-features/run-pass/stmt_expr_attributes.rs @@ -1,5 +1,3 @@ -// run-pass - // NB: If you change this test, change 'stmt_expr_attributes-feature-gate.rs' at the same time. // proc_macro_hygiene diff --git a/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs b/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs index a23535bb..177aed00 100644 --- a/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs +++ b/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs @@ -1,5 +1,3 @@ -// compile-fail - // NB: If you change this test, change 'stmt_expr_attributes.rs' at the same time. use pin_project::{pin_project, project}; diff --git a/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.stderr b/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.stderr index ce83c86a..0d4c376e 100644 --- a/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.stderr +++ b/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.stderr @@ -1,34 +1,34 @@ error[E0658]: attributes on expressions are experimental - --> $DIR/stmt_expr_attributes-feature-gate.rs:24:5 + --> $DIR/stmt_expr_attributes-feature-gate.rs:22:5 | -24 | #[project] //~ ERROR E0658 +22 | #[project] //~ ERROR E0658 | ^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/15701 = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable error[E0658]: attributes on expressions are experimental - --> $DIR/stmt_expr_attributes-feature-gate.rs:40:14 + --> $DIR/stmt_expr_attributes-feature-gate.rs:38:14 | -40 | let () = #[project] //~ ERROR E0658 +38 | let () = #[project] //~ ERROR E0658 | ^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/15701 = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable error[E0658]: custom attributes cannot be applied to expressions - --> $DIR/stmt_expr_attributes-feature-gate.rs:24:5 + --> $DIR/stmt_expr_attributes-feature-gate.rs:22:5 | -24 | #[project] //~ ERROR E0658 +22 | #[project] //~ ERROR E0658 | ^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/54727 = help: add `#![feature(proc_macro_hygiene)]` to the crate attributes to enable error[E0658]: custom attributes cannot be applied to expressions - --> $DIR/stmt_expr_attributes-feature-gate.rs:40:14 + --> $DIR/stmt_expr_attributes-feature-gate.rs:38:14 | -40 | let () = #[project] //~ ERROR E0658 +38 | let () = #[project] //~ ERROR E0658 | ^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/54727 diff --git a/tests/ui/unstable-features/trivial_bounds-bug.rs b/tests/ui/unstable-features/trivial_bounds-bug.rs index 37147a17..d2fb0195 100644 --- a/tests/ui/unstable-features/trivial_bounds-bug.rs +++ b/tests/ui/unstable-features/trivial_bounds-bug.rs @@ -1,5 +1,3 @@ -// compile-fail - // NB: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time. // trivial_bounds diff --git a/tests/ui/unstable-features/trivial_bounds-bug.stderr b/tests/ui/unstable-features/trivial_bounds-bug.stderr index f6c45aec..e02ca447 100644 --- a/tests/ui/unstable-features/trivial_bounds-bug.stderr +++ b/tests/ui/unstable-features/trivial_bounds-bug.stderr @@ -1,7 +1,7 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied - --> $DIR/trivial_bounds-bug.rs:15:5 + --> $DIR/trivial_bounds-bug.rs:13:5 | -15 | impl Unpin for Foo where PhantomPinned: Unpin {} //~ ERROR E0277 +13 | impl Unpin for Foo where PhantomPinned: Unpin {} //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: diff --git a/tests/ui/unstable-features/trivial_bounds-feature-gate.rs b/tests/ui/unstable-features/trivial_bounds-feature-gate.rs index bb390b31..1845b39b 100644 --- a/tests/ui/unstable-features/trivial_bounds-feature-gate.rs +++ b/tests/ui/unstable-features/trivial_bounds-feature-gate.rs @@ -1,5 +1,3 @@ -// compile-fail - // NB: If you change this test, change 'trivial_bounds.rs' at the same time. use std::marker::{PhantomData, PhantomPinned}; diff --git a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr index 2872f21c..d8944302 100644 --- a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr +++ b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr @@ -1,18 +1,18 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied - --> $DIR/trivial_bounds-feature-gate.rs:10:5 - | -10 | impl Unpin for Foo where PhantomPinned: Unpin {} //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` - | - = help: the following implementations were found: - - = help: see issue #48214 - = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable + --> $DIR/trivial_bounds-feature-gate.rs:8:5 + | +8 | impl Unpin for Foo where PhantomPinned: Unpin {} //~ ERROR E0277 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` + | + = help: the following implementations were found: + + = help: see issue #48214 + = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied - --> $DIR/trivial_bounds-feature-gate.rs:18:5 + --> $DIR/trivial_bounds-feature-gate.rs:16:5 | -18 | impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR E0277 +16 | impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: @@ -22,9 +22,9 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` i = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied in `inner::Inner` - --> $DIR/trivial_bounds-feature-gate.rs:35:5 + --> $DIR/trivial_bounds-feature-gate.rs:33:5 | -35 | impl Unpin for Foo where Inner: Unpin {} //~ ERROR E0277 +33 | impl Unpin for Foo where Inner: Unpin {} //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `inner::Inner`, the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: @@ -34,9 +34,9 @@ error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` i = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable error[E0277]: the trait bound `std::marker::PhantomPinned: std::marker::Unpin` is not satisfied in `inner::Inner` - --> $DIR/trivial_bounds-feature-gate.rs:43:5 + --> $DIR/trivial_bounds-feature-gate.rs:41:5 | -43 | impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR E0277 +41 | impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `inner::Inner`, the trait `std::marker::Unpin` is not implemented for `std::marker::PhantomPinned` | = help: the following implementations were found: diff --git a/tests/ui/unstable-features/trivial_bounds.rs b/tests/ui/unstable-features/trivial_bounds.rs index 07d70d14..770866c7 100644 --- a/tests/ui/unstable-features/trivial_bounds.rs +++ b/tests/ui/unstable-features/trivial_bounds.rs @@ -1,5 +1,3 @@ -// run-pass - // NB: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time. // trivial_bounds diff --git a/tests/ui/unstable-features/trivial_bounds.stderr b/tests/ui/unstable-features/trivial_bounds.stderr index cea34155..8841bfb3 100644 --- a/tests/ui/unstable-features/trivial_bounds.stderr +++ b/tests/ui/unstable-features/trivial_bounds.stderr @@ -1,17 +1,17 @@ error: Trait bound inner::Inner: std::marker::Unpin does not depend on any type or lifetime parameters - --> $DIR/trivial_bounds.rs:17:37 + --> $DIR/trivial_bounds.rs:15:37 | -17 | impl Unpin for Foo where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters +15 | impl Unpin for Foo where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters | ^^^^^ | note: lint level defined here - --> $DIR/trivial_bounds.rs:8:9 + --> $DIR/trivial_bounds.rs:6:9 | -8 | #![deny(trivial_bounds)] +6 | #![deny(trivial_bounds)] | ^^^^^^^^^^^^^^ error: Trait bound inner::Wrapper: std::marker::Unpin does not depend on any type or lifetime parameters - --> $DIR/trivial_bounds.rs:25:46 + --> $DIR/trivial_bounds.rs:23:46 | -25 | impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters +23 | impl Unpin for Bar where Wrapper: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters | ^^^^^