-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually do validation for poly trait refs with ? modifier
- Loading branch information
1 parent
759e07f
commit e356279
Showing
11 changed files
with
62 additions
and
46 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
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,6 +1,5 @@ | ||
struct Foo<T: ?Hash> {} | ||
//~^ ERROR expected trait, found derive macro `Hash` | ||
//~^^ ERROR parameter `T` is never used | ||
//~^^^ WARN relaxing a default bound only does something for `?Sized` | ||
//~| WARN relaxing a default bound only does something for `?Sized` | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fn uwu<T: ?Sized<i32>>() {} | ||
//~^ ERROR trait takes 0 generic arguments but 1 generic argument was supplied | ||
|
||
fn main() {} |
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,11 @@ | ||
error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied | ||
--> $DIR/maybe-bound-generics-deny.rs:1:12 | ||
| | ||
LL | fn uwu<T: ?Sized<i32>>() {} | ||
| ^^^^^----- help: remove the unnecessary generics | ||
| | | ||
| expected 0 generic arguments | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0107`. |
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,7 @@ | ||
trait Trait {} | ||
|
||
fn test<T: ?self::<i32>::Trait>() {} | ||
//~^ ERROR type arguments are not allowed on this type | ||
//~| WARN relaxing a default bound only does something for `?Sized` | ||
|
||
fn main() {} |
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,17 @@ | ||
warning: relaxing a default bound only does something for `?Sized`; all other traits are not bound by default | ||
--> $DIR/maybe-bound-has-path-args.rs:3:12 | ||
| | ||
LL | fn test<T: ?self::<i32>::Trait>() {} | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
|
||
error[E0109]: type arguments are not allowed on this type | ||
--> $DIR/maybe-bound-has-path-args.rs:3:20 | ||
| | ||
LL | fn test<T: ?self::<i32>::Trait>() {} | ||
| ---- ^^^ type argument not allowed | ||
| | | ||
| not allowed on this type | ||
|
||
error: aborting due to 1 previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0109`. |