about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-01-26 11:24:18 +0000
committerbors <bors@rust-lang.org>2016-01-26 11:24:18 +0000
commit43c1a173a874f5513db58b2f5321489a00087484 (patch)
tree7ef873b5f2f684e020ab78b9427be65ede858afb /src/libstd/sys/unix/stack_overflow.rs
parent1972c50b9eaab85742c0a6f5ea7eade5eb0d63fc (diff)
parentfaf0852fc1d01aef18fe8098a0f2f601dbfebd9b (diff)
downloadrust-43c1a173a874f5513db58b2f5321489a00087484.tar.gz
rust-43c1a173a874f5513db58b2f5321489a00087484.zip
Auto merge of #31105 - jseyfried:fix_lexical_scoping, r=nrc
This fixes #23880, a scoping bug in which items in a block are shadowed by local variables and type parameters that are in scope.

After this PR, an item in a block will shadow any local variables or type parameters above the item in the scope hierarchy. Items in a block will continue to be shadowed by local variables in the same block (even if the item is defined after the local variable).

This is a [breaking-change]. For example, the following code breaks:
```rust
fn foo() {
    let mut f = 1;
    {
        fn f() {}
        f += 1; // This will resolve to the function instead of the local variable
    }
}
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions