From 4043d90ce5c6d705d5b9d94dab8601bc376760e9 Mon Sep 17 00:00:00 2001 From: Brezak Date: Tue, 6 Aug 2024 18:20:11 +0200 Subject: [PATCH] Update `pointee` tests --- ...smart-pointer-pointee-in-strange-places.rs | 20 +++--- ...t-pointer-pointee-in-strange-places.stderr | 64 ++++++++++--------- .../feature-gate-derive-smart-pointer.rs | 1 - .../feature-gate-derive-smart-pointer.stderr | 12 +--- 4 files changed, 47 insertions(+), 50 deletions(-) diff --git a/tests/ui/deriving/deriving-smart-pointer-pointee-in-strange-places.rs b/tests/ui/deriving/deriving-smart-pointer-pointee-in-strange-places.rs index 2e8eb904aa0d1..0910c3bbbc510 100644 --- a/tests/ui/deriving/deriving-smart-pointer-pointee-in-strange-places.rs +++ b/tests/ui/deriving/deriving-smart-pointer-pointee-in-strange-places.rs @@ -1,35 +1,37 @@ #![feature(derive_smart_pointer)] #[pointee] -//~^ ERROR: attribute should be applied to generic type parameters +//~^ ERROR: cannot find attribute `pointee` in this scope struct AStruct< #[pointee] - //~^ ERROR: attribute should be applied to generic type parameters + //~^ ERROR: cannot find attribute `pointee` in this scope 'lifetime, #[pointee] - //~^ ERROR: attribute should be applied to generic type parameters + //~^ ERROR: cannot find attribute `pointee` in this scope const CONST: usize > { #[pointee] - //~^ ERROR: attribute should be applied to generic type parameters + //~^ ERROR: cannot find attribute `pointee` in this scope val: &'lifetime () } #[pointee] -//~^ ERROR: attribute should be applied to generic type parameters +//~^ ERROR: cannot find attribute `pointee` in this scope enum AnEnum { #[pointee] - //~^ ERROR: attribute should be applied to generic type parameters + //~^ ERROR: cannot find attribute `pointee` in this scope AVariant } #[pointee] -//~^ ERROR: attribute should be applied to generic type parameters -mod AModule {} +//~^ ERROR: cannot find attribute `pointee` in this scope +mod a_module {} #[pointee] -//~^ ERROR: attribute should be applied to generic type parameters +//~^ ERROR: cannot find attribute `pointee` in this scope fn a_function( ) {} +type AType<#[pointee] T> = T; //~ ERROR: cannot find attribute `pointee` in this scope + fn main() {} diff --git a/tests/ui/deriving/deriving-smart-pointer-pointee-in-strange-places.stderr b/tests/ui/deriving/deriving-smart-pointer-pointee-in-strange-places.stderr index eaddf8ba9d829..b2ef581cde3e5 100644 --- a/tests/ui/deriving/deriving-smart-pointer-pointee-in-strange-places.stderr +++ b/tests/ui/deriving/deriving-smart-pointer-pointee-in-strange-places.stderr @@ -1,50 +1,56 @@ -error: attribute should be applied to generic type parameters - --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:3:1 +error: cannot find attribute `pointee` in this scope + --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:35:14 + | +LL | type AType<#[pointee] T> = T; + | ^^^^^^^ + +error: cannot find attribute `pointee` in this scope + --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:30:3 | LL | #[pointee] - | ^^^^^^^^^^ + | ^^^^^^^ -error: attribute should be applied to generic type parameters - --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:6:5 +error: cannot find attribute `pointee` in this scope + --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:26:3 | -LL | #[pointee] - | ^^^^^^^^^^ +LL | #[pointee] + | ^^^^^^^ -error: attribute should be applied to generic type parameters - --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:9:5 +error: cannot find attribute `pointee` in this scope + --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:18:3 | -LL | #[pointee] - | ^^^^^^^^^^ +LL | #[pointee] + | ^^^^^^^ -error: attribute should be applied to generic type parameters - --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:13:5 +error: cannot find attribute `pointee` in this scope + --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:21:7 | LL | #[pointee] - | ^^^^^^^^^^ + | ^^^^^^^ -error: attribute should be applied to generic type parameters - --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:18:1 +error: cannot find attribute `pointee` in this scope + --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:3:3 | LL | #[pointee] - | ^^^^^^^^^^ + | ^^^^^^^ -error: attribute should be applied to generic type parameters - --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:21:5 +error: cannot find attribute `pointee` in this scope + --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:6:7 | LL | #[pointee] - | ^^^^^^^^^^ + | ^^^^^^^ -error: attribute should be applied to generic type parameters - --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:26:1 +error: cannot find attribute `pointee` in this scope + --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:9:7 | -LL | #[pointee] - | ^^^^^^^^^^ +LL | #[pointee] + | ^^^^^^^ -error: attribute should be applied to generic type parameters - --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:30:1 +error: cannot find attribute `pointee` in this scope + --> $DIR/deriving-smart-pointer-pointee-in-strange-places.rs:13:7 | -LL | #[pointee] - | ^^^^^^^^^^ +LL | #[pointee] + | ^^^^^^^ -error: aborting due to 8 previous errors +error: aborting due to 9 previous errors diff --git a/tests/ui/feature-gates/feature-gate-derive-smart-pointer.rs b/tests/ui/feature-gates/feature-gate-derive-smart-pointer.rs index 3257a9ca624ba..7b4764ee768ab 100644 --- a/tests/ui/feature-gates/feature-gate-derive-smart-pointer.rs +++ b/tests/ui/feature-gates/feature-gate-derive-smart-pointer.rs @@ -3,7 +3,6 @@ use std::marker::SmartPointer; //~ ERROR use of unstable library feature 'derive #[derive(SmartPointer)] //~ ERROR use of unstable library feature 'derive_smart_pointer' #[repr(transparent)] struct MyPointer<'a, #[pointee] T: ?Sized> { - //~^ ERROR the `#[pointee]` attribute is an experimental feature ptr: &'a T, } diff --git a/tests/ui/feature-gates/feature-gate-derive-smart-pointer.stderr b/tests/ui/feature-gates/feature-gate-derive-smart-pointer.stderr index 19501939dc5be..ea4d1271b7c87 100644 --- a/tests/ui/feature-gates/feature-gate-derive-smart-pointer.stderr +++ b/tests/ui/feature-gates/feature-gate-derive-smart-pointer.stderr @@ -8,16 +8,6 @@ LL | #[derive(SmartPointer)] = help: add `#![feature(derive_smart_pointer)]` 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 `#[pointee]` attribute is an experimental feature - --> $DIR/feature-gate-derive-smart-pointer.rs:5:22 - | -LL | struct MyPointer<'a, #[pointee] T: ?Sized> { - | ^^^^^^^^^^ - | - = note: see issue #123430 for more information - = help: add `#![feature(derive_smart_pointer)]` 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]: use of unstable library feature 'derive_smart_pointer' --> $DIR/feature-gate-derive-smart-pointer.rs:1:5 | @@ -28,6 +18,6 @@ LL | use std::marker::SmartPointer; = help: add `#![feature(derive_smart_pointer)]` 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: aborting due to 3 previous errors +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0658`.