resolve: Avoid comparing modules by optional def-id

It makes all block modules identical during comparison
This commit is contained in:
Vadim Petrochenkov
2021-09-26 19:29:53 +03:00
parent 5aa732a364
commit ded08e44c6
5 changed files with 19 additions and 15 deletions

View File

@@ -1491,7 +1491,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
// form the path
let mut path_segments = path_segments.clone();
path_segments.push(ast::PathSegment::from_ident(ident));
let module_def_id = module.def_id().unwrap();
let module_def_id = module.def_id();
if module_def_id == def_id {
let path =
Path { span: name_binding.span, segments: path_segments, tokens: None };