-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split out RTN resolver errors into new error codes
- Loading branch information
1 parent
e1e3cac
commit 7c9c9fb
Showing
10 changed files
with
99 additions
and
9 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,19 @@ | ||
Something other than an associated function has been used when one was | ||
expected. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0801 | ||
#![feature(return_type_notation)] | ||
const FOO: i32 = 0; | ||
fn test() | ||
where | ||
FOO(..): Send, | ||
{ | ||
} | ||
``` | ||
|
||
In the given example, within the where clause `FOO(..): Send`, `FOO` resolves | ||
to a const when only trait methods are supported with return-type notation. |
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,19 @@ | ||
An associated function of the given name is not in scope. | ||
|
||
Erroneous code examples: | ||
|
||
```compile_fail,E0802 | ||
#![feature(return_type_notation)] | ||
trait Trait {} | ||
fn test<T: Trait>() | ||
where | ||
<T as Trait>::method(..): Send, | ||
{ | ||
} | ||
``` | ||
|
||
To fix this error, please verify you didn't misspell the associate function | ||
name, or double-check if you forgot to declare the parameter in the list of | ||
generics. |
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 |
---|---|---|
|
@@ -540,6 +540,8 @@ E0797: 0797, | |
E0798: 0798, | ||
E0799: 0799, | ||
E0800: 0800, | ||
E0801: 0801, | ||
E0802: 0802, | ||
); | ||
) | ||
} | ||
|
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,11 @@ | ||
#![feature(return_type_notation)] | ||
|
||
fn test() | ||
where | ||
test(..): Send, | ||
//~^ ERROR expected associated function, found function `test` | ||
//~| ERROR return type notation not allowed in this position yet | ||
{ | ||
} | ||
|
||
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,15 @@ | ||
error[E0801]: expected associated function, found function `test` | ||
--> $DIR/E0801.rs:5:5 | ||
| | ||
LL | test(..): Send, | ||
| ^^^^^^^^ not a associated function | ||
|
||
error: return type notation not allowed in this position yet | ||
--> $DIR/E0801.rs:5:5 | ||
| | ||
LL | test(..): Send, | ||
| ^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0801`. |
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 @@ | ||
#![feature(return_type_notation)] | ||
|
||
trait Trait {} | ||
|
||
fn test<T: Trait>() | ||
where | ||
<T as Trait>::method(..): Send, | ||
//~^ ERROR associated function `method` not found for `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,9 @@ | ||
error[E0220]: associated function `method` not found for `T` | ||
--> $DIR/E0802.rs:7:8 | ||
| | ||
LL | T::method(..): Send, | ||
| ^^^^^^ associated function `method` not found | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0220`. |