This website requires JavaScript.
Explore
Help
Sign in
bjoernager
/
rust
Watch
1
Fork
You've already forked rust
0
Code
Activity
58e901b6fd
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 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
}
Copy permalink