mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
feat: add unit test
This commit is contained in:
parent
62318b38ef
commit
c811acb1f3
5
tests/ui/return/tail-expr-if-as-return.rs
Normal file
5
tests/ui/return/tail-expr-if-as-return.rs
Normal file
@ -0,0 +1,5 @@
|
||||
fn main() {
|
||||
if true {
|
||||
"" //~ ERROR mismatched types [E0308]
|
||||
}
|
||||
}
|
12
tests/ui/return/tail-expr-if-as-return.stderr
Normal file
12
tests/ui/return/tail-expr-if-as-return.stderr
Normal file
@ -0,0 +1,12 @@
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/tail-expr-if-as-return.rs:3:9
|
||||
|
|
||||
LL | / if true {
|
||||
LL | | ""
|
||||
| | ^^ expected `()`, found `&str`
|
||||
LL | | }
|
||||
| |_____- expected this to be `()`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0308`.
|
Loading…
Reference in New Issue
Block a user