Rollup merge of #86277 - jsha:remove-must-use, r=Manishearth

Remove must_use from ALLOWED_ATTRIBUTES

This is a fairly common attribute on methods, but is not something you need to know when reading the method docs - the purpose of the attribute is for the compiler to tell you about it if you forget to use a value.

Removing reclaims some valuable space in the summary of methods, particularly when the attribute has a long string value.

As discussed in #84309. Partially addresses #81482.

r? ```@Manishearth```
This commit is contained in:
Yuki Okushi
2021-06-15 17:40:12 +09:00
committed by GitHub
5 changed files with 3 additions and 50 deletions

View File

@@ -965,14 +965,8 @@ fn render_assoc_item(
}
}
const ALLOWED_ATTRIBUTES: &[Symbol] = &[
sym::export_name,
sym::link_section,
sym::must_use,
sym::no_mangle,
sym::repr,
sym::non_exhaustive,
];
const ALLOWED_ATTRIBUTES: &[Symbol] =
&[sym::export_name, sym::link_section, sym::no_mangle, sym::repr, sym::non_exhaustive];
fn attributes(it: &clean::Item) -> Vec<String> {
it.attrs