Skip to content

Commit 2e4bdd8

Browse files
author
Allen Hsu
committed
Warn about false positive in test.
1 parent 9723f96 commit 2e4bdd8

3 files changed

+7
-5
lines changed

tests/ui/repeated_where_clauses_or_trait_bounds.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ fn no_error_separate_arg_bounds(program: impl AsRef<()>, dir: impl AsRef<()>, ar
9494

9595
trait GenericTrait<T> {}
9696

97+
// This should not warn but currently does see #8757
9798
fn good_generic<T: GenericTrait<u64> + GenericTrait<u32>>(arg0: T) {
9899
unimplemented!();
99100
}

tests/ui/repeated_where_clauses_or_trait_bounds.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ fn no_error_separate_arg_bounds(program: impl AsRef<()>, dir: impl AsRef<()>, ar
9494

9595
trait GenericTrait<T> {}
9696

97+
// This should not warn but currently does see #8757
9798
fn good_generic<T: GenericTrait<u64> + GenericTrait<u32>>(arg0: T) {
9899
unimplemented!();
99100
}

tests/ui/repeated_where_clauses_or_trait_bounds.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,37 +64,37 @@ LL | T: Clone + Clone + Clone + Copy,
6464
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Clone + Copy`
6565

6666
error: this trait bound is already specified in the where clause
67-
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:97:20
67+
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:98:20
6868
|
6969
LL | fn good_generic<T: GenericTrait<u64> + GenericTrait<u32>>(arg0: T) {
7070
| ^^^^^^^^^^^^^^^^^
7171
|
7272
= help: consider removing this trait bound
7373

7474
error: this trait bound is already specified in the where clause
75-
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:101:19
75+
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:102:19
7676
|
7777
LL | fn bad_generic<T: GenericTrait<u64> + GenericTrait<u32> + GenericTrait<u64>>(arg0: T) {
7878
| ^^^^^^^^^^^^^^^^^
7979
|
8080
= help: consider removing this trait bound
8181

8282
error: these bounds contain repeated elements
83-
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:101:19
83+
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:102:19
8484
|
8585
LL | fn bad_generic<T: GenericTrait<u64> + GenericTrait<u32> + GenericTrait<u64>>(arg0: T) {
8686
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `GenericTrait<u32> + GenericTrait<u64>`
8787

8888
error: this trait bound is already specified in the where clause
89-
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:109:22
89+
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:110:22
9090
|
9191
LL | fn qualified_path<T: std::clone::Clone + Clone + foo::Clone>(arg0: T) {
9292
| ^^^^^^^^^^^^^^^^^
9393
|
9494
= help: consider removing this trait bound
9595

9696
error: these bounds contain repeated elements
97-
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:109:22
97+
--> $DIR/repeated_where_clauses_or_trait_bounds.rs:110:22
9898
|
9999
LL | fn qualified_path<T: std::clone::Clone + Clone + foo::Clone>(arg0: T) {
100100
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Clone + foo::Clone`

0 commit comments

Comments
 (0)