about summary refs log tree commit diff
path: root/tests/ui/unsafe/raw-pointer-field-access-error.stderr
diff options
context:
space:
mode:
authorKivooeo <Kivooeo123@gmail.com>2025-07-18 22:06:07 +0500
committerKivooeo <Kivooeo123@gmail.com>2025-07-25 20:38:54 +0500
commite9959aa74e23eb340d6c9e9a4eab807be03b028f (patch)
tree493df6b8c16382a44c1a8a51d5a1f5f7e416e5a7 /tests/ui/unsafe/raw-pointer-field-access-error.stderr
parent9f38ca97eab53ba2f431a48bec2343ef52335714 (diff)
downloadrust-e9959aa74e23eb340d6c9e9a4eab807be03b028f.tar.gz
rust-e9959aa74e23eb340d6c9e9a4eab807be03b028f.zip
comments
Diffstat (limited to 'tests/ui/unsafe/raw-pointer-field-access-error.stderr')
-rw-r--r--tests/ui/unsafe/raw-pointer-field-access-error.stderr25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/unsafe/raw-pointer-field-access-error.stderr b/tests/ui/unsafe/raw-pointer-field-access-error.stderr
new file mode 100644
index 00000000000..e9a205a5fa6
--- /dev/null
+++ b/tests/ui/unsafe/raw-pointer-field-access-error.stderr
@@ -0,0 +1,25 @@
+error[E0609]: no field `x` on type `*mut A`
+  --> $DIR/raw-pointer-field-access-error.rs:9:21
+   |
+LL |     let x : i32 = n.x;
+   |                     ^ unknown field
+   |
+help: `n` is a raw pointer; try dereferencing it
+   |
+LL |     let x : i32 = (*n).x;
+   |                   ++ +
+
+error[E0609]: no field `y` on type `*mut A`
+  --> $DIR/raw-pointer-field-access-error.rs:10:21
+   |
+LL |     let y : f64 = n.y;
+   |                     ^ unknown field
+   |
+help: `n` is a raw pointer; try dereferencing it
+   |
+LL |     let y : f64 = (*n).y;
+   |                   ++ +
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0609`.