Rollup merge of #104795 - estebank:multiline-spans, r=TaKO8Ki

Change multiline span ASCII art visual order

Tweak the ASCII art for nested multiline spans so that we minimize line overlaps.

Partially addresses https://github.com/rust-lang/rust/issues/61017.
This commit is contained in:
Dylan DPC 2022-11-28 15:42:10 +05:30 committed by GitHub
commit 79fe15c8b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 108 additions and 106 deletions

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | #[alloc_error_handler]
| ---------------------- in this procedural macro expansion
LL | fn oom(
| _^
| |_|
| __^
| | _|
| ||
LL | || info: &Layout,
LL | || ) -> ()
@ -30,8 +30,8 @@ error[E0308]: mismatched types
LL | #[alloc_error_handler]
| ---------------------- in this procedural macro expansion
LL | fn oom(
| _^
| |_|
| __^
| | _|
| ||
LL | || info: &Layout,
LL | || ) -> ()

View file

@ -4,14 +4,12 @@ error[E0308]: mismatched types
LL | #[alloc_error_handler]
| ---------------------- in this procedural macro expansion
LL | fn oom(
| _^
| |_|
| __^
| | _|
| ||
LL | || info: Layout,
LL | || ) {
| || -
| ||_|
| | arguments to this function are incorrect
| ||_- arguments to this function are incorrect
LL | | loop {}
LL | | }
| |__^ expected struct `Layout`, found struct `core::alloc::Layout`
@ -42,14 +40,12 @@ error[E0308]: mismatched types
LL | #[alloc_error_handler]
| ---------------------- in this procedural macro expansion
LL | fn oom(
| _^
| |_|
| __^
| | _|
| ||
LL | || info: Layout,
LL | || ) {
| || ^
| ||_|
| | expected `!`, found `()`
| ||_^ expected `!`, found `()`
LL | | loop {}
LL | | }
| |__- expected `!` because of return type

View file

@ -157,11 +157,11 @@ error[E0308]: `if` and `else` have incompatible types
--> $DIR/deref-suggestion.rs:69:12
|
LL | let val = if true {
| _______________-
LL | | *a
| | -- expected because of this
LL | | } else if true {
| |____________^
| ________________-
LL | | *a
| | -- expected because of this
LL | | } else if true {
| | ____________^
LL | ||
LL | || b
LL | || } else {
@ -169,7 +169,7 @@ LL | || &0
LL | || };
| || ^
| ||_____|
| |______`if` and `else` have incompatible types
| |_____`if` and `else` have incompatible types
| expected `i32`, found `&{integer}`
error: aborting due to 13 previous errors

View file

@ -2,12 +2,12 @@ error[E0515]: cannot return value referencing local variable `rawLines`
--> $DIR/issue-13497-2.rs:3:5
|
LL | rawLines
| _____^
| |_____|
| ______^
| | _____|
| ||
LL | || .iter().map(|l| l.trim()).collect()
| ||_______________-___________________________^ returns a value referencing data owned by the current function
| |________________|
| |_______________|
| `rawLines` is borrowed here
error: aborting due to previous error

View file

@ -41,12 +41,12 @@ warning: variable does not need to be mutable
--> $DIR/suggestions.rs:54:13
|
LL | let mut
| _____________^
| |_____________|
| ______________^
| | _____________|
| ||
LL | || b = 1;
| ||____________-^
| |____________|
| |_____________|
| help: remove this `mut`
error: const items should never be `#[no_mangle]`

View file

@ -35,17 +35,17 @@ LL | | }
error[E0572]: return statement outside of function body
--> $DIR/issue-86188-return-not-in-fn-body.rs:36:10
|
LL | / fn main() {
LL | |
LL | | [(); return || {
| |__________^
LL | / fn main() {
LL | |
LL | | [(); return || {
| | __________^
LL | ||
LL | ||
LL | || let tx;
LL | || }];
| ||_____^ the return is part of this body...
LL | | }
| |_- ...not the enclosing function body
LL | | }
| |__- ...not the enclosing function body
error: aborting due to 4 previous errors

View file

@ -5,12 +5,12 @@ LL | Unit,
| ---- enum variant `Alias::Unit` defined here
...
LL | Alias::
| _____^
| |_____|
| ______^
| | _____|
| ||
LL | || Unit();
| ||________^_- call expression requires function
| |_________|
| |________|
|
|
help: `Alias::Unit` is a unit enum variant, and does not take parentheses to be constructed

View file

@ -2,8 +2,8 @@ error[E0277]: `&&&&&Enumerate<std::slice::Iter<'_, {integer}>>` is not an iterat
--> $DIR/suggest-remove-refs-3.rs:6:19
|
LL | for (i, _) in & & &
| ___________________^
| |___________________|
| ____________________^
| | ___________________|
| ||
LL | || & &v
| ||___________- help: consider removing 5 leading `&`-references