You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #86348 - JohnTitor:rollup-o6a6k67, r=JohnTitor
Rollup of 8 pull requests
Successful merges:
- #85283 (Avoid possible filename collision in coverage tests)
- #86200 (Updates `Clone` docs for `Copy` comparison.)
- #86209 (fix minor wording/typo issues in core::option docs)
- #86242 (rustdoc- dont ICE on `ConstEvaluatable` predicates)
- #86280 (Add a regression test for issue-76510)
- #86293 (Allow to run only a few GUI tests)
- #86327 (Don't mark "safe" intrinsics as unsafe)
- #86345 (Remove some duplicate `char` assoc items on RELEASES.md)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
error[E0764]: mutable references are not allowed in the final value of constants
2
+
--> $DIR/issue-76510.rs:5:29
3
+
|
4
+
LL | const S: &'static mut str = &mut " hello ";
5
+
| ^^^^^^^^^^^^^^
6
+
7
+
error[E0658]: mutation through a reference is not allowed in constants
8
+
--> $DIR/issue-76510.rs:5:29
9
+
|
10
+
LL | const S: &'static mut str = &mut " hello ";
11
+
| ^^^^^^^^^^^^^^
12
+
|
13
+
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
14
+
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
15
+
16
+
error[E0596]: cannot borrow data in a `&` reference as mutable
17
+
--> $DIR/issue-76510.rs:5:29
18
+
|
19
+
LL | const S: &'static mut str = &mut " hello ";
20
+
| ^^^^^^^^^^^^^^ cannot borrow as mutable
21
+
22
+
error[E0080]: it is undefined behavior to use this value
23
+
--> $DIR/issue-76510.rs:5:1
24
+
|
25
+
LL | const S: &'static mut str = &mut " hello ";
26
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered mutable reference in a `const`
27
+
|
28
+
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
29
+
= note: the raw bytes of the constant (size: 8, align: 4) {
30
+
╾─alloc2──╼ 07 00 00 00 │ ╾──╼....
31
+
}
32
+
33
+
error: aborting due to 4 previous errors
34
+
35
+
Some errors have detailed explanations: E0080, E0596, E0658, E0764.
36
+
For more information about an error, try `rustc --explain E0080`.
error[E0764]: mutable references are not allowed in the final value of constants
2
+
--> $DIR/issue-76510.rs:5:29
3
+
|
4
+
LL | const S: &'static mut str = &mut " hello ";
5
+
| ^^^^^^^^^^^^^^
6
+
7
+
error[E0658]: mutation through a reference is not allowed in constants
8
+
--> $DIR/issue-76510.rs:5:29
9
+
|
10
+
LL | const S: &'static mut str = &mut " hello ";
11
+
| ^^^^^^^^^^^^^^
12
+
|
13
+
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
14
+
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
15
+
16
+
error[E0596]: cannot borrow data in a `&` reference as mutable
17
+
--> $DIR/issue-76510.rs:5:29
18
+
|
19
+
LL | const S: &'static mut str = &mut " hello ";
20
+
| ^^^^^^^^^^^^^^ cannot borrow as mutable
21
+
22
+
error[E0080]: it is undefined behavior to use this value
23
+
--> $DIR/issue-76510.rs:5:1
24
+
|
25
+
LL | const S: &'static mut str = &mut " hello ";
26
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered mutable reference in a `const`
27
+
|
28
+
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
29
+
= note: the raw bytes of the constant (size: 16, align: 8) {
0 commit comments