]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/issue-81098.rs
Auto merge of #90602 - mbartlett21:const-intoiterator, r=oli-obk
[rust.git] / src / test / ui / suggestions / issue-81098.rs
1 // Don't suggest removing a semicolon if the last statement isn't an expression with semicolon
2 // (#81098)
3 fn wat() -> impl core::fmt::Display { //~ ERROR: `()` doesn't implement `std::fmt::Display`
4     //~^ ERROR: `()` doesn't implement `std::fmt::Display`
5     fn why() {}
6 }
7
8 // Do it if the last statement is an expression with semicolon
9 // (#54771)
10 fn ok() -> impl core::fmt::Display { //~ ERROR: `()` doesn't implement `std::fmt::Display`
11     //~^ ERROR: `()` doesn't implement `std::fmt::Display`
12     1;
13 }
14
15 fn main() {}