1
Fork 0

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:
Mahdi Dibaiee 2022-01-07 11:38:16 +00:00
parent 66f64a441a
commit 4c3e330a8c
No known key found for this signature in database
GPG key ID: BABA115BDF0C598A
12 changed files with 165 additions and 56 deletions

View file

@ -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,