diff --git a/compiler/rustc_attr_parsing/src/attributes/mod.rs b/compiler/rustc_attr_parsing/src/attributes/mod.rs index 207fdb7ccabd..093969586596 100644 --- a/compiler/rustc_attr_parsing/src/attributes/mod.rs +++ b/compiler/rustc_attr_parsing/src/attributes/mod.rs @@ -48,7 +48,7 @@ pub(crate) mod must_use; pub(crate) mod no_implicit_prelude; pub(crate) mod non_exhaustive; pub(crate) mod path; -pub(crate) mod pin_project; +pub(crate) mod pin_v2; pub(crate) mod proc_macro_attrs; pub(crate) mod prototype; pub(crate) mod repr; diff --git a/compiler/rustc_attr_parsing/src/attributes/pin_project.rs b/compiler/rustc_attr_parsing/src/attributes/pin_v2.rs similarity index 78% rename from compiler/rustc_attr_parsing/src/attributes/pin_project.rs rename to compiler/rustc_attr_parsing/src/attributes/pin_v2.rs index 9a81f82c9f54..597a9515b004 100644 --- a/compiler/rustc_attr_parsing/src/attributes/pin_project.rs +++ b/compiler/rustc_attr_parsing/src/attributes/pin_v2.rs @@ -7,15 +7,15 @@ use crate::context::Stage; use crate::target_checking::AllowedTargets; use crate::target_checking::Policy::Allow; -pub(crate) struct PinProjectParser; +pub(crate) struct PinV2Parser; -impl NoArgsAttributeParser for PinProjectParser { - const PATH: &[Symbol] = &[sym::pin_project]; +impl NoArgsAttributeParser for PinV2Parser { + const PATH: &[Symbol] = &[sym::pin_v2]; const ON_DUPLICATE: OnDuplicate = OnDuplicate::Warn; const ALLOWED_TARGETS: AllowedTargets = AllowedTargets::AllowList(&[ Allow(Target::Enum), Allow(Target::Struct), Allow(Target::Union), ]); - const CREATE: fn(Span) -> AttributeKind = AttributeKind::PinProject; + const CREATE: fn(Span) -> AttributeKind = AttributeKind::PinV2; } diff --git a/compiler/rustc_attr_parsing/src/context.rs b/compiler/rustc_attr_parsing/src/context.rs index b2bd5ffad8d4..15904fd7d334 100644 --- a/compiler/rustc_attr_parsing/src/context.rs +++ b/compiler/rustc_attr_parsing/src/context.rs @@ -47,7 +47,7 @@ use crate::attributes::must_use::MustUseParser; use crate::attributes::no_implicit_prelude::NoImplicitPreludeParser; use crate::attributes::non_exhaustive::NonExhaustiveParser; use crate::attributes::path::PathParser as PathAttributeParser; -use crate::attributes::pin_project::PinProjectParser; +use crate::attributes::pin_v2::PinV2Parser; use crate::attributes::proc_macro_attrs::{ ProcMacroAttributeParser, ProcMacroDeriveParser, ProcMacroParser, RustcBuiltinMacroParser, }; @@ -234,7 +234,7 @@ attribute_parsers!( Single>, Single>, Single>, - Single>, + Single>, Single>, Single>, Single>, diff --git a/compiler/rustc_feature/src/builtin_attrs.rs b/compiler/rustc_feature/src/builtin_attrs.rs index c97c457086a4..2c472801aa04 100644 --- a/compiler/rustc_feature/src/builtin_attrs.rs +++ b/compiler/rustc_feature/src/builtin_attrs.rs @@ -893,13 +893,13 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ EncodeCrossCrate::No, loop_match, experimental!(loop_match) ), - // The `#[pin_project]` attribute is part of the `pin_ergonomics` experiment + // The `#[pin_v2]` attribute is part of the `pin_ergonomics` experiment // that allows structurally pinning, tracked in: // // - https://github.com/rust-lang/rust/issues/130494 gated!( - pin_project, Normal, template!(Word), ErrorFollowing, - EncodeCrossCrate::Yes, pin_ergonomics, experimental!(pin_project), + pin_v2, Normal, template!(Word), ErrorFollowing, + EncodeCrossCrate::Yes, pin_ergonomics, experimental!(pin_v2), ), // ========================================================================== diff --git a/compiler/rustc_hir/src/attrs/data_structures.rs b/compiler/rustc_hir/src/attrs/data_structures.rs index 29b4d2d96dd2..1bb87673d52d 100644 --- a/compiler/rustc_hir/src/attrs/data_structures.rs +++ b/compiler/rustc_hir/src/attrs/data_structures.rs @@ -637,8 +637,8 @@ pub enum AttributeKind { /// Represents `#[pattern_complexity_limit]` PatternComplexityLimit { attr_span: Span, limit_span: Span, limit: Limit }, - /// Represents `#[pin_project]` - PinProject(Span), + /// Represents `#[pin_v2]` + PinV2(Span), /// Represents `#[pointee]` Pointee(Span), diff --git a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs index e9a183437693..11c54b0ac1da 100644 --- a/compiler/rustc_hir/src/attrs/encode_cross_crate.rs +++ b/compiler/rustc_hir/src/attrs/encode_cross_crate.rs @@ -77,7 +77,7 @@ impl AttributeKind { PassByValue(..) => Yes, Path(..) => No, PatternComplexityLimit { .. } => No, - PinProject(..) => Yes, + PinV2(..) => Yes, Pointee(..) => No, ProcMacro(..) => No, ProcMacroAttribute(..) => No, diff --git a/compiler/rustc_hir_typeck/messages.ftl b/compiler/rustc_hir_typeck/messages.ftl index f14441a6363e..60303d5ee81e 100644 --- a/compiler/rustc_hir_typeck/messages.ftl +++ b/compiler/rustc_hir_typeck/messages.ftl @@ -227,9 +227,9 @@ hir_typeck_pass_to_variadic_function = can't pass `{$ty}` to variadic function .suggestion = cast the value to `{$cast_ty}` .teach_help = certain types, like `{$ty}`, must be cast before passing them to a variadic function to match the implicit cast that a C compiler would perform as part of C's numeric promotion rules -hir_typeck_project_on_non_pin_project_type = cannot project on type that is not `#[pin_project]` +hir_typeck_project_on_non_pin_project_type = cannot project on type that is not `#[pin_v2]` .note = type defined here - .suggestion = add `#[pin_project]` here + .suggestion = add `#[pin_v2]` here hir_typeck_ptr_cast_add_auto_to_object = cannot add {$traits_len -> [1] auto trait {$traits} diff --git a/compiler/rustc_hir_typeck/src/errors.rs b/compiler/rustc_hir_typeck/src/errors.rs index 34e0c9f0f68a..615a8c95056d 100644 --- a/compiler/rustc_hir_typeck/src/errors.rs +++ b/compiler/rustc_hir_typeck/src/errors.rs @@ -1164,6 +1164,6 @@ pub(crate) struct ProjectOnNonPinProjectType { pub span: Span, #[note] pub def_span: Option, - #[suggestion(code = "#[pin_project]\n", applicability = "machine-applicable")] + #[suggestion(code = "#[pin_v2]\n", applicability = "machine-applicable")] pub sugg_span: Option, } diff --git a/compiler/rustc_hir_typeck/src/pat.rs b/compiler/rustc_hir_typeck/src/pat.rs index d3867bda6fa0..f27085d59c0e 100644 --- a/compiler/rustc_hir_typeck/src/pat.rs +++ b/compiler/rustc_hir_typeck/src/pat.rs @@ -555,7 +555,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { debug!("scrutinee ty {expected:?} is a pinned reference, inserting pin deref"); // if the inner_ty is an ADT, make sure that it can be structurally pinned - // (i.e., it is `#[pin_project]`). + // (i.e., it is `#[pin_v2]`). if let Some(adt) = inner_ty.ty_adt_def() && !adt.is_pin_project() && !adt.is_pin() diff --git a/compiler/rustc_middle/src/ty/adt.rs b/compiler/rustc_middle/src/ty/adt.rs index 8386504245cd..510c546f82a4 100644 --- a/compiler/rustc_middle/src/ty/adt.rs +++ b/compiler/rustc_middle/src/ty/adt.rs @@ -288,7 +288,7 @@ impl AdtDefData { debug!("found non-exhaustive variant list for {:?}", did); flags = flags | AdtFlags::IS_VARIANT_LIST_NON_EXHAUSTIVE; } - if find_attr!(tcx.get_all_attrs(did), AttributeKind::PinProject(..)) { + if find_attr!(tcx.get_all_attrs(did), AttributeKind::PinV2(..)) { debug!("found pin-project type {:?}", did); flags |= AdtFlags::IS_PIN_PROJECT; } @@ -445,7 +445,7 @@ impl<'tcx> AdtDef<'tcx> { self.flags().contains(AdtFlags::IS_PIN) } - /// Returns `true` is this is `#[pin_project]` for the purposes + /// Returns `true` is this is `#[pin_v2]` for the purposes /// of structural pinning. #[inline] pub fn is_pin_project(self) -> bool { diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs index 3cd1d5ba61b4..c214104d6067 100644 --- a/compiler/rustc_passes/src/check_attr.rs +++ b/compiler/rustc_passes/src/check_attr.rs @@ -284,7 +284,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | AttributeKind::RustcCoherenceIsCore(..) | AttributeKind::DebuggerVisualizer(..) | AttributeKind::RustcMain - | AttributeKind::PinProject(..), + | AttributeKind::PinV2(..), ) => { /* do nothing */ } Attribute::Unparsed(attr_item) => { style = Some(attr_item.style); diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index c378927ded89..811bd1a6136e 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1667,7 +1667,7 @@ symbols! { pin, pin_ergonomics, pin_macro, - pin_project, + pin_v2, platform_intrinsics, plugin, plugin_registrar, diff --git a/src/tools/clippy/tests/ui/explicit_write_in_test.stderr b/src/tools/clippy/tests/ui/explicit_write_in_test.stderr deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/tests/ui/feature-gates/feature-gate-pin_ergonomics.rs b/tests/ui/feature-gates/feature-gate-pin_ergonomics.rs index 47c4b36a0770..07aba0d1d281 100644 --- a/tests/ui/feature-gates/feature-gate-pin_ergonomics.rs +++ b/tests/ui/feature-gates/feature-gate-pin_ergonomics.rs @@ -2,7 +2,7 @@ use std::pin::Pin; -#[pin_project] //~ ERROR the `#[pin_project]` attribute is an experimental feature +#[pin_v2] //~ ERROR the `#[pin_v2]` attribute is an experimental feature struct Foo; impl Foo { @@ -51,7 +51,7 @@ fn borrows() { mod not_compiled { use std::pin::Pin; - #[pin_project] + #[pin_v2] struct Foo; impl Foo { diff --git a/tests/ui/feature-gates/feature-gate-pin_ergonomics.stderr b/tests/ui/feature-gates/feature-gate-pin_ergonomics.stderr index 3952ba78d3c1..cff564c01fc6 100644 --- a/tests/ui/feature-gates/feature-gate-pin_ergonomics.stderr +++ b/tests/ui/feature-gates/feature-gate-pin_ergonomics.stderr @@ -148,11 +148,11 @@ LL | let x: Pin<&_> = &pin const Foo; = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[pin_project]` attribute is an experimental feature +error[E0658]: the `#[pin_v2]` attribute is an experimental feature --> $DIR/feature-gate-pin_ergonomics.rs:5:1 | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ +LL | #[pin_v2] + | ^^^^^^^^^ | = note: see issue #130494 for more information = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable diff --git a/tests/ui/pin-ergonomics/pattern-matching-deref-pattern.rs b/tests/ui/pin-ergonomics/pattern-matching-deref-pattern.rs index 26f52a0c79cf..3ec9b8fe476f 100644 --- a/tests/ui/pin-ergonomics/pattern-matching-deref-pattern.rs +++ b/tests/ui/pin-ergonomics/pattern-matching-deref-pattern.rs @@ -10,16 +10,16 @@ use std::pin::Pin; -#[cfg_attr(pin_ergonomics, pin_project)] +#[cfg_attr(pin_ergonomics, pin_v2)] struct Foo { x: T, y: U, } -#[cfg_attr(pin_ergonomics, pin_project)] +#[cfg_attr(pin_ergonomics, pin_v2)] struct Bar(T, U); -#[cfg_attr(pin_ergonomics, pin_project)] +#[cfg_attr(pin_ergonomics, pin_v2)] enum Baz { Foo(T, U), Bar { x: T, y: U }, diff --git a/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.both.stderr b/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.both.stderr index cc3be291580b..9bcb41299b7d 100644 --- a/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.both.stderr +++ b/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.both.stderr @@ -1,4 +1,4 @@ -error: cannot project on type that is not `#[pin_project]` +error: cannot project on type that is not `#[pin_v2]` --> $DIR/pattern-matching-mix-deref-pattern.rs:121:9 | LL | let NonPinProject { x } = foo; @@ -9,13 +9,13 @@ note: type defined here | LL | struct NonPinProject { | ^^^^^^^^^^^^^^^^^^^^^^^ -help: add `#[pin_project]` here +help: add `#[pin_v2]` here | -LL + #[pin_project] +LL + #[pin_v2] LL | struct NonPinProject { | -error: cannot project on type that is not `#[pin_project]` +error: cannot project on type that is not `#[pin_v2]` --> $DIR/pattern-matching-mix-deref-pattern.rs:125:9 | LL | let NonPinProject { x } = bar; @@ -26,13 +26,13 @@ note: type defined here | LL | struct NonPinProject { | ^^^^^^^^^^^^^^^^^^^^^^^ -help: add `#[pin_project]` here +help: add `#[pin_v2]` here | -LL + #[pin_project] +LL + #[pin_v2] LL | struct NonPinProject { | -error: cannot project on type that is not `#[pin_project]` +error: cannot project on type that is not `#[pin_v2]` --> $DIR/pattern-matching-mix-deref-pattern.rs:131:9 | LL | NonPinProject { x } => {} @@ -43,13 +43,13 @@ note: type defined here | LL | struct NonPinProject { | ^^^^^^^^^^^^^^^^^^^^^^^ -help: add `#[pin_project]` here +help: add `#[pin_v2]` here | -LL + #[pin_project] +LL + #[pin_v2] LL | struct NonPinProject { | -error: cannot project on type that is not `#[pin_project]` +error: cannot project on type that is not `#[pin_v2]` --> $DIR/pattern-matching-mix-deref-pattern.rs:139:9 | LL | NonPinProject { x } => {} @@ -60,9 +60,9 @@ note: type defined here | LL | struct NonPinProject { | ^^^^^^^^^^^^^^^^^^^^^^^ -help: add `#[pin_project]` here +help: add `#[pin_v2]` here | -LL + #[pin_project] +LL + #[pin_v2] LL | struct NonPinProject { | diff --git a/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.pin_ergonomics.stderr b/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.pin_ergonomics.stderr index cc3be291580b..9bcb41299b7d 100644 --- a/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.pin_ergonomics.stderr +++ b/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.pin_ergonomics.stderr @@ -1,4 +1,4 @@ -error: cannot project on type that is not `#[pin_project]` +error: cannot project on type that is not `#[pin_v2]` --> $DIR/pattern-matching-mix-deref-pattern.rs:121:9 | LL | let NonPinProject { x } = foo; @@ -9,13 +9,13 @@ note: type defined here | LL | struct NonPinProject { | ^^^^^^^^^^^^^^^^^^^^^^^ -help: add `#[pin_project]` here +help: add `#[pin_v2]` here | -LL + #[pin_project] +LL + #[pin_v2] LL | struct NonPinProject { | -error: cannot project on type that is not `#[pin_project]` +error: cannot project on type that is not `#[pin_v2]` --> $DIR/pattern-matching-mix-deref-pattern.rs:125:9 | LL | let NonPinProject { x } = bar; @@ -26,13 +26,13 @@ note: type defined here | LL | struct NonPinProject { | ^^^^^^^^^^^^^^^^^^^^^^^ -help: add `#[pin_project]` here +help: add `#[pin_v2]` here | -LL + #[pin_project] +LL + #[pin_v2] LL | struct NonPinProject { | -error: cannot project on type that is not `#[pin_project]` +error: cannot project on type that is not `#[pin_v2]` --> $DIR/pattern-matching-mix-deref-pattern.rs:131:9 | LL | NonPinProject { x } => {} @@ -43,13 +43,13 @@ note: type defined here | LL | struct NonPinProject { | ^^^^^^^^^^^^^^^^^^^^^^^ -help: add `#[pin_project]` here +help: add `#[pin_v2]` here | -LL + #[pin_project] +LL + #[pin_v2] LL | struct NonPinProject { | -error: cannot project on type that is not `#[pin_project]` +error: cannot project on type that is not `#[pin_v2]` --> $DIR/pattern-matching-mix-deref-pattern.rs:139:9 | LL | NonPinProject { x } => {} @@ -60,9 +60,9 @@ note: type defined here | LL | struct NonPinProject { | ^^^^^^^^^^^^^^^^^^^^^^^ -help: add `#[pin_project]` here +help: add `#[pin_v2]` here | -LL + #[pin_project] +LL + #[pin_v2] LL | struct NonPinProject { | diff --git a/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.rs b/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.rs index 691d5d51cafc..2b2a4e61abfd 100644 --- a/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.rs +++ b/tests/ui/pin-ergonomics/pattern-matching-mix-deref-pattern.rs @@ -10,16 +10,16 @@ use std::pin::Pin; -#[cfg_attr(any(pin_ergonomics, both), pin_project)] +#[cfg_attr(any(pin_ergonomics, both), pin_v2)] struct Foo { x: T, y: U, } -#[cfg_attr(any(pin_ergonomics, both), pin_project)] +#[cfg_attr(any(pin_ergonomics, both), pin_v2)] struct Bar(T, U); -#[cfg_attr(any(pin_ergonomics, both), pin_project)] +#[cfg_attr(any(pin_ergonomics, both), pin_v2)] enum Baz { Foo(T, U), Bar { x: T, y: U }, @@ -120,27 +120,27 @@ fn bar_const(bar: Pin<&Bar>) { fn non_pin_project(foo: Pin<&mut NonPinProject>, bar: Pin<&NonPinProject>) { let NonPinProject { x } = foo; //[normal]~^ ERROR mismatched types - //[pin_ergonomics]~^^ ERROR cannot project on type that is not `#[pin_project]` - //[both]~^^^ ERROR cannot project on type that is not `#[pin_project]` + //[pin_ergonomics]~^^ ERROR cannot project on type that is not `#[pin_v2]` + //[both]~^^^ ERROR cannot project on type that is not `#[pin_v2]` let NonPinProject { x } = bar; //[normal]~^ ERROR mismatched types - //[pin_ergonomics]~^^ ERROR cannot project on type that is not `#[pin_project]` - //[both]~^^^ ERROR cannot project on type that is not `#[pin_project]` + //[pin_ergonomics]~^^ ERROR cannot project on type that is not `#[pin_v2]` + //[both]~^^^ ERROR cannot project on type that is not `#[pin_v2]` match foo { NonPinProject { x } => {} //[normal]~^ ERROR mismatched types //[deref_patterns]~^^ ERROR mix of deref patterns and normal constructors - //[pin_ergonomics]~^^^ ERROR cannot project on type that is not `#[pin_project]` - //[both]~^^^^ ERROR cannot project on type that is not `#[pin_project]` + //[pin_ergonomics]~^^^ ERROR cannot project on type that is not `#[pin_v2]` + //[both]~^^^^ ERROR cannot project on type that is not `#[pin_v2]` Pin { .. } => {} } match bar { NonPinProject { x } => {} //[normal]~^ ERROR mismatched types //[deref_patterns]~^^ ERROR mix of deref patterns and normal constructors - //[pin_ergonomics]~^^^ ERROR cannot project on type that is not `#[pin_project]` - //[both]~^^^^ ERROR cannot project on type that is not `#[pin_project]` + //[pin_ergonomics]~^^^ ERROR cannot project on type that is not `#[pin_v2]` + //[both]~^^^^ ERROR cannot project on type that is not `#[pin_v2]` Pin { .. } => {} } } diff --git a/tests/ui/pin-ergonomics/pattern-matching.normal.stderr b/tests/ui/pin-ergonomics/pattern-matching.normal.stderr index 5d2d133761c4..8ec481fba9e0 100644 --- a/tests/ui/pin-ergonomics/pattern-matching.normal.stderr +++ b/tests/ui/pin-ergonomics/pattern-matching.normal.stderr @@ -1,18 +1,18 @@ -error[E0658]: the `#[pin_project]` attribute is an experimental feature +error[E0658]: the `#[pin_v2]` attribute is an experimental feature --> $DIR/pattern-matching.rs:12:1 | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ +LL | #[pin_v2] + | ^^^^^^^^^ | = note: see issue #130494 for more information = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date -error[E0658]: the `#[pin_project]` attribute is an experimental feature +error[E0658]: the `#[pin_v2]` attribute is an experimental feature --> $DIR/pattern-matching.rs:18:1 | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ +LL | #[pin_v2] + | ^^^^^^^^^ | = note: see issue #130494 for more information = help: add `#![feature(pin_ergonomics)]` to the crate attributes to enable diff --git a/tests/ui/pin-ergonomics/pattern-matching.rs b/tests/ui/pin-ergonomics/pattern-matching.rs index 8798e2ed7402..96a4705bf9b3 100644 --- a/tests/ui/pin-ergonomics/pattern-matching.rs +++ b/tests/ui/pin-ergonomics/pattern-matching.rs @@ -7,15 +7,15 @@ use std::pin::Pin; // This test verifies that a `&pin mut T` can be projected to a pinned -// reference field `&pin mut T.U` when `T` is marked with `#[pin_project]`. +// reference field `&pin mut T.U` when `T` is marked with `#[pin_v2]`. -#[pin_project] //[normal]~ ERROR the `#[pin_project]` attribute is an experimental feature +#[pin_v2] //[normal]~ ERROR the `#[pin_v2]` attribute is an experimental feature struct Foo { x: T, y: U, } -#[pin_project] //[normal]~ ERROR the `#[pin_project]` attribute is an experimental feature +#[pin_v2] //[normal]~ ERROR the `#[pin_v2]` attribute is an experimental feature enum Bar { Foo(T, U), Bar { x: T, y: U }, diff --git a/tests/ui/pin-ergonomics/pin_project-attr.rs b/tests/ui/pin-ergonomics/pin_project-attr.rs deleted file mode 100644 index be9bcc34d494..000000000000 --- a/tests/ui/pin-ergonomics/pin_project-attr.rs +++ /dev/null @@ -1,144 +0,0 @@ -#![feature( - pin_ergonomics, - where_clause_attrs, - trait_alias, - extern_types, - associated_type_defaults, - fn_delegation, -)] -#![allow(incomplete_features)] -#![pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on crates - -// allowed - -#[pin_project] -struct Struct {} - -#[pin_project] -enum Enum {} - -#[pin_project] -union Union { - field: (), -} - -// disallowed - -enum Foo<#[pin_project] T, #[pin_project] U = ()> { - //~^ ERROR `#[pin_project]` attribute cannot be used on function params - //~| ERROR `#[pin_project]` attribute cannot be used on function params - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on enum variants - UnitVariant, - TupleVariant(#[pin_project] T), //~ ERROR `#[pin_project]` attribute cannot be used on struct fields - StructVariant { - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on struct fields - field: U, - }, -} - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on traits -trait Trait { - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on associated consts - const ASSOC_CONST: () = (); - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on associated types - type AssocType = (); - - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on required trait methods - fn method(); - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on provided trait methods - fn method_with_body() {} -} - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on trait aliases -trait TraitAlias = Trait; - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on inherent impl blocks -impl Struct { - // FIXME: delegation macros are not tested yet (how to?) - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on delegations - reuse ::type_id; - - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on inherent methods - fn method() {} -} - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on trait impl blocks -impl Trait for Enum { - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on trait methods in impl blocks - fn method() {} -} - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on extern crates -extern crate alloc; - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on use statements -use std::pin::Pin; - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on statics -static STATIC: () = (); - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on constants -const CONST: () = (); - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on functions -fn f(#[pin_project] param: Foo) -//~^ ERROR `#[pin_project]` attribute cannot be used on function params -//~| ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters -where - #[pin_project] - //~^ ERROR `#[pin_project]` attribute cannot be used on where predicates - T:, -{ - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on closures - || (); - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on expressions - [(), (), ()]; - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on statements - let _: Foo<(), ()> = Foo::StructVariant { - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on struct fields - field: (), - }; - match param { - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on match arms - Foo::UnitVariant => {} - Foo::TupleVariant(..) => {} - Foo::StructVariant { - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on pattern fields - field, - } => {} - } -} - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on modules -mod m {} - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on foreign modules -extern "C" { - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on foreign types - type ForeignTy; - - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on foreign statics - static EXTERN_STATIC: (); - - #[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on foreign functions - fn extern_fn(); -} - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on type alias -type Type = (); - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on macro defs -macro_rules! macro_def { - () => {}; -} - -#[pin_project] //~ ERROR `#[pin_project]` attribute cannot be used on macro calls -macro_def!(); - -std::arch::global_asm! { - "{}", - #[pin_project] //~ ERROR this attribute is not supported on assembly - const 0 -} - -fn main() {} diff --git a/tests/ui/pin-ergonomics/pin_project-attr.stderr b/tests/ui/pin-ergonomics/pin_project-attr.stderr deleted file mode 100644 index aa1c376401ba..000000000000 --- a/tests/ui/pin-ergonomics/pin_project-attr.stderr +++ /dev/null @@ -1,318 +0,0 @@ -error: `#[pin_project]` attribute cannot be used on macro calls - --> $DIR/pin_project-attr.rs:135:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: this attribute is not supported on assembly - --> $DIR/pin_project-attr.rs:140:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - -error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters - --> $DIR/pin_project-attr.rs:84:12 - | -LL | fn f(#[pin_project] param: Foo) - | ^^^^^^^^^^^^^^ - -error: `#[pin_project]` attribute cannot be used on crates - --> $DIR/pin_project-attr.rs:10:1 - | -LL | #![pin_project] - | ^^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on function params - --> $DIR/pin_project-attr.rs:27:10 - | -LL | enum Foo<#[pin_project] T, #[pin_project] U = ()> { - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on function params - --> $DIR/pin_project-attr.rs:27:28 - | -LL | enum Foo<#[pin_project] T, #[pin_project] U = ()> { - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on enum variants - --> $DIR/pin_project-attr.rs:30:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on struct fields - --> $DIR/pin_project-attr.rs:32:18 - | -LL | TupleVariant(#[pin_project] T), - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on struct fields - --> $DIR/pin_project-attr.rs:34:9 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on traits - --> $DIR/pin_project-attr.rs:39:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on associated consts - --> $DIR/pin_project-attr.rs:41:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on associated types - --> $DIR/pin_project-attr.rs:43:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on required trait methods - --> $DIR/pin_project-attr.rs:46:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on provided trait methods - --> $DIR/pin_project-attr.rs:48:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on trait aliases - --> $DIR/pin_project-attr.rs:52:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on inherent impl blocks - --> $DIR/pin_project-attr.rs:55:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on delegations - --> $DIR/pin_project-attr.rs:58:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on inherent methods - --> $DIR/pin_project-attr.rs:61:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on trait impl blocks - --> $DIR/pin_project-attr.rs:65:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on trait methods in impl blocks - --> $DIR/pin_project-attr.rs:67:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on extern crates - --> $DIR/pin_project-attr.rs:71:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on use statements - --> $DIR/pin_project-attr.rs:74:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on statics - --> $DIR/pin_project-attr.rs:77:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on constants - --> $DIR/pin_project-attr.rs:80:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on functions - --> $DIR/pin_project-attr.rs:83:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on function params - --> $DIR/pin_project-attr.rs:84:12 - | -LL | fn f(#[pin_project] param: Foo) - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on closures - --> $DIR/pin_project-attr.rs:92:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on expressions - --> $DIR/pin_project-attr.rs:94:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on struct fields - --> $DIR/pin_project-attr.rs:98:9 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on statements - --> $DIR/pin_project-attr.rs:96:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on match arms - --> $DIR/pin_project-attr.rs:102:9 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on pattern fields - --> $DIR/pin_project-attr.rs:106:13 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on where predicates - --> $DIR/pin_project-attr.rs:88:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on modules - --> $DIR/pin_project-attr.rs:112:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on foreign modules - --> $DIR/pin_project-attr.rs:115:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on foreign types - --> $DIR/pin_project-attr.rs:117:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on foreign statics - --> $DIR/pin_project-attr.rs:120:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on foreign functions - --> $DIR/pin_project-attr.rs:123:5 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on type aliases - --> $DIR/pin_project-attr.rs:127:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: `#[pin_project]` attribute cannot be used on macro defs - --> $DIR/pin_project-attr.rs:130:1 - | -LL | #[pin_project] - | ^^^^^^^^^^^^^^ - | - = help: `#[pin_project]` can be applied to data types and unions - -error: aborting due to 40 previous errors - diff --git a/tests/ui/pin-ergonomics/pin_v2-attr.rs b/tests/ui/pin-ergonomics/pin_v2-attr.rs new file mode 100644 index 000000000000..af958952d084 --- /dev/null +++ b/tests/ui/pin-ergonomics/pin_v2-attr.rs @@ -0,0 +1,144 @@ +#![feature( + pin_ergonomics, + where_clause_attrs, + trait_alias, + extern_types, + associated_type_defaults, + fn_delegation, +)] +#![allow(incomplete_features)] +#![pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on crates + +// allowed + +#[pin_v2] +struct Struct {} + +#[pin_v2] +enum Enum {} + +#[pin_v2] +union Union { + field: (), +} + +// disallowed + +enum Foo<#[pin_v2] T, #[pin_v2] U = ()> { + //~^ ERROR `#[pin_v2]` attribute cannot be used on function params + //~| ERROR `#[pin_v2]` attribute cannot be used on function params + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on enum variants + UnitVariant, + TupleVariant(#[pin_v2] T), //~ ERROR `#[pin_v2]` attribute cannot be used on struct fields + StructVariant { + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on struct fields + field: U, + }, +} + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on traits +trait Trait { + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on associated consts + const ASSOC_CONST: () = (); + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on associated types + type AssocType = (); + + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on required trait methods + fn method(); + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on provided trait methods + fn method_with_body() {} +} + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on trait aliases +trait TraitAlias = Trait; + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on inherent impl blocks +impl Struct { + // FIXME: delegation macros are not tested yet (how to?) + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on delegations + reuse ::type_id; + + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on inherent methods + fn method() {} +} + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on trait impl blocks +impl Trait for Enum { + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on trait methods in impl blocks + fn method() {} +} + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on extern crates +extern crate alloc; + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on use statements +use std::pin::Pin; + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on statics +static STATIC: () = (); + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on constants +const CONST: () = (); + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on functions +fn f(#[pin_v2] param: Foo) +//~^ ERROR `#[pin_v2]` attribute cannot be used on function params +//~| ERROR allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters +where + #[pin_v2] + //~^ ERROR `#[pin_v2]` attribute cannot be used on where predicates + T:, +{ + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on closures + || (); + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on expressions + [(), (), ()]; + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on statements + let _: Foo<(), ()> = Foo::StructVariant { + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on struct fields + field: (), + }; + match param { + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on match arms + Foo::UnitVariant => {} + Foo::TupleVariant(..) => {} + Foo::StructVariant { + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on pattern fields + field, + } => {} + } +} + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on modules +mod m {} + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on foreign modules +extern "C" { + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on foreign types + type ForeignTy; + + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on foreign statics + static EXTERN_STATIC: (); + + #[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on foreign functions + fn extern_fn(); +} + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on type alias +type Type = (); + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on macro defs +macro_rules! macro_def { + () => {}; +} + +#[pin_v2] //~ ERROR `#[pin_v2]` attribute cannot be used on macro calls +macro_def!(); + +std::arch::global_asm! { + "{}", + #[pin_v2] //~ ERROR this attribute is not supported on assembly + const 0 +} + +fn main() {} diff --git a/tests/ui/pin-ergonomics/pin_v2-attr.stderr b/tests/ui/pin-ergonomics/pin_v2-attr.stderr new file mode 100644 index 000000000000..fb3e50a23fe7 --- /dev/null +++ b/tests/ui/pin-ergonomics/pin_v2-attr.stderr @@ -0,0 +1,318 @@ +error: `#[pin_v2]` attribute cannot be used on macro calls + --> $DIR/pin_v2-attr.rs:135:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: this attribute is not supported on assembly + --> $DIR/pin_v2-attr.rs:140:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + +error: allow, cfg, cfg_attr, deny, expect, forbid, and warn are the only allowed built-in attributes in function parameters + --> $DIR/pin_v2-attr.rs:84:12 + | +LL | fn f(#[pin_v2] param: Foo) + | ^^^^^^^^^ + +error: `#[pin_v2]` attribute cannot be used on crates + --> $DIR/pin_v2-attr.rs:10:1 + | +LL | #![pin_v2] + | ^^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on function params + --> $DIR/pin_v2-attr.rs:27:10 + | +LL | enum Foo<#[pin_v2] T, #[pin_v2] U = ()> { + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on function params + --> $DIR/pin_v2-attr.rs:27:23 + | +LL | enum Foo<#[pin_v2] T, #[pin_v2] U = ()> { + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on enum variants + --> $DIR/pin_v2-attr.rs:30:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on struct fields + --> $DIR/pin_v2-attr.rs:32:18 + | +LL | TupleVariant(#[pin_v2] T), + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on struct fields + --> $DIR/pin_v2-attr.rs:34:9 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on traits + --> $DIR/pin_v2-attr.rs:39:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on associated consts + --> $DIR/pin_v2-attr.rs:41:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on associated types + --> $DIR/pin_v2-attr.rs:43:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on required trait methods + --> $DIR/pin_v2-attr.rs:46:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on provided trait methods + --> $DIR/pin_v2-attr.rs:48:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on trait aliases + --> $DIR/pin_v2-attr.rs:52:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on inherent impl blocks + --> $DIR/pin_v2-attr.rs:55:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on delegations + --> $DIR/pin_v2-attr.rs:58:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on inherent methods + --> $DIR/pin_v2-attr.rs:61:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on trait impl blocks + --> $DIR/pin_v2-attr.rs:65:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on trait methods in impl blocks + --> $DIR/pin_v2-attr.rs:67:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on extern crates + --> $DIR/pin_v2-attr.rs:71:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on use statements + --> $DIR/pin_v2-attr.rs:74:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on statics + --> $DIR/pin_v2-attr.rs:77:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on constants + --> $DIR/pin_v2-attr.rs:80:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on functions + --> $DIR/pin_v2-attr.rs:83:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on function params + --> $DIR/pin_v2-attr.rs:84:12 + | +LL | fn f(#[pin_v2] param: Foo) + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on closures + --> $DIR/pin_v2-attr.rs:92:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on expressions + --> $DIR/pin_v2-attr.rs:94:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on struct fields + --> $DIR/pin_v2-attr.rs:98:9 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on statements + --> $DIR/pin_v2-attr.rs:96:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on match arms + --> $DIR/pin_v2-attr.rs:102:9 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on pattern fields + --> $DIR/pin_v2-attr.rs:106:13 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on where predicates + --> $DIR/pin_v2-attr.rs:88:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on modules + --> $DIR/pin_v2-attr.rs:112:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on foreign modules + --> $DIR/pin_v2-attr.rs:115:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on foreign types + --> $DIR/pin_v2-attr.rs:117:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on foreign statics + --> $DIR/pin_v2-attr.rs:120:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on foreign functions + --> $DIR/pin_v2-attr.rs:123:5 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on type aliases + --> $DIR/pin_v2-attr.rs:127:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: `#[pin_v2]` attribute cannot be used on macro defs + --> $DIR/pin_v2-attr.rs:130:1 + | +LL | #[pin_v2] + | ^^^^^^^^^ + | + = help: `#[pin_v2]` can be applied to data types and unions + +error: aborting due to 40 previous errors +