Auto merge of #131412 - matthiaskrgr:rollup-478o6h6, r=matthiaskrgr

Rollup of 3 pull requests

Successful merges:

 - #131378 (CI: rfl: move job forward to Linux v6.12-rc2)
 - #131400 (Simplify the compiletest directives for ignoring coverage-test modes)
 - #131408 (Remove unneeded argument of `LinkCollector::verify_disambiguator`)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2024-10-08 20:45:49 +00:00
commit 6f4ae0f345
10 changed files with 21 additions and 28 deletions

View File

@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
LINUX_VERSION=4c7864e81d8bbd51036dacf92fb0a400e13aaeee LINUX_VERSION=v6.12-rc2
# Build rustc, rustdoc, cargo, clippy-driver and rustfmt # Build rustc, rustdoc, cargo, clippy-driver and rustfmt
../x.py build --stage 2 library rustdoc clippy rustfmt ../x.py build --stage 2 library rustdoc clippy rustfmt

View File

@ -1073,7 +1073,7 @@ fn resolve_link(
// valid omission. See https://github.com/rust-lang/rust/pull/80660#discussion_r551585677 // valid omission. See https://github.com/rust-lang/rust/pull/80660#discussion_r551585677
// for discussion on the matter. // for discussion on the matter.
let kind = self.cx.tcx.def_kind(id); let kind = self.cx.tcx.def_kind(id);
self.verify_disambiguator(path_str, kind, id, disambiguator, item, &diag_info)?; self.verify_disambiguator(path_str, kind, id, disambiguator, &diag_info)?;
} else { } else {
match disambiguator { match disambiguator {
Some(Disambiguator::Primitive | Disambiguator::Namespace(_)) | None => {} Some(Disambiguator::Primitive | Disambiguator::Namespace(_)) | None => {}
@ -1102,7 +1102,6 @@ fn resolve_link(
kind_for_dis, kind_for_dis,
id_for_dis, id_for_dis,
disambiguator, disambiguator,
item,
&diag_info, &diag_info,
)?; )?;
@ -1123,7 +1122,6 @@ fn verify_disambiguator(
kind: DefKind, kind: DefKind,
id: DefId, id: DefId,
disambiguator: Option<Disambiguator>, disambiguator: Option<Disambiguator>,
item: &Item,
diag_info: &DiagnosticInfo<'_>, diag_info: &DiagnosticInfo<'_>,
) -> Option<()> { ) -> Option<()> {
debug!("intra-doc link to {path_str} resolved to {:?}", (kind, id)); debug!("intra-doc link to {path_str} resolved to {:?}", (kind, id));
@ -1150,7 +1148,7 @@ fn verify_disambiguator(
// item can be non-local e.g. when using `#[rustc_doc_primitive = "pointer"]` // item can be non-local e.g. when using `#[rustc_doc_primitive = "pointer"]`
if let Some((src_id, dst_id)) = id.as_local().and_then(|dst_id| { if let Some((src_id, dst_id)) = id.as_local().and_then(|dst_id| {
item.item_id.expect_def_id().as_local().map(|src_id| (src_id, dst_id)) diag_info.item.item_id.expect_def_id().as_local().map(|src_id| (src_id, dst_id))
}) { }) {
if self.cx.tcx.effective_visibilities(()).is_exported(src_id) if self.cx.tcx.effective_visibilities(()).is_exported(src_id)
&& !self.cx.tcx.effective_visibilities(()).is_exported(dst_id) && !self.cx.tcx.effective_visibilities(()).is_exported(dst_id)

View File

@ -42,6 +42,8 @@
"ignore-cdb", "ignore-cdb",
"ignore-compare-mode-next-solver", "ignore-compare-mode-next-solver",
"ignore-compare-mode-polonius", "ignore-compare-mode-polonius",
"ignore-coverage-map",
"ignore-coverage-run",
"ignore-cross-compile", "ignore-cross-compile",
"ignore-debug", "ignore-debug",
"ignore-eabi", "ignore-eabi",
@ -64,8 +66,6 @@
"ignore-loongarch64", "ignore-loongarch64",
"ignore-macabi", "ignore-macabi",
"ignore-macos", "ignore-macos",
"ignore-mode-coverage-map",
"ignore-mode-coverage-run",
"ignore-msp430", "ignore-msp430",
"ignore-msvc", "ignore-msvc",
"ignore-musl", "ignore-musl",

View File

@ -217,13 +217,10 @@ macro_rules! condition {
} }
// Coverage tests run the same test file in multiple modes. // Coverage tests run the same test file in multiple modes.
// If a particular test should not be run in one of the modes, ignore it // If a particular test should not be run in one of the modes, ignore it
// with "ignore-mode-coverage-map" or "ignore-mode-coverage-run". // with "ignore-coverage-map" or "ignore-coverage-run".
condition! { condition! {
name: format!("mode-{}", config.mode.to_str()), name: config.mode.to_str(),
allowed_names: ContainsPrefixed { allowed_names: ["coverage-map", "coverage-run"],
prefix: "mode-",
inner: ["coverage-run", "coverage-map"],
},
message: "when the test mode is {name}", message: "when the test mode is {name}",
} }

View File

@ -572,17 +572,15 @@ fn families() {
} }
#[test] #[test]
fn ignore_mode() { fn ignore_coverage() {
for mode in ["coverage-map", "coverage-run"] { // Indicate profiler support so that "coverage-run" tests aren't skipped.
// Indicate profiler support so that "coverage-run" tests aren't skipped. let config = cfg().mode("coverage-map").profiler_support(true).build();
let config: Config = cfg().mode(mode).profiler_support(true).build(); assert!(check_ignore(&config, "//@ ignore-coverage-map"));
let other = if mode == "coverage-run" { "coverage-map" } else { "coverage-run" }; assert!(!check_ignore(&config, "//@ ignore-coverage-run"));
assert_ne!(mode, other); let config = cfg().mode("coverage-run").profiler_support(true).build();
assert!(!check_ignore(&config, "//@ ignore-coverage-map"));
assert!(check_ignore(&config, &format!("//@ ignore-mode-{mode}"))); assert!(check_ignore(&config, "//@ ignore-coverage-run"));
assert!(!check_ignore(&config, &format!("//@ ignore-mode-{other}")));
}
} }
#[test] #[test]

View File

@ -1,5 +1,5 @@
LL| |//@ edition: 2021 LL| |//@ edition: 2021
LL| |//@ ignore-mode-coverage-map LL| |//@ ignore-coverage-map
LL| |//@ ignore-windows LL| |//@ ignore-windows
LL| |//@ llvm-cov-flags: --use-color LL| |//@ llvm-cov-flags: --use-color
LL| | LL| |

View File

@ -1,5 +1,5 @@
//@ edition: 2021 //@ edition: 2021
//@ ignore-mode-coverage-map //@ ignore-coverage-map
//@ ignore-windows //@ ignore-windows
//@ llvm-cov-flags: --use-color //@ llvm-cov-flags: --use-color

View File

@ -1,4 +1,4 @@
LL| |//@ ignore-mode-coverage-map LL| |//@ ignore-coverage-map
LL| | LL| |
LL| 1|fn main() {} LL| 1|fn main() {}

View File

@ -1,3 +1,3 @@
//@ ignore-mode-coverage-map //@ ignore-coverage-map
fn main() {} fn main() {}

View File

@ -1,3 +1,3 @@
//@ ignore-mode-coverage-run //@ ignore-coverage-run
fn main() {} fn main() {}