Rollup merge of #138924 - nnethercote:less-kw-Empty-3, r=compiler-errors
Reduce `kw::Empty` usage, part 3 Remove some more `kw::Empty` uses, in support of #137978. r? `@davidtwco`
This commit is contained in:
@@ -168,7 +168,7 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> {
|
||||
hygiene::update_dollar_crate_names(|ctxt| {
|
||||
let ident = Ident::new(kw::DollarCrate, DUMMY_SP.with_ctxt(ctxt));
|
||||
match self.resolve_crate_root(ident).kind {
|
||||
ModuleKind::Def(.., name) if name != kw::Empty => name,
|
||||
ModuleKind::Def(.., name) if let Some(name) = name => name,
|
||||
_ => kw::Crate,
|
||||
}
|
||||
});
|
||||
@@ -1067,11 +1067,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
|
||||
);
|
||||
if fallback_binding.ok().and_then(|b| b.res().opt_def_id()) != Some(def_id) {
|
||||
let location = match parent_scope.module.kind {
|
||||
ModuleKind::Def(_, _, name) if name == kw::Empty => {
|
||||
"the crate root".to_string()
|
||||
}
|
||||
ModuleKind::Def(kind, def_id, name) => {
|
||||
format!("{} `{name}`", kind.descr(def_id))
|
||||
if let Some(name) = name {
|
||||
format!("{} `{name}`", kind.descr(def_id))
|
||||
} else {
|
||||
"the crate root".to_string()
|
||||
}
|
||||
}
|
||||
ModuleKind::Block => "this scope".to_string(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user