forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#128452 - dingxiangfei2009:smart-ptr-require…
…-maybe-sized, r=compiler-errors derive(SmartPointer): require pointee to be maybe sized cc `@Darksonn` So `#[pointee]` has to be `?Sized` in order for deriving `SmartPointer` to be meaningful. cc `@compiler-errors` for suggestions in rust-lang#127681
- Loading branch information
Showing
3 changed files
with
69 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,81 @@ | ||
error: `SmartPointer` can only be derived on `struct`s with `#[repr(transparent)]` | ||
--> $DIR/deriving-smart-pointer-neg.rs:5:10 | ||
--> $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: At least one generic type should be designated as `#[pointee]` in order to derive `SmartPointer` traits | ||
--> $DIR/deriving-smart-pointer-neg.rs:11:10 | ||
--> $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:18:10 | ||
--> $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 with at least one field | ||
--> $DIR/deriving-smart-pointer-neg.rs:25:10 | ||
--> $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: `SmartPointer` can only be derived on `struct`s with `#[repr(transparent)]` | ||
--> $DIR/deriving-smart-pointer-neg.rs:32:10 | ||
--> $DIR/deriving-smart-pointer-neg.rs:33: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:41:36 | ||
| | ||
LL | struct NoMaybeSized<'a, #[pointee] T> { | ||
| ^ | ||
|
||
error[E0392]: lifetime parameter `'a` is never used | ||
--> $DIR/deriving-smart-pointer-neg.rs:21:16 | ||
--> $DIR/deriving-smart-pointer-neg.rs:22: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:21:31 | ||
--> $DIR/deriving-smart-pointer-neg.rs:22: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:28:20 | ||
--> $DIR/deriving-smart-pointer-neg.rs:29: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:28:35 | ||
--> $DIR/deriving-smart-pointer-neg.rs:29: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 9 previous errors | ||
error: aborting due to 10 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0392`. |