Skip to content

Commit

Permalink
Update pointee tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Brezak committed Aug 6, 2024
1 parent d05c2fc commit 4043d90
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 50 deletions.
Original file line number Diff line number Diff line change
@@ -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() {}
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down
12 changes: 1 addition & 11 deletions tests/ui/feature-gates/feature-gate-derive-smart-pointer.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/rust-lang/rust/issues/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
|
Expand All @@ -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`.

0 comments on commit 4043d90

Please sign in to comment.