error: Invalid ctor item. Expected a function with no args, return value, or type parameters or a static variable.
Valid forms are:
- [pub] [unsafe] [extern $abi] fn $name() { ... }
- static $name : $ty = [unsafe] { ... };
--> tests/errors/ctor_bad_shape.rs:3:1
|
3 | #[ctor]
| ^^^^^^^
|
= note: this error originates in the macro `$crate::__ctor_parse_impl` which comes from the expansion of the attribute macro `ctor` (in Nightly builds, run with -Z macro-backtrace for more info)
error: Invalid ctor item. Expected a function with no args, return value, or type parameters or a static variable.
Valid forms are:
- [pub] [unsafe] [extern $abi] fn $name() { ... }
- static $name : $ty = [unsafe] { ... };
--> tests/errors/ctor_bad_shape.rs:8:1
|
8 | #[ctor]
| ^^^^^^^
|
= note: this error originates in the macro `$crate::__ctor_parse_impl` which comes from the expansion of the attribute macro `ctor` (in Nightly builds, run with -Z macro-backtrace for more info)
error: Invalid ctor item. Expected a function with no args, return value, or type parameters or a static variable.
Valid forms are:
- [pub] [unsafe] [extern $abi] fn $name() { ... }
- static $name : $ty = [unsafe] { ... };
--> tests/errors/ctor_bad_shape.rs:15:5
|
15 | #[ctor]
| ^^^^^^^
|
= note: this error originates in the macro `$crate::__ctor_parse_impl` which comes from the expansion of the attribute macro `ctor` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0401]: can't use generic parameters from outer item
--> tests/errors/ctor_bad_shape.rs:28:13
|
24 | impl<T: Default> FooGeneric<T> {
| - type parameter from outer item
25 | #[ctor]
| ------- generic parameter used in this inner function
...
28 | _ = T::default();
| ^ use of generic parameter from outer item
|
= note: nested items are independent from their parent item for everything except for privacy and name resolution
help: try introducing a local generic parameter here
--> src/parse.rs
|
| $($unsafe)* $( extern $abi )? fn __ctor_private_inner<T>() {
| +++