mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
tweak removal span
This commit is contained in:
parent
f0fc4f9acf
commit
e6077fc1b8
@ -1596,8 +1596,15 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
||||
// Peel off the DesugaringKind from the span
|
||||
&& let Some(desugar_parent_span) = parent_expr.span.parent_callsite()
|
||||
{
|
||||
let removal_span = self.tcx
|
||||
.sess
|
||||
.source_map()
|
||||
.span_extend_while(expr.span, char::is_whitespace)
|
||||
.unwrap_or(expr.span)
|
||||
.shrink_to_hi()
|
||||
.to(desugar_parent_span);
|
||||
err.span_suggestion(
|
||||
self.tcx.sess.source.shrink_to_hi().to(desugar_parent_span),
|
||||
removal_span,
|
||||
"remove the `.await`",
|
||||
"",
|
||||
Applicability::MachineApplicable,
|
||||
|
@ -1,13 +1,11 @@
|
||||
error[E0277]: `()` is not a future
|
||||
--> $DIR/issue-101715.rs:11:10
|
||||
|
|
||||
LL | S.very_long_method_name_the_longest_method_name_in_the_whole_universe()
|
||||
| ____________________________________________________________________________-
|
||||
LL | | .await
|
||||
| | ^^^^-
|
||||
| |__________|___|
|
||||
| | help: remove the `.await`
|
||||
| `()` is not a future
|
||||
LL | .await
|
||||
| -^^^^^
|
||||
| ||
|
||||
| |`()` is not a future
|
||||
| help: remove the `.await`
|
||||
|
|
||||
= help: the trait `Future` is not implemented for `()`
|
||||
= note: () must be a future or must implement `IntoFuture` to be awaited
|
||||
|
Loading…
Reference in New Issue
Block a user