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-03-12 21:55:14 -0800
committerbors <bors@rust-lang.org>2016-03-12 21:55:14 -0800
commit06074ac004701bff42c625247c4764b2ae6fca6c (patch)
tree2a0fcf29c5dbfab69629fe2211b64ca089609f10 /src/libstd/sys/unix/stack_overflow.rs
parent3e05371c13f851a5af57a96a5e13c99537787314 (diff)
parente926f281dfc9baec0e01fb6aa82eb1bf8a0645c4 (diff)
downloadrust-06074ac004701bff42c625247c4764b2ae6fca6c.tar.gz
rust-06074ac004701bff42c625247c4764b2ae6fca6c.zip
Auto merge of #32141 - jseyfried:fix_resolution_in_lexical_scopes, r=nikomatsakis
Fix name resolution in lexical scopes

Currently, `resolve_item_in_lexical_scope` does not check the "ribs" (type parameters and local variables). This can allow items that should be shadowed by type parameters to be named.

For example,
```rust
struct T { i: i32 }
fn f<T>() {
    let t = T { i: 0 }; // This use of `T` resolves to the struct, not the type parameter
}

mod Foo {
    pub fn f() {}
}
fn g<Foo>() {
    Foo::f(); // This use of `Foo` resolves to the module, not the type parameter
}
```

This PR changes `resolve_item_in_lexical_scope` so that it fails when the item is shadowed by a rib (fixes #32120).
This is a [breaking-change], but it looks unlikely to cause breakage in practice.

r? @nikomatsakis
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions