diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2017-03-23 15:14:45 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2017-04-02 09:33:41 -0700 |
| commit | b946ecd02018d1671c990057d7136176df60da35 (patch) | |
| tree | cbce6be0c58b69cef93fa14656a0e13a9b5c0291 /src/rustllvm/PassWrapper.cpp | |
| parent | 5e122f59ba23494d460466cca53c71646d99c767 (diff) | |
| download | rust-b946ecd02018d1671c990057d7136176df60da35.tar.gz rust-b946ecd02018d1671c990057d7136176df60da35.zip | |
Suggest using enum when a variant is used as a type
Given a file:
```rust
enum Fruit {
Apple(i64),
Orange(i64),
}
fn should_return_fruit() -> Apple {
Apple(5)
}
```
Provide the following output:
```rust
error[E0412]: cannot find type `Apple` in this scope
--> file.rs:16:29
|
16 | fn should_return_fruit() -> Apple {
| ^^^^^ not found in this scope
|
help: there is an enum variant `Fruit::Apple`, did you mean to use `Fruit`?
--> file.rs:12:5
|
12 | Apple(i64),
| ^^^^^^^^^^
error[E0425]: cannot find function `Apple` in this scope
--> file.rs:17:5
|
17 | Apple(5)
| ^^^^^ not found in this scope
|
= help: possible candidate is found in another module, you can import it into scope:
`use Fruit::Apple;`
```
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
