Add sanity check.

We force the relative span's parent to be absolute. This avoids having to
handle long dependency chains.
This commit is contained in:
Camille GILLOT
2021-04-27 19:58:46 +02:00
parent 940fa9251e
commit fb5ced0fbd
3 changed files with 9 additions and 3 deletions

View File

@@ -788,7 +788,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
node_id,
DefPathData::LifetimeNs(str_name),
ExpnId::root(),
span,
span.with_parent(None),
);
hir::GenericParam {
@@ -1520,7 +1520,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
def_node_id,
DefPathData::LifetimeNs(name.ident().name),
ExpnId::root(),
span,
span.with_parent(None),
);
let (name, kind) = match name {