about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-17 18:36:53 +0000
committerbors <bors@rust-lang.org>2020-04-17 18:36:53 +0000
commitce93331e2cf21ac4b72a53854b105955919114e7 (patch)
tree34c8457090bd69c12170219b7b4a600814074924
parent8d67f576b56e8fc98a31123e5963f8d00e40611c (diff)
parent4132642e8a485fff5b8aa1d68ae3d0c32b514eb5 (diff)
downloadrust-ce93331e2cf21ac4b72a53854b105955919114e7.tar.gz
rust-ce93331e2cf21ac4b72a53854b105955919114e7.zip
Auto merge of #71255 - Dylan-DPC:rollup-u5yl04z, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #69642 (Use query to determine whether function needs const checking)
 - #71239 (Rename `asm` test directory in favor of `llvm_asm`)
 - #71246 (Implement `Clone` for `liballoc::collections::linked_list::Cursor`.)
 - #71247 (Remove unnecessary variable intialization)
 - #71254 (Minor fix and addition to doc comments)

Failed merges:

r? @ghost
-rw-r--r--src/liballoc/collections/linked_list.rs8
-rw-r--r--src/librustc_middle/mir/mod.rs6
-rw-r--r--src/librustc_mir/const_eval/fn_queries.rs27
-rw-r--r--src/librustc_mir/util/pretty.rs1
-rw-r--r--src/librustc_passes/check_const.rs14
-rw-r--r--src/librustc_typeck/check/expr.rs21
-rw-r--r--src/test/ui/llvm-asm/issue-51431.rs (renamed from src/test/ui/asm/issue-51431.rs)0
-rw-r--r--src/test/ui/llvm-asm/issue-51431.stderr (renamed from src/test/ui/asm/issue-51431.stderr)0
-rw-r--r--src/test/ui/llvm-asm/issue-54067.rs (renamed from src/test/ui/asm/issue-54067.rs)0
-rw-r--r--src/test/ui/llvm-asm/issue-62046.rs (renamed from src/test/ui/asm/issue-62046.rs)0
-rw-r--r--src/test/ui/llvm-asm/issue-62046.stderr (renamed from src/test/ui/asm/issue-62046.stderr)0
-rw-r--r--src/test/ui/llvm-asm/issue-69092.rs (renamed from src/test/ui/asm/issue-69092.rs)0
-rw-r--r--src/test/ui/llvm-asm/issue-69092.stderr (renamed from src/test/ui/asm/issue-69092.stderr)0
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs (renamed from src/test/ui/asm/asm-bad-clobber.rs)0
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-bad-clobber.stderr (renamed from src/test/ui/asm/asm-bad-clobber.stderr)2
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs (renamed from src/test/ui/asm/asm-in-bad-modifier.rs)0
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.stderr (renamed from src/test/ui/asm/asm-in-bad-modifier.stderr)4
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-literal-escaping.rs (renamed from src/test/ui/asm/asm-literal-escaping.rs)0
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs (renamed from src/test/ui/asm/asm-misplaced-option.rs)0
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-misplaced-option.stderr (renamed from src/test/ui/asm/asm-misplaced-option.stderr)4
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs (renamed from src/test/ui/asm/asm-out-assign-imm.rs)0
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-out-assign-imm.stderr (renamed from src/test/ui/asm/asm-out-assign-imm.stderr)2
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs (renamed from src/test/ui/asm/asm-out-no-modifier.rs)0
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-out-no-modifier.stderr (renamed from src/test/ui/asm/asm-out-no-modifier.stderr)2
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs (renamed from src/test/ui/asm/asm-out-read-uninit.rs)0
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-out-read-uninit.stderr (renamed from src/test/ui/asm/asm-out-read-uninit.stderr)2
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-parse-errors.rs (renamed from src/test/ui/asm/asm-parse-errors.rs)0
-rw-r--r--src/test/ui/llvm-asm/llvm-asm-parse-errors.stderr (renamed from src/test/ui/asm/asm-parse-errors.stderr)22
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs16
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr12
30 files changed, 87 insertions, 56 deletions
diff --git a/src/liballoc/collections/linked_list.rs b/src/liballoc/collections/linked_list.rs
index 53d4f7239b7..243ebb453d3 100644
--- a/src/liballoc/collections/linked_list.rs
+++ b/src/liballoc/collections/linked_list.rs
@@ -1198,6 +1198,14 @@ pub struct Cursor<'a, T: 'a> {
 }
 
 #[unstable(feature = "linked_list_cursors", issue = "58533")]
