mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
Account for bad placeholder errors on consts/statics with trait objects
This commit is contained in:
@@ -2,5 +2,4 @@ fn foo() -> _ { 5 } //~ ERROR E0121
|
||||
|
||||
static BAR: _ = "test"; //~ ERROR E0121
|
||||
|
||||
fn main() {
|
||||
}
|
||||
fn main() {}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// Regression test for #75889.
|
||||
|
||||
const FOO: dyn Fn() -> _ = ""; //~ ERROR E0121
|
||||
static BOO: dyn Fn() -> _ = ""; //~ ERROR E0121
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,15 @@
|
||||
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
|
||||
--> $DIR/issue-75889.rs:3:24
|
||||
|
|
||||
LL | const FOO: dyn Fn() -> _ = "";
|
||||
| ^ not allowed in type signatures
|
||||
|
||||
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
|
||||
--> $DIR/issue-75889.rs:4:25
|
||||
|
|
||||
LL | static BOO: dyn Fn() -> _ = "";
|
||||
| ^ not allowed in type signatures
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0121`.
|
||||
Reference in New Issue
Block a user