diff options
| author | bors <bors@rust-lang.org> | 2016-03-12 21:55:14 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-03-12 21:55:14 -0800 |
| commit | 06074ac004701bff42c625247c4764b2ae6fca6c (patch) | |
| tree | 2a0fcf29c5dbfab69629fe2211b64ca089609f10 /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 3e05371c13f851a5af57a96a5e13c99537787314 (diff) | |
| parent | e926f281dfc9baec0e01fb6aa82eb1bf8a0645c4 (diff) | |
| download | rust-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
