mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
internal: Enforce Resolver to always have a module scope
This commit is contained in:
parent
ef92453dfe
commit
75689f2ad8
71 changed files with 360 additions and 398 deletions
|
@ -103,7 +103,7 @@ pub(super) fn try_expr(
|
|||
|
||||
let adts = inner_ty.as_adt().zip(body_ty.as_adt());
|
||||
if let Some((hir::Adt::Enum(inner), hir::Adt::Enum(body))) = adts {
|
||||
let famous_defs = FamousDefs(sema, sema.scope(try_expr.syntax()).krate());
|
||||
let famous_defs = FamousDefs(sema, sema.scope(try_expr.syntax())?.krate());
|
||||
// special case for two options, there is no value in showing them
|
||||
if let Some(option_enum) = famous_defs.core_option_Option() {
|
||||
if inner == option_enum && body == option_enum {
|
||||
|
@ -234,7 +234,7 @@ pub(super) fn keyword(
|
|||
return None;
|
||||
}
|
||||
let parent = token.parent()?;
|
||||
let famous_defs = FamousDefs(sema, sema.scope(&parent).krate());
|
||||
let famous_defs = FamousDefs(sema, sema.scope(&parent)?.krate());
|
||||
|
||||
let KeywordHint { description, keyword_mod, actions } = keyword_hints(sema, token, parent);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue