Skip to content

Rollup of 10 pull requests #138693

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 39 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
51c5700
clarify BufRead::{fill_buf, consume} docs
hkBst Jan 28, 2025
2579bb5
Fix MCP links
Kobzol Mar 14, 2025
34a340e
Merge pull request #2286 from Kobzol/fix-mcp-link
jieyouxu Mar 14, 2025
901102f
those should not get shell highlighting
tshepang Mar 15, 2025
35a70bd
make 'mdbook test --chapter "Running tests"' pass
tshepang Mar 15, 2025
fdce008
add some copy-paste goodness
tshepang Mar 15, 2025
b30d197
Merge pull request #2287 from rust-lang/tshepang-running-chapter-clea…
tshepang Mar 15, 2025
4aee995
expand ${workspaceFolder} in sample vim config
jyn514 Mar 17, 2025
ef46ce7
Merge pull request #2290 from jyn514/nvim-config
dianqk Mar 17, 2025
eef70a9
Create a safe wrapper around LLVMRustDIBuilderCreateTemplateTypeParam…
oli-obk Mar 17, 2025
b4acf7a
Immediately create an `Option` instead of reallocating for it later
oli-obk Mar 17, 2025
6adc2c1
Deduplicate template parameter creation
oli-obk Mar 17, 2025
e19e4e3
Create a safe wrapper around `LLVMRustDIBuilderCreateSubroutineType`
oli-obk Mar 17, 2025
cc41dd4
Create a safe wrapper function around `LLVMRustDIBuilderCreateFile`
oli-obk Mar 17, 2025
018032c
Create a safe wrapper around `LLVMRustDIBuilderCreateBasicType`
oli-obk Mar 17, 2025
6d515a7
Preparing for merge from rustc
jieyouxu Mar 18, 2025
69ed023
Merge from rustc
jieyouxu Mar 18, 2025
e9d50f4
Merge pull request #2293 from jieyouxu/rustc-pull
Kobzol Mar 18, 2025
9dac479
Remove double nesting in post-merge workflow
Kobzol Mar 18, 2025
7f4d3bd
Remove the regex dependency from coretests
bjorn3 Mar 18, 2025
e5b86e2
Apply suggestions from code review
hkBst Mar 18, 2025
d76e89f
CI: mirror alpine and centos images to ghcr
marcoieni Mar 18, 2025
cd2b978
coverage: Don't refer to the body span when enlarging empty spans
Zalathar Mar 18, 2025
cc8336b
coverage: Don't store a body span in `FunctionCoverageInfo`
Zalathar Mar 18, 2025
20d04d8
Revert "Rollup merge of #136355 - GuillaumeGomez:proc-macro_add_value…
RalfJung Mar 18, 2025
1f34b19
Avoid splitting up a layout
oli-obk Mar 18, 2025
f4b0984
Create a safe wrapper around `LLVMRustDIBuilderCreateMemberType`
oli-obk Mar 17, 2025
93b31d9
Remove existing AFIDT implementation
compiler-errors Mar 18, 2025
7a8cdf0
use then
bend-n Mar 19, 2025
b52275f
Rollup merge of #136177 - hkBst:patch-24, r=ibraheemdev
matthiaskrgr Mar 19, 2025
a4c32b1
Rollup merge of #138654 - bjorn3:remove_coretests_regex, r=tgross35
matthiaskrgr Mar 19, 2025
67d3e5e
Rollup merge of #138655 - Kobzol:rdg-sync, r=jieyouxu
matthiaskrgr Mar 19, 2025
09c28f8
Rollup merge of #138656 - Kobzol:post-merge-unnest, r=marcoieni
matthiaskrgr Mar 19, 2025
cc06501
Rollup merge of #138658 - marcoieni:mirror-alpine-and-centos, r=Kobzol
matthiaskrgr Mar 19, 2025
00dddc6
Rollup merge of #138659 - Zalathar:no-body-span, r=oli-obk
matthiaskrgr Mar 19, 2025
8b713e2
Rollup merge of #138661 - RalfJung:revert-rustc-dev-breakage, r=petro…
matthiaskrgr Mar 19, 2025
351ba39
Rollup merge of #138670 - compiler-errors:remove-afidt, r=oli-obk
matthiaskrgr Mar 19, 2025
5661e98
Rollup merge of #138674 - oli-obk:llvm-cleanups, r=compiler-errors
matthiaskrgr Mar 19, 2025
3b7faca
Rollup merge of #138684 - bend-n:use_then, r=jhpratt
matthiaskrgr Mar 19, 2025
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
7 changes: 7 additions & 0 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# Docker Hub has a rate limit, while ghcr.io doesn't.
# Those images are pushed to ghcr.io by this job.
#
# While Docker Hub rate limit *shouldn't* be an issue on GitHub Actions,
# it certainly is for AWS codebuild.
#
# Note that authenticating to DockerHub or other registries isn't possible
# for PR jobs, because forks can't access secrets.
# That's why we use ghcr.io: it has no rate limit and it doesn't require authentication.
Expand Down Expand Up @@ -54,6 +57,10 @@ jobs:
"ubuntu:22.04"
# Mirrored because used by all linux CI jobs, including mingw-check-tidy
"moby/buildkit:buildx-stable-1"
# Mirrored because used when CI is running inside a Docker container
"alpine:3.4"
# Mirrored because used by dist-x86_64-linux
"centos:7"
)

