diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 2fdc28ff..00000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1 +0,0 @@ -* @taiki-e diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d68c7cea..4a53f3ae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: - uses: taiki-e/github-actions/install-rust@main with: toolchain: ${{ matrix.rust }} - component: rustfmt + component: rustfmt,rust-src - name: Pre Cache cargo-expand run: | mkdir -p .github/caching diff --git a/CHANGELOG.md b/CHANGELOG.md index c3179449..46b1c96d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,21 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](https://semver.org). + + ## [Unreleased] +## [0.4.29] - 2021-12-26 + +- [Fix compile error with `syn` 1.0.84 and later.](https://github.com/taiki-e/pin-project/pull/335) + ## [0.4.28] - 2021-03-28 - [Fix `unused_must_use` warning on unused borrows, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/322) See [#322](https://github.com/taiki-e/pin-project/pull/322) for more details. - (Note: 1.0 does not have this problem.) + (NOTE: 1.0 does not have this problem.) ## [0.4.27] - 2020-10-11 @@ -24,13 +32,13 @@ This project adheres to [Semantic Versioning](https://semver.org). - [Suppress `drop_bounds` lint, which will be added to rustc in the future.](https://github.com/taiki-e/pin-project/pull/273) See [#272](https://github.com/taiki-e/pin-project/issues/272) for more details. - (Note: 1.0.0-alpha.1 already contains this change.) + (NOTE: 1.0.0-alpha.1 already contains this change.) ## [0.4.24] - 2020-09-26 - [Fix compatibility of generated code with `forbid(future_incompatible)`.](https://github.com/taiki-e/pin-project/pull/282) - Note: This does not guarantee compatibility with `forbid(future_incompatible)` in the future. + NOTE: This does not guarantee compatibility with `forbid(future_incompatible)` in the future. If rustc adds a new lint, we may not be able to keep this. ## [0.4.23] - 2020-07-27 @@ -161,7 +169,7 @@ This project adheres to [Semantic Versioning](https://semver.org). } ``` - *[Note: This raises the minimum supported Rust version of this crate from Rust 1.33 to Rust 1.34.](https://github.com/taiki-e/pin-project/pull/219#pullrequestreview-408644187)* + *[NOTE: This raises the minimum supported Rust version of this crate from Rust 1.33 to Rust 1.34.](https://github.com/taiki-e/pin-project/pull/219#pullrequestreview-408644187)* - [Fix an issue where duplicate `#[project]` attributes were ignored.](https://github.com/taiki-e/pin-project/pull/218) @@ -195,7 +203,7 @@ This project adheres to [Semantic Versioning](https://semver.org). ## [0.4.11] - 2020-05-07 -**Note: This release has been yanked.** See [#206](https://github.com/taiki-e/pin-project/issues/206) for details. +**NOTE:** This release has been yanked. See [#206](https://github.com/taiki-e/pin-project/issues/206) for details. - [Fix an issue that `#[project]` on non-statement expression does not work without unstable features.](https://github.com/taiki-e/pin-project/pull/197) @@ -249,7 +257,7 @@ This project adheres to [Semantic Versioning](https://semver.org). ## [0.4.3] - 2019-10-15 -**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. +**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. - [`#[pin_project]` can now interoperate with `#[cfg_attr()]`.](https://github.com/taiki-e/pin-project/pull/135) @@ -261,19 +269,19 @@ This project adheres to [Semantic Versioning](https://semver.org). ## [0.4.2] - 2019-09-29 -**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. +**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. - [Fix support for DSTs(Dynamically Sized Types).](https://github.com/taiki-e/pin-project/pull/113) ## [0.4.1] - 2019-09-26 -**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. +**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. - [Fix an issue that caused an error when using `#[pin_project]` on a type that has `#[pin]` + `!Unpin` field with no generics or lifetime.](https://github.com/taiki-e/pin-project/pull/111) ## [0.4.0] - 2019-09-25 -**Note: This release has been yanked.** See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. +**NOTE:** This release has been yanked. See [#148](https://github.com/taiki-e/pin-project/pull/148) for details. - [**Pin projection has become a safe operation.**](https://github.com/taiki-e/pin-project/pull/18) In the absence of other unsafe code that you write, it is impossible to cause undefined behavior. @@ -402,7 +410,7 @@ Changes since the 0.4.0-beta.1 release: - `Unpin` impls must be specified with an impl of `UnsafeUnpin`, instead of implementing the normal `Unpin` trait. -- Made `#[project]` attribute disabled by default. +- Make `#[project]` attribute disabled by default. See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project/issues/21). @@ -416,7 +424,7 @@ See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project ## [0.3.3] - 2019-07-15 -**Note: This release has been yanked.** See [#16](https://github.com/taiki-e/pin-project/issues/16) for details. +**NOTE:** This release has been yanked. See [#16](https://github.com/taiki-e/pin-project/issues/16) for details. - Diagnostic improvements. @@ -490,11 +498,12 @@ See also [tracking issue for 0.4 release](https://github.com/taiki-e/pin-project ## [0.1.0] - 2019-01-08 -**Note: This release has been yanked.** +**NOTE:** This release has been yanked. Initial release -[Unreleased]: https://github.com/taiki-e/pin-project/compare/v0.4.28...HEAD +[Unreleased]: https://github.com/taiki-e/pin-project/compare/v0.4.29...v0.4 +[0.4.29]: https://github.com/taiki-e/pin-project/compare/v0.4.28...v0.4.29 [0.4.28]: https://github.com/taiki-e/pin-project/compare/v0.4.27...v0.4.28 [0.4.27]: https://github.com/taiki-e/pin-project/compare/v0.4.26...v0.4.27 [0.4.26]: https://github.com/taiki-e/pin-project/compare/v0.4.25...v0.4.26 diff --git a/Cargo.toml b/Cargo.toml index d2616206..e968c908 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,11 +1,10 @@ [package] name = "pin-project" -version = "0.4.28" -authors = ["Taiki Endo "] +version = "0.4.29" edition = "2018" +rust-version = "1.34" license = "Apache-2.0 OR MIT" repository = "https://github.com/taiki-e/pin-project" -documentation = "https://docs.rs/pin-project" keywords = ["pin", "macros", "attribute"] categories = ["no-std", "rust-patterns"] exclude = ["/.*", "/ci", "/tools"] @@ -28,9 +27,13 @@ members = [ ] [dependencies] -pin-project-internal = { version = "=0.4.28", path = "pin-project-internal", default-features = false } +pin-project-internal = { version = "=0.4.29", path = "pin-project-internal", default-features = false } [dev-dependencies] pin-project-auxiliary-macro = { path = "tests/ui/auxiliary" } rustversion = "1.0" trybuild = "1.0" + +# For test on MSRV. +ryu = "=1.0.6" +serde_json = "=1.0.72" diff --git a/pin-project-internal/Cargo.toml b/pin-project-internal/Cargo.toml index cd4e24f4..3b9e493e 100644 --- a/pin-project-internal/Cargo.toml +++ b/pin-project-internal/Cargo.toml @@ -1,11 +1,10 @@ [package] name = "pin-project-internal" -version = "0.4.28" -authors = ["Taiki Endo "] +version = "0.4.29" edition = "2018" +rust-version = "1.34" license = "Apache-2.0 OR MIT" repository = "https://github.com/taiki-e/pin-project" -documentation = "https://docs.rs/pin-project-internal" keywords = ["pin", "macros", "attribute"] categories = ["no-std", "rust-patterns"] description = """ diff --git a/pin-project-internal/src/lib.rs b/pin-project-internal/src/lib.rs index ba34e3ae..0f46d3b5 100644 --- a/pin-project-internal/src/lib.rs +++ b/pin-project-internal/src/lib.rs @@ -6,7 +6,7 @@ ))] #![warn(unsafe_code)] #![warn(rust_2018_idioms, single_use_lifetimes, unreachable_pub)] -#![warn(clippy::all, clippy::default_trait_access)] +#![warn(clippy::default_trait_access, clippy::wildcard_imports)] // mem::take and #[non_exhaustive] requires Rust 1.40 #![allow(clippy::mem_replace_with_default, clippy::manual_non_exhaustive)] #![allow(clippy::needless_doctest_main)] diff --git a/pin-project-internal/src/pin_project/attribute.rs b/pin-project-internal/src/pin_project/attribute.rs index 7945aba1..eee58a8e 100644 --- a/pin-project-internal/src/pin_project/attribute.rs +++ b/pin-project-internal/src/pin_project/attribute.rs @@ -2,7 +2,7 @@ use proc_macro2::TokenStream; use quote::quote; use syn::{ parse::{Parse, ParseStream}, - *, + Attribute, Result, Token, Visibility, }; use super::PIN; diff --git a/pin-project-internal/src/pin_project/derive.rs b/pin-project-internal/src/pin_project/derive.rs index 083d9481..7357da52 100644 --- a/pin-project-internal/src/pin_project/derive.rs +++ b/pin-project-internal/src/pin_project/derive.rs @@ -2,9 +2,13 @@ use proc_macro2::{Delimiter, Group, Span, TokenStream}; use quote::{format_ident, quote, quote_spanned, ToTokens}; use syn::{ parse::{Parse, ParseStream}, + parse_quote, spanned::Spanned, + token, visit_mut::VisitMut, - *, + Attribute, Data, DataEnum, DataStruct, DeriveInput, Error, Field, Fields, FieldsNamed, + FieldsUnnamed, Generics, Ident, Index, Lifetime, LifetimeDef, Meta, MetaList, NestedMeta, + Result, Token, Type, Variant, Visibility, WhereClause, }; use super::PIN; diff --git a/pin-project-internal/src/pinned_drop.rs b/pin-project-internal/src/pinned_drop.rs index 42619e33..c65a2c4b 100644 --- a/pin-project-internal/src/pinned_drop.rs +++ b/pin-project-internal/src/pinned_drop.rs @@ -1,6 +1,10 @@ use proc_macro2::TokenStream; use quote::{quote, ToTokens}; -use syn::{spanned::Spanned, visit_mut::VisitMut, *}; +use syn::{ + parse_quote, spanned::Spanned, visit_mut::VisitMut, Error, FnArg, GenericArgument, Ident, + ImplItem, ImplItemMethod, ItemImpl, Pat, Path, PathArguments, Result, ReturnType, Token, Type, + TypePath, TypeReference, +}; use crate::utils::{parse_as_empty, prepend_underscore_to_self, ReplaceReceiver, SliceExt}; diff --git a/pin-project-internal/src/project.rs b/pin-project-internal/src/project.rs index a00e4c2b..f593d9f7 100644 --- a/pin-project-internal/src/project.rs +++ b/pin-project-internal/src/project.rs @@ -1,8 +1,11 @@ use proc_macro2::{Span, TokenStream}; use quote::ToTokens; use syn::{ + parse_quote, visit_mut::{self, VisitMut}, - *, + Expr, ExprLet, ExprMatch, Ident, ImplItem, Item, ItemFn, ItemImpl, ItemUse, Lifetime, Local, + Pat, PatBox, PatIdent, PatOr, PatPath, PatReference, PatStruct, PatTupleStruct, PatType, Path, + PathArguments, PathSegment, Result, Stmt, Type, TypePath, UseTree, }; use crate::utils::{ diff --git a/pin-project-internal/src/utils.rs b/pin-project-internal/src/utils.rs index af68e9ed..1c1d671f 100644 --- a/pin-project-internal/src/utils.rs +++ b/pin-project-internal/src/utils.rs @@ -4,9 +4,13 @@ use proc_macro2::{Group, Spacing, Span, TokenStream, TokenTree}; use quote::{format_ident, quote, quote_spanned, ToTokens}; use syn::{ parse::{Parse, ParseBuffer, ParseStream}, + parse_quote, punctuated::Punctuated, + token, visit_mut::{self, VisitMut}, - *, + Attribute, ExprPath, ExprStruct, Generics, Ident, Item, Lifetime, LifetimeDef, Macro, PatPath, + PatStruct, PatTupleStruct, Path, PathArguments, PredicateType, QSelf, Result, Token, Type, + TypeParamBound, TypePath, Variant, Visibility, WherePredicate, }; pub(crate) type Variants = Punctuated; diff --git a/src/lib.rs b/src/lib.rs index 9ddba105..4b08e35d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -42,7 +42,7 @@ attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code)) ))] #![warn(missing_docs, rust_2018_idioms, single_use_lifetimes, unreachable_pub)] -#![warn(clippy::all, clippy::default_trait_access)] +#![warn(clippy::default_trait_access, clippy::wildcard_imports)] // mem::take and #[non_exhaustive] requires Rust 1.40 #![allow(clippy::mem_replace_with_default, clippy::manual_non_exhaustive)] #![allow(clippy::needless_doctest_main)] diff --git a/tests/doc/Cargo.toml b/tests/doc/Cargo.toml index a1ee24d5..055784a8 100644 --- a/tests/doc/Cargo.toml +++ b/tests/doc/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "doctest" version = "0.1.0" -authors = ["Taiki Endo "] edition = "2018" publish = false diff --git a/tests/doc/lib.rs b/tests/doc/lib.rs index 74067ccf..64673838 100644 --- a/tests/doc/lib.rs +++ b/tests/doc/lib.rs @@ -3,12 +3,11 @@ no_crate_inject, attr(deny(warnings, rust_2018_idioms, single_use_lifetimes), allow(dead_code)) ))] -#![cfg_attr(doctest, feature(external_doc))] -// As `feature(external_doc)` and `doc-comment` do not work with `cfg(test)`, +// As `doc = include_str!` and `doc-comment` do not work with `cfg(test)`, // and `cfg(doctest)` requires 1.40, these tests are split into this crate until // MSRV increases. -#[cfg(doctest)] -#[doc(include = "../../README.md")] +// https://github.com/rust-lang/rust/issues/82768 +#[cfg_attr(doctest, cfg_attr(doctest, doc = include_str!("../../README.md")))] const _README: () = (); diff --git a/tests/expand/Cargo.toml b/tests/expand/Cargo.toml index 60f7db61..da3bb2ba 100644 --- a/tests/expand/Cargo.toml +++ b/tests/expand/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "expandtest" version = "0.1.0" -authors = ["Taiki Endo "] edition = "2018" publish = false diff --git a/tests/lint.rs b/tests/lint.rs index d7af2bb2..1d874979 100644 --- a/tests/lint.rs +++ b/tests/lint.rs @@ -17,7 +17,6 @@ single_use_lifetimes, trivial_casts, trivial_numeric_casts, - unaligned_references, unreachable_pub, unused_extern_crates, unused_import_braces, diff --git a/tests/no-core/Cargo.toml b/tests/no-core/Cargo.toml index 77a52124..79f7c979 100644 --- a/tests/no-core/Cargo.toml +++ b/tests/no-core/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "no-core" version = "0.1.0" -authors = ["Taiki Endo "] edition = "2018" publish = false diff --git a/tests/no-std/Cargo.toml b/tests/no-std/Cargo.toml index 1d15b5c5..37724eaa 100644 --- a/tests/no-std/Cargo.toml +++ b/tests/no-std/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "no-std" version = "0.1.0" -authors = ["Taiki Endo "] edition = "2018" publish = false diff --git a/tests/rust-2015/Cargo.toml b/tests/rust-2015/Cargo.toml index ccc04341..2277a7b8 100644 --- a/tests/rust-2015/Cargo.toml +++ b/tests/rust-2015/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "rust-2015" version = "0.1.0" -authors = ["Taiki Endo "] edition = "2015" publish = false diff --git a/tests/ui/auxiliary/Cargo.toml b/tests/ui/auxiliary/Cargo.toml index a33bb2ec..99f670d6 100644 --- a/tests/ui/auxiliary/Cargo.toml +++ b/tests/ui/auxiliary/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "pin-project-auxiliary-macro" version = "0.0.0" -authors = ["Taiki Endo "] edition = "2018" publish = false diff --git a/tests/ui/cfg/cfg_attr-resolve.stderr b/tests/ui/cfg/cfg_attr-resolve.stderr index ee1fa03a..c473e8a1 100644 --- a/tests/ui/cfg/cfg_attr-resolve.stderr +++ b/tests/ui/cfg/cfg_attr-resolve.stderr @@ -1,5 +1,5 @@ error[E0599]: no method named `project` found for struct `Pin<&mut Foo>` in the current scope - --> $DIR/cfg_attr-resolve.rs:10:31 + --> tests/ui/cfg/cfg_attr-resolve.rs:10:31 | 10 | let _x = Pin::new(&mut x).project(); //~ ERROR E0599 | ^^^^^^^ method not found in `Pin<&mut Foo>` diff --git a/tests/ui/cfg/cfg_attr-type-mismatch.stderr b/tests/ui/cfg/cfg_attr-type-mismatch.stderr index b0224c01..166a32c0 100644 --- a/tests/ui/cfg/cfg_attr-type-mismatch.stderr +++ b/tests/ui/cfg/cfg_attr-type-mismatch.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/cfg_attr-type-mismatch.rs:19:27 + --> tests/ui/cfg/cfg_attr-type-mismatch.rs:19:27 | 19 | let _: Pin<&mut u8> = x.inner; //~ ERROR E0308 | ------------ ^^^^^^^ expected struct `Pin`, found `&mut u8` @@ -10,7 +10,7 @@ error[E0308]: mismatched types found mutable reference `&mut u8` error[E0308]: mismatched types - --> $DIR/cfg_attr-type-mismatch.rs:23:22 + --> tests/ui/cfg/cfg_attr-type-mismatch.rs:23:22 | 23 | let _: &mut u8 = x.inner; //~ ERROR E0308 | ------- ^^^^^^^ diff --git a/tests/ui/cfg/cfg_attr-unpin.stderr b/tests/ui/cfg/cfg_attr-unpin.stderr index 6ce17946..b59e644d 100644 --- a/tests/ui/cfg/cfg_attr-unpin.stderr +++ b/tests/ui/cfg/cfg_attr-unpin.stderr @@ -1,22 +1,43 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/cfg_attr-unpin.rs:18:5 + --> tests/ui/cfg/cfg_attr-unpin.rs:18:5 | -15 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 18 | is_unpin::>(); // ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Foo`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `Foo` + = note: consider using `Box::pin` +note: required because it appears within the type `Foo` + --> tests/ui/cfg/cfg_attr-unpin.rs:5:8 + | +5 | struct Foo { + | ^^^ +note: required by a bound in `is_unpin` + --> tests/ui/cfg/cfg_attr-unpin.rs:15:16 + | +15 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/cfg_attr-unpin.rs:20:5 + --> tests/ui/cfg/cfg_attr-unpin.rs:20:5 | -15 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 20 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `__Bar<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `__Bar<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Bar` + = note: consider using `Box::pin` +note: required because it appears within the type `__Bar<'_, PhantomPinned>` + --> tests/ui/cfg/cfg_attr-unpin.rs:10:8 + | +10 | struct Bar { + | ^^^ +note: required because of the requirements on the impl of `Unpin` for `Bar` + --> tests/ui/cfg/cfg_attr-unpin.rs:9:24 + | +9 | #[cfg_attr(not(any()), pin_project)] + | ^^^^^^^^^^^ +10 | struct Bar { + | ^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/cfg/cfg_attr-unpin.rs:15:16 + | +15 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/cfg/packed_sneaky-span-issue-1.stderr b/tests/ui/cfg/packed_sneaky-span-issue-1.stderr index d45aa867..1783adb3 100644 --- a/tests/ui/cfg/packed_sneaky-span-issue-1.stderr +++ b/tests/ui/cfg/packed_sneaky-span-issue-1.stderr @@ -1,7 +1,7 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-span-issue-1.rs:8:1 + --> tests/ui/cfg/packed_sneaky-span-issue-1.rs:8:1 | 8 | #[hidden_repr(packed)] | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/cfg/packed_sneaky-span-issue-2.stderr b/tests/ui/cfg/packed_sneaky-span-issue-2.stderr index cfd63b87..ff418101 100644 --- a/tests/ui/cfg/packed_sneaky-span-issue-2.stderr +++ b/tests/ui/cfg/packed_sneaky-span-issue-2.stderr @@ -1,7 +1,7 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-span-issue-2.rs:8:1 + --> tests/ui/cfg/packed_sneaky-span-issue-2.rs:8:1 | 8 | #[hidden_repr(packed)] | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/cfg/packed_sneaky.stderr b/tests/ui/cfg/packed_sneaky.stderr index 5910cf4b..9c30192d 100644 --- a/tests/ui/cfg/packed_sneaky.stderr +++ b/tests/ui/cfg/packed_sneaky.stderr @@ -1,7 +1,7 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky.rs:6:1 + --> tests/ui/cfg/packed_sneaky.rs:6:1 | 6 | #[hidden_repr_cfg_not_any(packed)] //~ ERROR may not be used on #[repr(packed)] types | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `hidden_repr_cfg_not_any` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/cfg/proper_unpin.stderr b/tests/ui/cfg/proper_unpin.stderr index 708387fb..af448c00 100644 --- a/tests/ui/cfg/proper_unpin.stderr +++ b/tests/ui/cfg/proper_unpin.stderr @@ -1,11 +1,25 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/proper_unpin.rs:27:5 + --> tests/ui/cfg/proper_unpin.rs:27:5 | -22 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 27 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `__Bar<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `__Bar<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Bar` + = note: consider using `Box::pin` +note: required because it appears within the type `__Bar<'_, PhantomPinned>` + --> tests/ui/cfg/proper_unpin.rs:14:8 + | +14 | struct Bar { + | ^^^ +note: required because of the requirements on the impl of `Unpin` for `Bar` + --> tests/ui/cfg/proper_unpin.rs:13:1 + | +13 | #[pin_project] + | ^^^^^^^^^^^^^^ +14 | struct Bar { + | ^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/cfg/proper_unpin.rs:22:16 + | +22 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/cfg/unsupported.stderr b/tests/ui/cfg/unsupported.stderr index 943f2c53..127df570 100644 --- a/tests/ui/cfg/unsupported.stderr +++ b/tests/ui/cfg/unsupported.stderr @@ -1,7 +1,8 @@ error: #[pin_project] attribute may not be used on structs with zero fields - --> $DIR/unsupported.rs:7:1 + --> tests/ui/cfg/unsupported.rs:7:15 | -7 | / struct Struct { +7 | struct Struct { + | _______________^ 8 | | #[cfg(any())] 9 | | #[pin] 10 | | f: u8, diff --git a/tests/ui/not_unpin/assert-not-unpin.stderr b/tests/ui/not_unpin/assert-not-unpin.stderr index df697acd..be5b0e67 100644 --- a/tests/ui/not_unpin/assert-not-unpin.stderr +++ b/tests/ui/not_unpin/assert-not-unpin.stderr @@ -1,83 +1,146 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/assert-not-unpin.rs:31:5 + --> tests/ui/not_unpin/assert-not-unpin.rs:31:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 31 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | + = note: consider using `Box::pin` = note: required because it appears within the type `Wrapper<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Foo<(), ()>` +note: required because of the requirements on the impl of `Unpin` for `Foo<(), ()>` + --> tests/ui/not_unpin/assert-not-unpin.rs:8:15 + | +8 | #[pin_project(!Unpin)] + | ^^^^^^ +9 | struct Foo { + | ^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/not_unpin/assert-not-unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/assert-not-unpin.rs:32:5 + --> tests/ui/not_unpin/assert-not-unpin.rs:32:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 32 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | + = note: consider using `Box::pin` = note: required because it appears within the type `Wrapper<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Foo` +note: required because of the requirements on the impl of `Unpin` for `Foo` + --> tests/ui/not_unpin/assert-not-unpin.rs:8:15 + | +8 | #[pin_project(!Unpin)] + | ^^^^^^ +9 | struct Foo { + | ^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/not_unpin/assert-not-unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/assert-not-unpin.rs:33:5 + --> tests/ui/not_unpin/assert-not-unpin.rs:33:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 33 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | + = note: consider using `Box::pin` = note: required because it appears within the type `Wrapper<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Foo<(), PhantomPinned>` +note: required because of the requirements on the impl of `Unpin` for `Foo<(), PhantomPinned>` + --> tests/ui/not_unpin/assert-not-unpin.rs:8:15 + | +8 | #[pin_project(!Unpin)] + | ^^^^^^ +9 | struct Foo { + | ^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/not_unpin/assert-not-unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/assert-not-unpin.rs:34:5 + --> tests/ui/not_unpin/assert-not-unpin.rs:34:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 34 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | + = note: consider using `Box::pin` = note: required because it appears within the type `Wrapper<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Foo` +note: required because of the requirements on the impl of `Unpin` for `Foo` + --> tests/ui/not_unpin/assert-not-unpin.rs:8:15 + | +8 | #[pin_project(!Unpin)] + | ^^^^^^ +9 | struct Foo { + | ^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/not_unpin/assert-not-unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/assert-not-unpin.rs:36:5 + --> tests/ui/not_unpin/assert-not-unpin.rs:36:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 36 | is_unpin::(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | + = note: consider using `Box::pin` = note: required because it appears within the type `Wrapper<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `TrivialBounds` +note: required because of the requirements on the impl of `Unpin` for `TrivialBounds` + --> tests/ui/not_unpin/assert-not-unpin.rs:15:15 + | +15 | #[pin_project(!Unpin)] + | ^^^^^^ +16 | struct TrivialBounds { + | ^^^^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/not_unpin/assert-not-unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/assert-not-unpin.rs:38:5 + --> tests/ui/not_unpin/assert-not-unpin.rs:38:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 38 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | + = note: consider using `Box::pin` = note: required because it appears within the type `Wrapper<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Bar<'_, (), ()>` +note: required because of the requirements on the impl of `Unpin` for `Bar<'_, (), ()>` + --> tests/ui/not_unpin/assert-not-unpin.rs:21:15 + | +21 | #[pin_project(!Unpin)] + | ^^^^^^ +22 | struct Bar<'a, T, U> { + | ^^^^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/not_unpin/assert-not-unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/assert-not-unpin.rs:39:5 + --> tests/ui/not_unpin/assert-not-unpin.rs:39:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 39 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Wrapper<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | + = note: consider using `Box::pin` = note: required because it appears within the type `Wrapper<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Bar<'_, PhantomPinned, PhantomPinned>` +note: required because of the requirements on the impl of `Unpin` for `Bar<'_, PhantomPinned, PhantomPinned>` + --> tests/ui/not_unpin/assert-not-unpin.rs:21:15 + | +21 | #[pin_project(!Unpin)] + | ^^^^^^ +22 | struct Bar<'a, T, U> { + | ^^^^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/not_unpin/assert-not-unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` diff --git a/tests/ui/not_unpin/conflict-unpin.stderr b/tests/ui/not_unpin/conflict-unpin.stderr index e90a574b..d644bf78 100644 --- a/tests/ui/not_unpin/conflict-unpin.stderr +++ b/tests/ui/not_unpin/conflict-unpin.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`: - --> $DIR/conflict-unpin.rs:3:15 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>` + --> tests/ui/not_unpin/conflict-unpin.rs:3:15 | 3 | #[pin_project(!Unpin)] //~ ERROR E0119 | ^^^^^^ conflicting implementation for `Foo<_, _>` @@ -7,8 +7,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 10 | impl Unpin for Foo where T: Unpin {} | --------------------------------------------- first implementation here -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`: - --> $DIR/conflict-unpin.rs:12:15 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>` + --> tests/ui/not_unpin/conflict-unpin.rs:12:15 | 12 | #[pin_project(!Unpin)] //~ ERROR E0119 | ^^^^^^ conflicting implementation for `Bar<_, _>` @@ -16,8 +16,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 19 | impl Unpin for Bar {} | ------------------------------ first implementation here -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`: - --> $DIR/conflict-unpin.rs:21:15 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>` + --> tests/ui/not_unpin/conflict-unpin.rs:21:15 | 21 | #[pin_project(!Unpin)] //~ ERROR E0119 | ^^^^^^ conflicting implementation for `Baz<_, _>` diff --git a/tests/ui/not_unpin/impl-unsafe-unpin.stderr b/tests/ui/not_unpin/impl-unsafe-unpin.stderr index ba80d5eb..efc51984 100644 --- a/tests/ui/not_unpin/impl-unsafe-unpin.stderr +++ b/tests/ui/not_unpin/impl-unsafe-unpin.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`: - --> $DIR/impl-unsafe-unpin.rs:3:1 +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>` + --> tests/ui/not_unpin/impl-unsafe-unpin.rs:3:1 | 3 | #[pin_project(!Unpin)] //~ ERROR E0119 | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>` @@ -7,10 +7,10 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 10 | unsafe impl UnsafeUnpin for Foo where T: Unpin {} | ---------------------------------------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`: - --> $DIR/impl-unsafe-unpin.rs:12:1 +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>` + --> tests/ui/not_unpin/impl-unsafe-unpin.rs:12:1 | 12 | #[pin_project(!Unpin)] //~ ERROR E0119 | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>` @@ -18,10 +18,10 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 19 | unsafe impl UnsafeUnpin for Bar {} | ------------------------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`: - --> $DIR/impl-unsafe-unpin.rs:21:1 +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>` + --> tests/ui/not_unpin/impl-unsafe-unpin.rs:21:1 | 21 | #[pin_project(!Unpin)] //~ ERROR E0119 | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>` @@ -29,4 +29,4 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 28 | unsafe impl UnsafeUnpin for Baz {} | --------------------------------------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/add-attr-to-struct.stderr b/tests/ui/pin_project/add-attr-to-struct.stderr index 27656d66..c1484102 100644 --- a/tests/ui/pin_project/add-attr-to-struct.stderr +++ b/tests/ui/pin_project/add-attr-to-struct.stderr @@ -1,15 +1,15 @@ error: duplicate #[pin] attribute - --> $DIR/add-attr-to-struct.rs:6:1 + --> tests/ui/pin_project/add-attr-to-struct.rs:6:1 | 6 | #[add_pin_attr(struct)] //~ ERROR duplicate #[pin] attribute | ^^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `add_pin_attr` (in Nightly builds, run with -Z macro-backtrace for more info) error: #[pin] attribute may only be used on fields of structs or variants - --> $DIR/add-attr-to-struct.rs:12:1 + --> tests/ui/pin_project/add-attr-to-struct.rs:12:1 | 12 | #[add_pin_attr(struct)] //~ ERROR #[pin] attribute may only be used on fields of structs or variants | ^^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `add_pin_attr` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/add-pinned-field.stderr b/tests/ui/pin_project/add-pinned-field.stderr index a140694a..d0832cce 100644 --- a/tests/ui/pin_project/add-pinned-field.stderr +++ b/tests/ui/pin_project/add-pinned-field.stderr @@ -1,23 +1,52 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/add-pinned-field.rs:21:5 + --> tests/ui/pin_project/add-pinned-field.rs:21:5 | -4 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 21 | is_unpin::(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^ within `__Foo<'_>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `__Foo<'_>` - = note: required because of the requirements on the impl of `Unpin` for `Foo` + = note: consider using `Box::pin` +note: required because it appears within the type `__Foo<'_>` + --> tests/ui/pin_project/add-pinned-field.rs:8:8 + | +8 | struct Foo { + | ^^^ +note: required because of the requirements on the impl of `Unpin` for `Foo` + --> tests/ui/pin_project/add-pinned-field.rs:6:1 + | +6 | #[pin_project] + | ^^^^^^^^^^^^^^ +7 | #[add_pinned_field] +8 | struct Foo { + | ^^^ +note: required by a bound in `is_unpin` + --> tests/ui/pin_project/add-pinned-field.rs:4:16 + | +4 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/add-pinned-field.rs:22:5 + --> tests/ui/pin_project/add-pinned-field.rs:22:5 | -4 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 22 | is_unpin::(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^ within `__Bar<'_>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `__Bar<'_>` - = note: required because of the requirements on the impl of `Unpin` for `Bar` + = note: consider using `Box::pin` +note: required because it appears within the type `__Bar<'_>` + --> tests/ui/pin_project/add-pinned-field.rs:15:8 + | +15 | struct Bar { + | ^^^ +note: required because of the requirements on the impl of `Unpin` for `Bar` + --> tests/ui/pin_project/add-pinned-field.rs:14:1 + | +14 | #[pin_project] + | ^^^^^^^^^^^^^^ +15 | struct Bar { + | ^^^ +note: required by a bound in `is_unpin` + --> tests/ui/pin_project/add-pinned-field.rs:4:16 + | +4 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/conflict-drop.stderr b/tests/ui/pin_project/conflict-drop.stderr index d5ca7b3d..6f7c3f17 100644 --- a/tests/ui/pin_project/conflict-drop.stderr +++ b/tests/ui/pin_project/conflict-drop.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for type `Foo<_, _>`: - --> $DIR/conflict-drop.rs:4:1 +error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for type `Foo<_, _>` + --> tests/ui/pin_project/conflict-drop.rs:4:1 | 4 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ @@ -7,10 +7,10 @@ error[E0119]: conflicting implementations of trait `_::FooMustNotImplDrop` for t | first implementation here | conflicting implementation for `Foo<_, _>` | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>`: - --> $DIR/conflict-drop.rs:15:15 +error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `Bar<_, _>` + --> tests/ui/pin_project/conflict-drop.rs:15:15 | 15 | #[pin_project(PinnedDrop)] //~ ERROR E0119 | ^^^^^^^^^^ conflicting implementation for `Bar<_, _>` diff --git a/tests/ui/pin_project/conflict-unpin.stderr b/tests/ui/pin_project/conflict-unpin.stderr index 0d6f439b..5e012c42 100644 --- a/tests/ui/pin_project/conflict-unpin.stderr +++ b/tests/ui/pin_project/conflict-unpin.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`: - --> $DIR/conflict-unpin.rs:5:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>` + --> tests/ui/pin_project/conflict-unpin.rs:5:1 | 5 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>` @@ -7,10 +7,10 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 13 | impl Unpin for Foo where T: Unpin {} // Conditional Unpin impl | --------------------------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`: - --> $DIR/conflict-unpin.rs:17:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>` + --> tests/ui/pin_project/conflict-unpin.rs:17:1 | 17 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>` @@ -18,10 +18,10 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 25 | impl Unpin for Bar {} // Non-conditional Unpin impl | ------------------------------ first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`: - --> $DIR/conflict-unpin.rs:27:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>` + --> tests/ui/pin_project/conflict-unpin.rs:27:1 | 27 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>` @@ -29,4 +29,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 35 | impl Unpin for Baz {} // Conditional Unpin impl | -------------------------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/impl-unsafe-unpin.stderr b/tests/ui/pin_project/impl-unsafe-unpin.stderr index 78545c2c..5680daaf 100644 --- a/tests/ui/pin_project/impl-unsafe-unpin.stderr +++ b/tests/ui/pin_project/impl-unsafe-unpin.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>`: - --> $DIR/impl-unsafe-unpin.rs:3:1 +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Foo<_, _>` + --> tests/ui/pin_project/impl-unsafe-unpin.rs:3:1 | 3 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Foo<_, _>` @@ -7,10 +7,10 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 10 | unsafe impl UnsafeUnpin for Foo where T: Unpin {} | ---------------------------------------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>`: - --> $DIR/impl-unsafe-unpin.rs:12:1 +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Bar<_, _>` + --> tests/ui/pin_project/impl-unsafe-unpin.rs:12:1 | 12 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Bar<_, _>` @@ -18,10 +18,10 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 19 | unsafe impl UnsafeUnpin for Bar {} | ------------------------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>`: - --> $DIR/impl-unsafe-unpin.rs:21:1 +error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` for type `Baz<_, _>` + --> tests/ui/pin_project/impl-unsafe-unpin.rs:21:1 | 21 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Baz<_, _>` @@ -29,4 +29,4 @@ error[E0119]: conflicting implementations of trait `pin_project::UnsafeUnpin` fo 28 | unsafe impl UnsafeUnpin for Baz {} | --------------------------------------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/invalid.stderr b/tests/ui/pin_project/invalid.stderr index 3c6af57c..b4406652 100644 --- a/tests/ui/pin_project/invalid.stderr +++ b/tests/ui/pin_project/invalid.stderr @@ -1,317 +1,317 @@ error: unexpected token: () - --> $DIR/invalid.rs:6:14 + --> tests/ui/pin_project/invalid.rs:6:14 | 6 | #[pin()] //~ ERROR unexpected token | ^^ error: unexpected token: (foo) - --> $DIR/invalid.rs:11:29 + --> tests/ui/pin_project/invalid.rs:11:29 | 11 | struct TupleStruct(#[pin(foo)] ()); //~ ERROR unexpected token | ^^^^^ error: unexpected token: (foo) - --> $DIR/invalid.rs:15:16 + --> tests/ui/pin_project/invalid.rs:15:16 | 15 | V(#[pin(foo)] ()), //~ ERROR unexpected token | ^^^^^ error: unexpected token: (foo) - --> $DIR/invalid.rs:21:18 + --> tests/ui/pin_project/invalid.rs:21:18 | 21 | #[pin(foo)] //~ ERROR unexpected token | ^^^^^ error: duplicate #[pin] attribute - --> $DIR/invalid.rs:33:9 + --> tests/ui/pin_project/invalid.rs:33:9 | 33 | #[pin] //~ ERROR duplicate #[pin] attribute | ^^^^^^ error: duplicate #[pin] attribute - --> $DIR/invalid.rs:40:9 + --> tests/ui/pin_project/invalid.rs:40:9 | 40 | #[pin] | ^^^^^^ error: duplicate #[pin] attribute - --> $DIR/invalid.rs:49:13 + --> tests/ui/pin_project/invalid.rs:49:13 | 49 | #[pin] | ^^^^^^ error: duplicate #[pin] attribute - --> $DIR/invalid.rs:59:13 + --> tests/ui/pin_project/invalid.rs:59:13 | 59 | #[pin] //~ ERROR duplicate #[pin] attribute | ^^^^^^ error: #[pin] attribute may only be used on fields of structs or variants - --> $DIR/invalid.rs:69:5 + --> tests/ui/pin_project/invalid.rs:69:5 | 69 | #[pin] //~ ERROR may only be used on fields of structs or variants | ^^^^^^ error: #[pin] attribute may only be used on fields of structs or variants - --> $DIR/invalid.rs:77:9 + --> tests/ui/pin_project/invalid.rs:77:9 | 77 | #[pin] //~ ERROR may only be used on fields of structs or variants | ^^^^^^ error: #[pin] attribute may only be used on fields of structs or variants - --> $DIR/invalid.rs:82:5 + --> tests/ui/pin_project/invalid.rs:82:5 | 82 | #[pin] //~ ERROR may only be used on fields of structs or variants | ^^^^^^ error: expected identifier - --> $DIR/invalid.rs:91:31 + --> tests/ui/pin_project/invalid.rs:91:31 | 91 | #[pin_project(UnsafeUnpin,,)] //~ ERROR expected identifier | ^ error: unexpected argument: Foo - --> $DIR/invalid.rs:94:19 + --> tests/ui/pin_project/invalid.rs:94:19 | 94 | #[pin_project(Foo)] //~ ERROR unexpected argument | ^^^ error: expected identifier - --> $DIR/invalid.rs:97:19 + --> tests/ui/pin_project/invalid.rs:97:19 | 97 | #[pin_project(,UnsafeUnpin)] //~ ERROR expected identifier | ^ error: expected `,` - --> $DIR/invalid.rs:103:30 + --> tests/ui/pin_project/invalid.rs:103:30 | 103 | #[pin_project(PinnedDrop PinnedDrop)] //~ ERROR expected `,` | ^^^^^^^^^^ error: duplicate `PinnedDrop` argument - --> $DIR/invalid.rs:106:31 + --> tests/ui/pin_project/invalid.rs:106:31 | 106 | #[pin_project(PinnedDrop, PinnedDrop)] //~ ERROR duplicate `PinnedDrop` argument | ^^^^^^^^^^ error: duplicate `Replace` argument - --> $DIR/invalid.rs:109:28 + --> tests/ui/pin_project/invalid.rs:109:28 | 109 | #[pin_project(Replace, Replace)] //~ ERROR duplicate `Replace` argument | ^^^^^^^ error: duplicate `UnsafeUnpin` argument - --> $DIR/invalid.rs:112:32 + --> tests/ui/pin_project/invalid.rs:112:32 | 112 | #[pin_project(UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument | ^^^^^^^^^^^ error: duplicate `!Unpin` argument - --> $DIR/invalid.rs:115:27 + --> tests/ui/pin_project/invalid.rs:115:27 | 115 | #[pin_project(!Unpin, !Unpin)] //~ ERROR duplicate `!Unpin` argument | ^^^^^^ error: duplicate `UnsafeUnpin` argument - --> $DIR/invalid.rs:118:44 + --> tests/ui/pin_project/invalid.rs:118:44 | 118 | #[pin_project(PinnedDrop, UnsafeUnpin, UnsafeUnpin)] //~ ERROR duplicate `UnsafeUnpin` argument | ^^^^^^^^^^^ error: duplicate `PinnedDrop` argument - --> $DIR/invalid.rs:121:44 + --> tests/ui/pin_project/invalid.rs:121:44 | 121 | #[pin_project(PinnedDrop, UnsafeUnpin, PinnedDrop, UnsafeUnpin)] //~ ERROR duplicate `PinnedDrop` argument | ^^^^^^^^^^ error: duplicate `project` argument - --> $DIR/invalid.rs:124:32 + --> tests/ui/pin_project/invalid.rs:124:32 | 124 | #[pin_project(project = A, project = B)] //~ ERROR duplicate `project` argument | ^^^^^^^^^^^ error: duplicate `project` argument - --> $DIR/invalid.rs:127:49 + --> tests/ui/pin_project/invalid.rs:127:49 | 127 | #[pin_project(project = A, project_ref = A, project = B)] //~ ERROR duplicate `project` argument | ^^^^^^^^^^^ error: duplicate `project_ref` argument - --> $DIR/invalid.rs:130:36 + --> tests/ui/pin_project/invalid.rs:130:36 | 130 | #[pin_project(project_ref = A, project_ref = B)] //~ ERROR duplicate `project_ref` argument | ^^^^^^^^^^^^^^^ error: duplicate `project_replace` argument - --> $DIR/invalid.rs:133:40 + --> tests/ui/pin_project/invalid.rs:133:40 | 133 | #[pin_project(project_replace = A, project_replace = B)] //~ ERROR duplicate `project_replace` argument | ^^^^^^^^^^^^^^^^^^^ error: duplicate `project_replace` argument - --> $DIR/invalid.rs:136:36 + --> tests/ui/pin_project/invalid.rs:136:36 | 136 | #[pin_project(project_replace, project_replace = B)] //~ ERROR duplicate `project_replace` argument | ^^^^^^^^^^^^^^^^^^^ error: duplicate `project_replace` argument - --> $DIR/invalid.rs:139:40 + --> tests/ui/pin_project/invalid.rs:139:40 | 139 | #[pin_project(project_replace = A, project_replace)] //~ ERROR duplicate `project_replace` argument | ^^^^^^^^^^^^^^^ error: arguments `PinnedDrop` and `Replace` are mutually exclusive - --> $DIR/invalid.rs:145:19 + --> tests/ui/pin_project/invalid.rs:145:19 | 145 | #[pin_project(PinnedDrop, Replace)] //~ ERROR arguments `PinnedDrop` and `Replace` are mutually exclusive | ^^^^^^^^^^ error: arguments `PinnedDrop` and `Replace` are mutually exclusive - --> $DIR/invalid.rs:148:41 + --> tests/ui/pin_project/invalid.rs:148:41 | 148 | #[pin_project(Replace, UnsafeUnpin, PinnedDrop)] //~ ERROR arguments `PinnedDrop` and `Replace` are mutually exclusive | ^^^^^^^^^^ error: arguments `PinnedDrop` and `project_replace` are mutually exclusive - --> $DIR/invalid.rs:151:19 + --> tests/ui/pin_project/invalid.rs:151:19 | 151 | #[pin_project(PinnedDrop, project_replace)] //~ ERROR arguments `PinnedDrop` and `project_replace` are mutually exclusive | ^^^^^^^^^^ error: arguments `PinnedDrop` and `project_replace` are mutually exclusive - --> $DIR/invalid.rs:154:49 + --> tests/ui/pin_project/invalid.rs:154:49 | 154 | #[pin_project(project_replace, UnsafeUnpin, PinnedDrop)] //~ ERROR arguments `PinnedDrop` and `project_replace` are mutually exclusive | ^^^^^^^^^^ error: arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive - --> $DIR/invalid.rs:163:19 + --> tests/ui/pin_project/invalid.rs:163:19 | 163 | #[pin_project(UnsafeUnpin, !Unpin)] //~ ERROR arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive | ^^^^^^^^^^^ error: arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive - --> $DIR/invalid.rs:166:39 + --> tests/ui/pin_project/invalid.rs:166:39 | 166 | #[pin_project(!Unpin, PinnedDrop, UnsafeUnpin)] //~ ERROR arguments `UnsafeUnpin` and `!Unpin` are mutually exclusive | ^^^^^^^^^^^ error: expected `!Unpin`, found `!` - --> $DIR/invalid.rs:169:19 + --> tests/ui/pin_project/invalid.rs:169:19 | 169 | #[pin_project(!)] //~ ERROR expected `!Unpin`, found `!` | ^ error: unexpected argument: Unpin - --> $DIR/invalid.rs:172:19 + --> tests/ui/pin_project/invalid.rs:172:19 | 172 | #[pin_project(Unpin)] //~ ERROR unexpected argument | ^^^^^ error: expected `project = `, found `project` - --> $DIR/invalid.rs:175:19 + --> tests/ui/pin_project/invalid.rs:175:19 | 175 | #[pin_project(project)] //~ ERROR expected `project = `, found `project` | ^^^^^^^ error: expected `project = `, found `project =` - --> $DIR/invalid.rs:178:19 + --> tests/ui/pin_project/invalid.rs:178:19 | 178 | #[pin_project(project = )] //~ ERROR expected `project = `, found `project =` | ^^^^^^^^^ error: expected identifier - --> $DIR/invalid.rs:181:29 + --> tests/ui/pin_project/invalid.rs:181:29 | 181 | #[pin_project(project = !)] //~ ERROR expected identifier | ^ error: expected `project_ref = `, found `project_ref` - --> $DIR/invalid.rs:184:19 + --> tests/ui/pin_project/invalid.rs:184:19 | 184 | #[pin_project(project_ref)] //~ ERROR expected `project_ref = `, found `project_ref` | ^^^^^^^^^^^ error: expected `project_ref = `, found `project_ref =` - --> $DIR/invalid.rs:187:19 + --> tests/ui/pin_project/invalid.rs:187:19 | 187 | #[pin_project(project_ref = )] //~ ERROR expected `project_ref = `, found `project_ref =` | ^^^^^^^^^^^^^ error: expected identifier - --> $DIR/invalid.rs:190:33 + --> tests/ui/pin_project/invalid.rs:190:33 | 190 | #[pin_project(project_ref = !)] //~ ERROR expected identifier | ^ error: expected `project_replace = `, found `project_replace =` - --> $DIR/invalid.rs:196:19 + --> tests/ui/pin_project/invalid.rs:196:19 | 196 | #[pin_project(project_replace = )] //~ ERROR expected `project_replace = `, found `project_replace =` | ^^^^^^^^^^^^^^^^^ error: expected identifier - --> $DIR/invalid.rs:199:37 + --> tests/ui/pin_project/invalid.rs:199:37 | 199 | #[pin_project(project_replace = !)] //~ ERROR expected identifier | ^ error: name `A` is already specified by `project` argument - --> $DIR/invalid.rs:206:46 + --> tests/ui/pin_project/invalid.rs:206:46 | 206 | #[pin_project(project = A, project_ref = A)] //~ ERROR name `A` is already specified by `project` argument | ^ error: name `A` is already specified by `project` argument - --> $DIR/invalid.rs:209:50 + --> tests/ui/pin_project/invalid.rs:209:50 | 209 | #[pin_project(project = A, project_replace = A)] //~ ERROR name `A` is already specified by `project` argument | ^ error: name `A` is already specified by `project_ref` argument - --> $DIR/invalid.rs:212:54 + --> tests/ui/pin_project/invalid.rs:212:54 | 212 | #[pin_project(project_ref = A, project_replace = A)] //~ ERROR name `A` is already specified by `project_ref` argument | ^ error: duplicate #[pin_project] attribute - --> $DIR/invalid.rs:220:5 + --> tests/ui/pin_project/invalid.rs:220:5 | 220 | #[pin_project] //~ ERROR duplicate #[pin_project] attribute | ^^^^^^^^^^^^^^ error: #[pin_project] attribute may not be used on structs with zero fields - --> $DIR/invalid.rs:228:19 + --> tests/ui/pin_project/invalid.rs:228:19 | 228 | struct Struct {} //~ ERROR may not be used on structs with zero fields | ^^ error: #[pin_project] attribute may not be used on structs with zero fields - --> $DIR/invalid.rs:231:23 + --> tests/ui/pin_project/invalid.rs:231:23 | 231 | struct TupleStruct(); //~ ERROR may not be used on structs with zero fields | ^^ error: #[pin_project] attribute may not be used on structs with zero fields - --> $DIR/invalid.rs:234:12 + --> tests/ui/pin_project/invalid.rs:234:12 | 234 | struct UnitStruct; //~ ERROR may not be used on structs with zero fields | ^^^^^^^^^^ error: #[pin_project] attribute may not be used on enums without variants - --> $DIR/invalid.rs:237:20 + --> tests/ui/pin_project/invalid.rs:237:20 | 237 | enum EnumEmpty {} //~ ERROR may not be used on enums without variants | ^^ error: #[pin_project] attribute may not be used on enums with discriminants - --> $DIR/invalid.rs:241:13 + --> tests/ui/pin_project/invalid.rs:241:13 | 241 | V = 2, //~ ERROR may not be used on enums with discriminants | ^ error: #[pin_project] attribute may not be used on enums with zero fields - --> $DIR/invalid.rs:246:9 + --> tests/ui/pin_project/invalid.rs:246:9 | 246 | / Unit, //~ ERROR may not be used on enums with zero fields 247 | | Tuple(), @@ -319,7 +319,7 @@ error: #[pin_project] attribute may not be used on enums with zero fields | |__________________^ error: #[pin_project] attribute may only be used on structs or enums - --> $DIR/invalid.rs:252:5 + --> tests/ui/pin_project/invalid.rs:252:5 | 252 | / union Union { 253 | | //~^ ERROR may only be used on structs or enums @@ -328,19 +328,19 @@ error: #[pin_project] attribute may only be used on structs or enums | |_____^ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/invalid.rs:263:12 + --> tests/ui/pin_project/invalid.rs:263:12 | 263 | #[repr(packed)] | ^^^^^^ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/invalid.rs:267:12 + --> tests/ui/pin_project/invalid.rs:267:12 | 267 | #[repr(packed)] | ^^^^^^ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/invalid.rs:271:12 + --> tests/ui/pin_project/invalid.rs:271:12 | 271 | #[repr(packed)] | ^^^^^^ diff --git a/tests/ui/pin_project/overlapping_unpin_struct.stderr b/tests/ui/pin_project/overlapping_unpin_struct.stderr index cb521a16..63cabfea 100644 --- a/tests/ui/pin_project/overlapping_unpin_struct.stderr +++ b/tests/ui/pin_project/overlapping_unpin_struct.stderr @@ -1,11 +1,25 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/overlapping_unpin_struct.rs:17:5 + --> tests/ui/pin_project/overlapping_unpin_struct.rs:17:5 | -14 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 17 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `_::__Foo<'_, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `_::__Foo<'_, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Foo` + = note: consider using `Box::pin` +note: required because it appears within the type `_::__Foo<'_, PhantomPinned>` + --> tests/ui/pin_project/overlapping_unpin_struct.rs:5:8 + | +5 | struct Foo { + | ^^^ +note: required because of the requirements on the impl of `Unpin` for `Foo` + --> tests/ui/pin_project/overlapping_unpin_struct.rs:4:1 + | +4 | #[pin_project] + | ^^^^^^^^^^^^^^ +5 | struct Foo { + | ^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/pin_project/overlapping_unpin_struct.rs:14:16 + | +14 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/packed-enum.stderr b/tests/ui/pin_project/packed-enum.stderr index afc8b308..1ce52bda 100644 --- a/tests/ui/pin_project/packed-enum.stderr +++ b/tests/ui/pin_project/packed-enum.stderr @@ -1,5 +1,5 @@ error[E0517]: attribute should be applied to a struct or union - --> $DIR/packed-enum.rs:3:8 + --> tests/ui/pin_project/packed-enum.rs:3:8 | 3 | #[repr(packed)] //~ ERROR E0517 | ^^^^^^ @@ -9,7 +9,7 @@ error[E0517]: attribute should be applied to a struct or union | |_- not a struct or union error[E0517]: attribute should be applied to a struct or union - --> $DIR/packed-enum.rs:9:8 + --> tests/ui/pin_project/packed-enum.rs:9:8 | 9 | #[repr(packed)] //~ ERROR E0517 | ^^^^^^ @@ -19,7 +19,7 @@ error[E0517]: attribute should be applied to a struct or union | |_- not a struct or union error[E0517]: attribute should be applied to a struct or union - --> $DIR/packed-enum.rs:14:8 + --> tests/ui/pin_project/packed-enum.rs:14:8 | 14 | #[repr(packed)] //~ ERROR E0517 | ^^^^^^ diff --git a/tests/ui/pin_project/packed-name-value.stderr b/tests/ui/pin_project/packed-name-value.stderr index a3e25711..1f40a2d2 100644 --- a/tests/ui/pin_project/packed-name-value.stderr +++ b/tests/ui/pin_project/packed-name-value.stderr @@ -1,17 +1,17 @@ -error[E0552]: unrecognized representation hint - --> $DIR/packed-name-value.rs:3:8 +error[E0693]: incorrect `repr(packed)` attribute format + --> tests/ui/pin_project/packed-name-value.rs:3:8 | 3 | #[repr(packed = "")] //~ ERROR E0552 - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ help: use parentheses instead: `packed()` -error[E0552]: unrecognized representation hint - --> $DIR/packed-name-value.rs:9:8 +error[E0693]: incorrect `repr(packed)` attribute format + --> tests/ui/pin_project/packed-name-value.rs:9:8 | 9 | #[repr(packed = "")] //~ ERROR E0552 - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ help: use parentheses instead: `packed()` -error[E0552]: unrecognized representation hint - --> $DIR/packed-name-value.rs:14:8 +error[E0693]: incorrect `repr(packed)` attribute format + --> tests/ui/pin_project/packed-name-value.rs:14:8 | 14 | #[repr(packed = "")] //~ ERROR E0552 - | ^^^^^^^^^^^ + | ^^^^^^^^^^^ help: use parentheses instead: `packed()` diff --git a/tests/ui/pin_project/packed.stderr b/tests/ui/pin_project/packed.stderr index e5b9e550..25ea5f43 100644 --- a/tests/ui/pin_project/packed.stderr +++ b/tests/ui/pin_project/packed.stderr @@ -1,23 +1,23 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed.rs:4:8 + --> tests/ui/pin_project/packed.rs:4:8 | 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:11:8 + --> tests/ui/pin_project/packed.rs:11:8 | 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:19:8 + --> tests/ui/pin_project/packed.rs:19:8 | 19 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types | ^^^^^^^^^ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed.rs:26:8 + --> tests/ui/pin_project/packed.rs:26:8 | 26 | #[repr(packed(2))] //~ ERROR may not be used on #[repr(packed)] types | ^^^^^^^^^ diff --git a/tests/ui/pin_project/packed_sneaky-1.stderr b/tests/ui/pin_project/packed_sneaky-1.stderr index 06a4f626..6b40123b 100644 --- a/tests/ui/pin_project/packed_sneaky-1.stderr +++ b/tests/ui/pin_project/packed_sneaky-1.stderr @@ -1,23 +1,23 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-1.rs:6:1 + --> tests/ui/pin_project/packed_sneaky-1.rs:6:1 | 6 | #[hidden_repr(packed)] | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info) error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-1.rs:13:1 + --> tests/ui/pin_project/packed_sneaky-1.rs:13:1 | 13 | #[hidden_repr(packed)] | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info) error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-1.rs:22:1 + --> tests/ui/pin_project/packed_sneaky-1.rs:22:1 | 22 | #[hidden_repr(packed)] | ^^^^^^^^^^^^^^^^^^^^^^ | - = note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the attribute macro `hidden_repr` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/packed_sneaky-2.stderr b/tests/ui/pin_project/packed_sneaky-2.stderr index d653a4d2..5e11071c 100644 --- a/tests/ui/pin_project/packed_sneaky-2.stderr +++ b/tests/ui/pin_project/packed_sneaky-2.stderr @@ -1,5 +1,5 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types - --> $DIR/packed_sneaky-2.rs:4:1 + --> tests/ui/pin_project/packed_sneaky-2.rs:4:1 | 4 | / hidden_repr_macro! { //~ ERROR may not be used on #[repr(packed)] types 5 | | #[pin_project] @@ -10,4 +10,4 @@ error: #[pin_project] attribute may not be used on #[repr(packed)] types 10 | | } | |_^ | - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `hidden_repr_macro` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/private_in_public-enum.stderr b/tests/ui/pin_project/private_in_public-enum.stderr index c7e6874a..208e004d 100644 --- a/tests/ui/pin_project/private_in_public-enum.stderr +++ b/tests/ui/pin_project/private_in_public-enum.stderr @@ -1,5 +1,5 @@ error[E0446]: private type `PrivateEnum` in public interface - --> $DIR/private_in_public-enum.rs:6:13 + --> tests/ui/pin_project/private_in_public-enum.rs:6:13 | 6 | Variant(PrivateEnum), //~ ERROR E0446 | ^^^^^^^^^^^ can't leak private type @@ -8,7 +8,7 @@ error[E0446]: private type `PrivateEnum` in public interface | ---------------- `PrivateEnum` declared as private error[E0446]: private type `foo::PrivateEnum` in public interface - --> $DIR/private_in_public-enum.rs:15:17 + --> tests/ui/pin_project/private_in_public-enum.rs:15:17 | 15 | Variant(PrivateEnum), //~ ERROR E0446 | ^^^^^^^^^^^ can't leak private type diff --git a/tests/ui/pin_project/project_replace_unsized.stderr b/tests/ui/pin_project/project_replace_unsized.stderr index bf230bf4..caea4044 100644 --- a/tests/ui/pin_project/project_replace_unsized.stderr +++ b/tests/ui/pin_project/project_replace_unsized.stderr @@ -1,70 +1,109 @@ error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized.rs:3:15 + --> tests/ui/pin_project/project_replace_unsized.rs:3:15 | 3 | #[pin_project(project_replace)] //~ ERROR E0277 | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 4 | struct Struct { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` | - = note: required because it appears within the type `Struct` +note: required because it appears within the type `Struct` + --> tests/ui/pin_project/project_replace_unsized.rs:4:8 + | +4 | struct Struct { + | ^^^^^^ = help: unsized fn params are gated as an unstable feature +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +4 - struct Struct { +4 + struct Struct { + | help: function arguments must have a statically known size, borrowed types always have a known size | 3 | #[pin_project(&project_replace)] //~ ERROR E0277 - | ^ + | + error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized.rs:5:5 + --> tests/ui/pin_project/project_replace_unsized.rs:5:5 | +3 | #[pin_project(project_replace)] //~ ERROR E0277 + | ------------------------------- required by a bound introduced by this call 4 | struct Struct { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` 5 | x: T, | ^ doesn't have a size known at compile-time + | +note: required by a bound in `std::ptr::read` + --> $RUST/core/src/ptr/mod.rs + | + | pub const unsafe fn read(src: *const T) -> T { + | ^ required by this bound in `std::ptr::read` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +4 - struct Struct { +4 + struct Struct { + | error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized.rs:3:1 + --> tests/ui/pin_project/project_replace_unsized.rs:3:1 | 3 | #[pin_project(project_replace)] //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 4 | struct Struct { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` + | +note: required because it appears within the type `__StructProjectionOwned` + --> tests/ui/pin_project/project_replace_unsized.rs:4:8 | - = note: required because it appears within the type `__StructProjectionOwned` +4 | struct Struct { + | ^^^^^^ = note: structs must have a statically known size to be initialized - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +4 - struct Struct { +4 + struct Struct { + | error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized.rs:8:15 + --> tests/ui/pin_project/project_replace_unsized.rs:8:15 | 8 | #[pin_project(project_replace)] //~ ERROR E0277 | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 9 | struct TupleStruct(T); - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` + | +note: required because it appears within the type `TupleStruct` + --> tests/ui/pin_project/project_replace_unsized.rs:9:8 | - = note: required because it appears within the type `TupleStruct` +9 | struct TupleStruct(T); + | ^^^^^^^^^^^ = help: unsized fn params are gated as an unstable feature +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +9 - struct TupleStruct(T); +9 + struct TupleStruct(T); + | help: function arguments must have a statically known size, borrowed types always have a known size | 8 | #[pin_project(&project_replace)] //~ ERROR E0277 - | ^ + | + error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized.rs:8:1 + --> tests/ui/pin_project/project_replace_unsized.rs:8:1 | 8 | #[pin_project(project_replace)] //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 9 | struct TupleStruct(T); - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` + | +note: required by a bound in `std::ptr::read` + --> $RUST/core/src/ptr/mod.rs + | + | pub const unsafe fn read(src: *const T) -> T { + | ^ required by this bound in `std::ptr::read` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +9 - struct TupleStruct(T); +9 + struct TupleStruct(T); | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) - -error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized.rs:9:8 - | -9 | struct TupleStruct(T); - | ^^^^^^^^^^^ - this type parameter needs to be `Sized` - | | - | doesn't have a size known at compile-time - | - = note: all function arguments must have a statically known size - = help: unsized fn params are gated as an unstable feature diff --git a/tests/ui/pin_project/project_replace_unsized_fn_params.stderr b/tests/ui/pin_project/project_replace_unsized_fn_params.stderr index 5fd37d7b..ebdabb7a 100644 --- a/tests/ui/pin_project/project_replace_unsized_fn_params.stderr +++ b/tests/ui/pin_project/project_replace_unsized_fn_params.stderr @@ -1,53 +1,103 @@ error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized_fn_params.rs:6:8 + --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:6:8 | 6 | struct Struct { | ^^^^^^^-^^^^^^^^^ | | | - | | this type parameter needs to be `Sized` + | | this type parameter needs to be `std::marker::Sized` | doesn't have a size known at compile-time | - = note: required because it appears within the type `__StructProjectionOwned` +note: required because it appears within the type `__StructProjectionOwned` + --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:6:8 + | +6 | struct Struct { + | ^^^^^^ = note: the return type of a function must have a statically known size +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +6 - struct Struct { +6 + struct Struct { + | error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized_fn_params.rs:7:5 + --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:7:5 | +5 | #[pin_project(project_replace)] //~ ERROR E0277 + | ------------------------------- required by a bound introduced by this call 6 | struct Struct { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` 7 | x: T, | ^ doesn't have a size known at compile-time + | +note: required by a bound in `std::ptr::read` + --> $RUST/core/src/ptr/mod.rs + | + | pub const unsafe fn read(src: *const T) -> T { + | ^ required by this bound in `std::ptr::read` +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +6 - struct Struct { +6 + struct Struct { + | error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized_fn_params.rs:5:1 + --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:5:1 | 5 | #[pin_project(project_replace)] //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 6 | struct Struct { - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` | - = note: required because it appears within the type `__StructProjectionOwned` +note: required because it appears within the type `__StructProjectionOwned` + --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:6:8 + | +6 | struct Struct { + | ^^^^^^ = note: structs must have a statically known size to be initialized - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +6 - struct Struct { +6 + struct Struct { + | error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized_fn_params.rs:11:8 + --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:11:8 | 11 | struct TupleStruct(T); | ^^^^^^^^^^^^-^^^^^^^^^ | | | - | | this type parameter needs to be `Sized` + | | this type parameter needs to be `std::marker::Sized` | doesn't have a size known at compile-time | - = note: required because it appears within the type `__TupleStructProjectionOwned` +note: required because it appears within the type `__TupleStructProjectionOwned` + --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:11:8 + | +11 | struct TupleStruct(T); + | ^^^^^^^^^^^ = note: the return type of a function must have a statically known size +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +11 - struct TupleStruct(T); +11 + struct TupleStruct(T); + | error[E0277]: the size for values of type `T` cannot be known at compilation time - --> $DIR/project_replace_unsized_fn_params.rs:10:1 + --> tests/ui/pin_project/project_replace_unsized_fn_params.rs:10:1 | 10 | #[pin_project(project_replace)] //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time 11 | struct TupleStruct(T); - | - this type parameter needs to be `Sized` + | - this type parameter needs to be `std::marker::Sized` + | +note: required by a bound in `std::ptr::read` + --> $RUST/core/src/ptr/mod.rs + | + | pub const unsafe fn read(src: *const T) -> T { + | ^ required by this bound in `std::ptr::read` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider removing the `?Sized` bound to make the type parameter `Sized` + | +11 - struct TupleStruct(T); +11 + struct TupleStruct(T); | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/proper_unpin.stderr b/tests/ui/pin_project/proper_unpin.stderr index 7963959d..112aa8ed 100644 --- a/tests/ui/pin_project/proper_unpin.stderr +++ b/tests/ui/pin_project/proper_unpin.stderr @@ -1,37 +1,87 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/proper_unpin.rs:31:5 + --> tests/ui/pin_project/proper_unpin.rs:31:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 31 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `__Foo<'_, PhantomPinned, ()>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `Inner` - = note: required because it appears within the type `__Foo<'_, PhantomPinned, ()>` - = note: required because of the requirements on the impl of `Unpin` for `Foo` + = note: consider using `Box::pin` +note: required because it appears within the type `Inner` + --> tests/ui/pin_project/proper_unpin.rs:4:8 + | +4 | struct Inner { + | ^^^^^ +note: required because it appears within the type `__Foo<'_, PhantomPinned, ()>` + --> tests/ui/pin_project/proper_unpin.rs:9:8 + | +9 | struct Foo { + | ^^^ +note: required because of the requirements on the impl of `Unpin` for `Foo` + --> tests/ui/pin_project/proper_unpin.rs:8:1 + | +8 | #[pin_project] + | ^^^^^^^^^^^^^^ +9 | struct Foo { + | ^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/pin_project/proper_unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/proper_unpin.rs:33:5 + --> tests/ui/pin_project/proper_unpin.rs:33:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 33 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `__Foo<'_, PhantomPinned, PhantomPinned>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `Inner` - = note: required because it appears within the type `__Foo<'_, PhantomPinned, PhantomPinned>` - = note: required because of the requirements on the impl of `Unpin` for `Foo` + = note: consider using `Box::pin` +note: required because it appears within the type `Inner` + --> tests/ui/pin_project/proper_unpin.rs:4:8 + | +4 | struct Inner { + | ^^^^^ +note: required because it appears within the type `__Foo<'_, PhantomPinned, PhantomPinned>` + --> tests/ui/pin_project/proper_unpin.rs:9:8 + | +9 | struct Foo { + | ^^^ +note: required because of the requirements on the impl of `Unpin` for `Foo` + --> tests/ui/pin_project/proper_unpin.rs:8:1 + | +8 | #[pin_project] + | ^^^^^^^^^^^^^^ +9 | struct Foo { + | ^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/pin_project/proper_unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/proper_unpin.rs:35:5 + --> tests/ui/pin_project/proper_unpin.rs:35:5 | -28 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 35 | is_unpin::(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^ within `__TrivialBounds<'_>`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `__TrivialBounds<'_>` - = note: required because of the requirements on the impl of `Unpin` for `TrivialBounds` + = note: consider using `Box::pin` +note: required because it appears within the type `__TrivialBounds<'_>` + --> tests/ui/pin_project/proper_unpin.rs:16:8 + | +16 | struct TrivialBounds { + | ^^^^^^^^^^^^^ +note: required because of the requirements on the impl of `Unpin` for `TrivialBounds` + --> tests/ui/pin_project/proper_unpin.rs:15:1 + | +15 | #[pin_project] + | ^^^^^^^^^^^^^^ +16 | struct TrivialBounds { + | ^^^^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/pin_project/proper_unpin.rs:28:16 + | +28 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/pin_project/remove-attr-from-field.stderr b/tests/ui/pin_project/remove-attr-from-field.stderr index 5cd0b839..fc81de42 100644 --- a/tests/ui/pin_project/remove-attr-from-field.stderr +++ b/tests/ui/pin_project/remove-attr-from-field.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> $DIR/remove-attr-from-field.rs:27:38 + --> tests/ui/pin_project/remove-attr-from-field.rs:27:38 | 27 | let _: Pin<&mut PhantomPinned> = x.field; //~ ERROR E0308 | ----------------------- ^^^^^^^ expected struct `Pin`, found `&mut PhantomPinned` @@ -10,7 +10,7 @@ error[E0308]: mismatched types found mutable reference `&mut PhantomPinned` error[E0308]: mismatched types - --> $DIR/remove-attr-from-field.rs:31:38 + --> tests/ui/pin_project/remove-attr-from-field.rs:31:38 | 31 | let _: Pin<&mut PhantomPinned> = x.field; //~ ERROR E0308 | ----------------------- ^^^^^^^ expected struct `Pin`, found `&mut PhantomPinned` diff --git a/tests/ui/pin_project/remove-attr-from-struct.stderr b/tests/ui/pin_project/remove-attr-from-struct.stderr index 4652b663..e794ba8a 100644 --- a/tests/ui/pin_project/remove-attr-from-struct.stderr +++ b/tests/ui/pin_project/remove-attr-from-struct.stderr @@ -1,71 +1,107 @@ error: #[pin_project] attribute has been removed - --> $DIR/remove-attr-from-struct.rs:21:1 + --> tests/ui/pin_project/remove-attr-from-struct.rs:21:1 | 21 | #[pin_project] //~ ERROR has been removed | ^^^^^^^^^^^^^^ | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) error: cannot find attribute `pin` in this scope - --> $DIR/remove-attr-from-struct.rs:17:7 + --> tests/ui/pin_project/remove-attr-from-struct.rs:17:7 | 17 | #[pin] //~ ERROR cannot find attribute `pin` in this scope | ^^^ error: cannot find attribute `pin` in this scope - --> $DIR/remove-attr-from-struct.rs:10:7 + --> tests/ui/pin_project/remove-attr-from-struct.rs:10:7 | 10 | #[pin] //~ ERROR cannot find attribute `pin` in this scope | ^^^ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/remove-attr-from-struct.rs:34:5 + --> tests/ui/pin_project/remove-attr-from-struct.rs:34:5 | -5 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 34 | is_unpin::(); //~ ERROR E0277 | ^^^^^^^^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `A` + = note: consider using `Box::pin` +note: required because it appears within the type `A` + --> tests/ui/pin_project/remove-attr-from-struct.rs:9:8 + | +9 | struct A { + | ^ +note: required by a bound in `is_unpin` + --> tests/ui/pin_project/remove-attr-from-struct.rs:5:16 + | +5 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/remove-attr-from-struct.rs:35:5 + --> tests/ui/pin_project/remove-attr-from-struct.rs:35:5 | -5 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 35 | is_unpin::(); //~ ERROR E0277 | ^^^^^^^^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `B` - -error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/remove-attr-from-struct.rs:39:13 + = note: consider using `Box::pin` +note: required because it appears within the type `B` + --> tests/ui/pin_project/remove-attr-from-struct.rs:16:8 | -39 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 - | ^^^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned` +16 | struct B { + | ^ +note: required by a bound in `is_unpin` + --> tests/ui/pin_project/remove-attr-from-struct.rs:5:16 | - = note: required because it appears within the type `A` - = note: required by `Pin::

::new` +5 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` + +error[E0277]: `PhantomPinned` cannot be unpinned + --> tests/ui/pin_project/remove-attr-from-struct.rs:39:22 + | +39 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 + | -------- ^^^^^^ within `A`, the trait `Unpin` is not implemented for `PhantomPinned` + | | + | required by a bound introduced by this call + | + = note: consider using `Box::pin` +note: required because it appears within the type `A` + --> tests/ui/pin_project/remove-attr-from-struct.rs:9:8 + | +9 | struct A { + | ^ +note: required by a bound in `Pin::

::new` + --> $RUST/core/src/pin.rs + | + | impl> Pin

{ + | ^^^^^ required by this bound in `Pin::

::new` error[E0599]: no method named `project` found for struct `Pin<&mut A>` in the current scope - --> $DIR/remove-attr-from-struct.rs:39:30 + --> tests/ui/pin_project/remove-attr-from-struct.rs:39:30 | 39 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 | ^^^^^^^ method not found in `Pin<&mut A>` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/remove-attr-from-struct.rs:42:13 - | -42 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 - | ^^^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned` - | - = note: required because it appears within the type `B` - = note: required by `Pin::

::new` + --> tests/ui/pin_project/remove-attr-from-struct.rs:42:22 + | +42 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 + | -------- ^^^^^^ within `B`, the trait `Unpin` is not implemented for `PhantomPinned` + | | + | required by a bound introduced by this call + | + = note: consider using `Box::pin` +note: required because it appears within the type `B` + --> tests/ui/pin_project/remove-attr-from-struct.rs:16:8 + | +16 | struct B { + | ^ +note: required by a bound in `Pin::

::new` + --> $RUST/core/src/pin.rs + | + | impl> Pin

{ + | ^^^^^ required by this bound in `Pin::

::new` error[E0599]: no method named `project` found for struct `Pin<&mut B>` in the current scope - --> $DIR/remove-attr-from-struct.rs:42:30 + --> tests/ui/pin_project/remove-attr-from-struct.rs:42:30 | 42 | let _ = Pin::new(&mut x).project(); //~ ERROR E0277,E0599 | ^^^^^^^ method not found in `Pin<&mut B>` diff --git a/tests/ui/pin_project/safe_packed_borrows.rs b/tests/ui/pin_project/safe_packed_borrows.rs index a51b7d12..de8181cb 100644 --- a/tests/ui/pin_project/safe_packed_borrows.rs +++ b/tests/ui/pin_project/safe_packed_borrows.rs @@ -1,4 +1,5 @@ -#![forbid(safe_packed_borrows)] +#![deny(renamed_and_removed_lints)] +#![deny(safe_packed_borrows)] //~ ERROR has been renamed to `unaligned_references` #![allow(unaligned_references)] // This lint was removed in https://github.com/rust-lang/rust/pull/82525 (nightly-2021-03-28). @@ -18,10 +19,8 @@ struct PackedN { fn main() { let a = Packed { f: 1 }; - &a.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block - let _ = &a.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block + let _ = &a.f; let b = PackedN { f: 1 }; - &b.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block - let _ = &b.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block + let _ = &b.f; } diff --git a/tests/ui/pin_project/safe_packed_borrows.stderr b/tests/ui/pin_project/safe_packed_borrows.stderr index a5a03cb3..f483b6d3 100644 --- a/tests/ui/pin_project/safe_packed_borrows.stderr +++ b/tests/ui/pin_project/safe_packed_borrows.stderr @@ -1,44 +1,11 @@ -error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/safe_packed_borrows.rs:21:5 - | -21 | &a.f; //~ ERROR borrow of packed field is unsafe and requires unsafe function or block - | ^^^^ - | +error: lint `safe_packed_borrows` has been renamed to `unaligned_references` + --> tests/ui/pin_project/safe_packed_borrows.rs:2:9 + | +2 | #![deny(safe_packed_borrows)] //~ ERROR has been renamed to `unaligned_references` + | ^^^^^^^^^^^^^^^^^^^ help: use the new name: `unaligned_references` + | note: the lint level is defined here - --> $DIR/safe_packed_borrows.rs:1:11 - | -1 | #![forbid(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:13 - | -22 | let _ = &a.f; //~ 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/safe_packed_borrows.rs:25:5 - | -25 | &b.f; //~ 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/safe_packed_borrows.rs:26:13 - | -26 | let _ = &b.f; //~ 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 + --> tests/ui/pin_project/safe_packed_borrows.rs:1:9 + | +1 | #![deny(renamed_and_removed_lints)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/pin_project/unaligned_references.rs b/tests/ui/pin_project/unaligned_references.rs index 99dd4175..eaf185d2 100644 --- a/tests/ui/pin_project/unaligned_references.rs +++ b/tests/ui/pin_project/unaligned_references.rs @@ -1,5 +1,4 @@ #![forbid(unaligned_references)] -#![allow(safe_packed_borrows)] // Refs: https://github.com/rust-lang/rust/issues/82523 @@ -15,10 +14,8 @@ struct PackedN { fn main() { let a = Packed { f: 1 }; - &a.f; //~ ERROR reference to packed field is unaligned let _ = &a.f; //~ ERROR reference to packed field is unaligned let b = PackedN { f: 1 }; - &b.f; //~ ERROR reference to packed field is unaligned let _ = &b.f; //~ ERROR reference to packed field is unaligned } diff --git a/tests/ui/pin_project/unaligned_references.stderr b/tests/ui/pin_project/unaligned_references.stderr index efe17dcc..8d5ddfc5 100644 --- a/tests/ui/pin_project/unaligned_references.stderr +++ b/tests/ui/pin_project/unaligned_references.stderr @@ -1,36 +1,26 @@ error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:18:5 + --> tests/ui/pin_project/unaligned_references.rs:17:13 | -18 | &a.f; //~ ERROR reference to packed field is unaligned - | ^^^^ +17 | let _ = &a.f; //~ ERROR reference to packed field is unaligned + | ^^^^ | note: the lint level is defined here - --> $DIR/unaligned_references.rs:1:11 + --> tests/ui/pin_project/unaligned_references.rs:1:11 | 1 | #![forbid(unaligned_references)] | ^^^^^^^^^^^^^^^^^^^^ + = 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 #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:19:13 - | -19 | let _ = &a.f; //~ ERROR reference to packed field is unaligned - | ^^^^ - | - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:22:5 - | -22 | &b.f; //~ ERROR reference to packed field is unaligned - | ^^^^ - | - = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) - -error: reference to packed field is unaligned - --> $DIR/unaligned_references.rs:23:13 + --> tests/ui/pin_project/unaligned_references.rs:20:13 | -23 | let _ = &b.f; //~ ERROR reference to packed field is unaligned +20 | let _ = &b.f; //~ ERROR reference to packed field is unaligned | ^^^^ | + = 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 #82523 = note: fields of packed structs are not properly aligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) + = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers) diff --git a/tests/ui/pin_project/unpin_sneaky.stderr b/tests/ui/pin_project/unpin_sneaky.stderr index 46c05175..66bb03fa 100644 --- a/tests/ui/pin_project/unpin_sneaky.stderr +++ b/tests/ui/pin_project/unpin_sneaky.stderr @@ -1,11 +1,11 @@ error[E0412]: cannot find type `__Foo` in this scope - --> $DIR/unpin_sneaky.rs:9:16 + --> tests/ui/pin_project/unpin_sneaky.rs:9:16 | 9 | impl Unpin for __Foo {} //~ ERROR E0412,E0321 | ^^^^^ not found in this scope error[E0321]: cross-crate traits with a default impl, like `Unpin`, can only be implemented for a struct/enum type, not `[type error]` - --> $DIR/unpin_sneaky.rs:9:1 + --> tests/ui/pin_project/unpin_sneaky.rs:9:1 | 9 | impl Unpin for __Foo {} //~ 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/visibility.stderr b/tests/ui/pin_project/visibility.stderr index cab0e2e3..6fbee154 100644 --- a/tests/ui/pin_project/visibility.stderr +++ b/tests/ui/pin_project/visibility.stderr @@ -1,79 +1,79 @@ -error[E0365]: `__DefaultProjection` is private, and cannot be re-exported - --> $DIR/visibility.rs:12:13 +error[E0365]: `__DefaultProjection` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:12:13 | 12 | pub use crate::pub_::__DefaultProjection; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__DefaultProjection` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__DefaultProjection` | = note: consider declaring type or module `__DefaultProjection` with `pub` -error[E0365]: `__DefaultProjectionRef` is private, and cannot be re-exported - --> $DIR/visibility.rs:14:13 +error[E0365]: `__DefaultProjectionRef` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:14:13 | 14 | pub use crate::pub_::__DefaultProjectionRef; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__DefaultProjectionRef` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__DefaultProjectionRef` | = note: consider declaring type or module `__DefaultProjectionRef` with `pub` -error[E0365]: `__ReplaceProjection` is private, and cannot be re-exported - --> $DIR/visibility.rs:16:13 +error[E0365]: `__ReplaceProjection` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:16:13 | 16 | pub use crate::pub_::__ReplaceProjection; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__ReplaceProjection` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__ReplaceProjection` | = note: consider declaring type or module `__ReplaceProjection` with `pub` -error[E0365]: `__ReplaceProjectionOwned` is private, and cannot be re-exported - --> $DIR/visibility.rs:18:13 +error[E0365]: `__ReplaceProjectionOwned` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:18:13 | 18 | pub use crate::pub_::__ReplaceProjectionOwned; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__ReplaceProjectionOwned` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__ReplaceProjectionOwned` | = note: consider declaring type or module `__ReplaceProjectionOwned` with `pub` -error[E0365]: `__ReplaceProjectionRef` is private, and cannot be re-exported - --> $DIR/visibility.rs:20:13 +error[E0365]: `__ReplaceProjectionRef` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:20:13 | 20 | pub use crate::pub_::__ReplaceProjectionRef; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `__ReplaceProjectionRef` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `__ReplaceProjectionRef` | = note: consider declaring type or module `__ReplaceProjectionRef` with `pub` -error[E0365]: `DProj` is private, and cannot be re-exported - --> $DIR/visibility.rs:63:13 +error[E0365]: `DProj` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:63:13 | 63 | pub use crate::pub_renamed::DProj; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `DProj` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `DProj` | = note: consider declaring type or module `DProj` with `pub` -error[E0365]: `DProjRef` is private, and cannot be re-exported - --> $DIR/visibility.rs:65:13 +error[E0365]: `DProjRef` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:65:13 | 65 | pub use crate::pub_renamed::DProjRef; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `DProjRef` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `DProjRef` | = note: consider declaring type or module `DProjRef` with `pub` -error[E0365]: `RProj` is private, and cannot be re-exported - --> $DIR/visibility.rs:67:13 +error[E0365]: `RProj` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:67:13 | 67 | pub use crate::pub_renamed::RProj; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `RProj` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `RProj` | = note: consider declaring type or module `RProj` with `pub` -error[E0365]: `RProjOwn` is private, and cannot be re-exported - --> $DIR/visibility.rs:69:13 +error[E0365]: `RProjOwn` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:69:13 | 69 | pub use crate::pub_renamed::RProjOwn; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `RProjOwn` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `RProjOwn` | = note: consider declaring type or module `RProjOwn` with `pub` -error[E0365]: `RProjRef` is private, and cannot be re-exported - --> $DIR/visibility.rs:71:13 +error[E0365]: `RProjRef` is only public within the crate, and cannot be re-exported outside + --> tests/ui/pin_project/visibility.rs:71:13 | 71 | pub use crate::pub_renamed::RProjRef; //~ ERROR E0365 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of private `RProjRef` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ re-export of crate public `RProjRef` | = note: consider declaring type or module `RProjRef` with `pub` diff --git a/tests/ui/pinned_drop/call-drop-inner.stderr b/tests/ui/pinned_drop/call-drop-inner.stderr index 599dfc38..ce753b1a 100644 --- a/tests/ui/pinned_drop/call-drop-inner.stderr +++ b/tests/ui/pinned_drop/call-drop-inner.stderr @@ -1,5 +1,5 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied - --> $DIR/call-drop-inner.rs:12:9 + --> tests/ui/pinned_drop/call-drop-inner.rs:12:9 | 12 | __drop_inner(__self); | ^^^^^^^^^^^^ ------ supplied 1 argument @@ -7,7 +7,7 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied | expected 0 arguments | note: function defined here - --> $DIR/call-drop-inner.rs:11:8 + --> tests/ui/pinned_drop/call-drop-inner.rs:11:8 | 11 | fn drop(mut self: Pin<&mut Self>) { | ^^^^ diff --git a/tests/ui/pinned_drop/conditional-drop-impl.stderr b/tests/ui/pinned_drop/conditional-drop-impl.stderr index a150950d..cc47c44e 100644 --- a/tests/ui/pinned_drop/conditional-drop-impl.stderr +++ b/tests/ui/pinned_drop/conditional-drop-impl.stderr @@ -1,11 +1,11 @@ error[E0367]: `Drop` impl requires `T: Unpin` but the struct it is implemented for does not - --> $DIR/conditional-drop-impl.rs:10:9 + --> tests/ui/pinned_drop/conditional-drop-impl.rs:10:9 | 10 | impl Drop for DropImpl { | ^^^^^ | note: the implementor must specify the same requirement - --> $DIR/conditional-drop-impl.rs:6:1 + --> tests/ui/pinned_drop/conditional-drop-impl.rs:6:1 | 6 | / struct DropImpl { 7 | | field: T, @@ -13,14 +13,18 @@ note: the implementor must specify the same requirement | |_^ error[E0277]: `T` cannot be unpinned - --> $DIR/conditional-drop-impl.rs:15:15 + --> tests/ui/pinned_drop/conditional-drop-impl.rs:15:15 | 15 | #[pin_project(PinnedDrop)] //~ ERROR E0277 | ^^^^^^^^^^ the trait `Unpin` is not implemented for `T` | - = note: required because of the requirements on the impl of `PinnedDrop` for `PinnedDropImpl` - = note: required by `pin_project::__private::PinnedDrop::drop` + = note: consider using `Box::pin` +note: required because of the requirements on the impl of `PinnedDrop` for `PinnedDropImpl` + --> tests/ui/pinned_drop/conditional-drop-impl.rs:22:16 + | +22 | impl PinnedDrop for PinnedDropImpl { + | ^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ help: consider restricting type parameter `T` | -16 | struct PinnedDropImpl { - | ^^^^^^^ +16 | struct PinnedDropImpl { + | ++++++++++++++++++++ diff --git a/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr b/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr index 9fd7cdb0..ef8a7bf4 100644 --- a/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr +++ b/tests/ui/pinned_drop/forget-pinned-drop-impl.stderr @@ -1,7 +1,5 @@ error[E0277]: the trait bound `Struct: PinnedDrop` is not satisfied - --> $DIR/forget-pinned-drop-impl.rs:3:15 + --> tests/ui/pinned_drop/forget-pinned-drop-impl.rs:3:15 | 3 | #[pin_project(PinnedDrop)] //~ ERROR E0277 | ^^^^^^^^^^ the trait `PinnedDrop` is not implemented for `Struct` - | - = note: required by `pin_project::__private::PinnedDrop::drop` diff --git a/tests/ui/pinned_drop/invalid-self.stderr b/tests/ui/pinned_drop/invalid-self.stderr index a43e91d9..a3f26960 100644 --- a/tests/ui/pinned_drop/invalid-self.stderr +++ b/tests/ui/pinned_drop/invalid-self.stderr @@ -1,23 +1,23 @@ error: expected identifier, found keyword `self` - --> $DIR/invalid-self.rs:8:26 + --> tests/ui/pinned_drop/invalid-self.rs:8:26 | 8 | fn take_ref_self(ref self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self` | ^^^^ expected identifier, found keyword error: expected identifier, found keyword `self` - --> $DIR/invalid-self.rs:9:34 + --> tests/ui/pinned_drop/invalid-self.rs:9:34 | 9 | fn take_ref_mut_self(ref mut self: Pin<&mut Self>) {} //~ ERROR expected identifier, found keyword `self` | ^^^^ expected identifier, found keyword error: expected parameter name, found `@` - --> $DIR/invalid-self.rs:11:25 + --> tests/ui/pinned_drop/invalid-self.rs:11:25 | 11 | fn self_subpat(self @ Struct {}: Self) {} //~ ERROR expected one of `)`, `,`, or `:`, found `@` | ^ expected parameter name error: expected one of `)`, `,`, or `:`, found `@` - --> $DIR/invalid-self.rs:11:25 + --> tests/ui/pinned_drop/invalid-self.rs:11:25 | 11 | fn self_subpat(self @ Struct {}: Self) {} //~ ERROR expected one of `)`, `,`, or `:`, found `@` | -^ expected one of `)`, `,`, or `:` diff --git a/tests/ui/pinned_drop/invalid.stderr b/tests/ui/pinned_drop/invalid.stderr index 65ef9ff6..67984201 100644 --- a/tests/ui/pinned_drop/invalid.stderr +++ b/tests/ui/pinned_drop/invalid.stderr @@ -1,143 +1,143 @@ error: unexpected token: foo - --> $DIR/invalid.rs:8:19 + --> tests/ui/pinned_drop/invalid.rs:8:19 | 8 | #[pinned_drop(foo)] //~ ERROR unexpected token | ^^^ error: duplicate #[pinned_drop] attribute - --> $DIR/invalid.rs:29:5 + --> tests/ui/pinned_drop/invalid.rs:29:5 | 29 | #[pinned_drop] //~ ERROR duplicate #[pinned_drop] attribute | ^^^^^^^^^^^^^^ error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait - --> $DIR/invalid.rs:42:10 + --> tests/ui/pinned_drop/invalid.rs:42:10 | 42 | impl Drop for TraitImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait | ^^^^ error: #[pinned_drop] may only be used on implementation for the `PinnedDrop` trait - --> $DIR/invalid.rs:48:10 + --> tests/ui/pinned_drop/invalid.rs:48:10 | 48 | impl InherentImpl {} //~ ERROR may only be used on implementation for the `PinnedDrop` trait | ^^^^^^^^^^^^ error: expected `impl` - --> $DIR/invalid.rs:51:5 + --> tests/ui/pinned_drop/invalid.rs:51:5 | 51 | fn drop(_: Pin<&mut ()>) {} //~ ERROR expected `impl` | ^^ error: implementing the trait `PinnedDrop` is not unsafe - --> $DIR/invalid.rs:61:5 + --> tests/ui/pinned_drop/invalid.rs:61:5 | 61 | unsafe impl PinnedDrop for Impl { | ^^^^^^ error: implementing the method `drop` is not unsafe - --> $DIR/invalid.rs:71:9 + --> tests/ui/pinned_drop/invalid.rs:71:9 | 71 | unsafe fn drop(self: Pin<&mut Self>) {} //~ ERROR implementing the method `drop` is not unsafe | ^^^^^^ error: not all trait items implemented, missing: `drop` - --> $DIR/invalid.rs:82:5 + --> tests/ui/pinned_drop/invalid.rs:82:5 | 82 | impl PinnedDrop for Empty {} //~ ERROR not all trait items implemented, missing: `drop` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: const `A` is not a member of trait `PinnedDrop` - --> $DIR/invalid.rs:89:9 + --> tests/ui/pinned_drop/invalid.rs:89:9 | 89 | 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:99:9 + --> tests/ui/pinned_drop/invalid.rs:99:9 | 99 | 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:107:9 + --> tests/ui/pinned_drop/invalid.rs:107:9 | 107 | 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:117:9 + --> tests/ui/pinned_drop/invalid.rs:117:9 | 117 | type A = u8; //~ ERROR type `A` is not a member of trait `PinnedDrop` | ^^^^^^^^^^^^ error: duplicate definitions with name `drop` - --> $DIR/invalid.rs:126:9 + --> tests/ui/pinned_drop/invalid.rs:126:9 | 126 | fn drop(self: Pin<&mut Self>) {} //~ ERROR duplicate definitions with name `drop` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: method `drop` must return the unit type - --> $DIR/invalid.rs:147:42 + --> tests/ui/pinned_drop/invalid.rs:147:42 | 147 | fn drop(self: Pin<&mut Self>) -> Self {} //~ ERROR method `drop` must return the unit type | ^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:155:16 + --> tests/ui/pinned_drop/invalid.rs:155:16 | 155 | fn drop() {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:163:17 + --> tests/ui/pinned_drop/invalid.rs:163:17 | 163 | fn drop(self: Pin<&mut Self>, _: ()) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:171:17 + --> tests/ui/pinned_drop/invalid.rs:171:17 | 171 | fn drop(&mut self) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:179:17 + --> tests/ui/pinned_drop/invalid.rs:179:17 | 179 | fn drop(_: Pin<&mut Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^^^^^^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:187:17 + --> tests/ui/pinned_drop/invalid.rs:187:17 | 187 | fn drop(self: Pin<&Self>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^^^^^^^^ error: method `drop` must take an argument `self: Pin<&mut Self>` - --> $DIR/invalid.rs:195:17 + --> tests/ui/pinned_drop/invalid.rs:195:17 | 195 | fn drop(self: Pin<&mut ()>) {} //~ ERROR method `drop` must take an argument `self: Pin<&mut Self>` | ^^^^^^^^^^^^^^^^^^ error: method `pinned_drop` is not a member of trait `PinnedDrop - --> $DIR/invalid.rs:203:12 + --> tests/ui/pinned_drop/invalid.rs:203:12 | 203 | fn pinned_drop(&mut self) {} //~ ERROR method `pinned_drop` is not a member of trait `PinnedDrop | ^^^^^^^^^^^ error: implementing the trait `PinnedDrop` on this type is unsupported - --> $DIR/invalid.rs:211:25 + --> tests/ui/pinned_drop/invalid.rs:211:25 | 211 | impl PinnedDrop for () { | ^^ error: implementing the trait `PinnedDrop` on this type is unsupported - --> $DIR/invalid.rs:217:25 + --> tests/ui/pinned_drop/invalid.rs:217:25 | 217 | impl PinnedDrop for &mut A { | ^^^^^^ error: implementing the trait `PinnedDrop` on this type is unsupported - --> $DIR/invalid.rs:223:25 + --> tests/ui/pinned_drop/invalid.rs:223:25 | 223 | impl PinnedDrop for [A] { | ^^^ diff --git a/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr b/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr index 7353dc48..f907e960 100644 --- a/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr +++ b/tests/ui/pinned_drop/pinned-drop-no-attr-arg.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `pin_project::__private::PinnedDrop` for type `Foo`: - --> $DIR/pinned-drop-no-attr-arg.rs:11:1 +error[E0119]: conflicting implementations of trait `pin_project::__private::PinnedDrop` for type `Foo` + --> tests/ui/pinned_drop/pinned-drop-no-attr-arg.rs:11:1 | 4 | #[pin_project] | -------------- first implementation here diff --git a/tests/ui/pinned_drop/self.stderr b/tests/ui/pinned_drop/self.stderr index 086cecf2..76cf1e17 100644 --- a/tests/ui/pinned_drop/self.stderr +++ b/tests/ui/pinned_drop/self.stderr @@ -1,29 +1,29 @@ error: `self` parameter is only allowed in associated functions - --> $DIR/self.rs:17:26 + --> tests/ui/pinned_drop/self.rs:17:26 | 17 | fn f(self: ()) {} //~ ERROR `self` parameter is only allowed in associated functions | ^^^^ not semantically valid as function parameter ... 20 | t!(); - | ----- in this macro invocation + | ---- in this macro invocation | = note: associated functions are those in `impl` or `trait` definitions - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0434]: can't capture dynamic environment in a fn item - --> $DIR/self.rs:15:29 + --> tests/ui/pinned_drop/self.rs:15:29 | 15 | let _ = self; //~ ERROR E0434 | ^^^^ ... 20 | t!(); - | ----- in this macro invocation + | ---- in this macro invocation | = help: use the `|| { ... }` closure form instead - = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0423]: expected value, found struct `S` - --> $DIR/self.rs:38:27 + --> tests/ui/pinned_drop/self.rs:38:27 | 30 | / pub struct S { 31 | | x: (), @@ -34,7 +34,7 @@ error[E0423]: expected value, found struct `S` | ^^^^ help: use struct literal syntax instead: `S { x: val }` error[E0308]: mismatched types - --> $DIR/self.rs:37:25 + --> tests/ui/pinned_drop/self.rs:37:25 | 37 | let _: () = self; //~ ERROR E0308 | -- ^^^^ expected `()`, found struct `Pin` @@ -45,7 +45,7 @@ error[E0308]: mismatched types found struct `Pin<&mut S>` error[E0308]: mismatched types - --> $DIR/self.rs:50:25 + --> tests/ui/pinned_drop/self.rs:50:25 | 50 | let _: () = self; //~ ERROR E0308 | -- ^^^^ expected `()`, found struct `Pin` @@ -56,7 +56,7 @@ error[E0308]: mismatched types found struct `Pin<&mut E>` error[E0533]: expected unit struct, unit variant or constant, found struct variant `Self::V` - --> $DIR/self.rs:51:27 + --> tests/ui/pinned_drop/self.rs:51:27 | 51 | let _: Self = Self::V; //~ ERROR E0533 | ^^^^^^^ diff --git a/tests/ui/pinned_drop/unsafe-call.stderr b/tests/ui/pinned_drop/unsafe-call.stderr index 4e8e00bd..e02c10a7 100644 --- a/tests/ui/pinned_drop/unsafe-call.stderr +++ b/tests/ui/pinned_drop/unsafe-call.stderr @@ -1,5 +1,5 @@ error[E0133]: call to unsafe function is unsafe and requires unsafe function or block - --> $DIR/unsafe-call.rs:13:9 + --> tests/ui/pinned_drop/unsafe-call.rs:13:9 | 13 | self.project().field.get_unchecked_mut(); //~ ERROR call to unsafe function is unsafe and requires unsafe function or block [E0133] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function diff --git a/tests/ui/project/ambiguous-let.stderr b/tests/ui/project/ambiguous-let.stderr index 2e664846..f808c6fd 100644 --- a/tests/ui/project/ambiguous-let.stderr +++ b/tests/ui/project/ambiguous-let.stderr @@ -1,5 +1,5 @@ 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 + --> tests/ui/project/ambiguous-let.rs:18:9 | 18 | let Struct(x) = match Pin::new(&mut foo).project() { | ^^^^^^^^^ diff --git a/tests/ui/project/deprecated.stderr b/tests/ui/project/deprecated.stderr index e1b614cc..5d67e895 100644 --- a/tests/ui/project/deprecated.stderr +++ b/tests/ui/project/deprecated.stderr @@ -1,23 +1,23 @@ error: use of deprecated macro `project`: consider naming projected type by passing `project` argument to #[pin_project] attribute instead, see release note for details - --> $DIR/deprecated.rs:5:3 + --> tests/ui/project/deprecated.rs:5:3 | 5 | #[project] | ^^^^^^^ | note: the lint level is defined here - --> $DIR/deprecated.rs:1:9 + --> tests/ui/project/deprecated.rs:1:9 | 1 | #![deny(deprecated)] | ^^^^^^^^^^ error: use of deprecated macro `project_ref`: consider naming projected type by passing `project_ref` argument to #[pin_project] attribute instead, see release note for details - --> $DIR/deprecated.rs:6:3 + --> tests/ui/project/deprecated.rs:6:3 | 6 | #[project_ref] | ^^^^^^^^^^^ error: use of deprecated macro `project_replace`: consider naming projected type by passing `project_replace` argument to #[pin_project] attribute instead, see release note for details - --> $DIR/deprecated.rs:7:3 + --> tests/ui/project/deprecated.rs:7:3 | 7 | #[project_replace] | ^^^^^^^^^^^^^^^ diff --git a/tests/ui/project/invalid.stderr b/tests/ui/project/invalid.stderr index e1dc388b..6cbce486 100644 --- a/tests/ui/project/invalid.stderr +++ b/tests/ui/project/invalid.stderr @@ -1,155 +1,155 @@ error: unexpected token: () - --> $DIR/invalid.rs:12:18 + --> tests/ui/project/invalid.rs:12:18 | 12 | #[project()] //~ ERROR unexpected token | ^^ error: unexpected token: (foo) - --> $DIR/invalid.rs:19:18 + --> tests/ui/project/invalid.rs:19:18 | 19 | #[project(foo)] //~ ERROR unexpected token | ^^^^^ error: unexpected token: () - --> $DIR/invalid.rs:26:18 + --> tests/ui/project/invalid.rs:26:18 | 26 | #[project()] //~ ERROR unexpected token | ^^ error: unexpected token: (foo) - --> $DIR/invalid.rs:35:18 + --> tests/ui/project/invalid.rs:35:18 | 35 | #[project(foo)] //~ ERROR unexpected token | ^^^^^ error: unexpected token: foo - --> $DIR/invalid.rs:44:15 + --> tests/ui/project/invalid.rs:44:15 | 44 | #[project(foo)] //~ ERROR unexpected token | ^^^ error: duplicate #[project] attribute - --> $DIR/invalid.rs:58:9 + --> tests/ui/project/invalid.rs:58:9 | 58 | #[project] //~ ERROR duplicate #[project] attribute | ^^^^^^^^^^ error: duplicate #[project_ref] attribute - --> $DIR/invalid.rs:66:9 + --> tests/ui/project/invalid.rs:66:9 | 66 | #[project_ref] //~ ERROR duplicate #[project_ref] attribute | ^^^^^^^^^^^^^^ error: duplicate #[project_replace] attribute - --> $DIR/invalid.rs:74:9 + --> tests/ui/project/invalid.rs:74:9 | 74 | #[project_replace] //~ ERROR duplicate #[project_replace] attribute | ^^^^^^^^^^^^^^^^^^ error: attributes `project` and `project_ref` are mutually exclusive - --> $DIR/invalid.rs:82:9 + --> tests/ui/project/invalid.rs:82:9 | 82 | #[project_ref] //~ ERROR are mutually exclusive | ^^^^^^^^^^^^^^ error: attributes `project` and `project_replace` are mutually exclusive - --> $DIR/invalid.rs:90:9 + --> tests/ui/project/invalid.rs:90:9 | 90 | #[project_replace] //~ ERROR are mutually exclusive | ^^^^^^^^^^^^^^^^^^ error: attributes `project_ref` and `project_replace` are mutually exclusive - --> $DIR/invalid.rs:98:9 + --> tests/ui/project/invalid.rs:98:9 | 98 | #[project_replace] //~ ERROR are mutually exclusive | ^^^^^^^^^^^^^^^^^^ error: attributes `project` and `project_ref` are mutually exclusive - --> $DIR/invalid.rs:106:9 + --> tests/ui/project/invalid.rs:106:9 | 106 | #[project_ref] //~ ERROR are mutually exclusive | ^^^^^^^^^^^^^^ error: attributes `project` and `project_replace` are mutually exclusive - --> $DIR/invalid.rs:114:9 + --> tests/ui/project/invalid.rs:114:9 | 114 | #[project_replace] //~ ERROR are mutually exclusive | ^^^^^^^^^^^^^^^^^^ error: attributes `project_ref` and `project_replace` are mutually exclusive - --> $DIR/invalid.rs:122:9 + --> tests/ui/project/invalid.rs:122:9 | 122 | #[project_replace] //~ ERROR are mutually exclusive | ^^^^^^^^^^^^^^^^^^ error: attributes `project` and `project_ref` are mutually exclusive - --> $DIR/invalid.rs:130:9 + --> tests/ui/project/invalid.rs:130:9 | 130 | #[project_ref] //~ ERROR are mutually exclusive | ^^^^^^^^^^^^^^ error: attributes `project` and `project_replace` are mutually exclusive - --> $DIR/invalid.rs:138:9 + --> tests/ui/project/invalid.rs:138:9 | 138 | #[project_replace] //~ ERROR are mutually exclusive | ^^^^^^^^^^^^^^^^^^ error: attributes `project_ref` and `project_replace` are mutually exclusive - --> $DIR/invalid.rs:146:9 + --> tests/ui/project/invalid.rs:146:9 | 146 | #[project_replace] //~ ERROR are mutually exclusive | ^^^^^^^^^^^^^^^^^^ error: duplicate #[project] attribute - --> $DIR/invalid.rs:151:5 + --> tests/ui/project/invalid.rs:151:5 | 151 | #[project] //~ ERROR duplicate #[project] attribute | ^^^^^^^^^^ error: duplicate #[project_ref] attribute - --> $DIR/invalid.rs:155:5 + --> tests/ui/project/invalid.rs:155:5 | 155 | #[project_ref] //~ ERROR duplicate #[project_ref] attribute | ^^^^^^^^^^^^^^ error: duplicate #[project_replace] attribute - --> $DIR/invalid.rs:159:5 + --> tests/ui/project/invalid.rs:159:5 | 159 | #[project_replace] //~ ERROR duplicate #[project_replace] attribute | ^^^^^^^^^^^^^^^^^^ error: duplicate #[project] attribute - --> $DIR/invalid.rs:163:5 + --> tests/ui/project/invalid.rs:163:5 | 163 | #[project] //~ ERROR duplicate #[project] attribute | ^^^^^^^^^^ error: duplicate #[project_ref] attribute - --> $DIR/invalid.rs:167:5 + --> tests/ui/project/invalid.rs:167:5 | 167 | #[project_ref] //~ ERROR duplicate #[project_ref] attribute | ^^^^^^^^^^^^^^ error: duplicate #[project_replace] attribute - --> $DIR/invalid.rs:171:5 + --> tests/ui/project/invalid.rs:171:5 | 171 | #[project_replace] //~ ERROR duplicate #[project_replace] attribute | ^^^^^^^^^^^^^^^^^^ error: duplicate #[project] attribute - --> $DIR/invalid.rs:179:9 + --> tests/ui/project/invalid.rs:179:9 | 179 | #[project] //~ ERROR duplicate #[project] attribute | ^^^^^^^^^^ error: duplicate #[project_ref] attribute - --> $DIR/invalid.rs:183:9 + --> tests/ui/project/invalid.rs:183:9 | 183 | #[project_ref] //~ ERROR duplicate #[project_ref] attribute | ^^^^^^^^^^^^^^ error: duplicate #[project_replace] attribute - --> $DIR/invalid.rs:187:9 + --> tests/ui/project/invalid.rs:187:9 | 187 | #[project_replace] //~ ERROR duplicate #[project_replace] attribute | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/project/type-mismatch.stderr b/tests/ui/project/type-mismatch.stderr index 1475cc11..4a5c421f 100644 --- a/tests/ui/project/type-mismatch.stderr +++ b/tests/ui/project/type-mismatch.stderr @@ -1,23 +1,17 @@ error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:36:9 + --> tests/ui/project/type-mismatch.rs:68:9 | -24 | match &mut foo { - | -------- this expression has type `&mut type_mismatch::__EnumProjection<'_, {integer}, {integer}, _, _>` -... -36 | None => {} //~ ERROR mismatched types - | ^^^^ expected enum `type_mismatch::__EnumProjection`, found enum `Option` +68 | None => {} //~ ERROR mismatched types + | ^^^^ expected enum `type_mismatch_span_issue::__EnumProjection`, found enum `Option` | - = note: expected enum `type_mismatch::__EnumProjection<'_, {integer}, {integer}, _, _>` + = note: expected enum `type_mismatch_span_issue::__EnumProjection<'_, {integer}, {integer}, _, _>` found enum `Option<_>` error[E0308]: mismatched types - --> $DIR/type-mismatch.rs:68:9 + --> tests/ui/project/type-mismatch.rs:36:9 | -56 | match &mut foo { - | -------- this expression has type `&mut type_mismatch_span_issue::__EnumProjection<'_, {integer}, {integer}, _, _>` -... -68 | None => {} //~ ERROR mismatched types - | ^^^^ expected enum `type_mismatch_span_issue::__EnumProjection`, found enum `Option` +36 | None => {} //~ ERROR mismatched types + | ^^^^ expected enum `type_mismatch::__EnumProjection`, found enum `Option` | - = note: expected enum `type_mismatch_span_issue::__EnumProjection<'_, {integer}, {integer}, _, _>` + = note: expected enum `type_mismatch::__EnumProjection<'_, {integer}, {integer}, _, _>` found enum `Option<_>` diff --git a/tests/ui/project/use-public.stderr b/tests/ui/project/use-public.stderr index 6956656c..621f19c6 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 +error[E0365]: `__AProjection` is only public within the crate, and cannot be re-exported outside + --> tests/ui/project/use-public.rs:14:13 | 14 | pub use crate::A; //~ ERROR E0365 - | ^^^^^^^^ re-export of private `__AProjection` + | ^^^^^^^^ re-export of crate public `__AProjection` | = note: consider declaring type or module `__AProjection` with `pub` diff --git a/tests/ui/project/use.stderr b/tests/ui/project/use.stderr index daddb16d..db89e225 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 + --> tests/ui/project/use.rs:14:16 | 14 | 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 + --> tests/ui/project/use.rs:16:16 | 16 | use crate::*; //~ ERROR #[project] attribute may not be used on glob imports | ^ diff --git a/tests/ui/unsafe_unpin/conflict-unpin.stderr b/tests/ui/unsafe_unpin/conflict-unpin.stderr index 916c3f22..6add4ab8 100644 --- a/tests/ui/unsafe_unpin/conflict-unpin.stderr +++ b/tests/ui/unsafe_unpin/conflict-unpin.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>`: - --> $DIR/conflict-unpin.rs:3:15 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Foo<_, _>` + --> tests/ui/unsafe_unpin/conflict-unpin.rs:3:15 | 3 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119 | ^^^^^^^^^^^ conflicting implementation for `Foo<_, _>` @@ -9,8 +9,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type | = note: upstream crates may add a new impl of trait `pin_project::UnsafeUnpin` for type `pin_project::__private::Wrapper<'_, Foo<_, _>>` in future versions -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>`: - --> $DIR/conflict-unpin.rs:12:15 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Bar<_, _>` + --> tests/ui/unsafe_unpin/conflict-unpin.rs:12:15 | 12 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119 | ^^^^^^^^^^^ conflicting implementation for `Bar<_, _>` @@ -20,8 +20,8 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type | = note: upstream crates may add a new impl of trait `pin_project::UnsafeUnpin` for type `pin_project::__private::Wrapper<'_, Bar<_, _>>` in future versions -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>`: - --> $DIR/conflict-unpin.rs:21:15 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Baz<_, _>` + --> tests/ui/unsafe_unpin/conflict-unpin.rs:21:15 | 21 | #[pin_project(UnsafeUnpin)] //~ ERROR E0119 | ^^^^^^^^^^^ conflicting implementation for `Baz<_, _>` diff --git a/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.stderr b/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.stderr index a838ed33..65fec0aa 100644 --- a/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.stderr +++ b/tests/ui/unsafe_unpin/not-implement-unsafe-unpin.stderr @@ -1,11 +1,19 @@ error[E0277]: the trait bound `Struct<(), ()>: UnsafeUnpin` is not satisfied - --> $DIR/not-implement-unsafe-unpin.rs:13:16 + --> tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs:13:16 | -10 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 13 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^ the trait `UnsafeUnpin` is not implemented for `Struct<(), ()>` | = note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, Struct<(), ()>>` - = note: required because of the requirements on the impl of `Unpin` for `Struct<(), ()>` +note: required because of the requirements on the impl of `Unpin` for `Struct<(), ()>` + --> tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs:3:15 + | +3 | #[pin_project(UnsafeUnpin)] + | ^^^^^^^^^^^ +4 | struct Struct { + | ^^^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/unsafe_unpin/not-implement-unsafe-unpin.rs:10:16 + | +10 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` diff --git a/tests/ui/unsafe_unpin/proper_unpin.stderr b/tests/ui/unsafe_unpin/proper_unpin.stderr index 567fe9c3..59e44b39 100644 --- a/tests/ui/unsafe_unpin/proper_unpin.stderr +++ b/tests/ui/unsafe_unpin/proper_unpin.stderr @@ -1,67 +1,127 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/proper_unpin.rs:33:5 + --> tests/ui/unsafe_unpin/proper_unpin.rs:33:5 | -4 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 33 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because of the requirements on the impl of `UnsafeUnpin` for `Blah` - = note: 1 redundant requirements hidden + = note: consider using `Box::pin` +note: required because of the requirements on the impl of `UnsafeUnpin` for `Blah` + --> tests/ui/unsafe_unpin/proper_unpin.rs:13:26 + | +13 | unsafe impl UnsafeUnpin for Blah {} + | ^^^^^^^^^^^ ^^^^^^^^^^ + = note: 1 redundant requirement hidden = note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, Blah>` - = note: required because of the requirements on the impl of `Unpin` for `Blah` +note: required because of the requirements on the impl of `Unpin` for `Blah` + --> tests/ui/unsafe_unpin/proper_unpin.rs:6:15 + | +6 | #[pin_project(UnsafeUnpin)] + | ^^^^^^^^^^^ +7 | struct Blah { + | ^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/unsafe_unpin/proper_unpin.rs:4:16 + | +4 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/proper_unpin.rs:35:5 + --> tests/ui/unsafe_unpin/proper_unpin.rs:35:5 | -4 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 35 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because of the requirements on the impl of `UnsafeUnpin` for `Blah` - = note: 1 redundant requirements hidden + = note: consider using `Box::pin` +note: required because of the requirements on the impl of `UnsafeUnpin` for `Blah` + --> tests/ui/unsafe_unpin/proper_unpin.rs:13:26 + | +13 | unsafe impl UnsafeUnpin for Blah {} + | ^^^^^^^^^^^ ^^^^^^^^^^ + = note: 1 redundant requirement hidden = note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, Blah>` - = note: required because of the requirements on the impl of `Unpin` for `Blah` +note: required because of the requirements on the impl of `Unpin` for `Blah` + --> tests/ui/unsafe_unpin/proper_unpin.rs:6:15 + | +6 | #[pin_project(UnsafeUnpin)] + | ^^^^^^^^^^^ +7 | struct Blah { + | ^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/unsafe_unpin/proper_unpin.rs:4:16 + | +4 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: the trait bound `TrivialBounds: UnsafeUnpin` is not satisfied - --> $DIR/proper_unpin.rs:37:16 + --> tests/ui/unsafe_unpin/proper_unpin.rs:37:16 | -4 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 37 | is_unpin::(); //~ ERROR E0277 | ^^^^^^^^^^^^^ the trait `UnsafeUnpin` is not implemented for `TrivialBounds` | = note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, TrivialBounds>` - = note: required because of the requirements on the impl of `Unpin` for `TrivialBounds` +note: required because of the requirements on the impl of `Unpin` for `TrivialBounds` + --> tests/ui/unsafe_unpin/proper_unpin.rs:15:15 + | +15 | #[pin_project(UnsafeUnpin)] + | ^^^^^^^^^^^ +16 | struct TrivialBounds { + | ^^^^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/unsafe_unpin/proper_unpin.rs:4:16 + | +4 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/proper_unpin.rs:39:5 + --> tests/ui/unsafe_unpin/proper_unpin.rs:39:5 | -4 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 39 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because of the requirements on the impl of `UnsafeUnpin` for `OverlappingLifetimeNames<'_, PhantomPinned, ()>` - = note: 1 redundant requirements hidden + = note: consider using `Box::pin` +note: required because of the requirements on the impl of `UnsafeUnpin` for `OverlappingLifetimeNames<'_, PhantomPinned, ()>` + --> tests/ui/unsafe_unpin/proper_unpin.rs:30:33 + | +30 | unsafe impl UnsafeUnpin for OverlappingLifetimeNames<'_, T, U> {} + | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: 1 redundant requirement hidden = note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, OverlappingLifetimeNames<'_, PhantomPinned, ()>>` - = note: required because of the requirements on the impl of `Unpin` for `OverlappingLifetimeNames<'_, PhantomPinned, ()>` +note: required because of the requirements on the impl of `Unpin` for `OverlappingLifetimeNames<'_, PhantomPinned, ()>` + --> tests/ui/unsafe_unpin/proper_unpin.rs:21:15 + | +21 | #[pin_project(UnsafeUnpin)] + | ^^^^^^^^^^^ +22 | struct OverlappingLifetimeNames<'pin, T, U> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/unsafe_unpin/proper_unpin.rs:4:16 + | +4 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/proper_unpin.rs:40:5 + --> tests/ui/unsafe_unpin/proper_unpin.rs:40:5 | -4 | fn is_unpin() {} - | ----- required by this bound in `is_unpin` -... 40 | is_unpin::>(); //~ ERROR E0277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because of the requirements on the impl of `UnsafeUnpin` for `OverlappingLifetimeNames<'_, (), PhantomPinned>` - = note: 1 redundant requirements hidden + = note: consider using `Box::pin` +note: required because of the requirements on the impl of `UnsafeUnpin` for `OverlappingLifetimeNames<'_, (), PhantomPinned>` + --> tests/ui/unsafe_unpin/proper_unpin.rs:30:33 + | +30 | unsafe impl UnsafeUnpin for OverlappingLifetimeNames<'_, T, U> {} + | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: 1 redundant requirement hidden = note: required because of the requirements on the impl of `UnsafeUnpin` for `Wrapper<'_, OverlappingLifetimeNames<'_, (), PhantomPinned>>` - = note: required because of the requirements on the impl of `Unpin` for `OverlappingLifetimeNames<'_, (), PhantomPinned>` +note: required because of the requirements on the impl of `Unpin` for `OverlappingLifetimeNames<'_, (), PhantomPinned>` + --> tests/ui/unsafe_unpin/proper_unpin.rs:21:15 + | +21 | #[pin_project(UnsafeUnpin)] + | ^^^^^^^^^^^ +22 | struct OverlappingLifetimeNames<'pin, T, U> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +note: required by a bound in `is_unpin` + --> tests/ui/unsafe_unpin/proper_unpin.rs:4:16 + | +4 | fn is_unpin() {} + | ^^^^^ required by this bound in `is_unpin` 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 bab534b9..ef03a00a 100644 --- a/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr +++ b/tests/ui/unstable-features/marker_trait_attr-feature-gate.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`: - --> $DIR/marker_trait_attr-feature-gate.rs:6:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>` + --> tests/ui/unstable-features/marker_trait_attr-feature-gate.rs:6:1 | 6 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>` @@ -7,4 +7,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 13 | impl Unpin for Struct {} | --------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/unstable-features/marker_trait_attr.stderr b/tests/ui/unstable-features/marker_trait_attr.stderr index 9b3ec57e..8974f971 100644 --- a/tests/ui/unstable-features/marker_trait_attr.stderr +++ b/tests/ui/unstable-features/marker_trait_attr.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`: - --> $DIR/marker_trait_attr.rs:12:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>` + --> tests/ui/unstable-features/marker_trait_attr.rs:12:1 | 12 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>` @@ -7,4 +7,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 19 | impl Unpin for Struct {} | --------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) 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 4a8e2384..624a396d 100644 --- a/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr +++ b/tests/ui/unstable-features/overlapping_marker_traits-feature-gate.stderr @@ -1,5 +1,5 @@ -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`: - --> $DIR/overlapping_marker_traits-feature-gate.rs:6:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>` + --> tests/ui/unstable-features/overlapping_marker_traits-feature-gate.rs:6:1 | 6 | #[pin_project] //~ ERROR E0119 | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>` @@ -7,4 +7,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 13 | impl Unpin for Struct {} | --------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/ui/unstable-features/overlapping_marker_traits.stderr b/tests/ui/unstable-features/overlapping_marker_traits.stderr index 91aaf6ca..a9f3a6e9 100644 --- a/tests/ui/unstable-features/overlapping_marker_traits.stderr +++ b/tests/ui/unstable-features/overlapping_marker_traits.stderr @@ -1,13 +1,13 @@ error[E0557]: feature has been removed - --> $DIR/overlapping_marker_traits.rs:11:12 + --> tests/ui/unstable-features/overlapping_marker_traits.rs:11:12 | 11 | #![feature(overlapping_marker_traits)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ feature has been removed | = note: removed in favor of `#![feature(marker_trait_attr)]` -error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>`: - --> $DIR/overlapping_marker_traits.rs:16:1 +error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type `Struct<_>` + --> tests/ui/unstable-features/overlapping_marker_traits.rs:16:1 | 16 | #[pin_project] | ^^^^^^^^^^^^^^ conflicting implementation for `Struct<_>` @@ -15,4 +15,4 @@ error[E0119]: conflicting implementations of trait `std::marker::Unpin` for type 23 | impl Unpin for Struct {} | --------------------------- first implementation here | - = note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `::pin_project::__private::__PinProjectInternalDerive` (in Nightly builds, run with -Z macro-backtrace for more info) 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 3c0501ae..76ed4f09 100644 --- a/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.stderr +++ b/tests/ui/unstable-features/stmt_expr_attributes-feature-gate.stderr @@ -1,5 +1,5 @@ error[E0658]: attributes on expressions are experimental - --> $DIR/stmt_expr_attributes-feature-gate.rs:24:5 + --> tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs:24:5 | 24 | #[project] //~ ERROR E0658 | ^^^^^^^^^^ @@ -8,7 +8,7 @@ error[E0658]: attributes on expressions are experimental = 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 + --> tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs:40:14 | 40 | let () = #[project] //~ ERROR E0658 | ^^^^^^^^^^ @@ -17,7 +17,7 @@ error[E0658]: attributes on expressions are experimental = 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 + --> tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs:24:5 | 24 | #[project] //~ ERROR E0658 | ^^^^^^^^^^ @@ -26,7 +26,7 @@ error[E0658]: custom attributes cannot be applied to expressions = 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 + --> tests/ui/unstable-features/stmt_expr_attributes-feature-gate.rs:40:14 | 40 | let () = #[project] //~ ERROR E0658 | ^^^^^^^^^^ diff --git a/tests/ui/unstable-features/trivial_bounds-bug.rs b/tests/ui/unstable-features/trivial_bounds-bug.rs deleted file mode 100644 index 2ec49605..00000000 --- a/tests/ui/unstable-features/trivial_bounds-bug.rs +++ /dev/null @@ -1,33 +0,0 @@ -// 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)] - -mod phantom_pinned { - use std::marker::{PhantomData, PhantomPinned}; - - struct A(PhantomPinned); - - // bug of trivial_bounds? - impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277 - - struct Wrapper(T); - - impl Unpin for Wrapper where T: Unpin {} - - struct B(PhantomPinned); - - impl Unpin for B where Wrapper: Unpin {} // Ok - - struct WrapperWithLifetime<'a, T>(PhantomData<&'a ()>, T); - - impl Unpin for WrapperWithLifetime<'_, T> where T: Unpin {} - - struct C(PhantomPinned); - - // Ok - impl<'a> Unpin for C where WrapperWithLifetime<'a, PhantomPinned>: Unpin {} -} - -fn main() {} diff --git a/tests/ui/unstable-features/trivial_bounds-bug.stderr b/tests/ui/unstable-features/trivial_bounds-bug.stderr deleted file mode 100644 index fff09f93..00000000 --- a/tests/ui/unstable-features/trivial_bounds-bug.stderr +++ /dev/null @@ -1,5 +0,0 @@ -error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/trivial_bounds-bug.rs:13:43 - | -13 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277 - | ^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` diff --git a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr index ce520c3e..0d5ed55b 100644 --- a/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr +++ b/tests/ui/unstable-features/trivial_bounds-feature-gate.stderr @@ -1,45 +1,59 @@ error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/trivial_bounds-feature-gate.rs:8:5 + --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:8:28 | 8 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` + | ^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` | + = note: consider using `Box::pin` = help: see issue #48214 = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/trivial_bounds-feature-gate.rs:8:43 - | -8 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR E0277 - | ^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` - -error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/trivial_bounds-feature-gate.rs:16:5 + --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:16:28 | 16 | impl Unpin for B where Wrapper: Unpin {} //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unpin` is not implemented for `PhantomPinned` + | + = note: consider using `Box::pin` +note: required because of the requirements on the impl of `Unpin` for `phantom_pinned::Wrapper` + --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:12:13 | - = note: required because of the requirements on the impl of `Unpin` for `phantom_pinned::Wrapper` +12 | impl Unpin for Wrapper where T: Unpin {} + | ^^^^^ ^^^^^^^^^^ = help: see issue #48214 = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/trivial_bounds-feature-gate.rs:35:5 + --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:35:28 | 35 | impl Unpin for A where Inner: Unpin {} //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned` + | ^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned` | - = note: required because it appears within the type `Inner` + = note: consider using `Box::pin` +note: required because it appears within the type `Inner` + --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:31:12 + | +31 | struct Inner(PhantomPinned); + | ^^^^^ = help: see issue #48214 = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable error[E0277]: `PhantomPinned` cannot be unpinned - --> $DIR/trivial_bounds-feature-gate.rs:43:5 + --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:43:28 | 43 | impl Unpin for B where Wrapper: Unpin {} //~ ERROR E0277 - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned` + | ^^^^^^^^^^^^^^^^^^^^^ within `Inner`, the trait `Unpin` is not implemented for `PhantomPinned` + | + = note: consider using `Box::pin` +note: required because it appears within the type `Inner` + --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:31:12 + | +31 | struct Inner(PhantomPinned); + | ^^^^^ +note: required because of the requirements on the impl of `Unpin` for `inner::Wrapper` + --> tests/ui/unstable-features/trivial_bounds-feature-gate.rs:39:13 | - = note: required because it appears within the type `Inner` - = note: required because of the requirements on the impl of `Unpin` for `inner::Wrapper` +39 | impl Unpin for Wrapper where T: Unpin {} + | ^^^^^ ^^^^^^^^^^ = 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 index 680effe6..41f885d4 100644 --- a/tests/ui/unstable-features/trivial_bounds.rs +++ b/tests/ui/unstable-features/trivial_bounds.rs @@ -1,4 +1,4 @@ -// NB: If you change this test, change 'trivial_bounds-feature-gate.rs' at the same time. +// Note: 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 @@ -10,25 +10,29 @@ use std::marker::{PhantomData, PhantomPinned}; fn inner() { struct Inner(PhantomPinned); - struct A(Inner); + struct A(PhantomPinned); - impl Unpin for A where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters + impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters + + struct B(Inner); + + impl Unpin for B where Inner: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters struct Wrapper(T); impl Unpin for Wrapper where T: Unpin {} - struct B(Inner); + struct C(Inner); - impl Unpin for B where Wrapper: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters + impl Unpin for C where Wrapper: Unpin {} //~ ERROR 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 C(Inner); + struct D(Inner); - impl<'a> Unpin for C where WrapperWithLifetime<'a, Inner>: Unpin {} // Ok + impl<'a> Unpin for D 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 index 6a3bb94b..23f45c73 100644 --- a/tests/ui/unstable-features/trivial_bounds.stderr +++ b/tests/ui/unstable-features/trivial_bounds.stderr @@ -1,17 +1,23 @@ -error: Trait bound Inner: Unpin does not depend on any type or lifetime parameters - --> $DIR/trivial_bounds.rs:15:35 +error: trait bound PhantomPinned: Unpin does not depend on any type or lifetime parameters + --> tests/ui/unstable-features/trivial_bounds.rs:15:43 | -15 | impl Unpin for A where Inner: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters - | ^^^^^ +15 | impl Unpin for A where PhantomPinned: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters + | ^^^^^ | note: the lint level is defined here - --> $DIR/trivial_bounds.rs:6:9 + --> tests/ui/unstable-features/trivial_bounds.rs:6:9 | 6 | #![deny(trivial_bounds)] | ^^^^^^^^^^^^^^ -error: Trait bound Wrapper: Unpin does not depend on any type or lifetime parameters - --> $DIR/trivial_bounds.rs:23:44 +error: trait bound Inner: Unpin does not depend on any type or lifetime parameters + --> tests/ui/unstable-features/trivial_bounds.rs:19:35 + | +19 | impl Unpin for B where Inner: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters + | ^^^^^ + +error: trait bound Wrapper: Unpin does not depend on any type or lifetime parameters + --> tests/ui/unstable-features/trivial_bounds.rs:27:44 | -23 | impl Unpin for B where Wrapper: Unpin {} //~ ERROR std::marker::Unpin does not depend on any type or lifetime parameters +27 | impl Unpin for C where Wrapper: Unpin {} //~ ERROR Unpin does not depend on any type or lifetime parameters | ^^^^^