Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit eaee1e9

Browse files
committedMar 2, 2024
Auto merge of rust-lang#121870 - matthiaskrgr:rollup-mfpa3jx, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - rust-lang#111505 (Made `INVALID_DOC_ATTRIBUTES` lint deny by default) - rust-lang#120305 (Delete line if suggestion would replace it with an empty line) - rust-lang#121153 (Suggest removing superfluous semicolon when statements used as expression) - rust-lang#121497 (`-Znext-solver=coherence`: suggest increasing recursion limit) - rust-lang#121634 (Clarify behavior of slice prefix/suffix operations in case of equality) - rust-lang#121706 (match lowering: Remove hacky branch in sort_candidate) - rust-lang#121730 (Add profiling support to AIX) - rust-lang#121750 (match lowering: Separate the `bool` case from other integers in `TestKind`) - rust-lang#121803 (Never say "`Trait` is implemented for `{type error}`") - rust-lang#121811 (Move sanitizer ui tests to sanitizer directory) - rust-lang#121824 (Implement missing ABI structures in StableMIR) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e612d07 + 63e916e commit eaee1e9

File tree

137 files changed

+1165
-708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+1165
-708
lines changed
 

‎compiler/rustc_codegen_ssa/src/back/linker.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1631,7 +1631,9 @@ impl<'a> Linker for AixLinker<'a> {
16311631

16321632
fn optimize(&mut self) {}
16331633

1634-
fn pgo_gen(&mut self) {}
1634+
fn pgo_gen(&mut self) {
1635+
self.cmd.arg("-bdbg:namedsects:ss");
1636+
}
16351637

16361638
fn control_flow_guard(&mut self) {}
16371639

‎compiler/rustc_errors/src/json.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,24 @@ impl DiagnosticSpan {
428428
}
429429

430430
fn from_span_full(
431-
span: Span,
431+
mut span: Span,
432432
is_primary: bool,
433433
label: Option<String>,
434434
suggestion: Option<(&String, Applicability)>,
435435
mut backtrace: impl Iterator<Item = ExpnData>,
436436
je: &JsonEmitter,
437437
) -> DiagnosticSpan {
438438
let start = je.sm.lookup_char_pos(span.lo());
439+
// If this goes from the start of a line to the end and the replacement
440+
// is an empty string, increase the length to include the newline so we don't
441+
// leave an empty line
442+
if start.col.0 == 0
443+
&& suggestion.map_or(false, |(s, _)| s.is_empty())
444+
&& let Ok(after) = je.sm.span_to_next_source(span)
445+
&& after.starts_with('\n')
446+
{
447+
span = span.with_hi(span.hi() + rustc_span::BytePos(1));
448+
}
439449
let end = je.sm.lookup_char_pos(span.hi());
440450
let backtrace_step = backtrace.next().map(|bt| {
441451
let call_site = Self::from_span_full(bt.call_site, false, None, None, backtrace, je);

0 commit comments

Comments
 (0)
This repository has been archived.