# Mirror each image from DockerHub to ghcr.io
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,12 @@ jobs:

cd src/ci/citool

printf "*This is an experimental post-merge analysis report. You can ignore it.*\n\n" > output.log
printf "<details>\n<summary>Post-merge report</summary>\n\n" >> output.log
printf "<details>\n<summary>What is this?</summary>\n" >> output.log
printf "This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.\n" >> output.log
printf "</details>\n\n" >> output.log

cargo run --release post-merge-report ${PARENT_COMMIT} ${{ github.sha }} >> output.log

printf "</details>\n" >> output.log

cat output.log

gh pr comment ${HEAD_PR} -F output.log
17 changes: 0 additions & 17 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2082,13 +2082,6 @@ version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104"

[[package]]
name = "literal-escaper"
version = "0.0.0"
dependencies = [
"rustc-std-workspace-std 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "lld-wrapper"
version = "0.1.0"
Expand Down Expand Up @@ -3155,12 +3148,6 @@ version = "1.0.1"
name = "rustc-std-workspace-std"
version = "1.0.1"

[[package]]
name = "rustc-std-workspace-std"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aba676a20abe46e5b0f1b0deae474aaaf31407e6c71147159890574599da04ef"

[[package]]
name = "rustc_abi"
version = "0.0.0"
Expand Down Expand Up @@ -3199,7 +3186,6 @@ name = "rustc_ast"
version = "0.0.0"
dependencies = [
"bitflags",
"literal-escaper",
"memchr",
"rustc_ast_ir",
"rustc_data_structures",
Expand Down Expand Up @@ -3909,7 +3895,6 @@ name = "rustc_lexer"
version = "0.0.0"
dependencies = [
"expect-test",
"literal-escaper",
"memchr",
"unicode-properties",
"unicode-xid",
Expand Down Expand Up @@ -4172,7 +4157,6 @@ name = "rustc_parse"
version = "0.0.0"
dependencies = [
"bitflags",
"literal-escaper",
"rustc_ast",
"rustc_ast_pretty",
"rustc_data_structures",
Expand All @@ -4195,7 +4179,6 @@ dependencies = [
name = "rustc_parse_format"
version = "0.0.0"
dependencies = [
"literal-escaper",
"rustc_index",
"rustc_lexer",
]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_ast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ edition = "2024"
[dependencies]
# tidy-alphabetical-start
bitflags = "2.4.1"
literal-escaper = { path = "../../library/literal-escaper" }
memchr = "2.7.4"
rustc_ast_ir = { path = "../rustc_ast_ir" }
rustc_data_structures = { path = "../rustc_data_structures" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/util/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use std::{ascii, fmt, str};

use literal_escaper::{
use rustc_lexer::unescape::{
MixedUnit, Mode, byte_from_char, unescape_byte, unescape_char, unescape_mixed, unescape_unicode,
};
use rustc_span::{Span, Symbol, kw, sym};
Expand Down
14 changes: 9 additions & 5 deletions compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/covfun.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ fn fill_region_tables<'tcx>(
ids_info: &'tcx CoverageIdsInfo,
covfun: &mut CovfunRecord<'tcx>,
) {
// Currently a function's mappings must all be in the same file as its body span.
// Currently a function's mappings must all be in the same file, so use the
// first mapping's span to determine the file.
let source_map = tcx.sess.source_map();
let source_file = source_map.lookup_source_file(fn_cov_info.body_span.lo());
let Some(first_span) = (try { fn_cov_info.mappings.first()?.span }) else {
debug_assert!(false, "function has no mappings: {:?}", covfun.mangled_function_name);
return;
};
let source_file = source_map.lookup_source_file(first_span.lo());

// Look up the global file ID for that file.
let global_file_id = global_file_table.global_file_id_for_file(&source_file);
Expand All @@ -118,9 +123,8 @@ fn fill_region_tables<'tcx>(
let ffi::Regions { code_regions, branch_regions, mcdc_branch_regions, mcdc_decision_regions } =
&mut covfun.regions;

let make_cov_span = |span: Span| {
spans::make_coverage_span(local_file_id, source_map, fn_cov_info, &source_file, span)
};
let make_cov_span =
|span: Span| spans::make_coverage_span(local_file_id, source_map, &source_file, span);
let discard_all = tcx.sess.coverage_discard_all_spans_in_codegen();

// For each counter/region pair in this function+file, convert it to a
Expand Down
30 changes: 7 additions & 23 deletions compiler/rustc_codegen_llvm/src/coverageinfo/mapgen/spans.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use rustc_middle::mir::coverage::FunctionCoverageInfo;
use rustc_span::source_map::SourceMap;
use rustc_span::{BytePos, Pos, SourceFile, Span};
use tracing::debug;
Expand All @@ -19,11 +18,10 @@ use crate::coverageinfo::mapgen::LocalFileId;
pub(crate) fn make_coverage_span(
file_id: LocalFileId,
source_map: &SourceMap,
fn_cov_info: &FunctionCoverageInfo,
file: &SourceFile,
span: Span,
) -> Option<ffi::CoverageSpan> {
let span = ensure_non_empty_span(source_map, fn_cov_info, span)?;
let span = ensure_non_empty_span(source_map, span)?;

let lo = span.lo();
let hi = span.hi();
Expand Down Expand Up @@ -55,36 +53,22 @@ pub(crate) fn make_coverage_span(
})
}

fn ensure_non_empty_span(
source_map: &SourceMap,
fn_cov_info: &FunctionCoverageInfo,
span: Span,
) -> Option<Span> {
fn ensure_non_empty_span(source_map: &SourceMap, span: Span) -> Option<Span> {
if !span.is_empty() {
return Some(span);
}

let lo = span.lo();
let hi = span.hi();

// The span is empty, so try to expand it to cover an adjacent '{' or '}',
// but only within the bounds of the body span.
let try_next = hi < fn_cov_info.body_span.hi();
let try_prev = fn_cov_info.body_span.lo() < lo;
if !(try_next || try_prev) {
return None;
}

// The span is empty, so try to enlarge it to cover an adjacent '{' or '}'.
source_map
.span_to_source(span, |src, start, end| try {
// Adjusting span endpoints by `BytePos(1)` is normally a bug,
// but in this case we have specifically checked that the character
// we're skipping over is one of two specific ASCII characters, so
// adjusting by exactly 1 byte is correct.
if try_next && src.as_bytes()[end] == b'{' {
Some(span.with_hi(hi + BytePos(1)))
} else if try_prev && src.as_bytes()[start - 1] == b'}' {
Some(span.with_lo(lo - BytePos(1)))
if src.as_bytes().get(end).copied() == Some(b'{') {
Some(span.with_hi(span.hi() + BytePos(1)))
} else if start > 0 && src.as_bytes()[start - 1] == b'}' {
Some(span.with_lo(span.lo() - BytePos(1)))
} else {
None
}
Expand Down
Loading
Loading