forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a regression test for rust-lang#75883
- Loading branch information
Showing
2 changed files
with
74 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Regression test for #75883. | ||
|
||
pub struct UI {} | ||
|
||
impl UI { | ||
pub fn run() -> Result<_> { | ||
//~^ ERROR: this enum takes 2 type arguments but only 1 type argument was supplied | ||
//~| ERROR: the type placeholder `_` is not allowed within types on item signatures | ||
let mut ui = UI {}; | ||
ui.interact(); | ||
|
||
unimplemented!(); | ||
} | ||
|
||
pub fn interact(&mut self) -> Result<_> { | ||
//~^ ERROR: this enum takes 2 type arguments but only 1 type argument was supplied | ||
//~| ERROR: the type placeholder `_` is not allowed within types on item signatures | ||
unimplemented!(); | ||
} | ||
} | ||
|
||
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,52 @@ | ||
error[E0107]: this enum takes 2 type arguments but only 1 type argument was supplied | ||
--> $DIR/issue-75883.rs:6:21 | ||
| | ||
LL | pub fn run() -> Result<_> { | ||
| ^^^^^^ - supplied 1 type argument | ||
| | | ||
| expected 2 type arguments | ||
| | ||
note: enum defined here, with 2 type parameters: `T`, `E` | ||
--> $SRC_DIR/core/src/result.rs:LL:COL | ||
| | ||
LL | pub enum Result<T, E> { | ||
| ^^^^^^ - - | ||
help: add missing type argument | ||
| | ||
LL | pub fn run() -> Result<_, E> { | ||
| ^^^ | ||
|
||
error[E0107]: this enum takes 2 type arguments but only 1 type argument was supplied | ||
--> $DIR/issue-75883.rs:15:35 | ||
| | ||
LL | pub fn interact(&mut self) -> Result<_> { | ||
| ^^^^^^ - supplied 1 type argument | ||
| | | ||
| expected 2 type arguments | ||
| | ||
note: enum defined here, with 2 type parameters: `T`, `E` | ||
--> $SRC_DIR/core/src/result.rs:LL:COL | ||
| | ||
LL | pub enum Result<T, E> { | ||
| ^^^^^^ - - | ||
help: add missing type argument | ||
| | ||
LL | pub fn interact(&mut self) -> Result<_, E> { | ||
| ^^^ | ||
|
||
error[E0121]: the type placeholder `_` is not allowed within types on item signatures | ||
--> $DIR/issue-75883.rs:15:42 | ||
| | ||
LL | pub fn interact(&mut self) -> Result<_> { | ||
| ^ not allowed in type signatures | ||
|
||
error[E0121]: the type placeholder `_` is not allowed within types on item signatures | ||
--> $DIR/issue-75883.rs:6:28 | ||
| | ||
LL | pub fn run() -> Result<_> { | ||
| ^ not allowed in type signatures | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0107, E0121. | ||
For more information about an error, try `rustc --explain E0107`. |