feat: pass_by_value lint attribute
Useful for thin wrapper attributes that are best passed as value instead of reference.
This commit is contained in:
parent
66f64a441a
commit
4c3e330a8c
12 changed files with 165 additions and 56 deletions
|
@ -623,6 +623,11 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
|
|||
lang, Normal, template!(NameValueStr: "name"), DuplicatesOk, lang_items,
|
||||
"language items are subject to change",
|
||||
),
|
||||
rustc_attr!(
|
||||
rustc_pass_by_value, Normal,
|
||||
template!(Word, NameValueStr: "reason"), WarnFollowing,
|
||||
"#[rustc_pass_by_value] is used to mark types that must be passed by value instead of reference."
|
||||
),
|
||||
BuiltinAttribute {
|
||||
name: sym::rustc_diagnostic_item,
|
||||
type_: Normal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue