]> git.lizzy.rs Git - rust.git/blob - tests/ui/mir/thir-constparam-temp.stderr
Add regression test for #42114
[rust.git] / tests / ui / mir / thir-constparam-temp.stderr
1 warning: taking a mutable reference to a `const` item
2   --> $DIR/thir-constparam-temp.rs:14:5
3    |
4 LL |     YIKES.mut_self()
5    |     ^^^^^^^^^^^^^^^^
6    |
7    = note: each usage of a `const` item creates a new temporary
8    = note: the mutable reference will refer to this temporary, not the original `const` item
9 note: mutable reference created due to call to this method
10   --> $DIR/thir-constparam-temp.rs:10:5
11    |
12 LL |     fn mut_self(&mut self) {}
13    |     ^^^^^^^^^^^^^^^^^^^^^^
14 note: `const` item defined here
15   --> $DIR/thir-constparam-temp.rs:13:8
16    |
17 LL | fn foo<const YIKES: Yikes>() {
18    |        ^^^^^^^^^^^^^^^^^^
19    = note: `#[warn(const_item_mutation)]` on by default
20
21 warning: 1 warning emitted
22