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
a2bbf7debaab60be33bd8008a71bca69576945a0
rust/src/test/ui/parser/struct-literal-in-if.rs

18 lines
328 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() {
tests: Do not use `-Z parse-only`, continue compilation to test recovery
2019-01-06 18:33:05 +03:00
if Foo { //~ ERROR expected value, found struct `Foo`
Implement type ascription.
2015-02-01 09:59:46 +02:00
x: 3 //~ ERROR expected type, found `3`
update error messages in parse-fail tests
2016-03-07 21:17:31 -05:00
}.hi() { //~ ERROR expected one of `.`, `;`, `?`, `}`, or an operator, found `{`
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: 2224ms Template: 3ms
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