| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
Also avoid excessive cloning
|
|
|
|
Make function return early if source map is not present
|
|
|
|
|
|
|
|
|
|
`taken` is actually used afterwards
|
|
|
|
|
|
1. Rewrite `if let` into `match` to return earl and avoid indenting giant block
2. Assign `spans_updated` only once
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fixed issue from #64447
Did two tiny fixes. One is a micro optimization since we know that max is going to be assigned a `usize`, we do not have to worry about a possible negative number.
The other issue that was fixed is that the max from the children isn't updated correctly. Now it will use `sub_result` instead of `primary` and will properly get the needed value.
|
|
|
|
|
|
|
|
|
|
|
|
Refactor librustc_errors::Handler API
This should be reviewed by-commit.
The last commit moves all fields into an inner struct behind a single lock; this is done to prevent possible deadlocks in a multi-threaded compiler, as well as inconsistent state observation.
|
|
r=Mark-Simulacrum
Fix failure note `to_str` implementation
Serialize the level to something a little more useful for a failure note struct. This fixes #60425.
|
|
This avoids concurrency-related bugs when locks are acquired for too
short a time and similar cases.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Serialize the level to something a little more useful for a failure note
struct
* Update tests accordingly
|
|
Box `DiagnosticBuilder`.
It's a large type -- 176 bytes on 64-bit. And it's passed around and
returned from a lot of functions, including within `PResult`.
This commit boxes it, which reduces memory traffic. In particular,
`PResult` shrinks to 16 bytes in the best case; this reduces instruction
counts by up to 2% on various workloads. The commit touches a lot of
lines but it's almost all trivial plumbing changes.
|
|
It's a large type -- 176 bytes on 64-bit. And it's passed around and
returned from a lot of functions, including within PResult.
This commit boxes it, which reduces memory traffic. In particular,
`PResult` shrinks to 16 bytes in the best case; this reduces instruction
counts by up to 2% on various workloads.
|
|
|
|
|
|
Adress issue #64238. Create a macro to be used for pluralisation check
throughout rustc codebase.
|
|
annotate-snippet emitter: Update an issue number
The tracking issue has been replaced by one with mentoring instructions (#64205).
|
|
The tracking issue has been replaced by one with mentoring instructions.
|
|
This moves the two methods from the `EmitterWriter` impl to trait
default methods in the `Emitter` trait so that they can be re-used by
the `AnnotateSnippetEmitterWriter`.
Closes #61810
|
|
librustc_errors: Extract sugg/subst handling into method
An initial refactoring before working on #61809.
This moves the whole block into a method so that it can be reused in the
annotate-snippet emitter. The method is already used in the new emitter, but
there's no UI tests with suggestions included in this PR.
A first look at some UI tests with suggestions showed that there's some
more work to do in [annotate-snippet-rs][annotate-snippet-rs] before the new output is closer to the
current one, so I opted to do that in a second step.
r? @estebank
[annotate-snippet-rs]: https://github.com/rust-lang/annotate-snippets-rs
|
|
An initial refactoring before working on #61809.
This moves the whole block into a method so that it can be reused in the
annotate-snippet output. It's already used in the new emitter, but
there's no UI tests with suggestions included in this PR.
A first look at some UI tests with suggestions showed that there's some
more work to do in [annotate-snippet-rs][annotate-snippet-rs] before the
new output is closer to the current one.
|
|
|
|
Properly account for left margin when setting terminal width through
CLI flag and don't trim code by default if we can't get the terminal's
dimensions.
|
|
|
|
|