diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 5bc1bf4431c..fdeb41a8770 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -3017,9 +3017,10 @@ impl<'a> LoweringContext<'a> { let tail = block.expr.take().map_or_else( || { let LoweredNodeId { node_id, hir_id } = this.next_id(); + let span = this.sess.codemap().end_point(unstable_span); hir::Expr { id: node_id, - span: unstable_span, + span, node: hir::ExprTup(hir_vec![]), attrs: ThinVec::new(), hir_id, diff --git a/src/test/ui/catch-block-type-error.rs b/src/test/ui/catch-block-type-error.rs index c7739f6c5f8..10130ef1e5d 100644 --- a/src/test/ui/catch-block-type-error.rs +++ b/src/test/ui/catch-block-type-error.rs @@ -20,7 +20,7 @@ fn main() { }; let _: Option = do catch { - //~^ ERROR type mismatch foo()?; }; + //~^ ERROR type mismatch } diff --git a/src/test/ui/catch-block-type-error.stderr b/src/test/ui/catch-block-type-error.stderr index 9634efe2cd8..0ae8d4862f7 100644 --- a/src/test/ui/catch-block-type-error.stderr +++ b/src/test/ui/catch-block-type-error.stderr @@ -8,14 +8,10 @@ LL | 42 found type `{integer}` error[E0271]: type mismatch resolving ` as std::ops::Try>::Ok == ()` - --> $DIR/catch-block-type-error.rs:22:35 + --> $DIR/catch-block-type-error.rs:24:5 | -LL | let _: Option = do catch { - | ___________________________________^ -LL | | //~^ ERROR type mismatch -LL | | foo()?; -LL | | }; - | |_____^ expected i32, found () +LL | }; + | ^ expected i32, found () | = note: expected type `i32` found type `()`