diff options
| author | bors <bors@rust-lang.org> | 2023-02-22 12:04:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-22 12:04:45 +0000 |
| commit | 3b4d6e080404560f63599deeb328dfa27fe081a6 (patch) | |
| tree | 0404fed1412000d50e1807cda997649437aa7220 /src | |
| parent | bd4a96a12d0bf6dc12edf20a45df3a33052c9d7d (diff) | |
| parent | 0d0de4971e2b134549f5e8019cbc06dadc5596ca (diff) | |
| download | rust-3b4d6e080404560f63599deeb328dfa27fe081a6.tar.gz rust-3b4d6e080404560f63599deeb328dfa27fe081a6.zip | |
Auto merge of #108339 - GuillaumeGomez:rollup-4z02kas, r=GuillaumeGomez
Rollup of 8 pull requests Successful merges: - #108110 (Move some `InferCtxt` methods to `EvalCtxt` in new solver) - #108168 (Fix ICE on type alias in recursion) - #108230 (Convert a hard-warning about named static lifetimes into lint "unused_lifetimes") - #108239 (Fix overlapping spans in removing extra arguments) - #108246 (Add an InstCombine for redundant casts) - #108264 (no-fail-fast support for tool testsuites) - #108310 (rustdoc: Fix duplicated attributes for first reexport) - #108318 (Remove unused FileDesc::get_cloexec) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/test.rs | 12 | ||||
| -rw-r--r-- | src/librustdoc/clean/mod.rs | 24 |
2 files changed, 29 insertions, 7 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 9cd6107b43a..b4f1506dc8f 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -435,6 +435,10 @@ impl Step for Rustfmt { &[], ); + if !builder.fail_fast { + cargo.arg("--no-fail-fast"); + } + let dir = testdir(builder, compiler.host); t!(fs::create_dir_all(&dir)); cargo.env("RUSTFMT_TEST_DIR", dir); @@ -615,6 +619,10 @@ impl Step for Miri { ); cargo.add_rustc_lib_path(builder, compiler); + if !builder.fail_fast { + cargo.arg("--no-fail-fast"); + } + // miri tests need to know about the stage sysroot cargo.env("MIRI_SYSROOT", &miri_sysroot); cargo.env("MIRI_HOST_SYSROOT", sysroot); @@ -746,6 +754,10 @@ impl Step for Clippy { &[], ); + if !builder.fail_fast { + cargo.arg("--no-fail-fast"); + } + cargo.env("RUSTC_TEST_SUITE", builder.rustc(compiler)); cargo.env("RUSTC_LIB_PATH", builder.rustc_libdir(compiler)); let host_libs = builder.stage_out(compiler, Mode::ToolRustc).join(builder.cargo_dir()); diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 0c70d31ed60..5541136ef49 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2114,17 +2114,29 @@ fn get_all_import_attributes<'hir>( attributes: &mut Vec<ast::Attribute>, is_inline: bool, ) { + let mut first = true; let hir_map = tcx.hir(); let mut visitor = OneLevelVisitor::new(hir_map, target_def_id); let mut visited = FxHashSet::default(); + // If the item is an import and has at least a path with two parts, we go into it. while let hir::ItemKind::Use(path, _) = item.kind && visited.insert(item.hir_id()) { - // We add the attributes from this import into the list. - add_without_unwanted_attributes(attributes, hir_map.attrs(item.hir_id()), is_inline); + if first { + // This is the "original" reexport so we get all its attributes without filtering them. + attributes.extend_from_slice(hir_map.attrs(item.hir_id())); + first = false; + } else { + add_without_unwanted_attributes(attributes, hir_map.attrs(item.hir_id()), is_inline); + } - let def_id = if path.segments.len() > 1 { - match path.segments[path.segments.len() - 2].res { + let def_id = if let [.., parent_segment, _] = &path.segments { + match parent_segment.res { hir::def::Res::Def(_, def_id) => def_id, + _ if parent_segment.ident.name == kw::Crate => { + // In case the "parent" is the crate, it'll give `Res::Err` so we need to + // circumvent it this way. + tcx.parent(item.owner_id.def_id.to_def_id()) + } _ => break, } } else { @@ -2341,9 +2353,7 @@ fn clean_maybe_renamed_item<'tcx>( if let Some(import_id) = import_id && let Some(hir::Node::Item(use_node)) = cx.tcx.hir().find_by_def_id(import_id) { - // First, we add the attributes from the current import. - extra_attrs.extend_from_slice(inline::load_attrs(cx, import_id.to_def_id())); - let is_inline = extra_attrs.lists(sym::doc).get_word_attr(sym::inline).is_some(); + let is_inline = inline::load_attrs(cx, import_id.to_def_id()).lists(sym::doc).get_word_attr(sym::inline).is_some(); // Then we get all the various imports' attributes. get_all_import_attributes(use_node, cx.tcx, item.owner_id.def_id, &mut extra_attrs, is_inline); add_without_unwanted_attributes(&mut extra_attrs, inline::load_attrs(cx, def_id), is_inline); |
