about summary refs log tree commit diff
path: root/src/rustllvm/ExecutionEngineWrapper.cpp
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-03-26 09:07:20 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-03-26 09:07:20 +0530
commitb8b17a54cf1f6d216d83c5679cf9d7951656e36c (patch)
treedd0b177ccc15012c68f7ecc0945e559c6d0d8f9c /src/rustllvm/ExecutionEngineWrapper.cpp
parent8d2d2be6c61c17da8027a72da91f87a0e2487f74 (diff)
parentb418cd23068b1074e78d8631aec923b865bcc583 (diff)
downloadrust-b8b17a54cf1f6d216d83c5679cf9d7951656e36c.tar.gz
rust-b8b17a54cf1f6d216d83c5679cf9d7951656e36c.zip
Rollup merge of #32131 - petrochenkov:prim, r=eddyb
resolve: Minimize hacks in name resolution of primitive types

When resolving the first unqualified segment in a path with `n` segments and `n - 1` associated item segments, e.g. (`a` or `a::assoc` or `a::assoc::assoc` etc) try to resolve `a` without considering primitive types first. If the "normal" lookup fails or results in a module, then try to resolve `a` as a primitive type as a fallback.

This way backward compatibility is respected, but the restriction from E0317 can be lifted, i.e. primitive names mostly can be shadowed like any other names.

Furthermore, if names of primitive types are [put into prelude](https://github.com/petrochenkov/rust/tree/prim2) (now it's possible to do), then most of names will be resolved in conventional way and amount of code relying on this fallback will be greatly reduced. Although, it's not entirely convenient to put them into prelude right now due to temporary conflicts like `use prelude::v1::*; use usize;` in libcore/libstd, I'd better wait for proper glob shadowing before doing it.
I wish the `no_prelude` attribute were unstable as intended :(

cc @jseyfried @arielb1
r? @eddyb
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions