forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make ty::Error implement auto traits
- Loading branch information
1 parent
409998c
commit f349d72
Showing
5 changed files
with
45 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Make sure we treat the error type as freeze to suppress useless errors. | ||
|
||
struct MyStruct { | ||
foo: Option<UndefinedType>, | ||
//~^ ERROR cannot find type `UndefinedType` in this scope | ||
} | ||
impl MyStruct { | ||
pub const EMPTY_REF: &'static Self = &Self::EMPTY; | ||
pub const EMPTY: Self = Self { | ||
foo: None, | ||
}; | ||
} | ||
|
||
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,14 @@ | ||
error[E0412]: cannot find type `UndefinedType` in this scope | ||
--> $DIR/error-is-freeze.rs:4:17 | ||
| | ||
LL | foo: Option<UndefinedType>, | ||
| ^^^^^^^^^^^^^ not found in this scope | ||
| | ||
help: you might be missing a type parameter | ||
| | ||
LL | struct MyStruct<UndefinedType> { | ||
| +++++++++++++++ | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |
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 @@ | ||
error[E0277]: `()` is not a future | ||
--> $DIR/auto-trait-contains-err.rs:5:24 | ||
| | ||
LL | fn invalid_future() -> impl Future {} | ||
| ^^^^^^^^^^^ `()` is not a future | ||
| | ||
= help: the trait `Future` is not implemented for `()` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |