-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
130 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
error: couldn't parse trait item | ||
|
||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
|
||
--> tests/compile-fail/attr_on_enum.rs:4:1 | ||
| | ||
4 | #[auto_impl(&, &mut)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,11 +1,9 @@ | ||
error: couldn't parse trait item | ||
|
||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
|
||
--> tests/compile-fail/attr_on_fn.rs:4:1 | ||
| | ||
4 | #[auto_impl(&, &mut)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,11 +1,9 @@ | ||
error: couldn't parse trait item | ||
|
||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
|
||
--> tests/compile-fail/attr_on_impl_block.rs:6:1 | ||
| | ||
6 | #[auto_impl(&, &mut)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,11 +1,9 @@ | ||
error: couldn't parse trait item | ||
|
||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
|
||
--> tests/compile-fail/attr_on_struct.rs:4:1 | ||
| | ||
4 | #[auto_impl(&, &mut)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,11 +1,9 @@ | ||
error: couldn't parse trait item | ||
|
||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
|
||
--> tests/compile-fail/attr_on_type.rs:4:1 | ||
| | ||
4 | #[auto_impl(&, &mut)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,11 +1,9 @@ | ||
error: couldn't parse trait item | ||
|
||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
|
||
--> tests/compile-fail/attr_on_unit_struct.rs:4:1 | ||
| | ||
4 | #[auto_impl(&, &mut)] | ||
| ^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: expected `trait` | ||
= note: the #[auto_impl] attribute can only be applied to traits! | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,14 +1,36 @@ | ||
error: this trait cannot be auto-implemented for Fn-traits (only traits with exactly one method and no other items are allowed) | ||
--> tests/compile-fail/fn_associated_const.rs:5:1 | ||
| | ||
5 | trait Foo { | ||
| ^^^^^ | ||
5 | / trait Foo { | ||
6 | | const LEN: usize; | ||
7 | | | ||
8 | | fn a(&self); | ||
9 | | } | ||
| |_^ | ||
|
||
error: the trait `Foo` cannot be auto-implemented for Fn-traits, because it has associated consts | ||
|
||
= note: only traits with a single method can be implemented for Fn-traits | ||
|
||
--> tests/compile-fail/fn_associated_const.rs:6:5 | ||
| | ||
6 | const LEN: usize; | ||
| ^^^^^ | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: only traits with a single method can be implemented for Fn-traits | ||
|
||
error[E0046]: not all trait items implemented, missing: `LEN` | ||
--> tests/compile-fail/fn_associated_const.rs:4:1 | ||
| | ||
4 | #[auto_impl(Fn)] | ||
| ^^^^^^^^^^^^^^^^ missing `LEN` in implementation | ||
5 | trait Foo { | ||
6 | const LEN: usize; | ||
| ---------------- `LEN` from trait | ||
| | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0618]: expected function, found `&T` | ||
--> tests/compile-fail/fn_associated_const.rs:4:1 | ||
| | ||
4 | #[auto_impl(Fn)] | ||
| ^^^^^^^^^^^^^^^^ call expression requires function | ||
| | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,14 +1,36 @@ | ||
error: this trait cannot be auto-implemented for Fn-traits (only traits with exactly one method and no other items are allowed) | ||
--> tests/compile-fail/fn_associated_type.rs:5:1 | ||
| | ||
5 | trait Foo { | ||
| ^^^^^ | ||
5 | / trait Foo { | ||
6 | | type Out; | ||
7 | | | ||
8 | | fn a(&self); | ||
9 | | } | ||
| |_^ | ||
|
||
error: the trait `Foo` cannot be auto-implemented for Fn-traits, because it has associated types | ||
|
||
= note: only traits with a single method can be implemented for Fn-traits | ||
|
||
--> tests/compile-fail/fn_associated_type.rs:6:5 | ||
| | ||
6 | type Out; | ||
| ^^^^ | ||
| ^^^^^^^^^ | ||
| | ||
= note: only traits with a single method can be implemented for Fn-traits | ||
|
||
error[E0046]: not all trait items implemented, missing: `Out` | ||
--> tests/compile-fail/fn_associated_type.rs:4:1 | ||
| | ||
4 | #[auto_impl(Fn)] | ||
| ^^^^^^^^^^^^^^^^ missing `Out` in implementation | ||
5 | trait Foo { | ||
6 | type Out; | ||
| -------- `Out` from trait | ||
| | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0618]: expected function, found `&T` | ||
--> tests/compile-fail/fn_associated_type.rs:4:1 | ||
| | ||
4 | #[auto_impl(Fn)] | ||
| ^^^^^^^^^^^^^^^^ call expression requires function | ||
| | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,5 +1,16 @@ | ||
error: this trait cannot be auto-implemented for Fn-traits (only traits with exactly one method and no other items are allowed) | ||
--> tests/compile-fail/fn_multiple_methods.rs:5:1 | ||
| | ||
5 | trait Foo { | ||
| ^^^^^ | ||
5 | / trait Foo { | ||
6 | | fn a(&self); | ||
7 | | fn b(&self); | ||
8 | | } | ||
| |_^ | ||
|
||
error[E0618]: expected function, found `&T` | ||
--> tests/compile-fail/fn_multiple_methods.rs:4:1 | ||
| | ||
4 | #[auto_impl(Fn)] | ||
| ^^^^^^^^^^^^^^^^ call expression requires function | ||
| | ||
= note: this error originates in the attribute macro `auto_impl` (in Nightly builds, run with -Z macro-backtrace for more info) |
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,5 +1,6 @@ | ||
error: `#[auto_impl]` attributes are only allowed on methods | ||
--> tests/compile-fail/keep_default_for_on_assoc_type.rs:6:5 | ||
| | ||
6 | #[auto_impl(keep_default_for(&))] | ||
| ^ | ||
6 | / #[auto_impl(keep_default_for(&))] | ||
7 | | type Foo; | ||
| |_____________^ |
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,8 +1,7 @@ | ||
error: the trait `Foo` cannot be auto-implemented for Arc, because this method has a `&mut self` receiver | ||
|
||
= note: only `&self` and no receiver are allowed | ||
|
||
--> tests/compile-fail/mut_self_for_arc.rs:6:5 | ||
| | ||
6 | fn foo(&mut self); | ||
| ^^ | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: only `&self` and no receiver are allowed |
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,8 +1,7 @@ | ||
error: the trait `Foo` cannot be auto-implemented for immutable references, because this method has a `&mut self` receiver | ||
|
||
= note: only `&self` and no receiver are allowed | ||
|
||
--> tests/compile-fail/mut_self_for_immutable_ref.rs:6:5 | ||
| | ||
6 | fn foo(&mut self); | ||
| ^^ | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: only `&self` and no receiver are allowed |
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,8 +1,7 @@ | ||
error: the trait `Foo` cannot be auto-implemented for Rc, because this method has a `&mut self` receiver | ||
|
||
= note: only `&self` and no receiver are allowed | ||
|
||
--> tests/compile-fail/mut_self_for_rc.rs:6:5 | ||
| | ||
6 | fn foo(&mut self); | ||
| ^^ | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: only `&self` and no receiver are allowed |
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,8 +1,7 @@ | ||
error: the trait `Foo` cannot be auto-implemented for immutable references, because this method has a `self` receiver | ||
|
||
= note: only `&self` and no receiver are allowed | ||
|
||
--> tests/compile-fail/value_self_for_immutable_ref.rs:6:5 | ||
| | ||
6 | fn foo(self); | ||
| ^^ | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: only `&self` and no receiver are allowed |
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,8 +1,7 @@ | ||
error: the trait `Foo` cannot be auto-implemented for mutable references, because this method has a `self` receiver | ||
|
||
= note: only `&self`, `&mut self` and no receiver are allowed | ||
|
||
--> tests/compile-fail/value_self_for_mutable_ref.rs:6:5 | ||
| | ||
6 | fn foo(self); | ||
| ^^ | ||
| ^^^^^^^^^^^^ | ||
| | ||
= note: only `&self`, `&mut self` and no receiver are allowed |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#[auto_impl::auto_impl(&, Arc, Box)] | ||
pub trait Trait { | ||
type Type<'a, T>: Iterator<Item = T> + 'a; | ||
} | ||
|
||
fn main() {} |