-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #86355 - JohnTitor:issue-82158, r=estebank
Remove invalid suggestions for assoc consts on placeholder type error Fixes #82158 This also moves some tests to typeck. r? ``@estebank``
- Loading branch information
Showing
10 changed files
with
51 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
struct MyStruct; | ||
|
||
trait Test { | ||
const TEST: fn() -> _; | ||
//~^ ERROR: the type placeholder `_` is not allowed within types on item signatures [E0121] | ||
//~| ERROR: the type placeholder `_` is not allowed within types on item signatures [E0121] | ||
} | ||
|
||
impl Test for MyStruct { | ||
const TEST: fn() -> _ = 42; | ||
//~^ ERROR: the type placeholder `_` is not allowed within types on item signatures [E0121] | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0121]: the type placeholder `_` is not allowed within types on item signatures | ||
--> $DIR/type-placeholder-fn-in-const.rs:4:25 | ||
| | ||
LL | const TEST: fn() -> _; | ||
| ^ not allowed in type signatures | ||
|
||
error[E0121]: the type placeholder `_` is not allowed within types on item signatures | ||
--> $DIR/type-placeholder-fn-in-const.rs:4:25 | ||
| | ||
LL | const TEST: fn() -> _; | ||
| ^ not allowed in type signatures | ||
|
||
error[E0121]: the type placeholder `_` is not allowed within types on item signatures | ||
--> $DIR/type-placeholder-fn-in-const.rs:10:25 | ||
| | ||
LL | const TEST: fn() -> _ = 42; | ||
| ^ not allowed in type signatures | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0121`. |
File renamed without changes.
File renamed without changes.
File renamed without changes.