Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
e5565b1aaa6ec4a0edb08d2bcb09cf4bdae01b6d
rust/tests/ui/parser/struct-literal-in-if.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
220 B
Rust
Raw Normal View History

libsyntax: Disallow struct literals after `if`, `while`, `match`, and `for...in`. Closes #14803. If you used a structure literal after one of these keywords, surround it in parentheses. [breaking-change]
2014-06-13 19:09:12 -07:00
struct Foo {
Update compile fail tests to use isize.
2015-01-08 21:54:35 +11:00
x: isize,
libsyntax: Disallow struct literals after `if`, `while`, `match`, and `for...in`. Closes #14803. If you used a structure literal after one of these keywords, surround it in parentheses. [breaking-change]
2014-06-13 19:09:12 -07:00
}
impl Foo {
fn hi(&self) -> bool {
true
}
}
fn main() {
Emit specific error for struct literal in conditions
2019-04-14 17:09:03 -07:00
if Foo { //~ ERROR struct literals are not allowed here
x: 3
}.hi() {
libsyntax: Disallow struct literals after `if`, `while`, `match`, and `for...in`. Closes #14803. If you used a structure literal after one of these keywords, surround it in parentheses. [breaking-change]
2014-06-13 19:09:12 -07:00
println!("yo");
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 3869ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API