Skip to content

Rollup of 3 pull requests #131412

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 6 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/ci/docker/scripts/rfl-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -euo pipefail

LINUX_VERSION=4c7864e81d8bbd51036dacf92fb0a400e13aaeee
LINUX_VERSION=v6.12-rc2

# Build rustc, rustdoc, cargo, clippy-driver and rustfmt
../x.py build --stage 2 library rustdoc clippy rustfmt
Expand Down
6 changes: 2 additions & 4 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ impl LinkCollector<'_, '_> {
// valid omission. See https://github.com/rust-lang/rust/pull/80660#discussion_r551585677
// for discussion on the matter.
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 {
match disambiguator {
Some(Disambiguator::Primitive | Disambiguator::Namespace(_)) | None => {}
Expand Down Expand Up @@ -1102,7 +1102,6 @@ impl LinkCollector<'_, '_> {
kind_for_dis,
id_for_dis,
disambiguator,
item,
&diag_info,
)?;

Expand All @@ -1123,7 +1122,6 @@ impl LinkCollector<'_, '_> {
kind: DefKind,
id: DefId,
disambiguator: Option<Disambiguator>,
item: &Item,
diag_info: &DiagnosticInfo<'_>,
) -> Option<()> {
debug!("intra-doc link to {path_str} resolved to {:?}", (kind, id));
Expand All @@ -1150,7 +1148,7 @@ impl LinkCollector<'_, '_> {

// 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| {
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)
&& !self.cx.tcx.effective_visibilities(()).is_exported(dst_id)
Expand Down
4 changes: 2 additions & 2 deletions src/tools/compiletest/src/command-list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"ignore-cdb",
"ignore-compare-mode-next-solver",
"ignore-compare-mode-polonius",
"ignore-coverage-map",
"ignore-coverage-run",
"ignore-cross-compile",
"ignore-debug",
"ignore-eabi",
Expand All @@ -64,8 +66,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
"ignore-loongarch64",
"ignore-macabi",
"ignore-macos",
"ignore-mode-coverage-map",
"ignore-mode-coverage-run",
"ignore-msp430",
"ignore-msvc",
"ignore-musl",
Expand Down
9 changes: 3 additions & 6 deletions src/tools/compiletest/src/header/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,10 @@ pub(super) fn parse_cfg_name_directive<'a>(
}
// 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
// with "ignore-mode-coverage-map" or "ignore-mode-coverage-run".
// with "ignore-coverage-map" or "ignore-coverage-run".
condition! {
name: format!("mode-{}", config.mode.to_str()),
allowed_names: ContainsPrefixed {
prefix: "mode-",
inner: ["coverage-run", "coverage-map"],
},
name: config.mode.to_str(),
allowed_names: ["coverage-map", "coverage-run"],
message: "when the test mode is {name}",
}

Expand Down
20 changes: 9 additions & 11 deletions src/tools/compiletest/src/header/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,17 +572,15 @@ fn families() {
}

#[test]
fn ignore_mode() {
for mode in ["coverage-map", "coverage-run"] {
// Indicate profiler support so that "coverage-run" tests aren't skipped.
let config: Config = cfg().mode(mode).profiler_support(true).build();
let other = if mode == "coverage-run" { "coverage-map" } else { "coverage-run" };

assert_ne!(mode, other);

assert!(check_ignore(&config, &format!("//@ ignore-mode-{mode}")));
assert!(!check_ignore(&config, &format!("//@ ignore-mode-{other}")));
}
fn ignore_coverage() {
// Indicate profiler support so that "coverage-run" tests aren't skipped.
let config = cfg().mode("coverage-map").profiler_support(true).build();
assert!(check_ignore(&config, "//@ ignore-coverage-map"));
assert!(!check_ignore(&config, "//@ ignore-coverage-run"));

let config = cfg().mode("coverage-run").profiler_support(true).build();
assert!(!check_ignore(&config, "//@ ignore-coverage-map"));
assert!(check_ignore(&config, "//@ ignore-coverage-run"));
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion tests/coverage/color.coverage
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
LL| |//@ edition: 2021
LL| |//@ ignore-mode-coverage-map
LL| |//@ ignore-coverage-map
LL| |//@ ignore-windows
LL| |//@ llvm-cov-flags: --use-color
LL| |
Expand Down
2 changes: 1 addition & 1 deletion tests/coverage/color.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ edition: 2021
//@ ignore-mode-coverage-map
//@ ignore-coverage-map
//@ ignore-windows
//@ llvm-cov-flags: --use-color

Expand Down
2 changes: 1 addition & 1 deletion tests/coverage/ignore_map.coverage
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LL| |//@ ignore-mode-coverage-map
LL| |//@ ignore-coverage-map
LL| |
LL| 1|fn main() {}

2 changes: 1 addition & 1 deletion tests/coverage/ignore_map.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@ ignore-mode-coverage-map
//@ ignore-coverage-map

fn main() {}
2 changes: 1 addition & 1 deletion tests/coverage/ignore_run.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//@ ignore-mode-coverage-run
//@ ignore-coverage-run

fn main() {}
Loading