]> git.proxmox.com Git - rustc.git/blob - src/test/ui/issues/issue-35675.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-35675.rs
1 // these two HELPs are actually in a new line between this line and the `enum Fruit` line
2 enum Fruit {
3 Apple(i64),
4 Orange(i64),
5 }
6
7 fn should_return_fruit() -> Apple {
8 //~^ ERROR cannot find type `Apple` in this scope
9 Apple(5)
10 //~^ ERROR cannot find function, tuple struct or tuple variant `Apple` in this scope
11 }
12
13 fn should_return_fruit_too() -> Fruit::Apple {
14 //~^ ERROR expected type, found variant `Fruit::Apple`
15 Apple(5)
16 //~^ ERROR cannot find function, tuple struct or tuple variant `Apple` in this scope
17 }
18
19 fn foo() -> Ok {
20 //~^ ERROR expected type, found variant `Ok`
21 Ok(())
22 }
23
24 fn bar() -> Variant3 {
25 //~^ ERROR cannot find type `Variant3` in this scope
26 }
27
28 fn qux() -> Some {
29 //~^ ERROR expected type, found variant `Some`
30 Some(1)
31 }
32
33 fn main() {}
34
35 mod x {
36 pub enum Enum {
37 Variant1,
38 Variant2(),
39 Variant3(usize),
40 Variant4 {},
41 }
42 }