This website requires JavaScript.
Explore
Help
Sign In
nordic-dev.net
/
rust
Watch
2
Star
0
Fork
0
You've already forked rust
mirror of
https://github.com/rust-lang/rust.git
synced
2025-01-25 22:22:44 +00:00
Code
Issues
Packages
Projects
Releases
Wiki
Activity
dfc5ffacd3
rust
/
tests
/
ui
/
resolve
/
name-clash-nullary.rs
4 lines
65 B
Rust
Raw
Normal View
History
Unescape
Escape
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 19:46:38 +00:00
fn
main
(
)
{
resolve: Use same rules for disambiguating fresh bindings in `match` and `let`
2017-10-05 19:54:34 +00: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 19:46:38 +00:00
}
Reference in New Issue
Copy Permalink