Skip to content

Commit

Permalink
stabilize const_mut_refs
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 15, 2024
1 parent b5ea5c2 commit 976131f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 31 deletions.
6 changes: 3 additions & 3 deletions tests/ui/arithmetic_side_effects.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
//@aux-build:proc_macro_derive.rs

#![feature(f128)]
#![feature(f16)]

#![allow(
clippy::assign_op_pattern,
clippy::erasing_op,
Expand All @@ -10,9 +13,6 @@
arithmetic_overflow,
unconditional_panic
)]
#![feature(const_mut_refs)]
#![feature(f128)]
#![feature(f16)]
#![warn(clippy::arithmetic_side_effects)]

extern crate proc_macro_derive;
Expand Down
1 change: 0 additions & 1 deletion tests/ui/missing_const_for_fn/could_be_const.fixed
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![warn(clippy::missing_const_for_fn)]
#![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)]
#![allow(unsupported_calling_conventions)]
#![feature(const_mut_refs)]
#![feature(const_trait_impl)]

use std::mem::transmute;
Expand Down
1 change: 0 additions & 1 deletion tests/ui/missing_const_for_fn/could_be_const.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![warn(clippy::missing_const_for_fn)]
#![allow(incomplete_features, clippy::let_and_return, clippy::missing_transmute_annotations)]
#![allow(unsupported_calling_conventions)]
#![feature(const_mut_refs)]
#![feature(const_trait_impl)]

