Skip to content

Commit 42ed400

Browse files
committedJul 16, 2024
Be more accurate about calculating display_col from a BytePos
No longer track "zero-width" chars in `SourceMap`, read directly from the line when calculating the `display_col` of a `BytePos`. Move `char_width` to `rustc_span` and use it from the emitter. This change allows the following to properly align in terminals (depending on the font, the replaced control codepoints are rendered as 1 or 2 width, on my terminal they are rendered as 1, on VSCode text they are rendered as 2): ``` error: this file contains an unclosed delimiter --> $DIR/issue-68629.rs:5:17 | LL | ␜␟ts␀![{i | -- unclosed delimiter | | | unclosed delimiter LL | ␀␀ fn rݻoa>rݻm | ^ ```
1 parent c60b38c commit 42ed400

File tree

60 files changed

+141
-285
lines changed

Some content is hidden

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

60 files changed

+141
-285
lines changed
 

‎Cargo.lock

-1
Original file line numberDiff line numberDiff line change
@@ -3982,7 +3982,6 @@ dependencies = [
39823982
"termcolor",
39833983
"termize",
39843984
"tracing",
3985-
"unicode-width",
39863985
"windows",
39873986
]
39883987

‎compiler/rustc_errors/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ serde_json = "1.0.59"
2626
termcolor = "1.2.0"
2727
termize = "0.1.1"
2828
tracing = "0.1"
29-
unicode-width = "0.1.4"
3029
# tidy-alphabetical-end
3130

3231
[target.'cfg(windows)'.dependencies.windows]

0 commit comments

Comments
 (0)