]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #18339 : chastell/rust/guide_pattern_fixes, r=nikomatsakis
authorbors <bors@rust-lang.org>
Thu, 30 Oct 2014 20:17:15 +0000 (20:17 +0000)
committerbors <bors@rust-lang.org>
Thu, 30 Oct 2014 20:17:15 +0000 (20:17 +0000)
I think it helps to show that the variables introduced in match blocks are indeed independent from the matched variable `x` (especially when `x` is still reachable inside those blocks and might be useful), so this renames them accordingly. Maybe some linter (or language-level warning?) will eventually warn about shadowing `x` in such cases. ;)

I’m not super happy about the matching-on-range example, as it’s too contrived (`e` and `x` are exactly the same here), but I couldn’t come up with something both simple and non-redundant.

1  2 
src/doc/guide.md

Simple merge