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/mir/thir-constparam-temp.stderr | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/test/ui/mir/thir-constparam-temp.stderr (limited to 'src/test/ui/mir/thir-constparam-temp.stderr') diff --git a/src/test/ui/mir/thir-constparam-temp.stderr b/src/test/ui/mir/thir-constparam-temp.stderr new file mode 100644 index 000000000..ed2766c00 --- /dev/null +++ b/src/test/ui/mir/thir-constparam-temp.stderr @@ -0,0 +1,22 @@ +warning: taking a mutable reference to a `const` item + --> $DIR/thir-constparam-temp.rs:14:5 + | +LL | YIKES.mut_self() + | ^^^^^^^^^^^^^^^^ + | + = note: `#[warn(const_item_mutation)]` on by default + = note: each usage of a `const` item creates a new temporary + = note: the mutable reference will refer to this temporary, not the original `const` item +note: mutable reference created due to call to this method + --> $DIR/thir-constparam-temp.rs:10:5 + | +LL | fn mut_self(&mut self) {} + | ^^^^^^^^^^^^^^^^^^^^^^ +note: `const` item defined here + --> $DIR/thir-constparam-temp.rs:13:8 + | +LL | fn foo() { + | ^^^^^^^^^^^^^^^^^^ + +warning: 1 warning emitted + -- cgit v1.2.3