Skip to content
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

Rollup of 5 pull requests #131536

Closed
wants to merge 10 commits into from
48 changes: 24 additions & 24 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5804,16 +5804,16 @@ checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"

[[package]]
name = "wasm-component-ld"
version = "0.5.9"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fde17bc96539700198e12516230c76095cc215c84ef39ad206e1af3f84243e0f"
checksum = "4d4aa6bd7fbe7cffbed29fe3e236fda74419def1bdef6f80f989ec51137edf44"
dependencies = [
"anyhow",
"clap",
"lexopt",
"tempfile",
"wasi-preview1-component-adapter-provider",
"wasmparser 0.218.0",
"wasmparser 0.219.0",
"wat",
"wit-component",
"wit-parser",
Expand All @@ -5837,28 +5837,28 @@ dependencies = [

[[package]]
name = "wasm-encoder"
version = "0.218.0"
version = "0.219.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22b896fa8ceb71091ace9bcb81e853f54043183a1c9667cf93422c40252ffa0a"
checksum = "e2b1b95711b3ad655656a341e301cc64e33cbee94de9a99a1c5a2ab88efab79d"
dependencies = [
"leb128",
"wasmparser 0.218.0",
"wasmparser 0.219.0",
]

[[package]]
name = "wasm-metadata"
version = "0.218.0"
version = "0.219.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa5eeb071abe8a2132fdd5565dabffee70775ee8c24fc7e300ac43f51f4a8a91"
checksum = "96132fe00dd17d092d2be289eeed5a0a68ad3cf30b68e8875bc953b96f55f0be"
dependencies = [
"anyhow",
"indexmap",
"serde",
"serde_derive",
"serde_json",
"spdx",
"wasm-encoder 0.218.0",
"wasmparser 0.218.0",
"wasm-encoder 0.219.0",
"wasmparser 0.219.0",
]

[[package]]
Expand All @@ -5873,9 +5873,9 @@ dependencies = [

[[package]]
name = "wasmparser"
version = "0.218.0"
version = "0.219.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b09e46c7fceceaa72b2dd1a8a137ea7fd8f93dfaa69806010a709918e496c5dc"
checksum = "324b4e56d24439495b88cd81439dad5e97f3c7b1eedc3c7e10455ed1e045e9a2"
dependencies = [
"ahash",
"bitflags 2.6.0",
Expand All @@ -5887,22 +5887,22 @@ dependencies = [

[[package]]
name = "wast"
version = "218.0.0"
version = "219.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a53cd1f0fa505df97557e36a58bddb8296e2fcdcd089529545ebfdb18a1b9d7"
checksum = "06880ecb25662bc21db6a83f4fcc27c41f71fbcba4f1980b650c88ada92728e1"
dependencies = [
"bumpalo",
"leb128",
"memchr",
"unicode-width",
"wasm-encoder 0.218.0",
"wasm-encoder 0.219.0",
]

[[package]]
name = "wat"
version = "1.218.0"
version = "1.219.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f87f8e14e776762e07927c27c2054d2cf678aab9aae2d431a79b3e31e4dd391"
checksum = "11e56dbf9fc89111b0d97c91e683d7895b1a6e5633a729f2ccad2303724005b6"
dependencies = [
"wast",
]
Expand Down Expand Up @@ -6179,9 +6179,9 @@ dependencies = [

[[package]]
name = "wit-component"
version = "0.218.0"
version = "0.219.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa53aa7e6bf2b3e8ccaffbcc963fbdb672a603dc0af393a481b6cec24c266406"
checksum = "99a76111c20444a814019de20499d30940ecd219b9512ee296f034a5edb18a2d"
dependencies = [
"anyhow",
"bitflags 2.6.0",
Expand All @@ -6190,17 +6190,17 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
"wasm-encoder 0.218.0",
"wasm-encoder 0.219.0",
"wasm-metadata",
"wasmparser 0.218.0",
"wasmparser 0.219.0",
"wit-parser",
]

[[package]]
name = "wit-parser"
version = "0.218.0"
version = "0.219.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d3d1066ab761b115f97fef2b191090faabcb0f37b555b758d3caf42d4ed9e55"
checksum = "23102e180c0c464f36e293d31a27b524e3ece930d7b5527d2f33f9d2c963de64"
dependencies = [
"anyhow",
"id-arena",
Expand All @@ -6211,7 +6211,7 @@ dependencies = [
"serde_derive",
"serde_json",
"unicode-xid",
"wasmparser 0.218.0",
"wasmparser 0.219.0",
]

[[package]]
Expand Down
3 changes: 2 additions & 1 deletion library/core/src/alloc/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,8 @@ impl Layout {
)]
pub type LayoutErr = LayoutError;

/// The parameters given to `Layout::from_size_align`
/// The `LayoutError` is returned when the parameters given
/// to `Layout::from_size_align`
/// or some other `Layout` constructor
/// do not satisfy its documented constraints.
#[stable(feature = "alloc_layout_error", since = "1.50.0")]
Expand Down
12 changes: 0 additions & 12 deletions src/ci/docker/host-x86_64/mingw-check/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,18 +47,6 @@ ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
# We disable optimized compiler built-ins because that requires a C toolchain for the target.
# We also skip the x86_64-unknown-linux-gnu target as it is well-tested by other jobs.
ENV SCRIPT \
# `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test covers the `rust.download-rustc=if-unchanged` logic.
# Here we are adding a dummy commit on compiler and running that test to ensure when there is a change on the compiler,
# we never download ci rustc with `rust.download-rustc=if-unchanged` option.
echo \"\" >> ../compiler/rustc/src/main.rs && \
git config --global user.email \"[email protected]\" && \
git config --global user.name \"dummy\" && \
git add ../compiler/rustc/src/main.rs && \
git commit -m \"test commit for rust.download-rustc=if-unchanged logic\" && \
DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 python3 ../x.py test bootstrap -- core::builder::tests::ci_rustc_if_unchanged_logic && \
# Revert the dummy commit
git reset --hard HEAD~1 && \

python3 ../x.py check --stage 0 --set build.optimized-compiler-builtins=false core alloc std --target=aarch64-unknown-linux-gnu,i686-pc-windows-msvc,i686-unknown-linux-gnu,x86_64-apple-darwin,x86_64-pc-windows-gnu,x86_64-pc-windows-msvc && \
/scripts/check-default-config-profiles.sh && \
python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu && \
Expand Down
14 changes: 14 additions & 0 deletions src/ci/docker/scripts/x86_64-gnu-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

set -ex

# `core::builder::tests::ci_rustc_if_unchanged_logic` bootstrap test ensures that
# "download-rustc=if-unchanged" logic don't use CI rustc while there are changes on
# compiler and/or library. Here we are adding a dummy commit on compiler and running
# that test to make sure we never download CI rustc with a change on the compiler tree.
echo "" >> ../compiler/rustc/src/main.rs
git config --global user.email "[email protected]"
git config --global user.name "dummy"
git add ../compiler/rustc/src/main.rs
git commit -m "test commit for rust.download-rustc=if-unchanged logic"
DISABLE_CI_RUSTC_IF_INCOMPATIBLE=0 ../x.py test bootstrap \
-- core::builder::tests::ci_rustc_if_unchanged_logic
# Revert the dummy commit
git reset --hard HEAD~1

# Only run the stage 1 tests on merges, not on PR CI jobs.
if [[ -z "${PR_CI_JOB}" ]]; then
../x.py --stage 1 test --skip src/tools/tidy
Expand Down
8 changes: 3 additions & 5 deletions src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,15 @@ envs:
# it in each job definition.
pr:
- image: mingw-check
env:
# We are adding (temporarily) a dummy commit on the compiler
READ_ONLY_SRC: "0"
<<: *job-linux-4c
- image: mingw-check-tidy
continue_on_error: true
<<: *job-linux-4c
- image: x86_64-gnu-llvm-18
env:
ENABLE_GCC_CODEGEN: "1"
# We are adding (temporarily) a dummy commit on the compiler
READ_ONLY_SRC: "0"
<<: *job-linux-16c
- image: x86_64-gnu-tools
<<: *job-linux-16c
Expand Down Expand Up @@ -210,8 +209,6 @@ auto:
<<: *job-linux-8c

- image: mingw-check
env:
READ_ONLY_SRC: 0
<<: *job-linux-4c

- image: test-various
Expand Down Expand Up @@ -264,6 +261,7 @@ auto:
- image: x86_64-gnu-llvm-18
env:
RUST_BACKTRACE: 1
READ_ONLY_SRC: "0"
<<: *job-linux-8c

- image: x86_64-gnu-nopt
Expand Down
2 changes: 1 addition & 1 deletion src/rustdoc-json-types/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ pub struct FunctionHeader {
/// on unwinding for more info.
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum Abi {
// We only have a concrete listing here for stable ABI's because their are so many
// We only have a concrete listing here for stable ABI's because there are so many
// See rustc_ast_passes::feature_gate::PostExpansionVisitor::check_abi for the list
/// The default ABI, but that can also be written explicitly with `extern "Rust"`.
Rust,
Expand Down
42 changes: 42 additions & 0 deletions src/tools/coverage-dump/src/covfun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,19 @@ pub(crate) fn dump_covfun_mappings(
expression_resolver.push_operands(lhs, rhs);
}

let mut max_counter = None;
for i in 0..num_files {
let num_mappings = parser.read_uleb128_u32()?;
println!("Number of file {i} mappings: {num_mappings}");

for _ in 0..num_mappings {
let (kind, region) = parser.read_mapping_kind_and_region()?;
println!("- {kind:?} at {region:?}");
kind.for_each_term(|term| {
if let CovTerm::Counter(n) = term {
max_counter = max_counter.max(Some(n));
}
});

match kind {
// Also print expression mappings in resolved form.
Expand All @@ -83,6 +89,16 @@ pub(crate) fn dump_covfun_mappings(
}

parser.ensure_empty()?;

// Printing the highest counter ID seen in the functions mappings makes
// it easier to determine whether a change to coverage instrumentation
// has increased or decreased the number of physical counters needed.
// (It's possible for the generated code to have more counters that
// aren't used by any mappings, but that should hopefully be rare.)
println!("Highest counter ID seen: {}", match max_counter {
Some(id) => format!("c{id}"),
None => "(none)".to_owned(),
});
println!();
}
Ok(())
Expand Down Expand Up @@ -271,6 +287,32 @@ enum MappingKind {
},
}

impl MappingKind {
fn for_each_term(&self, mut callback: impl FnMut(CovTerm)) {
match *self {
Self::Code(term) => callback(term),
Self::Gap(term) => callback(term),
Self::Expansion(_id) => {}
Self::Skip => {}
Self::Branch { r#true, r#false } => {
callback(r#true);
callback(r#false);
}
Self::MCDCBranch {
r#true,
r#false,
condition_id: _,
true_next_id: _,
false_next_id: _,
} => {
callback(r#true);
callback(r#false);
}
Self::MCDCDecision { bitmap_idx: _, conditions_num: _ } => {}
}
}
}

struct MappingRegion {
/// Offset of this region's start line, relative to the *start line* of
/// the *previous mapping* (or 0). Line numbers are 1-based.
Expand Down
2 changes: 1 addition & 1 deletion src/tools/wasm-component-ld/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ name = "wasm-component-ld"
path = "src/main.rs"

[dependencies]
wasm-component-ld = "0.5.9"
wasm-component-ld = "0.5.10"
2 changes: 2 additions & 0 deletions tests/coverage/abort.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Number of file 0 mappings: 13
- Code(Expression(9, Add)) at (prev + 1, 9) to (start + 0, 23)
= (c1 + c2)
- Code(Counter(3)) at (prev + 2, 5) to (start + 1, 2)
Highest counter ID seen: c5

Function name: abort::might_abort
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 03, 01, 01, 14, 05, 02, 09, 01, 24, 02, 02, 0c, 03, 02]
Expand All @@ -46,4 +47,5 @@ Number of file 0 mappings: 3
- Code(Counter(1)) at (prev + 2, 9) to (start + 1, 36)
- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 3, 2)
= (c0 - c1)
Highest counter ID seen: c1

1 change: 1 addition & 0 deletions tests/coverage/assert-ne.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Number of file 0 mappings: 4
- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 19)
= (c0 - c1)
- Code(Counter(2)) at (prev + 3, 5) to (start + 1, 2)
Highest counter ID seen: c2

2 changes: 2 additions & 0 deletions tests/coverage/assert.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Number of file 0 mappings: 9
- Code(Expression(6, Add)) at (prev + 1, 9) to (start + 0, 23)
= (c1 + (c2 + c3))
- Code(Counter(4)) at (prev + 2, 5) to (start + 1, 2)
Highest counter ID seen: c4

Function name: assert::might_fail_assert
Raw bytes (21): 0x[01, 01, 01, 01, 05, 03, 01, 04, 01, 02, 0f, 02, 02, 25, 00, 3d, 05, 01, 01, 00, 02]
Expand All @@ -37,4 +38,5 @@ Number of file 0 mappings: 3
- Code(Expression(0, Sub)) at (prev + 2, 37) to (start + 0, 61)
= (c0 - c1)
- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2)
Highest counter ID seen: c1

1 change: 1 addition & 0 deletions tests/coverage/assert_not.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ Number of file 0 mappings: 5
- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 22)
- Code(Expression(1, Sub)) at (prev + 1, 1) to (start + 0, 2)
= (c3 - Zero)
Highest counter ID seen: c3

Loading
Loading