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
359bfa901b9d8eddbed7b88b6716dbb77b7bfb95
rust/tests/ui/resolve/name-clash-nullary.rs

4 lines
65 B
Rust
Raw Normal View History

Disallow variable names that shadow tags in scope Now, if you have a tag named "foo", a variable declaration like "let foo..." is illegal. This change makes it possible to eliminate the '.' after a nullary tag pattern in an alt (but I'll be doing that in a future commit) -- as now it's always obvious whether a name refers to a tag or a new declared variable. resolve implements this change -- all the other changes are just to get rid of existing code that declares variables that shadow tag names.
2012-01-05 11:46:38 -08:00
fn main() {
resolve: Use same rules for disambiguating fresh bindings in `match` and `let`
2017-10-05 22:54:34 +03:00
let None: isize = 42; //~ ERROR mismatched types
Disallow variable names that shadow tags in scope Now, if you have a tag named "foo", a variable declaration like "let foo..." is illegal. This change makes it possible to eliminate the '.' after a nullary tag pattern in an alt (but I'll be doing that in a future commit) -- as now it's always obvious whether a name refers to a tag or a new declared variable. resolve implements this change -- all the other changes are just to get rid of existing code that declares variables that shadow tag names.
2012-01-05 11:46:38 -08:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 8185ms 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