Skip to content

Commit e7c4966

Browse files
committed
Expand fixme comments
1 parent 31b6a75 commit e7c4966

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

crates/hir_def/src/path.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ impl Path {
166166
}
167167

168168
/// Converts a known mod path to `Path`.
169-
pub fn from_known_path(path: ModPath, generic_args: Vec<Option<Interned<GenericArgs>>>) -> Path {
169+
pub fn from_known_path(
170+
path: ModPath,
171+
generic_args: Vec<Option<Interned<GenericArgs>>>,
172+
) -> Path {
170173
Path { type_anchor: None, mod_path: Interned::new(path), generic_args }
171174
}
172175

crates/hir_ty/src/diagnostics/expr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
376376
// https://github.com/rust-lang/rust/blob/25c15cdbe/compiler/rustc_mir_build/src/thir/pattern/check_match.rs#L200-L201
377377

378378
let witnesses = report.non_exhaustiveness_witnesses;
379+
// FIXME Report witnesses
379380
// eprintln!("compute_match_usefulness(..) -> {:?}", &witnesses);
380381
if !witnesses.is_empty() {
381382
if let Ok(source_ptr) = source_map.expr_syntax(id) {

crates/hir_ty/src/diagnostics/match_check/deconstruct_pat.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,8 @@ impl Fields {
864864
pat: PatId,
865865
cx: &MatchCheckCtx<'_>,
866866
) -> Self {
867-
// FIXME(iDawer): these alocations and clones are so unfortunate (+1 for switching to references)
867+
// FIXME(iDawer): Factor out pattern deep cloning. See discussion:
868+
// https://github.com/rust-analyzer/rust-analyzer/pull/8717#discussion_r633086640
868869
let mut arena = cx.pattern_arena.borrow_mut();
869870
match arena[pat].kind.as_ref() {
870871
PatKind::Deref { subpattern } => {

crates/hir_ty/src/diagnostics/match_check/usefulness.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,10 @@ impl PatIdExt for PatId {
376376
fn expand_or_pat(self, cx: &MatchCheckCtx<'_>) -> Vec<Self> {
377377
fn expand(pat: PatId, vec: &mut Vec<PatId>, pat_arena: &mut PatternArena) {
378378
if let PatKind::Or { pats } = pat_arena[pat].kind.as_ref() {
379+
// FIXME(iDawer): Factor out pattern deep cloning. See discussion:
380+
// https://github.com/rust-analyzer/rust-analyzer/pull/8717#discussion_r633086640
379381
let pats = pats.clone();
380382
for pat in pats {
381-
// FIXME(iDawer): Ugh, I want to go back to references (PatId -> &Pat)
382383
let pat = pat_arena.alloc(pat.clone());
383384
expand(pat, vec, pat_arena);
384385
}

0 commit comments

Comments
 (0)