-
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.
Do not report cycle error when inferring return type for suggestion
- Loading branch information
1 parent
4033686
commit 5309375
Showing
8 changed files
with
75 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4359,6 +4359,7 @@ dependencies = [ | |
"rustc_serialize", | ||
"rustc_session", | ||
"rustc_span", | ||
"rustc_target", | ||
"tracing", | ||
] | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use std::marker::PhantomData; | ||
|
||
struct Token<T>(PhantomData<T>); | ||
|
||
impl<T> Token<T> { | ||
fn as_ref(_: i32, _: i32) -> _ { | ||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types | ||
//~| NOTE not allowed in type signatures | ||
//~| HELP replace with the correct return type | ||
Token(PhantomData::<&T>) | ||
} | ||
} | ||
|
||
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,12 @@ | ||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types | ||
--> $DIR/return-cycle-2.rs:6:34 | ||
| | ||
LL | fn as_ref(_: i32, _: i32) -> _ { | ||
| ^ | ||
| | | ||
| not allowed in type signatures | ||
| help: replace with the correct return type: `Token<&'static T>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0121`. |
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 @@ | ||
use std::marker::PhantomData; | ||
|
||
struct Token<T>(PhantomData<T>); | ||
|
||
impl<T> Token<T> { | ||
fn new() -> _ { | ||
//~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types | ||
//~| NOTE not allowed in type signatures | ||
//~| HELP replace with the correct return type | ||
Token(PhantomData::<()>) | ||
} | ||
} | ||
|
||
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,12 @@ | ||
error[E0121]: the placeholder `_` is not allowed within types on item signatures for return types | ||
--> $DIR/return-cycle.rs:6:17 | ||
| | ||
LL | fn new() -> _ { | ||
| ^ | ||
| | | ||
| not allowed in type signatures | ||
| help: replace with the correct return type: `Token<()>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0121`. |