Skip to content

Commit 039c9a8

Browse files
authored
Merge pull request #911 from dtolnay/resultui
Update ui test suite to nightly-2021-08-12
2 parents 971082d + a104fd6 commit 039c9a8

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

macro/src/expand.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1127,9 +1127,11 @@ fn expand_rust_function_shim_super(
11271127
Some(ret) => quote!(#ret),
11281128
None => quote!(()),
11291129
};
1130-
let impl_trait = quote_spanned!(result.span=> impl);
1131-
let display = quote_spanned!(rangle.span=> ::std::fmt::Display);
1132-
quote!(-> ::std::result::Result<#ok, #impl_trait #display>)
1130+
// Set spans that result in the `Result<...>` written by the user being
1131+
// highlighted as the cause if their error type has no Display impl.
1132+
let result_begin = quote_spanned!(result.span=> ::std::result::Result<#ok, impl);
1133+
let result_end = quote_spanned!(rangle.span=> ::std::fmt::Display>);
1134+
quote!(-> #result_begin #result_end)
11331135
} else {
11341136
expand_return_type(&sig.ret)
11351137
};

tests/ui/array_len_suffix.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ error[E0308]: mismatched types
77
help: change the type of the numeric literal from `u16` to `usize`
88
|
99
4 | fn array() -> [String; 12usize];
10-
| ^^^^^^^
10+
| ~~~~~~~

tests/ui/expected_named.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ error[E0106]: missing lifetime specifier
88
help: consider using the `'static` lifetime
99
|
1010
5 | fn borrowed() -> UniquePtr<Borrowed<'static>>;
11-
| ^^^^^^^^^^^^^^^^^
11+
| ~~~~~~~~~~~~~~~~~

tests/ui/unsupported_elided.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ error[E0106]: missing lifetime specifier
1616
help: consider introducing a named lifetime parameter
1717
|
1818
8 | fn f<'a>(t: &'a T) -> &'a str;
19-
| ^^^^ ^^^^^ ^^^
19+
| ++++ ~~~~~ ~~~

0 commit comments

Comments
 (0)