diff options
| author | bors <bors@rust-lang.org> | 2025-07-03 19:59:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-07-03 19:59:09 +0000 |
| commit | da58c051315268a197ce280f6ba07bbd03c66535 (patch) | |
| tree | d4e8490322e7fae28ddacd47d4fa6861af392fc2 /src | |
| parent | 48aee7e383503c234cce4206dee9f19f57edb617 (diff) | |
| parent | 9092fbbee1080a2aae02120f823012a48df68f84 (diff) | |
| download | rust-da58c051315268a197ce280f6ba07bbd03c66535.tar.gz rust-da58c051315268a197ce280f6ba07bbd03c66535.zip | |
Auto merge of #143390 - GuillaumeGomez:rollup-2avj41s, r=GuillaumeGomez
Rollup of 5 pull requests
Successful merges:
- rust-lang/rust#141831 (rustdoc: fix attrs of locally reexported foreign items)
- rust-lang/rust#143364 (don't include `.md` in title)
- rust-lang/rust#143369 (Various refactorings to the metadata loader)
- rust-lang/rust#143379 (Post {beta,stable}-accepted notifications to compiler/bootstrap backport zulip channels on `{beta,stable}-accepted` label application)
- rust-lang/rust#143384 (Update browser-ui-test version to `0.21.1`)
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version | 2 | ||||
| -rw-r--r-- | src/doc/rustc/src/SUMMARY.md | 2 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 19 | ||||
| -rw-r--r-- | src/librustdoc/visit_ast.rs | 20 | ||||
| -rw-r--r-- | src/tools/rustdoc-gui/tester.js | 2 |
5 files changed, 29 insertions, 16 deletions
diff --git a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version index f8d54d44557..b9f8e558df4 100644 --- a/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version +++ b/src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version @@ -1 +1 @@ -0.20.7 \ No newline at end of file +0.21.1 \ No newline at end of file diff --git a/src/doc/rustc/src/SUMMARY.md b/src/doc/rustc/src/SUMMARY.md index 201a5503079..9fe4c218121 100644 --- a/src/doc/rustc/src/SUMMARY.md +++ b/src/doc/rustc/src/SUMMARY.md @@ -130,7 +130,7 @@ - [\*-win7-windows-msvc](platform-support/win7-windows-msvc.md) - [x86_64-fortanix-unknown-sgx](platform-support/x86_64-fortanix-unknown-sgx.md) - [x86_64-pc-cygwin](platform-support/x86_64-pc-cygwin.md) - - [x86_64-unknown-linux-none.md](platform-support/x86_64-unknown-linux-none.md) + - [x86_64-unknown-linux-none](platform-support/x86_64-unknown-linux-none.md) - [x86_64-unknown-none](platform-support/x86_64-unknown-none.md) - [xtensa-\*-none-elf](platform-support/xtensa.md) - [\*-nuttx-\*](platform-support/nuttx.md) diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 93d0e76b56f..2ab827b3ace 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -66,8 +66,8 @@ use crate::visit_ast::Module as DocModule; pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<'tcx>) -> Item { let mut items: Vec<Item> = vec![]; let mut inserted = FxHashSet::default(); - items.extend(doc.foreigns.iter().map(|(item, renamed)| { - let item = clean_maybe_renamed_foreign_item(cx, item, *renamed); + items.extend(doc.foreigns.iter().map(|(item, renamed, import_id)| { + let item = clean_maybe_renamed_foreign_item(cx, item, *renamed, *import_id); if let Some(name) = item.name && (cx.render_options.document_hidden || !item.is_doc_hidden()) { @@ -89,7 +89,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext< Some(item) })); - // Split up imports from all other items. + // Split up glob imports from all other items. // // This covers the case where somebody does an import which should pull in an item, // but there's already an item with the same namespace and same name. Rust gives @@ -2762,7 +2762,6 @@ fn clean_maybe_renamed_item<'tcx>( import_id: Option<LocalDefId>, ) -> Vec<Item> { use hir::ItemKind; - fn get_name( cx: &DocContext<'_>, item: &hir::Item<'_>, @@ -2974,6 +2973,7 @@ fn clean_extern_crate<'tcx>( && !cx.is_json_output(); let krate_owner_def_id = krate.owner_id.def_id; + if please_inline && let Some(items) = inline::try_inline( cx, @@ -3135,6 +3135,7 @@ fn clean_maybe_renamed_foreign_item<'tcx>( cx: &mut DocContext<'tcx>, item: &hir::ForeignItem<'tcx>, renamed: Option<Symbol>, + import_id: Option<LocalDefId>, ) -> Item { let def_id = item.owner_id.to_def_id(); cx.with_param_env(def_id, |cx| { @@ -3150,11 +3151,13 @@ fn clean_maybe_renamed_foreign_item<'tcx>( hir::ForeignItemKind::Type => ForeignTypeItem, }; - Item::from_def_id_and_parts( - item.owner_id.def_id.to_def_id(), - Some(renamed.unwrap_or(item.ident.name)), - kind, + generate_item_with_correct_attrs( cx, + kind, + item.owner_id.def_id.to_def_id(), + item.ident.name, + import_id, + renamed, ) }) } diff --git a/src/librustdoc/visit_ast.rs b/src/librustdoc/visit_ast.rs index 5b52e785b8f..2889bfae7b0 100644 --- a/src/librustdoc/visit_ast.rs +++ b/src/librustdoc/visit_ast.rs @@ -38,9 +38,18 @@ pub(crate) struct Module<'hir> { (LocalDefId, Option<Symbol>), (&'hir hir::Item<'hir>, Option<Symbol>, Option<LocalDefId>), >, - /// Same as for `items`. + + /// (def_id, renamed) -> (res, local_import_id) + /// + /// `inlined_foreigns` only contains `extern` items + /// that are cross-crate inlined. + /// + /// Locally inlined `extern` items are + /// stored in `foreigns` with the `import_id` set, + /// analogous to how `items` is. pub(crate) inlined_foreigns: FxIndexMap<(DefId, Option<Symbol>), (Res, LocalDefId)>, - pub(crate) foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option<Symbol>)>, + /// (item, renamed, import_id) + pub(crate) foreigns: Vec<(&'hir hir::ForeignItem<'hir>, Option<Symbol>, Option<LocalDefId>)>, } impl Module<'_> { @@ -327,7 +336,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { } Node::ForeignItem(it) if !glob => { let prev = mem::replace(&mut self.inlining, true); - self.visit_foreign_item_inner(it, renamed); + self.visit_foreign_item_inner(it, renamed, Some(def_id)); self.inlining = prev; true } @@ -432,7 +441,7 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { hir::ItemKind::ForeignMod { items, .. } => { for item in items { let item = tcx.hir_foreign_item(item.id); - self.visit_foreign_item_inner(item, None); + self.visit_foreign_item_inner(item, None, None); } } // If we're inlining, skip private items. @@ -527,10 +536,11 @@ impl<'a, 'tcx> RustdocVisitor<'a, 'tcx> { &mut self, item: &'tcx hir::ForeignItem<'_>, renamed: Option<Symbol>, + import_id: Option<LocalDefId>, ) { // If inlining we only want to include public functions. if !self.inlining || self.cx.tcx.visibility(item.owner_id).is_public() { - self.modules.last_mut().unwrap().foreigns.push((item, renamed)); + self.modules.last_mut().unwrap().foreigns.push((item, renamed, import_id)); } } diff --git a/src/tools/rustdoc-gui/tester.js b/src/tools/rustdoc-gui/tester.js index ff87b76aa45..9dc32f335a8 100644 --- a/src/tools/rustdoc-gui/tester.js +++ b/src/tools/rustdoc-gui/tester.js @@ -196,7 +196,7 @@ async function main(argv) { // This is more convenient that setting fields one by one. const args = [ "--variable", "DOC_PATH", opts["doc_folder"].split("\\").join("/"), - "--enable-fail-on-js-error", "--allow-file-access-from-files", + "--allow-file-access-from-files", ]; if (opts["debug"]) { debug = true; |
