From fc6c19e2dcbb3039a380755699669d317a6a3fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Sun, 21 Feb 2021 16:54:42 -0800 Subject: [PATCH] fix rebase --- compiler/rustc_hir/src/hir.rs | 3 +-- src/test/ui/return/tail-expr-as-potential-return.stderr | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 840099841839..9b2077f0039b 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1,5 +1,4 @@ // ignore-tidy-filelength -use crate::def::{DefKind, Namespace, Res}; use crate::def::{CtorKind, DefKind, Namespace, Res}; use crate::def_id::DefId; crate use crate::hir_id::HirId; @@ -1562,7 +1561,7 @@ impl Expr<'_> { ExprKind::Type(base, _) | ExprKind::Unary(_, base) | ExprKind::Field(base, _) - | ExprKind::Index(base, _) + | ExprKind::Index(base, _) | ExprKind::AddrOf(.., base) | ExprKind::Cast(base, _) => { // This isn't exactly true for `Index` and all `Unnary`, but we are using this diff --git a/src/test/ui/return/tail-expr-as-potential-return.stderr b/src/test/ui/return/tail-expr-as-potential-return.stderr index 52c63c8e223e..f8527961374d 100644 --- a/src/test/ui/return/tail-expr-as-potential-return.stderr +++ b/src/test/ui/return/tail-expr-as-potential-return.stderr @@ -3,12 +3,12 @@ error[E0308]: mismatched types | LL | / if x { LL | | Err(42) - | | ^^^^^^^ expected `()`, found enum `std::result::Result` + | | ^^^^^^^ expected `()`, found enum `Result` LL | | } | |_____- expected this to be `()` | = note: expected unit type `()` - found enum `std::result::Result<_, {integer}>` + found enum `Result<_, {integer}>` help: you might have meant to return this value | LL | return Err(42);