// 3 | |
// 4 | | }
// | |_^ test
- if let [ann] = &line.annotations[..] {
+ let mut buffer_ops = vec![];
+ let mut annotations = vec![];
+ let mut short_start = true;
+ for ann in &line.annotations {
if let AnnotationType::MultilineStart(depth) = ann.annotation_type {
if source_string.chars().take(ann.start_col).all(|c| c.is_whitespace()) {
let style = if ann.is_primary {
} else {
Style::UnderlineSecondary
};
- buffer.putc(line_offset, width_offset + depth - 1, '/', style);
- return vec![(depth, style)];
+ annotations.push((depth, style));
+ buffer_ops.push((line_offset, width_offset + depth - 1, '/', style));
+ } else {
+ short_start = false;
+ break;
}
+ } else if let AnnotationType::MultilineLine(_) = ann.annotation_type {
+ } else {
+ short_start = false;
+ break;
+ }
+ }
+ if short_start {
+ for (y, x, c, s) in buffer_ops {
+ buffer.putc(y, x, c, s);
}
+ return annotations;
}
// We want to display like this:
|
LL | #[alloc_error_handler]
| ---------------------- in this procedural macro expansion
-LL | fn oom(
- | __^
- | | _|
- | ||
+LL | // fn oom(
LL | || info: &Layout,
LL | || ) -> ()
| ||_______- arguments to this function are incorrect
|
LL | #[alloc_error_handler]
| ---------------------- in this procedural macro expansion
-LL | fn oom(
- | __^
- | | _|
- | ||
+LL | // fn oom(
LL | || info: &Layout,
LL | || ) -> ()
| ||_______^ expected `!`, found `()`
|
LL | #[alloc_error_handler]
| ---------------------- in this procedural macro expansion
-LL | fn oom(
- | __^
- | | _|
- | ||
+LL | // fn oom(
LL | || info: Layout,
LL | || ) {
| ||_- arguments to this function are incorrect
|
LL | #[alloc_error_handler]
| ---------------------- in this procedural macro expansion
-LL | fn oom(
- | __^
- | | _|
- | ||
+LL | // fn oom(
LL | || info: Layout,
LL | || ) {
| ||_^ expected `!`, found `()`
LL | asm!("", $in(x) x, $out(x) x, $lateout(x) x, $inout(x) x, $inlateout(x) x,
| ^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^
...
-LL | m!(in out lateout inout inlateout const sym
- | _____-
- | |_____|
- | |_____|
- | |_____|
- | |
+LL | / m!(in out lateout inout inlateout const sym
LL | | pure nomem readonly preserves_flags
LL | | noreturn nostack options);
| | -
LL | asm!("", $in(x) x, $out(x) x, $lateout(x) x, $inout(x) x, $inlateout(x) x,
| ^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^
...
-LL | m!(in out lateout inout inlateout const sym
- | _____-
- | |_____|
- | |_____|
- | |_____|
- | |
+LL | / m!(in out lateout inout inlateout const sym
LL | | pure nomem readonly preserves_flags
LL | | noreturn nostack att_syntax options);
| | -
error[E0515]: cannot return value referencing local variable `rawLines`
--> $DIR/issue-13497-2.rs:3:5
|
-LL | rawLines
- | ______^
- | | _____|
- | ||
+LL | // rawLines
LL | || .iter().map(|l| l.trim()).collect()
| ||_______________-___________________________^ returns a value referencing data owned by the current function
| |_______________|
LL | Unit,
| ---- enum variant `Alias::Unit` defined here
...
-LL | Alias::
- | ______^
- | | _____|
- | ||
+LL | // Alias::
LL | || Unit();
| ||________^_- call expression requires function
| |________|
|
LL | let _h = async {
| _____________________-
-LL | | async {
- | | _________^
+LL | |/ async {
LL | || 3
LL | || }
| ||_________^ awaitable value not awaited
|
LL | let _j = async || {
| ________________________-
-LL | | async {
- | | _________^
+LL | |/ async {
LL | || 3
LL | || }
| ||_________^ awaitable value not awaited
error: called `map(f)` on an `Result` value where `f` is a closure that returns the unit type `()`
--> $DIR/result_map_unit_fn_unfixable.rs:29:5
|
-LL | x.field.map(|value| {
- | ______^
- | | _____|
- | ||
+LL | // x.field.map(|value| {
LL | || do_nothing(value);
LL | || do_nothing(value)
LL | || });