From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/issues/issue-16538.thir.stderr | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/ui/issues/issue-16538.thir.stderr (limited to 'src/test/ui/issues/issue-16538.thir.stderr') diff --git a/src/test/ui/issues/issue-16538.thir.stderr b/src/test/ui/issues/issue-16538.thir.stderr new file mode 100644 index 000000000..a18b0197d --- /dev/null +++ b/src/test/ui/issues/issue-16538.thir.stderr @@ -0,0 +1,28 @@ +error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block + --> $DIR/issue-16538.rs:14:22 + | +LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer + | + = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior + +error[E0133]: use of extern static is unsafe and requires unsafe function or block + --> $DIR/issue-16538.rs:14:30 + | +LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); + | ^^^^ use of extern static + | + = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior + +error[E0015]: cannot call non-const fn `Y::foo` in statics + --> $DIR/issue-16538.rs:14:23 + | +LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: calls in statics are limited to constant functions, tuple structs and tuple variants + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0015, E0133. +For more information about an error, try `rustc --explain E0015`. -- cgit v1.2.3