about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/lib.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-04-27 19:58:46 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2021-09-10 20:18:26 +0200
commitfb5ced0fbd7625316ee28d4f2f7230aac35753dd (patch)
tree0523ed2d831d5ca8c07b046e896f458a0f8e694c /compiler/rustc_ast_lowering/src/lib.rs
parent940fa9251e3c538a4c9d35d84dcaa09065e45687 (diff)
downloadrust-fb5ced0fbd7625316ee28d4f2f7230aac35753dd.tar.gz
rust-fb5ced0fbd7625316ee28d4f2f7230aac35753dd.zip
Add sanity check.
We force the relative span's parent to be absolute. This avoids having to
handle long dependency chains.
Diffstat (limited to 'compiler/rustc_ast_lowering/src/lib.rs')
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 9232be8ea2b..9edc30ceb19 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -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 {