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:
parent
fba116fc5f
commit
dae4c7b1ff
17 changed files with 226 additions and 75 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue