rustc_pass_by_value lint: add test on custom types

This commit is contained in:
Mahdi Dibaiee 2022-01-10 08:54:42 +00:00
parent 4c3e330a8c
commit 91ed6892f7
No known key found for this signature in database
GPG key ID: BABA115BDF0C598A
4 changed files with 82 additions and 22 deletions

View file

@ -11,6 +11,7 @@ declare_tool_lint! {
/// The `rustc_pass_by_value` lint marks a type with `#[rustc_pass_by_value]` requiring it to always be passed by value.
/// This is usually used for types that are thin wrappers around references, so there is no benefit to an extra
/// layer of indirection. (Example: `Ty` which is a reference to a `TyS`)
/// This lint relies on `#[rustc_diagnostic_item]` being available for the target.
pub rustc::PASS_BY_VALUE,
Warn,
"pass by reference of a type flagged as `#[rustc_pass_by_value]`",