about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2022-07-31 16:02:45 +0400
committerMaybe Waffle <waffle.lapkin@gmail.com>2022-07-31 16:02:45 +0400
commite11b4b8e02495e9753df983de7bcec9ef2b8ae31 (patch)
tree33a8501622525c776eb098f76e1e3fa65fe3b33f
parent1e1d6fe84dd086a9075fcfe5fc63d81738c02f12 (diff)
downloadrust-e11b4b8e02495e9753df983de7bcec9ef2b8ae31.tar.gz
rust-e11b4b8e02495e9753df983de7bcec9ef2b8ae31.zip
Panic when checking an unknown stability attribute
-rw-r--r--compiler/rustc_attr/src/builtin.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs
index 2eb50d64802..62ccd734fe7 100644
--- a/compiler/rustc_attr/src/builtin.rs
+++ b/compiler/rustc_attr/src/builtin.rs
@@ -428,9 +428,11 @@ where
                                     ConstStability { level, feature, promotable: false },
                                     attr.span,
                                 ));
-                            } else {
+                            } else if sym::rustc_default_body_unstable == meta_name {
                                 body_stab =
                                     Some((DefaultBodyStability { level, feature }, attr.span));
+                            } else {
+                                unreachable!("Unknown stability attribute {meta_name}");
                             }
                         }
                         (None, _, _) => {