use std::mem::transmute;
Expand Down
52 changes: 26 additions & 26 deletions tests/ui/missing_const_for_fn/could_be_const.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:15:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:14:5
|
LL | / pub fn new() -> Self {
LL | |
Expand All @@ -16,7 +16,7 @@ LL | pub const fn new() -> Self {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:21:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:20:5
|
LL | / fn const_generic_params<'a, T, const N: usize>(&self, b: &'a [T; N]) -> &'a [T; N] {
LL | |
Expand All @@ -30,7 +30,7 @@ LL | const fn const_generic_params<'a, T, const N: usize>(&self, b: &'a [T;
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:28:1
--> tests/ui/missing_const_for_fn/could_be_const.rs:27:1
|
LL | / fn one() -> i32 {
LL | |
Expand All @@ -44,7 +44,7 @@ LL | const fn one() -> i32 {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:34:1
--> tests/ui/missing_const_for_fn/could_be_const.rs:33:1
|
LL | / fn two() -> i32 {
LL | |
Expand All @@ -59,7 +59,7 @@ LL | const fn two() -> i32 {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:41:1
--> tests/ui/missing_const_for_fn/could_be_const.rs:40:1
|
LL | / fn string() -> String {
LL | |
Expand All @@ -73,7 +73,7 @@ LL | const fn string() -> String {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:47:1
--> tests/ui/missing_const_for_fn/could_be_const.rs:46:1
|
LL | / unsafe fn four() -> i32 {
LL | |
Expand All @@ -87,7 +87,7 @@ LL | const unsafe fn four() -> i32 {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:53:1
--> tests/ui/missing_const_for_fn/could_be_const.rs:52:1
|
LL | / fn generic<T>(t: T) -> T {
LL | |
Expand All @@ -101,7 +101,7 @@ LL | const fn generic<T>(t: T) -> T {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:62:1
--> tests/ui/missing_const_for_fn/could_be_const.rs:61:1
|
LL | / fn generic_arr<T: Copy>(t: [T; 1]) -> T {
LL | |
Expand All @@ -115,7 +115,7 @@ LL | const fn generic_arr<T: Copy>(t: [T; 1]) -> T {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:76:9
--> tests/ui/missing_const_for_fn/could_be_const.rs:75:9
|
LL | / pub fn b(self, a: &A) -> B {
LL | |
Expand All @@ -129,7 +129,7 @@ LL | pub const fn b(self, a: &A) -> B {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:86:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:85:5
|
LL | / fn const_fn_stabilized_before_msrv(byte: u8) {
LL | |
Expand All @@ -143,7 +143,7 @@ LL | const fn const_fn_stabilized_before_msrv(byte: u8) {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:98:1
--> tests/ui/missing_const_for_fn/could_be_const.rs:97:1
|
LL | / fn msrv_1_46() -> i32 {
LL | |
Expand All @@ -157,7 +157,7 @@ LL | const fn msrv_1_46() -> i32 {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:118:1
--> tests/ui/missing_const_for_fn/could_be_const.rs:117:1
|
LL | fn d(this: D) {}
| ^^^^^^^^^^^^^^^^
Expand All @@ -168,7 +168,7 @@ LL | const fn d(this: D) {}
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:126:9
--> tests/ui/missing_const_for_fn/could_be_const.rs:125:9
|
LL | / fn deref_ptr_can_be_const(self) -> usize {
LL | |
Expand All @@ -182,7 +182,7 @@ LL | const fn deref_ptr_can_be_const(self) -> usize {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:131:9
--> tests/ui/missing_const_for_fn/could_be_const.rs:130:9
|
LL | / fn deref_copied_val(self) -> usize {
LL | |
Expand All @@ -196,7 +196,7 @@ LL | const fn deref_copied_val(self) -> usize {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:142:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:141:5
|
LL | / fn union_access_can_be_const() {
LL | |
Expand All @@ -211,7 +211,7 @@ LL | const fn union_access_can_be_const() {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:150:9
--> tests/ui/missing_const_for_fn/could_be_const.rs:149:9
|
LL | extern "C" fn c() {}
| ^^^^^^^^^^^^^^^^^^^^
Expand All @@ -222,7 +222,7 @@ LL | const extern "C" fn c() {}
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:154:9
--> tests/ui/missing_const_for_fn/could_be_const.rs:153:9
|
LL | extern fn implicit_c() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -233,7 +233,7 @@ LL | const extern fn implicit_c() {}
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:171:9
--> tests/ui/missing_const_for_fn/could_be_const.rs:170:9
|
LL | / pub fn new(strings: Vec<String>) -> Self {
LL | | Self { strings }
Expand All @@ -246,7 +246,7 @@ LL | pub const fn new(strings: Vec<String>) -> Self {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:176:9
--> tests/ui/missing_const_for_fn/could_be_const.rs:175:9
|
LL | / pub fn empty() -> Self {
LL | | Self { strings: Vec::new() }
Expand All @@ -259,7 +259,7 @@ LL | pub const fn empty() -> Self {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:187:9
--> tests/ui/missing_const_for_fn/could_be_const.rs:186:9
|
LL | / pub fn new(text: String) -> Self {
LL | | let vec = Vec::new();
Expand All @@ -273,7 +273,7 @@ LL | pub const fn new(text: String) -> Self {
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:206:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:205:5
|
LL | fn alias_ty_is_projection(bar: <() as FooTrait>::Foo) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -284,7 +284,7 @@ LL | const fn alias_ty_is_projection(bar: <() as FooTrait>::Foo) {}
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:210:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:209:5
|
LL | extern "C-unwind" fn c_unwind() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -295,7 +295,7 @@ LL | const extern "C-unwind" fn c_unwind() {}
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:212:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:211:5
|
LL | extern "system" fn system() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -306,7 +306,7 @@ LL | const extern "system" fn system() {}
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:214:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:213:5
|
LL | extern "system-unwind" fn system_unwind() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -317,7 +317,7 @@ LL | const extern "system-unwind" fn system_unwind() {}
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:216:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:215:5
|
LL | pub extern "stdcall" fn std_call() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -328,7 +328,7 @@ LL | pub const extern "stdcall" fn std_call() {}
| +++++

error: this could be a `const fn`
--> tests/ui/missing_const_for_fn/could_be_const.rs:218:5
--> tests/ui/missing_const_for_fn/could_be_const.rs:217:5
|
LL | pub extern "stdcall-unwind" fn std_call_unwind() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down

0 comments on commit 976131f

Please sign in to comment.