Skip to content

Rollup of 7 pull requests #138611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Mar 17, 2025
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d183da6
Install licenses into `share/doc/rust/licenses`
cuviper Mar 12, 2025
bca5f56
Add a mir-opt test that demonstrates user type annotations
Zalathar Feb 23, 2025
977106a
Simplify handling of `visibility_scope` in `declare_bindings`
Zalathar Feb 16, 2025
7805b46
Split `visit_primary_bindings` into two variants
Zalathar Feb 15, 2025
5434242
Build `UserTypeProjections` lazily when visiting bindings
Zalathar Feb 20, 2025
2439623
Make ControlFlow must_use
compiler-errors Feb 22, 2025
380ce74
Suppress must_use in compiler and tools
compiler-errors Feb 22, 2025
e250bd1
Suppress must_use for ControlFlow in rust-analyzer
compiler-errors Feb 22, 2025
2ff2815
rustdoc-json: Add tests for `#[deprecated(...)]`
aDotInTheVoid Mar 16, 2025
a8a913d
rustdoc: Rename `Item::attributes` param to `is_json`
aDotInTheVoid Mar 16, 2025
677489f
rustdoc-json: Don't also include `#[deprecated]` in `Item::attrs`
aDotInTheVoid Mar 16, 2025
87457f6
Inline and remove `LoweringContext::new_named_lifetime_with_res`.
nnethercote Mar 17, 2025
fe4d144
Avoid double lowering of lifetime identifiers.
nnethercote Mar 17, 2025
6496d69
Make the `match` in `new_named_lifetime` exhaustive.
nnethercote Mar 17, 2025
adf2bb7
Avoid double lowering of generic identifiers.
nnethercote Mar 17, 2025
b30cf11
Emit function declarations for functions with #[linkage="extern_weak"]
1c3t3a Mar 11, 2025
292c622
Stabilize asm_goto
nbdd0121 Dec 2, 2024
3d3f817
Rollup merge of #133870 - nbdd0121:asm, r=traviscross,nnethercote
matthiaskrgr Mar 17, 2025
9adf218
Rollup merge of #137449 - compiler-errors:control-flow, r=Amanieu,lni…
matthiaskrgr Mar 17, 2025
fd4ad33
Rollup merge of #137465 - Zalathar:visit-primary, r=oli-obk
matthiaskrgr Mar 17, 2025
8f5c09b
Rollup merge of #138349 - 1c3t3a:external-weak-cfi, r=rcvalle
matthiaskrgr Mar 17, 2025
78d141f
Rollup merge of #138412 - cuviper:licenses, r=jieyouxu
matthiaskrgr Mar 17, 2025
b15e663
Rollup merge of #138577 - aDotInTheVoid:deprecate-deprecations, r=Gui…
matthiaskrgr Mar 17, 2025
1e58d51
Rollup merge of #138588 - nnethercote:avoid-double-lower_ident, r=com…
matthiaskrgr Mar 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustdoc: Rename Item::attributes param to is_json
This makes it clearer what it's actually used for, and makes it easier
to think about modifying `Item::attributes`.
  • Loading branch information
aDotInTheVoid committed Mar 16, 2025
commit a8a913dcd23c75744486773e491a18af0555cdd8
12 changes: 4 additions & 8 deletions src/librustdoc/clean/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,7 @@ impl Item {
Some(tcx.visibility(def_id))
}

pub(crate) fn attributes(
&self,
tcx: TyCtxt<'_>,
cache: &Cache,
keep_as_is: bool,
) -> Vec<String> {
pub(crate) fn attributes(&self, tcx: TyCtxt<'_>, cache: &Cache, is_json: bool) -> Vec<String> {
const ALLOWED_ATTRIBUTES: &[Symbol] =
&[sym::export_name, sym::link_section, sym::no_mangle, sym::non_exhaustive];

Expand All @@ -772,7 +767,7 @@ impl Item {
.other_attrs
.iter()
.filter_map(|attr| {
if keep_as_is {
if is_json {
Some(rustc_hir_pretty::attribute_to_string(&tcx, attr))
} else if ALLOWED_ATTRIBUTES.contains(&attr.name_or_empty()) {
Some(
Expand All @@ -786,7 +781,8 @@ impl Item {
}
})
.collect();
if !keep_as_is

if !is_json
&& let Some(def_id) = self.def_id()
&& let ItemType::Struct | ItemType::Enum | ItemType::Union = self.type_()
{
Expand Down