Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit db0597f

Browse files
committedOct 11, 2022
Auto merge of #102926 - matthiaskrgr:rollup-oe2cdzj, r=matthiaskrgr
Rollup of 11 pull requests Successful merges: - #100387 (Check uniqueness of impl items by trait item when applicable.) - #101727 (Stabilize map_first_last) - #101774 (Warn about safety of `fetch_update`) - #102227 (fs::get_path solarish version.) - #102445 (Add `is_empty()` method to `core::ffi::CStr`.) - #102612 (Migrate `codegen_ssa` to diagnostics structs - [Part 1]) - #102685 (Interpret EH actions properly) - #102869 (Add basename and dirname aliases) - #102889 (rustc_hir: Less error-prone methods for accessing `PartialRes` resolution) - #102893 (Fix ICE #102878) - #102912 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents cde693c + 3e01d07 commit db0597f

File tree

163 files changed

+3790
-1349
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+3790
-1349
lines changed
 

‎compiler/rustc_ast_lowering/src/asm.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,10 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
205205
let static_def_id = self
206206
.resolver
207207
.get_partial_res(sym.id)
208-
.filter(|res| res.unresolved_segments() == 0)
209-
.and_then(|res| {
210-
if let Res::Def(DefKind::Static(_), def_id) = res.base_res() {
211-
Some(def_id)
212-
} else {
213-
None
214-
}
208+
.and_then(|res| res.full_res())
209+
.and_then(|res| match res {
210+
Res::Def(DefKind::Static(_), def_id) => Some(def_id),
211+
_ => None,
215212
});
216213

217214
if let Some(def_id) = static_def_id {

‎compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,9 +1044,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10441044
if let ExprKind::Path(qself, path) = &expr.kind {
10451045
// Does the path resolve to something disallowed in a tuple struct/variant pattern?
10461046
if let Some(partial_res) = self.resolver.get_partial_res(expr.id) {
1047-
if partial_res.unresolved_segments() == 0
1048-
&& !partial_res.base_res().expected_in_tuple_struct_pat()
1049-
{
1047+
if let Some(res) = partial_res.full_res() && !res.expected_in_tuple_struct_pat() {
10501048
return None;
10511049
}
10521050
}
@@ -1066,9 +1064,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
10661064
if let ExprKind::Path(qself, path) = &expr.kind {
10671065
// Does the path resolve to something disallowed in a unit struct/variant pattern?
10681066
if let Some(partial_res) = self.resolver.get_partial_res(expr.id) {
1069-
if partial_res.unresolved_segments() == 0
1070-
&& !partial_res.base_res().expected_in_unit_struct_pat()
1071-
{
1067+
if let Some(res) = partial_res.full_res() && !res.expected_in_unit_struct_pat() {
10721068
return None;
10731069
}
10741070
}

0 commit comments

Comments
 (0)
Please sign in to comment.