Description
Right now import resolution on 2018 edition fails with an ambiguity error if multiple candidates are found:
struct S; // Outer
fn main() {
struct S; // Inner
use S as Z; // ERROR `S` is ambiguous (name vs any other name during import resolution)
let s = S; // OK, the Inner S is preferred
}
This is different from non-import paths in which resolutions from closer scopes are preferred without errors.
This restriction is technically unnecessary and exists because some people were uncomfortable with disambiguation happening in import paths specifically (see previous threads, ... many of them, #55618 being the latest one).
This restriction can be lifted fully or partially if it causes too much trouble in practice with ambiguity errors, or with addition of new names to libraries being backward-incompatible due to new ambiguities.
(By "partially" I mean e.g. "disambiguation is okay, unless one of the candidates is an extern crate" or something like that.)