about summary refs log tree commit diff
path: root/tests/ui/offset-of
diff options
context:
space:
mode:
authorGeorge Bateman <george.bateman16@gmail.com>2023-10-31 23:41:40 +0000
committerGeorge Bateman <george.bateman16@gmail.com>2023-10-31 23:41:40 +0000
commite742f809f68d571a28b7c9153366194e47714b65 (patch)
treeb83bb9802bbaa73a5d398c91dc28d8b3093ab015 /tests/ui/offset-of
parent9d6ce61376ef77bae3268b1b69ec6e7f3b815923 (diff)
downloadrust-e742f809f68d571a28b7c9153366194e47714b65.tar.gz
rust-e742f809f68d571a28b7c9153366194e47714b65.zip
Update based on wesleywiser review
Diffstat (limited to 'tests/ui/offset-of')
-rw-r--r--tests/ui/offset-of/offset-of-enum.rs1
-rw-r--r--tests/ui/offset-of/offset-of-enum.stderr12
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/ui/offset-of/offset-of-enum.rs b/tests/ui/offset-of/offset-of-enum.rs
index cf516175085..e8b5a08377b 100644
--- a/tests/ui/offset-of/offset-of-enum.rs
+++ b/tests/ui/offset-of/offset-of-enum.rs
@@ -14,4 +14,5 @@ fn main() {
     offset_of!(Alpha, Two.1); //~ ERROR no field named `1` on enum variant `Alpha::Two`
     offset_of!(Alpha, Two.foo); //~ ERROR no field named `foo` on enum variant `Alpha::Two`
     offset_of!(Alpha, NonExistent); //~ ERROR no variant named `NonExistent` found for enum `Alpha`
+    offset_of!(Beta, One); //~ ERROR cannot find type `Beta` in this scope
 }
diff --git a/tests/ui/offset-of/offset-of-enum.stderr b/tests/ui/offset-of/offset-of-enum.stderr
index 2867cc6befb..7e7ad41f5b6 100644
--- a/tests/ui/offset-of/offset-of-enum.stderr
+++ b/tests/ui/offset-of/offset-of-enum.stderr
@@ -7,6 +7,12 @@ LL |     offset_of!(Alpha::One, 0);
    |                not a type
    |                help: try using the variant's enum: `Alpha`
 
+error[E0412]: cannot find type `Beta` in this scope
+  --> $DIR/offset-of-enum.rs:17:16
+   |
+LL |     offset_of!(Beta, One);
+   |                ^^^^ not found in this scope
+
 error[E0795]: `One` is an enum variant; expected field at end of `offset_of`
   --> $DIR/offset-of-enum.rs:12:23
    |
@@ -35,7 +41,7 @@ error[E0599]: no variant named `NonExistent` found for enum `Alpha`
 LL |     offset_of!(Alpha, NonExistent);
    |                       ^^^^^^^^^^^ variant not found
 
-error: aborting due to 5 previous errors
+error: aborting due to 6 previous errors
 
-Some errors have detailed explanations: E0573, E0599, E0609, E0795.
-For more information about an error, try `rustc --explain E0573`.
+Some errors have detailed explanations: E0412, E0573, E0599, E0609, E0795.
+For more information about an error, try `rustc --explain E0412`.