-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests, only lint for public tests
- Loading branch information
Showing
8 changed files
with
50 additions
and
19 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
avoid-breaking-exported-api = false |
16 changes: 16 additions & 0 deletions
16
tests/ui-toml/impl_trait_in_params/impl_trait_in_params.rs
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,16 @@ | ||
//! As avoid-breaking-exported-api is `false`, nothing here should lint | ||
#![warn(clippy::impl_trait_in_params)] | ||
#![no_main] | ||
//@no-rustfix | ||
|
||
pub trait Trait {} | ||
|
||
trait Private { | ||
fn t(_: impl Trait); | ||
fn tt<T: Trait>(_: T); | ||
} | ||
|
||
pub trait Public { | ||
fn t(_: impl Trait); //~ ERROR: `impl Trait` used as a function parameter | ||
fn tt<T: Trait>(_: T); | ||
} |
15 changes: 15 additions & 0 deletions
15
tests/ui-toml/impl_trait_in_params/impl_trait_in_params.stderr
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,15 @@ | ||
error: `impl Trait` used as a function parameter | ||
--> $DIR/impl_trait_in_params.rs:14:13 | ||
| | ||
LL | fn t(_: impl Trait); | ||
| ^^^^^^^^^^ | ||
| | ||
= note: `-D clippy::impl-trait-in-params` implied by `-D warnings` | ||
= help: to override `-D warnings` add `#[allow(clippy::impl_trait_in_params)]` | ||
help: add a type parameter | ||
| | ||
LL | fn t<{ /* Generic name */ }: Trait>(_: impl Trait); | ||
| +++++++++++++++++++++++++++++++ | ||
|
||
error: aborting due to previous error | ||
|
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
tests/ui-toml/impl_trait_in_params/true/impl_trait_in_params.rs
This file was deleted.
Oops, something went wrong.
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