-
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.
Make const/fn return params more suggestable
- Loading branch information
1 parent
658fad6
commit 0b5941a
Showing
10 changed files
with
163 additions
and
67 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
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
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
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
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
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
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
12 changes: 12 additions & 0 deletions
12
tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.fixed
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,12 @@ | ||
// run-rustfix | ||
|
||
#![allow(unused)] | ||
|
||
struct Wrapper<T>(T); | ||
|
||
fn bar() -> Wrapper<fn()> { Wrapper(foo) } | ||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types | ||
|
||
fn foo() {} | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.rs
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,12 @@ | ||
// run-rustfix | ||
|
||
#![allow(unused)] | ||
|
||
struct Wrapper<T>(T); | ||
|
||
fn bar() -> _ { Wrapper(foo) } | ||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types | ||
|
||
fn foo() {} | ||
|
||
fn main() {} |
12 changes: 12 additions & 0 deletions
12
tests/ui/suggestions/suggest-fn-ptr-for-fn-item-in-fn-ret.stderr
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,12 @@ | ||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types | ||
--> $DIR/suggest-fn-ptr-for-fn-item-in-fn-ret.rs:7:13 | ||
| | ||
LL | fn bar() -> _ { Wrapper(foo) } | ||
| ^ | ||
| | | ||
| not allowed in type signatures | ||
| help: replace with the correct return type: `Wrapper<fn()>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0121`. |