Auto merge of #50205 - topecongiro:include-parens-to-type-parameter, r=petrochenkov
Include parens to type parameter The motivation of this PR is to fix a bug in rustfmt (cc https://github.com/rust-lang-nursery/rustfmt/issues/2630).
This commit is contained in:
commit
a805a2a5eb
3 changed files with 19 additions and 18 deletions
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
trait Tr: ?Sized {} //~ ERROR `?Trait` is not permitted in supertraits
|
||||
|
||||
type A1 = Tr + ?Sized; //~ ERROR `?Trait` is not permitted in trait object types
|
||||
type A2 = for<'a> Tr + ?Sized; //~ ERROR `?Trait` is not permitted in trait object types
|
||||
type A1 = Tr + (?Sized); //~ ERROR `?Trait` is not permitted in trait object types
|
||||
type A2 = for<'a> Tr + (?Sized); //~ ERROR `?Trait` is not permitted in trait object types
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,22 @@
|
|||
error: `?Trait` is not permitted in supertraits
|
||||
--> $DIR/maybe-bounds.rs:11:12
|
||||
--> $DIR/maybe-bounds.rs:11:11
|
||||
|
|
||||
LL | trait Tr: ?Sized {} //~ ERROR `?Trait` is not permitted in supertraits
|
||||
| ^^^^^
|
||||
| ^^^^^^
|
||||
|
|
||||
= note: traits are `?Sized` by default
|
||||
|
||||
error: `?Trait` is not permitted in trait object types
|
||||
--> $DIR/maybe-bounds.rs:13:17
|
||||
--> $DIR/maybe-bounds.rs:13:16
|
||||
|
|
||||
LL | type A1 = Tr + ?Sized; //~ ERROR `?Trait` is not permitted in trait object types
|
||||
| ^^^^^
|
||||
LL | type A1 = Tr + (?Sized); //~ ERROR `?Trait` is not permitted in trait object types
|
||||
| ^^^^^^^^
|
||||
|
||||
error: `?Trait` is not permitted in trait object types
|
||||
--> $DIR/maybe-bounds.rs:14:25
|
||||
--> $DIR/maybe-bounds.rs:14:24
|
||||
|
|
||||
LL | type A2 = for<'a> Tr + ?Sized; //~ ERROR `?Trait` is not permitted in trait object types
|
||||
| ^^^^^
|
||||
LL | type A2 = for<'a> Tr + (?Sized); //~ ERROR `?Trait` is not permitted in trait object types
|
||||
| ^^^^^^^^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue