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
e0e7a432db38ac26355e7c60219c27720b9ec42f
rust/tests/ui/parser/struct-literal-in-for.rs

18 lines
269 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
for x in Foo { //~ ERROR struct literals are not allowed here
x: 3 //~^ ERROR `bool` is not an iterator
}.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: 3732ms Template: 5ms
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