diff options
| author | Stuart Cook <Zalathar@users.noreply.github.com> | 2024-12-24 14:05:24 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-24 14:05:24 +1100 |
| commit | 772b95e7554194dfbb04aaee65fcd983d0b84221 (patch) | |
| tree | 9fc560505321d7a860cddb7d3b7f64ea5d0408e7 /tests/ui/error-codes | |
| parent | 33311856e13ca440a57f822969d5f6fff254e194 (diff) | |
| parent | 92f93f6d1127cd8f2438474ebe4620231f5d5473 (diff) | |
| download | rust-772b95e7554194dfbb04aaee65fcd983d0b84221.tar.gz rust-772b95e7554194dfbb04aaee65fcd983d0b84221.zip | |
Rollup merge of #134701 - compiler-errors:non-const-def-descr, r=Urgau,fmease
Correctly note item kind in `NonConstFunctionCall` error message Don't just call everything a "`fn`". This is more consistent with the error message we give for conditionally-const items, which do note the item's def kind. r? fmease, this is a prerequisite for making those `~const PartialEq` error messages better. Re-roll if you're busy or don't want to review this.
Diffstat (limited to 'tests/ui/error-codes')
| -rw-r--r-- | tests/ui/error-codes/E0010-teach.rs | 2 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0010-teach.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0010.rs | 2 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0010.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0015.rs | 2 | ||||
| -rw-r--r-- | tests/ui/error-codes/E0015.stderr | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/tests/ui/error-codes/E0010-teach.rs b/tests/ui/error-codes/E0010-teach.rs index 146e68df14a..0eef2478387 100644 --- a/tests/ui/error-codes/E0010-teach.rs +++ b/tests/ui/error-codes/E0010-teach.rs @@ -3,5 +3,5 @@ #![allow(warnings)] const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010 -//~| ERROR cannot call non-const fn +//~| ERROR cannot call non-const method fn main() {} diff --git a/tests/ui/error-codes/E0010-teach.stderr b/tests/ui/error-codes/E0010-teach.stderr index 37a9892ccbf..82bbe01aef7 100644 --- a/tests/ui/error-codes/E0010-teach.stderr +++ b/tests/ui/error-codes/E0010-teach.stderr @@ -7,7 +7,7 @@ LL | const CON: Vec<i32> = vec![1, 2, 3]; = note: The runtime heap is not yet available at compile-time, so no runtime heap allocations can be created. = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0015]: cannot call non-const fn `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants +error[E0015]: cannot call non-const method `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants --> $DIR/E0010-teach.rs:5:23 | LL | const CON: Vec<i32> = vec![1, 2, 3]; diff --git a/tests/ui/error-codes/E0010.rs b/tests/ui/error-codes/E0010.rs index 11721efffcb..edb96714dd3 100644 --- a/tests/ui/error-codes/E0010.rs +++ b/tests/ui/error-codes/E0010.rs @@ -1,5 +1,5 @@ #![allow(warnings)] const CON: Vec<i32> = vec![1, 2, 3]; //~ ERROR E0010 -//~| ERROR cannot call non-const fn +//~| ERROR cannot call non-const method fn main() {} diff --git a/tests/ui/error-codes/E0010.stderr b/tests/ui/error-codes/E0010.stderr index 08947222422..87b722b5f65 100644 --- a/tests/ui/error-codes/E0010.stderr +++ b/tests/ui/error-codes/E0010.stderr @@ -6,7 +6,7 @@ LL | const CON: Vec<i32> = vec![1, 2, 3]; | = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0015]: cannot call non-const fn `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants +error[E0015]: cannot call non-const method `slice::<impl [i32]>::into_vec::<std::alloc::Global>` in constants --> $DIR/E0010.rs:3:23 | LL | const CON: Vec<i32> = vec![1, 2, 3]; diff --git a/tests/ui/error-codes/E0015.rs b/tests/ui/error-codes/E0015.rs index b0211358d81..7a80308d7bb 100644 --- a/tests/ui/error-codes/E0015.rs +++ b/tests/ui/error-codes/E0015.rs @@ -3,6 +3,6 @@ fn create_some() -> Option<u8> { } const FOO: Option<u8> = create_some(); -//~^ ERROR cannot call non-const fn `create_some` in constants [E0015] +//~^ ERROR cannot call non-const function `create_some` in constants [E0015] fn main() {} diff --git a/tests/ui/error-codes/E0015.stderr b/tests/ui/error-codes/E0015.stderr index 9d892a3e098..0c983d28434 100644 --- a/tests/ui/error-codes/E0015.stderr +++ b/tests/ui/error-codes/E0015.stderr @@ -1,4 +1,4 @@ -error[E0015]: cannot call non-const fn `create_some` in constants +error[E0015]: cannot call non-const function `create_some` in constants --> $DIR/E0015.rs:5:25 | LL | const FOO: Option<u8> = create_some(); |