+impl<T> Clone for Cursor<'_, T> {
+    fn clone(&self) -> Self {
+        let Cursor { index, current, list } = *self;
+        Cursor { index, current, list }
+    }
+}
+
+#[unstable(feature = "linked_list_cursors", issue = "58533")]
 impl<T: fmt::Debug> fmt::Debug for Cursor<'_, T> {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         f.debug_tuple("Cursor").field(&self.list).field(&self.index()).finish()
diff --git a/src/librustc_middle/mir/mod.rs b/src/librustc_middle/mir/mod.rs
index 212061cfd82..4063d290993 100644
--- a/src/librustc_middle/mir/mod.rs
+++ b/src/librustc_middle/mir/mod.rs
@@ -2611,14 +2611,14 @@ impl<'a, 'b> graph::GraphSuccessors<'b> for Body<'a> {
     type Iter = iter::Cloned<Successors<'b>>;
 }
 
+/// `Location` represents the position of the start of the statement; or, if
+/// `statement_index` equals the number of statements, then the start of the
+/// terminator.
 #[derive(Copy, Clone, PartialEq, Eq, Hash, Ord, PartialOrd, HashStable)]
 pub struct Location {
     /// The block that the location is within.
     pub block: BasicBlock,
 
-    /// The location is the position of the start of the statement; or, if
-    /// `statement_index` equals the number of statements, then the start of the
-    /// terminator.
     pub statement_index: usize,
 }
 
