diff options
| author | bors <bors@rust-lang.org> | 2017-04-08 09:23:28 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-04-08 09:23:28 +0000 |
| commit | 4cadff61ef395f3937d950e35304969ced2ea0b0 (patch) | |
| tree | 1b2004649c34ad8c3056aaf1d433dfc2e7a86bd5 /src/rustllvm/PassWrapper.cpp | |
| parent | 3178d4318c669eb0a7bf985e2d603a8e9e1917e7 (diff) | |
| parent | 2b2eeda0831401935a45c70667cf4c3eaedafe7d (diff) | |
| download | rust-4cadff61ef395f3937d950e35304969ced2ea0b0.tar.gz rust-4cadff61ef395f3937d950e35304969ced2ea0b0.zip | |
Auto merge of #40775 - estebank:variant-as-type, r=petrochenkov
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;`
```
Fix #35675.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
