Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/ui/consts/ice-extra-args-fn-abi-issue-127423.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//! Regression test for https://github.com/rust-lang/rust/issues/127423

#![allow(dead_code)]

const fn add(a: &'self isize) -> usize {
//~^ ERROR use of undeclared lifetime name `'self`
//~| ERROR lifetimes cannot use keyword names
Qux + y
//~^ ERROR cannot find value `Qux` in this scope
//~| ERROR cannot find value `y` in this scope
}

const ARR: [i32; add(1, 2)] = [5, 6, 7];

pub fn main() {}
39 changes: 39 additions & 0 deletions tests/ui/consts/ice-extra-args-fn-abi-issue-127423.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
error: lifetimes cannot use keyword names
--> $DIR/ice-extra-args-fn-abi-issue-127423.rs:5:18
|
LL | const fn add(a: &'self isize) -> usize {
| ^^^^^

error[E0261]: use of undeclared lifetime name `'self`
--> $DIR/ice-extra-args-fn-abi-issue-127423.rs:5:18
|
LL | const fn add(a: &'self isize) -> usize {
| ^^^^^ undeclared lifetime
|
help: consider introducing lifetime `'self` here
|
LL | const fn add<'self>(a: &'self isize) -> usize {
| +++++++

error[E0425]: cannot find value `Qux` in this scope
--> $DIR/ice-extra-args-fn-abi-issue-127423.rs:8:5
|
LL | Qux + y
| ^^^ not found in this scope

error[E0425]: cannot find value `y` in this scope
--> $DIR/ice-extra-args-fn-abi-issue-127423.rs:8:11
|
LL | Qux + y
| ^
|
help: a local variable with a similar name exists
|
LL - Qux + y
LL + Qux + a
|

error: aborting due to 4 previous errors

Some errors have detailed explanations: E0261, E0425.
For more information about an error, try `rustc --explain E0261`.
Loading