diff --git a/src/librustc_mir/const_eval/fn_queries.rs b/src/librustc_mir/const_eval/fn_queries.rs
index f1dff4fceb4..bb33372692d 100644
--- a/src/librustc_mir/const_eval/fn_queries.rs
+++ b/src/librustc_mir/const_eval/fn_queries.rs
@@ -95,8 +95,16 @@ fn is_const_fn_raw(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
 
     let node = tcx.hir().get(hir_id);
 
-    if let Some(whitelisted) = is_const_intrinsic(tcx, def_id) {
-        whitelisted
+    if let hir::Node::ForeignItem(hir::ForeignItem { kind: hir::ForeignItemKind::Fn(..), .. }) =
+        node
+    {
+        // Intrinsics use `rustc_const_{un,}stable` attributes to indicate constness. All other
+        // foreign items cannot be evaluated at compile-time.
+        if let Abi::RustIntrinsic | Abi::PlatformIntrinsic = tcx.hir().get_foreign_abi(hir_id) {
+            tcx.lookup_const_stability(def_id).is_some()
+        } else {
+            false
+        }
     } else if let Some(fn_like) = FnLikeNode::from_node(node) {
         if fn_like.constness() == hir::Constness::Const {
             return true;
@@ -112,21 +120,6 @@ fn is_const_fn_raw(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
     }
 }
 
-/// Const evaluability whitelist is here to check evaluability at the
-/// top level beforehand.
-fn is_const_intrinsic(tcx: TyCtxt<'_>, def_id: DefId) -> Option<bool> {
-    if tcx.is_closure(def_id) {
-        return None;
-    }
-
-    match tcx.fn_sig(def_id).abi() {
-        Abi::RustIntrinsic | Abi::PlatformIntrinsic => {
-            Some(tcx.lookup_const_stability(def_id).is_some())
-        }
-        _ => None,
-    }
-}
-
 /// Checks whether the given item is an `impl` that has a `const` modifier.
 fn is_const_impl_raw(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool {
     let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
diff --git a/src/librustc_mir/util/pretty.rs b/src/librustc_mir/util/pretty.rs
index 64221c41bff..efb84ef35f3 100644
--- a/src/librustc_mir/util/pretty.rs
+++ b/src/librustc_mir/util/pretty.rs
@@ -254,6 +254,7 @@ pub fn write_mir_pretty<'tcx>(
     Ok(())
 }
 
+/// Write out a human-readable textual representation for the given function.
 pub fn write_mir_fn<'tcx, F>(
     tcx: TyCtxt<'tcx>,
     src: MirSource<'tcx>,
diff --git a/src/librustc_passes/check_const.rs b/src/librustc_passes/check_const.rs
index f68213cc9c2..f409b040c69 100644
--- a/src/librustc_passes/check_const.rs
+++ b/src/librustc_passes/check_const.rs
@@ -74,16 +74,16 @@ enum ConstKind {
 }
 
 impl ConstKind {
-    fn for_body(body: &hir::Body<'_>, hir_map: Map<'_>) -> Option<Self> {
-        let is_const_fn = |id| hir_map.fn_sig_by_hir_id(id).unwrap().header.is_const();
-
-        let owner = hir_map.body_owner(body.id());
-        let const_kind = match hir_map.body_owner_kind(owner) {
+    fn for_body(body: &hir::Body<'_>, tcx: TyCtxt<'_>) -> Option<Self> {
+        let owner = tcx.hir().body_owner(body.id());
+        let const_kind = match tcx.hir().body_owner_kind(owner) {
             hir::BodyOwnerKind::Const => Self::Const,
             hir::BodyOwnerKind::Static(Mutability::Mut) => Self::StaticMut,
             hir::BodyOwnerKind::Static(Mutability::Not) => Self::Static,
 
-            hir::BodyOwnerKind::Fn if is_const_fn(owner) => Self::ConstFn,
+            hir::BodyOwnerKind::Fn if tcx.is_const_fn_raw(tcx.hir().local_def_id(owner)) => {
+                Self::ConstFn
+            }
             hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure => return None,
         };
 
@@ -211,7 +211,7 @@ impl<'tcx> Visitor<'tcx> for CheckConstVisitor<'tcx> {
     }
 
     fn visit_body(&mut self, body: &'tcx hir::Body<'tcx>) {
-        let kind = ConstKind::for_body(body, self.tcx.hir());
+        let kind = ConstKind::for_body(body, self.tcx);
         self.recurse_into(kind, |this| intravisit::walk_body(this, body));
     }
 
diff --git a/src/librustc_typeck/check/expr.rs b/src/librustc_typeck/check/expr.rs
index 7cb51b4d6d8..dbda735aa99 100644
--- a/src/librustc_typeck/check/expr.rs
+++ b/src/librustc_typeck/check/expr.rs
@@ -975,18 +975,19 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         expected: Expectation<'tcx>,
         expr: &'tcx hir::Expr<'tcx>,
     ) -> Ty<'tcx> {
-        let uty = expected.to_option(self).and_then(|uty| match uty.kind {
-            ty::Array(ty, _) | ty::Slice(ty) => Some(ty),
-            _ => None,
-        });
-
         let element_ty = if !args.is_empty() {
-            let coerce_to = uty.unwrap_or_else(|| {
-                self.next_ty_var(TypeVariableOrigin {
-                    kind: TypeVariableOriginKind::TypeInference,
-                    span: expr.span,
+            let coerce_to = expected
+                .to_option(self)
+                .and_then(|uty| match uty.kind {
+                    ty::Array(ty, _) | ty::Slice(ty) => Some(ty),
+                    _ => None,
                 })
-            });
+                .unwrap_or_else(|| {
+                    self.next_ty_var(TypeVariableOrigin {
+                        kind: TypeVariableOriginKind::TypeInference,
+                        span: expr.span,
+                    })
+                });
             let mut coerce = CoerceMany::with_coercion_sites(coerce_to, args);
             assert_eq!(self.diverges.get(), Diverges::Maybe);
             for e in args {
diff --git a/src/test/ui/asm/issue-51431.rs b/src/test/ui/llvm-asm/issue-51431.rs
index ca06bdab27b..ca06bdab27b 100644
--- a/src/test/ui/asm/issue-51431.rs
+++ b/src/test/ui/llvm-asm/issue-51431.rs
diff --git a/src/test/ui/asm/issue-51431.stderr b/src/test/ui/llvm-asm/issue-51431.stderr
index b4b39a2a44e..b4b39a2a44e 100644
--- a/src/test/ui/asm/issue-51431.stderr
+++ b/src/test/ui/llvm-asm/issue-51431.stderr
diff --git a/src/test/ui/asm/issue-54067.rs b/src/test/ui/llvm-asm/issue-54067.rs
index f2e097222bd..f2e097222bd 100644
--- a/src/test/ui/asm/issue-54067.rs
+++ b/src/test/ui/llvm-asm/issue-54067.rs
diff --git a/src/test/ui/asm/issue-62046.rs b/src/test/ui/llvm-asm/issue-62046.rs
index fd4d9bdd23d..fd4d9bdd23d 100644
--- a/src/test/ui/asm/issue-62046.rs
+++ b/src/test/ui/llvm-asm/issue-62046.rs
diff --git a/src/test/ui/asm/issue-62046.stderr b/src/test/ui/llvm-asm/issue-62046.stderr
index cf27052df05..cf27052df05 100644
--- a/src/test/ui/asm/issue-62046.stderr
+++ b/src/test/ui/llvm-asm/issue-62046.stderr
diff --git a/src/test/ui/asm/issue-69092.rs b/src/test/ui/llvm-asm/issue-69092.rs
index ecce7bfdf5b..ecce7bfdf5b 100644
--- a/src/test/ui/asm/issue-69092.rs
+++ b/src/test/ui/llvm-asm/issue-69092.rs
diff --git a/src/test/ui/asm/issue-69092.stderr b/src/test/ui/llvm-asm/issue-69092.stderr
index 35f77edc3c4..35f77edc3c4 100644
--- a/src/test/ui/asm/issue-69092.stderr
+++ b/src/test/ui/llvm-asm/issue-69092.stderr
diff --git a/src/test/ui/asm/asm-bad-clobber.rs b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs
index 9f5662cbd1e..9f5662cbd1e 100644
--- a/src/test/ui/asm/asm-bad-clobber.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.rs
diff --git a/src/test/ui/asm/asm-bad-clobber.stderr b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.stderr
index 8c5d04694c4..9ecd12caa0e 100644
--- a/src/test/ui/asm/asm-bad-clobber.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-bad-clobber.stderr
@@ -1,5 +1,5 @@
 error[E0664]: clobber should not be surrounded by braces
-  --> $DIR/asm-bad-clobber.rs:22:42
+  --> $DIR/llvm-asm-bad-clobber.rs:22:42
    |
 LL |         llvm_asm!("xor %eax, %eax" : : : "{eax}");
    |                                          ^^^^^^^
diff --git a/src/test/ui/asm/asm-in-bad-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs
index b791ec3e8c8..b791ec3e8c8 100644
--- a/src/test/ui/asm/asm-in-bad-modifier.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.rs
diff --git a/src/test/ui/asm/asm-in-bad-modifier.stderr b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.stderr
index f1624f74a70..e94ac94f59f 100644
--- a/src/test/ui/asm/asm-in-bad-modifier.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-in-bad-modifier.stderr
@@ -1,11 +1,11 @@
 error[E0662]: input operand constraint contains '='
-  --> $DIR/asm-in-bad-modifier.rs:23:44
+  --> $DIR/llvm-asm-in-bad-modifier.rs:23:44
    |
 LL |         llvm_asm!("mov $1, $0" : "=r"(x) : "=r"(5));
    |                                            ^^^^
 
 error[E0663]: input operand constraint contains '+'
-  --> $DIR/asm-in-bad-modifier.rs:24:44
+  --> $DIR/llvm-asm-in-bad-modifier.rs:24:44
    |
 LL |         llvm_asm!("mov $1, $0" : "=r"(y) : "+r"(5));
    |                                            ^^^^
diff --git a/src/test/ui/asm/asm-literal-escaping.rs b/src/test/ui/llvm-asm/llvm-asm-literal-escaping.rs
index 5d45f5084c5..5d45f5084c5 100644
--- a/src/test/ui/asm/asm-literal-escaping.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-literal-escaping.rs
diff --git a/src/test/ui/asm/asm-misplaced-option.rs b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs
index 3c44fc90ef3..3c44fc90ef3 100644
--- a/src/test/ui/asm/asm-misplaced-option.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.rs
diff --git a/src/test/ui/asm/asm-misplaced-option.stderr b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.stderr
index ea155b91c5d..21fd27825a1 100644
--- a/src/test/ui/asm/asm-misplaced-option.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-misplaced-option.stderr
@@ -1,11 +1,11 @@
 warning: unrecognized option
-  --> $DIR/asm-misplaced-option.rs:24:69
+  --> $DIR/llvm-asm-misplaced-option.rs:24:69
    |
 LL |         llvm_asm!("mov $1, $0" : "=r"(x) : "r"(5_usize), "0"(x) : : "cc");
    |                                                                     ^^^^
 
 warning: expected a clobber, found an option
-  --> $DIR/asm-misplaced-option.rs:31:85
+  --> $DIR/llvm-asm-misplaced-option.rs:31:85
    |
 LL |         llvm_asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile");
    |                                                                                     ^^^^^^^^^^
diff --git a/src/test/ui/asm/asm-out-assign-imm.rs b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs
index 1a46879f9f2..1a46879f9f2 100644
--- a/src/test/ui/asm/asm-out-assign-imm.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.rs
diff --git a/src/test/ui/asm/asm-out-assign-imm.stderr b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.stderr
index feec61b4fc6..e110aec2209 100644
--- a/src/test/ui/asm/asm-out-assign-imm.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-out-assign-imm.stderr
@@ -1,5 +1,5 @@
 error[E0384]: cannot assign twice to immutable variable `x`
-  --> $DIR/asm-out-assign-imm.rs:24:39
+  --> $DIR/llvm-asm-out-assign-imm.rs:24:39
    |
 LL |     let x: isize;
    |         - help: make this binding mutable: `mut x`
diff --git a/src/test/ui/asm/asm-out-no-modifier.rs b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs
index d198437c508..d198437c508 100644
--- a/src/test/ui/asm/asm-out-no-modifier.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.rs
diff --git a/src/test/ui/asm/asm-out-no-modifier.stderr b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.stderr
index 1c9e108f910..1f2b2727924 100644
--- a/src/test/ui/asm/asm-out-no-modifier.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-out-no-modifier.stderr
@@ -1,5 +1,5 @@
 error[E0661]: output operand constraint lacks '=' or '+'
-  --> $DIR/asm-out-no-modifier.rs:22:34
+  --> $DIR/llvm-asm-out-no-modifier.rs:22:34
    |
 LL |         llvm_asm!("mov $1, $0" : "r"(x) : "r"(5));
    |                                  ^^^
diff --git a/src/test/ui/asm/asm-out-read-uninit.rs b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs
index d45498d4bb4..d45498d4bb4 100644
--- a/src/test/ui/asm/asm-out-read-uninit.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.rs
diff --git a/src/test/ui/asm/asm-out-read-uninit.stderr b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.stderr
index 3c3f3a6febb..a22ebe4e4d9 100644
--- a/src/test/ui/asm/asm-out-read-uninit.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-out-read-uninit.stderr
@@ -1,5 +1,5 @@
 error[E0381]: use of possibly-uninitialized variable: `x`
-  --> $DIR/asm-out-read-uninit.rs:22:48
+  --> $DIR/llvm-asm-out-read-uninit.rs:22:48
    |
 LL |         llvm_asm!("mov $1, $0" : "=r"(x) : "r"(x));
    |                                                ^ use of possibly-uninitialized `x`
diff --git a/src/test/ui/asm/asm-parse-errors.rs b/src/test/ui/llvm-asm/llvm-asm-parse-errors.rs
index d458be81529..d458be81529 100644
--- a/src/test/ui/asm/asm-parse-errors.rs
+++ b/src/test/ui/llvm-asm/llvm-asm-parse-errors.rs
diff --git a/src/test/ui/asm/asm-parse-errors.stderr b/src/test/ui/llvm-asm/llvm-asm-parse-errors.stderr
index 64f295c3b36..1fd46809f3e 100644
--- a/src/test/ui/asm/asm-parse-errors.stderr
+++ b/src/test/ui/llvm-asm/llvm-asm-parse-errors.stderr
@@ -1,65 +1,65 @@
 error: macro requires a string literal as an argument
-  --> $DIR/asm-parse-errors.rs:4:5
+  --> $DIR/llvm-asm-parse-errors.rs:4:5
    |
 LL |     llvm_asm!();
    |     ^^^^^^^^^^^^ string literal required
 
 error: expected string literal
-  --> $DIR/asm-parse-errors.rs:5:23
+  --> $DIR/llvm-asm-parse-errors.rs:5:23
    |
 LL |     llvm_asm!("nop" : struct);
    |                       ^^^^^^ not a string literal
 
 error: expected string literal
-  --> $DIR/asm-parse-errors.rs:6:35
+  --> $DIR/llvm-asm-parse-errors.rs:6:35
    |
 LL |     llvm_asm!("mov %eax, $$0x2" : struct);
    |                                   ^^^^^^ not a string literal
 
 error: expected `(`, found keyword `struct`
-  --> $DIR/asm-parse-errors.rs:7:44
+  --> $DIR/llvm-asm-parse-errors.rs:7:44
    |
 LL |     llvm_asm!("mov %eax, $$0x2" : "={eax}" struct);
    |                                            ^^^^^^ expected `(`
 
 error: expected expression, found keyword `struct`
-  --> $DIR/asm-parse-errors.rs:8:44
+  --> $DIR/llvm-asm-parse-errors.rs:8:44
    |
 LL |     llvm_asm!("mov %eax, $$0x2" : "={eax}"(struct));
    |                                            ^^^^^^ expected expression
 
 error: expected string literal
-  --> $DIR/asm-parse-errors.rs:9:49
+  --> $DIR/llvm-asm-parse-errors.rs:9:49
    |
 LL |     llvm_asm!("in %dx, %al" : "={al}"(result) : struct);
    |                                                 ^^^^^^ not a string literal
 
 error: expected `(`, found keyword `struct`
-  --> $DIR/asm-parse-errors.rs:10:56
+  --> $DIR/llvm-asm-parse-errors.rs:10:56
    |
 LL |     llvm_asm!("in %dx, %al" : "={al}"(result) : "{dx}" struct);
    |                                                        ^^^^^^ expected `(`
 
 error: expected expression, found keyword `struct`
-  --> $DIR/asm-parse-errors.rs:11:56
+  --> $DIR/llvm-asm-parse-errors.rs:11:56
    |
 LL |     llvm_asm!("in %dx, %al" : "={al}"(result) : "{dx}"(struct));
    |                                                        ^^^^^^ expected expression
 
 error: expected string literal
-  --> $DIR/asm-parse-errors.rs:12:41
+  --> $DIR/llvm-asm-parse-errors.rs:12:41
    |
 LL |     llvm_asm!("mov $$0x200, %eax" : : : struct);
    |                                         ^^^^^^ not a string literal
 
 error: expected string literal
-  --> $DIR/asm-parse-errors.rs:13:50
+  --> $DIR/llvm-asm-parse-errors.rs:13:50
    |
 LL |     llvm_asm!("mov eax, 2" : "={eax}"(foo) : : : struct);
    |                                                  ^^^^^^ not a string literal
 
 error: inline assembly must be a string literal
-  --> $DIR/asm-parse-errors.rs:14:15
+  --> $DIR/llvm-asm-parse-errors.rs:14:15
    |
 LL |     llvm_asm!(123);
    |               ^^^
diff --git a/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs
new file mode 100644
index 00000000000..f7af1b506f0
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.rs
@@ -0,0 +1,16 @@
+// Regression test for #69615.
+
+#![feature(const_trait_impl, const_fn)]
+#![allow(incomplete_features)]
+
+pub trait MyTrait {
+    fn method(&self);
+}
+
+impl const MyTrait for () {
+    fn method(&self) {
+        match *self {} //~ ERROR `match` is not allowed in a `const fn`
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr
new file mode 100644
index 00000000000..563a9afe5bb
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/hir-const-check.stderr
@@ -0,0 +1,12 @@
+error[E0658]: `match` is not allowed in a `const fn`
+  --> $DIR/hir-const-check.rs:12:9
+   |
+LL |         match *self {}
+   |         ^^^^^^^^^^^^^^
+   |
+   = note: see issue #49146 <https://github.com/rust-lang/rust/issues/49146> for more information
+   = help: add `#![feature(const_if_match)]` to the crate attributes to enable
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0658`.