1
Fork 0

resolve: Implement edition hygiene for imports and absolute paths

Use per-span hygiene in a few other places in resolve
Prefer `rust_2015`/`rust_2018` helpers to comparing editions
This commit is contained in:
Vadim Petrochenkov 2018-11-18 03:25:59 +03:00
parent fba116fc5f
commit dae4c7b1ff
17 changed files with 226 additions and 75 deletions

View file

@ -325,6 +325,16 @@ impl Span {
|einfo| einfo.edition)
}
#[inline]
pub fn rust_2015(&self) -> bool {
self.edition() == edition::Edition::Edition2015
}
#[inline]
pub fn rust_2018(&self) -> bool {
self.edition() >= edition::Edition::Edition2018
}
/// Return the source callee.
///
/// Returns `None` if the supplied span has no expansion trace,