Fix substitution parts having a shifted underline in some cases#124370
Fix substitution parts having a shifted underline in some cases#124370bors merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
Please include this as an UI test. @rustbot author |
|
I'm still working on PR #123877 which makes this suggestion, here is the blessed UI tests after this PR: a580d10 The suggestion is emitted here: rust/compiler/rustc_parse/src/parser/item.rs Lines 2450 to 2455 in a580d10 rust/compiler/rustc_parse/src/errors.rs Lines 2450 to 2461 in a580d10 @rustbot review |
|
Alright, thanks! |
…=fee1-dead Fix substitution parts having a shifted underline in some cases If two suggestions parts are side by side, the underline's offset: (WIP PR as an example, not yet pushed) ``` error: expected a pattern, found an expression --> ./main.rs:4:9 | 4 | 1 + 2 => 3 | ^^^^^ arbitrary expressions are not allowed in patterns | help: check the value in an arm guard | 4 | n if n == 1 + 2 => 3 | ~ +++++++++++++ ``` The emitter didn't take into account that the string had shrunk/grown if two substitution parts were side-by-side (surprisingly, there was only one case in the ui testsuite.) ``` help: check the value in an arm guard | 4 | n if n == 1 + 2 => 3 | ~ +++++++++++++ ``` `@rustbot` label +A-suggestion-diagnostics
Rollup of 3 pull requests Successful merges: - rust-lang#124370 (Fix substitution parts having a shifted underline in some cases) - rust-lang#124382 (ast: Generalize item kind visiting) - rust-lang#124387 (thread_local: be excruciatingly explicit in dtor code) r? `@ghost` `@rustbot` modify labels: rollup
…ee1-dead Fix substitution parts having a shifted underline in some cases If two suggestions parts are side by side, the underline's offset: (WIP PR as an example, not yet pushed) ``` error: expected a pattern, found an expression --> ./main.rs:4:9 | 4 | 1 + 2 => 3 | ^^^^^ arbitrary expressions are not allowed in patterns | help: check the value in an arm guard | 4 | n if n == 1 + 2 => 3 | ~ +++++++++++++ ``` The emitter didn't take into account that the string had shrunk/grown if two substitution parts were side-by-side (surprisingly, there was only one case in the ui testsuite.) ``` help: check the value in an arm guard | 4 | n if n == 1 + 2 => 3 | ~ +++++++++++++ ``` `@rustbot` label +A-suggestion-diagnostics
|
💔 Test failed - checks-actions |
|
@bors retry: appears spurious |
|
@bors retry |
…=fee1-dead Fix substitution parts having a shifted underline in some cases If two suggestions parts are side by side, the underline's offset: (WIP PR as an example, not yet pushed) ``` error: expected a pattern, found an expression --> ./main.rs:4:9 | 4 | 1 + 2 => 3 | ^^^^^ arbitrary expressions are not allowed in patterns | help: check the value in an arm guard | 4 | n if n == 1 + 2 => 3 | ~ +++++++++++++ ``` The emitter didn't take into account that the string had shrunk/grown if two substitution parts were side-by-side (surprisingly, there was only one case in the ui testsuite.) ``` help: check the value in an arm guard | 4 | n if n == 1 + 2 => 3 | ~ +++++++++++++ ``` `@rustbot` label +A-suggestion-diagnostics
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#124370 (Fix substitution parts having a shifted underline in some cases) - rust-lang#124405 (miri core/alloc tests: do not test a 2nd target) - rust-lang#124425 (Do not ICE on invalid consts when walking mono-reachable blocks) - rust-lang#124435 (add more tests) - rust-lang#124437 (doc: Make the `mod.rs` in the comment point to the correct location) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#124370 (Fix substitution parts having a shifted underline in some cases) - rust-lang#124394 (Fix ICE on invalid const param types) - rust-lang#124425 (Do not ICE on invalid consts when walking mono-reachable blocks) - rust-lang#124434 (Remove lazycell and once_cell from compiletest dependencies) - rust-lang#124437 (doc: Make the `mod.rs` in the comment point to the correct location) - rust-lang#124443 (Elaborate in comment about `statx` probe) - rust-lang#124445 (bootstrap: Change `global(true)` to `global = true` for flags for consistency) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#124370 - ShE3py:substitution-part-offset, r=fee1-dead Fix substitution parts having a shifted underline in some cases If two suggestions parts are side by side, the underline's offset: (WIP PR as an example, not yet pushed) ``` error: expected a pattern, found an expression --> ./main.rs:4:9 | 4 | 1 + 2 => 3 | ^^^^^ arbitrary expressions are not allowed in patterns | help: check the value in an arm guard | 4 | n if n == 1 + 2 => 3 | ~ +++++++++++++ ``` The emitter didn't take into account that the string had shrunk/grown if two substitution parts were side-by-side (surprisingly, there was only one case in the ui testsuite.) ``` help: check the value in an arm guard | 4 | n if n == 1 + 2 => 3 | ~ +++++++++++++ ``` ``@rustbot`` label +A-suggestion-diagnostics
If two suggestions parts are side by side, the underline's offset:
(WIP PR as an example, not yet pushed)
The emitter didn't take into account that the string had shrunk/grown if two substitution parts were side-by-side (surprisingly, there was only one case in the ui testsuite.)
@rustbot label +A-suggestion-diagnostics