diff options
| author | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2024-10-05 17:44:53 +0800 |
|---|---|---|
| committer | Ding Xiang Fei <dingxiangfei2009@protonmail.ch> | 2024-10-24 02:14:09 +0800 |
| commit | fd36b3a4a8168fcadecac2317e407bbd0eaeb1d2 (patch) | |
| tree | f2c48c56f9f5903519cba4f257b8213fedf6f853 /tests/ui/deriving | |
| parent | be01dabfefd2daa4574b974f571c7852085d60cb (diff) | |
| download | rust-fd36b3a4a8168fcadecac2317e407bbd0eaeb1d2.tar.gz rust-fd36b3a4a8168fcadecac2317e407bbd0eaeb1d2.zip | |
s/SmartPointer/CoerceReferent/g
move derive_smart_pointer into removed set
Diffstat (limited to 'tests/ui/deriving')
12 files changed, 199 insertions, 183 deletions
diff --git a/tests/ui/deriving/auxiliary/another-proc-macro.rs b/tests/ui/deriving/auxiliary/another-proc-macro.rs index a05175c9de9..c992cde4066 100644 --- a/tests/ui/deriving/auxiliary/another-proc-macro.rs +++ b/tests/ui/deriving/auxiliary/another-proc-macro.rs @@ -6,7 +6,7 @@ extern crate proc_macro; -use proc_macro::{quote, TokenStream}; +use proc_macro::{TokenStream, quote}; #[proc_macro_derive(AnotherMacro, attributes(pointee))] pub fn derive(_input: TokenStream) -> TokenStream { diff --git a/tests/ui/deriving/built-in-proc-macro-scope.rs b/tests/ui/deriving/built-in-proc-macro-scope.rs index 41c95f63b13..6c473aefc5b 100644 --- a/tests/ui/deriving/built-in-proc-macro-scope.rs +++ b/tests/ui/deriving/built-in-proc-macro-scope.rs @@ -2,14 +2,14 @@ //@ aux-build: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded -#![feature(derive_smart_pointer)] +#![feature(derive_coerce_pointee)] #[macro_use] extern crate another_proc_macro; -use another_proc_macro::{pointee, AnotherMacro}; +use another_proc_macro::{AnotherMacro, pointee}; -#[derive(core::marker::SmartPointer)] +#[derive(core::marker::CoercePointee)] #[repr(transparent)] pub struct Ptr<'a, #[pointee] T: ?Sized> { data: &'a mut T, diff --git a/tests/ui/deriving/built-in-proc-macro-scope.stdout b/tests/ui/deriving/built-in-proc-macro-scope.stdout index c649b7a9a57..07767dc229f 100644 --- a/tests/ui/deriving/built-in-proc-macro-scope.stdout +++ b/tests/ui/deriving/built-in-proc-macro-scope.stdout @@ -4,7 +4,7 @@ //@ aux-build: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded -#![feature(derive_smart_pointer)] +#![feature(derive_coerce_pointee)] #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] @@ -13,7 +13,7 @@ extern crate std; #[macro_use] extern crate another_proc_macro; -use another_proc_macro::{pointee, AnotherMacro}; +use another_proc_macro::{AnotherMacro, pointee}; #[repr(transparent)] pub struct Ptr<'a, #[pointee] T: ?Sized> { diff --git a/tests/ui/deriving/smart-pointer-bounds-issue-127647.rs b/tests/ui/deriving/coerce-pointee-bounds-issue-127647.rs index 4cae1b32896..a1aabf1cb52 100644 --- a/tests/ui/deriving/smart-pointer-bounds-issue-127647.rs +++ b/tests/ui/deriving/coerce-pointee-bounds-issue-127647.rs @@ -1,8 +1,8 @@ //@ check-pass -#![feature(derive_smart_pointer)] +#![feature(derive_coerce_pointee)] -#[derive(core::marker::SmartPointer)] +#[derive(core::marker::CoercePointee)] #[repr(transparent)] pub struct Ptr<'a, #[pointee] T: OnDrop + ?Sized, X> { data: &'a mut T, @@ -13,7 +13,7 @@ pub trait OnDrop { fn on_drop(&mut self); } -#[derive(core::marker::SmartPointer)] +#[derive(core::marker::CoercePointee)] #[repr(transparent)] pub struct Ptr2<'a, #[pointee] T: ?Sized, X> where @@ -25,7 +25,7 @@ where pub trait MyTrait<T: ?Sized> {} -#[derive(core::marker::SmartPointer)] +#[derive(core::marker::CoercePointee)] #[repr(transparent)] pub struct Ptr3<'a, #[pointee] T: ?Sized, X> where @@ -35,14 +35,14 @@ where x: core::marker::PhantomData<X>, } -#[derive(core::marker::SmartPointer)] +#[derive(core::marker::CoercePointee)] #[repr(transparent)] pub struct Ptr4<'a, #[pointee] T: MyTrait<T> + ?Sized, X> { data: &'a mut T, x: core::marker::PhantomData<X>, } -#[derive(core::marker::SmartPointer)] +#[derive(core::marker::CoercePointee)] #[repr(transparent)] pub struct Ptr5<'a, #[pointee] T: ?Sized, X> where @@ -56,7 +56,7 @@ where pub struct Ptr5Companion<T: ?Sized>(core::marker::PhantomData<T>); pub struct Ptr5Companion2; -#[derive(core::marker::SmartPointer)] +#[derive(core::marker::CoercePointee)] #[repr(transparent)] pub struct Ptr6<'a, #[pointee] T: ?Sized, X: MyTrait<T> = (), const PARAM: usize = 0> { data: &'a mut T, @@ -65,7 +65,7 @@ pub struct Ptr6<'a, #[pointee] T: ?Sized, X: MyTrait<T> = (), const PARAM: usize // a reduced example from https://lore.kernel.org/all/20240402-linked-list-v1-1-b1c59ba7ae3b@google.com/ #[repr(transparent)] -#[derive(core::marker::SmartPointer)] +#[derive(core::marker::CoercePointee)] pub struct ListArc<#[pointee] T, const ID: u64 = 0> where T: ListArcSafe<ID> + ?Sized, diff --git a/tests/ui/deriving/deriving-smart-pointer-expanded.rs b/tests/ui/deriving/deriving-coerce-pointee-expanded.rs index e48ad3dd4bc..94be7031fb7 100644 --- a/tests/ui/deriving/deriving-smart-pointer-expanded.rs +++ b/tests/ui/deriving/deriving-coerce-pointee-expanded.rs @@ -1,17 +1,17 @@ //@ check-pass //@ compile-flags: -Zunpretty=expanded -#![feature(derive_smart_pointer)] -use std::marker::SmartPointer; +#![feature(derive_coerce_pointee)] +use std::marker::CoercePointee; pub trait MyTrait<T: ?Sized> {} -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct MyPointer<'a, #[pointee] T: ?Sized> { ptr: &'a T, } -#[derive(core::marker::SmartPointer)] +#[derive(core::marker::CoercePointee)] #[repr(transparent)] pub struct MyPointer2<'a, Y, Z: MyTrait<T>, #[pointee] T: ?Sized + MyTrait<T>, X: MyTrait<T> = ()> where @@ -21,7 +21,7 @@ where x: core::marker::PhantomData<X>, } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct MyPointerWithoutPointee<'a, T: ?Sized> { ptr: &'a T, diff --git a/tests/ui/deriving/deriving-smart-pointer-expanded.stdout b/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout index 68ef17f2b05..d6eaca5cba1 100644 --- a/tests/ui/deriving/deriving-smart-pointer-expanded.stdout +++ b/tests/ui/deriving/deriving-coerce-pointee-expanded.stdout @@ -2,12 +2,12 @@ #![no_std] //@ check-pass //@ compile-flags: -Zunpretty=expanded -#![feature(derive_smart_pointer)] +#![feature(derive_coerce_pointee)] #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; -use std::marker::SmartPointer; +use std::marker::CoercePointee; pub trait MyTrait<T: ?Sized> {} diff --git a/tests/ui/deriving/deriving-smart-pointer-neg.rs b/tests/ui/deriving/deriving-coerce-pointee-neg.rs index 41d3039236f..deef35cdf70 100644 --- a/tests/ui/deriving/deriving-smart-pointer-neg.rs +++ b/tests/ui/deriving/deriving-coerce-pointee-neg.rs @@ -1,115 +1,131 @@ -#![feature(derive_smart_pointer, arbitrary_self_types)] +#![feature(derive_coerce_pointee, arbitrary_self_types)] extern crate core; -use std::marker::SmartPointer; +use std::marker::CoercePointee; -#[derive(SmartPointer)] -//~^ ERROR: `SmartPointer` can only be derived on `struct`s with `#[repr(transparent)]` +#[derive(CoercePointee)] +//~^ ERROR: `CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]` enum NotStruct<'a, T: ?Sized> { Variant(&'a T), } -#[derive(SmartPointer)] -//~^ ERROR: `SmartPointer` can only be derived on `struct`s with at least one field +#[derive(CoercePointee)] +//~^ ERROR: `CoercePointee` can only be derived on `struct`s with at least one field #[repr(transparent)] struct NoField<'a, #[pointee] T: ?Sized> {} //~^ ERROR: lifetime parameter `'a` is never used //~| ERROR: type parameter `T` is never used -#[derive(SmartPointer)] -//~^ ERROR: `SmartPointer` can only be derived on `struct`s with at least one field +#[derive(CoercePointee)] +//~^ ERROR: `CoercePointee` can only be derived on `struct`s with at least one field #[repr(transparent)] struct NoFieldUnit<'a, #[pointee] T: ?Sized>(); //~^ ERROR: lifetime parameter `'a` is never used //~| ERROR: type parameter `T` is never used -#[derive(SmartPointer)] -//~^ ERROR: `SmartPointer` can only be derived on `struct`s that are generic over at least one type +#[derive(CoercePointee)] +//~^ ERROR: `CoercePointee` can only be derived on `struct`s that are generic over at least one type #[repr(transparent)] struct NoGeneric<'a>(&'a u8); -#[derive(SmartPointer)] -//~^ ERROR: exactly one generic type parameter must be marked as #[pointee] to derive SmartPointer traits +#[derive(CoercePointee)] +//~^ ERROR: exactly one generic type parameter must be marked as #[pointee] to derive CoercePointee traits #[repr(transparent)] struct AmbiguousPointee<'a, T1: ?Sized, T2: ?Sized> { a: (&'a T1, &'a T2), } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct TooManyPointees<'a, #[pointee] A: ?Sized, #[pointee] B: ?Sized>((&'a A, &'a B)); -//~^ ERROR: only one type parameter can be marked as `#[pointee]` when deriving SmartPointer traits +//~^ ERROR: only one type parameter can be marked as `#[pointee]` when deriving CoercePointee traits -#[derive(SmartPointer)] -//~^ ERROR: `SmartPointer` can only be derived on `struct`s with `#[repr(transparent)]` +#[derive(CoercePointee)] +//~^ ERROR: `CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]` struct NotTransparent<'a, #[pointee] T: ?Sized> { ptr: &'a T, } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct NoMaybeSized<'a, #[pointee] T> { - //~^ ERROR: `derive(SmartPointer)` requires T to be marked `?Sized` + //~^ ERROR: `derive(CoercePointee)` requires T to be marked `?Sized` ptr: &'a T, } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct PointeeOnField<'a, #[pointee] T: ?Sized> { #[pointee] //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters - ptr: &'a T + ptr: &'a T, } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] -struct PointeeInTypeConstBlock<'a, T: ?Sized = [u32; const { struct UhOh<#[pointee] T>(T); 10 }]> { - //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters +struct PointeeInTypeConstBlock< + 'a, + T: ?Sized = [u32; const { + struct UhOh<#[pointee] T>(T); + //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters + 10 + }], +> { ptr: &'a T, } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct PointeeInConstConstBlock< 'a, T: ?Sized, - const V: u32 = { struct UhOh<#[pointee] T>(T); 10 }> - //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters -{ + const V: u32 = { + struct UhOh<#[pointee] T>(T); + //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters + 10 + }, +> { ptr: &'a T, } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct PointeeInAnotherTypeConstBlock<'a, #[pointee] T: ?Sized> { - ptr: PointeeInConstConstBlock<'a, T, { struct UhOh<#[pointee] T>(T); 0 }> - //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters + ptr: PointeeInConstConstBlock< + 'a, + T, + { + struct UhOh<#[pointee] T>(T); + //~^ ERROR: the `#[pointee]` attribute may only be used on generic parameters + 0 + }, + >, } // However, reordering attributes should work nevertheless. #[repr(transparent)] -#[derive(SmartPointer)] -struct ThisIsAPossibleSmartPointer<'a, #[pointee] T: ?Sized> { +#[derive(CoercePointee)] +struct ThisIsAPossibleCoercePointee<'a, #[pointee] T: ?Sized> { ptr: &'a T, } // Also, these paths to Sized should work -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct StdSized<'a, #[pointee] T: ?std::marker::Sized> { ptr: &'a T, } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct CoreSized<'a, #[pointee] T: ?core::marker::Sized> { ptr: &'a T, } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct GlobalStdSized<'a, #[pointee] T: ?::std::marker::Sized> { ptr: &'a T, } -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct GlobalCoreSized<'a, #[pointee] T: ?::core::marker::Sized> { ptr: &'a T, diff --git a/tests/ui/deriving/deriving-coerce-pointee-neg.stderr b/tests/ui/deriving/deriving-coerce-pointee-neg.stderr new file mode 100644 index 00000000000..e590d636d0e --- /dev/null +++ b/tests/ui/deriving/deriving-coerce-pointee-neg.stderr @@ -0,0 +1,119 @@ +error: `CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]` + --> $DIR/deriving-coerce-pointee-neg.rs:6:10 + | +LL | #[derive(CoercePointee)] + | ^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `CoercePointee` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: `CoercePointee` can only be derived on `struct`s with at least one field + --> $DIR/deriving-coerce-pointee-neg.rs:12:10 + | +LL | #[derive(CoercePointee)] + | ^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `CoercePointee` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: `CoercePointee` can only be derived on `struct`s with at least one field + --> $DIR/deriving-coerce-pointee-neg.rs:19:10 + | +LL | #[derive(CoercePointee)] + | ^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `CoercePointee` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: `CoercePointee` can only be derived on `struct`s that are generic over at least one type + --> $DIR/deriving-coerce-pointee-neg.rs:26:10 + | +LL | #[derive(CoercePointee)] + | ^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `CoercePointee` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: exactly one generic type parameter must be marked as #[pointee] to derive CoercePointee traits + --> $DIR/deriving-coerce-pointee-neg.rs:31:10 + | +LL | #[derive(CoercePointee)] + | ^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `CoercePointee` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: only one type parameter can be marked as `#[pointee]` when deriving CoercePointee traits + --> $DIR/deriving-coerce-pointee-neg.rs:40:39 + | +LL | struct TooManyPointees<'a, #[pointee] A: ?Sized, #[pointee] B: ?Sized>((&'a A, &'a B)); + | ^ ^ + +error: `CoercePointee` can only be derived on `struct`s with `#[repr(transparent)]` + --> $DIR/deriving-coerce-pointee-neg.rs:43:10 + | +LL | #[derive(CoercePointee)] + | ^^^^^^^^^^^^^ + | + = note: this error originates in the derive macro `CoercePointee` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: `derive(CoercePointee)` requires T to be marked `?Sized` + --> $DIR/deriving-coerce-pointee-neg.rs:51:36 + | +LL | struct NoMaybeSized<'a, #[pointee] T> { + | ^ + +error: the `#[pointee]` attribute may only be used on generic parameters + --> $DIR/deriving-coerce-pointee-neg.rs:59:5 + | +LL | #[pointee] + | ^^^^^^^^^^ + +error: the `#[pointee]` attribute may only be used on generic parameters + --> $DIR/deriving-coerce-pointee-neg.rs:69:33 + | +LL | struct UhOh<#[pointee] T>(T); + | ^^^^^^^^^^ + +error: the `#[pointee]` attribute may only be used on generic parameters + --> $DIR/deriving-coerce-pointee-neg.rs:83:21 + | +LL | struct UhOh<#[pointee] T>(T); + | ^^^^^^^^^^ + +error: the `#[pointee]` attribute may only be used on generic parameters + --> $DIR/deriving-coerce-pointee-neg.rs:98:25 + | +LL | struct UhOh<#[pointee] T>(T); + | ^^^^^^^^^^ + +error[E0392]: lifetime parameter `'a` is never used + --> $DIR/deriving-coerce-pointee-neg.rs:15:16 + | +LL | struct NoField<'a, #[pointee] T: ?Sized> {} + | ^^ unused lifetime parameter + | + = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData` + +error[E0392]: type parameter `T` is never used + --> $DIR/deriving-coerce-pointee-neg.rs:15:31 + | +LL | struct NoField<'a, #[pointee] T: ?Sized> {} + | ^ unused type parameter + | + = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` + +error[E0392]: lifetime parameter `'a` is never used + --> $DIR/deriving-coerce-pointee-neg.rs:22:20 + | +LL | struct NoFieldUnit<'a, #[pointee] T: ?Sized>(); + | ^^ unused lifetime parameter + | + = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData` + +error[E0392]: type parameter `T` is never used + --> $DIR/deriving-coerce-pointee-neg.rs:22:35 + | +LL | struct NoFieldUnit<'a, #[pointee] T: ?Sized>(); + | ^ unused type parameter + | + = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` + +error: aborting due to 16 previous errors + +For more information about this error, try `rustc --explain E0392`. diff --git a/tests/ui/deriving/deriving-smart-pointer.rs b/tests/ui/deriving/deriving-coerce-pointee.rs index d34a502da68..26762e4d0fa 100644 --- a/tests/ui/deriving/deriving-smart-pointer.rs +++ b/tests/ui/deriving/deriving-coerce-pointee.rs @@ -1,9 +1,9 @@ //@ run-pass -#![feature(derive_smart_pointer, arbitrary_self_types)] +#![feature(derive_coerce_pointee, arbitrary_self_types)] -use std::marker::SmartPointer; +use std::marker::CoercePointee; -#[derive(SmartPointer)] +#[derive(CoercePointee)] #[repr(transparent)] struct MyPointer<'a, #[pointee] T: ?Sized> { ptr: &'a T, diff --git a/tests/ui/deriving/deriving-smart-pointer-neg.stderr b/tests/ui/deriving/deriving-smart-pointer-neg.stderr deleted file mode 100644 index 9ab117698c7..00000000000 --- a/tests/ui/deriving/deriving-smart-pointer-neg.stderr +++ /dev/null @@ -1,119 +0,0 @@ -error: `SmartPointer` can only be derived on `struct`s with `#[repr(transparent)]` - --> $DIR/deriving-smart-pointer-neg.rs:6:10 - | -LL | #[derive(SmartPointer)] - | ^^^^^^^^^^^^ - | - = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: `SmartPointer` can only be derived on `struct`s with at least one field - --> $DIR/deriving-smart-pointer-neg.rs:12:10 - | -LL | #[derive(SmartPointer)] - | ^^^^^^^^^^^^ - | - = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: `SmartPointer` can only be derived on `struct`s with at least one field - --> $DIR/deriving-smart-pointer-neg.rs:19:10 - | -LL | #[derive(SmartPointer)] - | ^^^^^^^^^^^^ - | - = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: `SmartPointer` can only be derived on `struct`s that are generic over at least one type - --> $DIR/deriving-smart-pointer-neg.rs:26:10 - | -LL | #[derive(SmartPointer)] - | ^^^^^^^^^^^^ - | - = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: exactly one generic type parameter must be marked as #[pointee] to derive SmartPointer traits - --> $DIR/deriving-smart-pointer-neg.rs:31:10 - | -LL | #[derive(SmartPointer)] - | ^^^^^^^^^^^^ - | - = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: only one type parameter can be marked as `#[pointee]` when deriving SmartPointer traits - --> $DIR/deriving-smart-pointer-neg.rs:40:39 - | -LL | struct TooManyPointees<'a, #[pointee] A: ?Sized, #[pointee] B: ?Sized>((&'a A, &'a B)); - | ^ ^ - -error: `SmartPointer` can only be derived on `struct`s with `#[repr(transparent)]` - --> $DIR/deriving-smart-pointer-neg.rs:43:10 - | -LL | #[derive(SmartPointer)] - | ^^^^^^^^^^^^ - | - = note: this error originates in the derive macro `SmartPointer` (in Nightly builds, run with -Z macro-backtrace for more info) - -error: `derive(SmartPointer)` requires T to be marked `?Sized` - --> $DIR/deriving-smart-pointer-neg.rs:51:36 - | -LL | struct NoMaybeSized<'a, #[pointee] T> { - | ^ - -error: the `#[pointee]` attribute may only be used on generic parameters - --> $DIR/deriving-smart-pointer-neg.rs:59:5 - | -LL | #[pointee] - | ^^^^^^^^^^ - -error: the `#[pointee]` attribute may only be used on generic parameters - --> $DIR/deriving-smart-pointer-neg.rs:66:74 - | -LL | struct PointeeInTypeConstBlock<'a, T: ?Sized = [u32; const { struct UhOh<#[pointee] T>(T); 10 }]> { - | ^^^^^^^^^^ - -error: the `#[pointee]` attribute may only be used on generic parameters - --> $DIR/deriving-smart-pointer-neg.rs:76:34 - | -LL | const V: u32 = { struct UhOh<#[pointee] T>(T); 10 }> - | ^^^^^^^^^^ - -error: the `#[pointee]` attribute may only be used on generic parameters - --> $DIR/deriving-smart-pointer-neg.rs:85:56 - | -LL | ptr: PointeeInConstConstBlock<'a, T, { struct UhOh<#[pointee] T>(T); 0 }> - | ^^^^^^^^^^ - -error[E0392]: lifetime parameter `'a` is never used - --> $DIR/deriving-smart-pointer-neg.rs:15:16 - | -LL | struct NoField<'a, #[pointee] T: ?Sized> {} - | ^^ unused lifetime parameter - | - = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData` - -error[E0392]: type parameter `T` is never used - --> $DIR/deriving-smart-pointer-neg.rs:15:31 - | -LL | struct NoField<'a, #[pointee] T: ?Sized> {} - | ^ unused type parameter - | - = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` - -error[E0392]: lifetime parameter `'a` is never used - --> $DIR/deriving-smart-pointer-neg.rs:22:20 - | -LL | struct NoFieldUnit<'a, #[pointee] T: ?Sized>(); - | ^^ unused lifetime parameter - | - = help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData` - -error[E0392]: type parameter `T` is never used - --> $DIR/deriving-smart-pointer-neg.rs:22:35 - | -LL | struct NoFieldUnit<'a, #[pointee] T: ?Sized>(); - | ^ unused type parameter - | - = help: consider removing `T`, referring to it in a field, or using a marker such as `PhantomData` - -error: aborting due to 16 previous errors - -For more information about this error, try `rustc --explain E0392`. diff --git a/tests/ui/deriving/proc-macro-attribute-mixing.rs b/tests/ui/deriving/proc-macro-attribute-mixing.rs index 489665ebeb5..80a0d068ce7 100644 --- a/tests/ui/deriving/proc-macro-attribute-mixing.rs +++ b/tests/ui/deriving/proc-macro-attribute-mixing.rs @@ -1,5 +1,5 @@ // This test certify that we can mix attribute macros from Rust and external proc-macros. -// For instance, `#[derive(Default)]` uses `#[default]` and `#[derive(SmartPointer)]` uses +// For instance, `#[derive(Default)]` uses `#[default]` and `#[derive(CoercePointee)]` uses // `#[pointee]`. // The scoping rule should allow the use of the said two attributes when external proc-macros // are in scope. @@ -8,7 +8,7 @@ //@ aux-build: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded -#![feature(derive_smart_pointer)] +#![feature(derive_coerce_pointee)] #[macro_use] extern crate another_proc_macro; diff --git a/tests/ui/deriving/proc-macro-attribute-mixing.stdout b/tests/ui/deriving/proc-macro-attribute-mixing.stdout index f314f6efbe2..03128c6c957 100644 --- a/tests/ui/deriving/proc-macro-attribute-mixing.stdout +++ b/tests/ui/deriving/proc-macro-attribute-mixing.stdout @@ -1,7 +1,7 @@ #![feature(prelude_import)] #![no_std] // This test certify that we can mix attribute macros from Rust and external proc-macros. -// For instance, `#[derive(Default)]` uses `#[default]` and `#[derive(SmartPointer)]` uses +// For instance, `#[derive(Default)]` uses `#[default]` and `#[derive(CoercePointee)]` uses // `#[pointee]`. // The scoping rule should allow the use of the said two attributes when external proc-macros // are in scope. @@ -10,7 +10,7 @@ //@ aux-build: another-proc-macro.rs //@ compile-flags: -Zunpretty=expanded -#![feature(derive_smart_pointer)] +#![feature(derive_coerce_pointee)] #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] |
