]> git.lizzy.rs Git - rust.git/blob - tests/ui/error-codes/E0283.rs
Auto merge of #106627 - Ezrashaw:no-e0711-without-staged-api, r=Mark-Simulacrum
[rust.git] / tests / ui / error-codes / E0283.rs
1 trait Generator {
2     fn create() -> u32;
3 }
4
5 struct Impl;
6
7 impl Generator for Impl {
8     fn create() -> u32 { 1 }
9 }
10
11 impl Impl {
12     fn new() -> Self {
13         Impl{}
14     }
15 }
16
17 impl Into<u32> for Impl {
18     fn into(self) -> u32 { 1 }
19 }
20
21 fn foo(bar: u32) {}
22
23 struct AnotherImpl;
24
25 impl Generator for AnotherImpl {
26     fn create() -> u32 { 2 }
27 }
28
29 fn main() {
30     let cont: u32 = Generator::create(); //~ ERROR E0790
31 }
32
33 fn buzz() {
34     let foo_impl = Impl::new();
35     let bar = foo_impl.into() * 1u32; //~ ERROR E0283
36     foo(bar);
37 }