mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Expand fixme comments
This commit is contained in:
parent
31b6a750f8
commit
e7c49666be
4 changed files with 9 additions and 3 deletions
|
@ -166,7 +166,10 @@ impl Path {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts a known mod path to `Path`.
|
/// Converts a known mod path to `Path`.
|
||||||
pub fn from_known_path(path: ModPath, generic_args: Vec<Option<Interned<GenericArgs>>>) -> Path {
|
pub fn from_known_path(
|
||||||
|
path: ModPath,
|
||||||
|
generic_args: Vec<Option<Interned<GenericArgs>>>,
|
||||||
|
) -> Path {
|
||||||
Path { type_anchor: None, mod_path: Interned::new(path), generic_args }
|
Path { type_anchor: None, mod_path: Interned::new(path), generic_args }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -376,6 +376,7 @@ impl<'a, 'b> ExprValidator<'a, 'b> {
|
||||||
// https://github.com/rust-lang/rust/blob/25c15cdbe/compiler/rustc_mir_build/src/thir/pattern/check_match.rs#L200-L201
|
// https://github.com/rust-lang/rust/blob/25c15cdbe/compiler/rustc_mir_build/src/thir/pattern/check_match.rs#L200-L201
|
||||||
|
|
||||||
let witnesses = report.non_exhaustiveness_witnesses;
|
let witnesses = report.non_exhaustiveness_witnesses;
|
||||||
|
// FIXME Report witnesses
|
||||||
// eprintln!("compute_match_usefulness(..) -> {:?}", &witnesses);
|
// eprintln!("compute_match_usefulness(..) -> {:?}", &witnesses);
|
||||||
if !witnesses.is_empty() {
|
if !witnesses.is_empty() {
|
||||||
if let Ok(source_ptr) = source_map.expr_syntax(id) {
|
if let Ok(source_ptr) = source_map.expr_syntax(id) {
|
||||||
|
|
|
@ -864,7 +864,8 @@ impl Fields {
|
||||||
pat: PatId,
|
pat: PatId,
|
||||||
cx: &MatchCheckCtx<'_>,
|
cx: &MatchCheckCtx<'_>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
// FIXME(iDawer): these alocations and clones are so unfortunate (+1 for switching to references)
|
// FIXME(iDawer): Factor out pattern deep cloning. See discussion:
|
||||||
|
// https://github.com/rust-analyzer/rust-analyzer/pull/8717#discussion_r633086640
|
||||||
let mut arena = cx.pattern_arena.borrow_mut();
|
let mut arena = cx.pattern_arena.borrow_mut();
|
||||||
match arena[pat].kind.as_ref() {
|
match arena[pat].kind.as_ref() {
|
||||||
PatKind::Deref { subpattern } => {
|
PatKind::Deref { subpattern } => {
|
||||||
|
|
|
@ -376,9 +376,10 @@ impl PatIdExt for PatId {
|
||||||
fn expand_or_pat(self, cx: &MatchCheckCtx<'_>) -> Vec<Self> {
|
fn expand_or_pat(self, cx: &MatchCheckCtx<'_>) -> Vec<Self> {
|
||||||
fn expand(pat: PatId, vec: &mut Vec<PatId>, pat_arena: &mut PatternArena) {
|
fn expand(pat: PatId, vec: &mut Vec<PatId>, pat_arena: &mut PatternArena) {
|
||||||
if let PatKind::Or { pats } = pat_arena[pat].kind.as_ref() {
|
if let PatKind::Or { pats } = pat_arena[pat].kind.as_ref() {
|
||||||
|
// FIXME(iDawer): Factor out pattern deep cloning. See discussion:
|
||||||
|
// https://github.com/rust-analyzer/rust-analyzer/pull/8717#discussion_r633086640
|
||||||
let pats = pats.clone();
|
let pats = pats.clone();
|
||||||
for pat in pats {
|
for pat in pats {
|
||||||
// FIXME(iDawer): Ugh, I want to go back to references (PatId -> &Pat)
|
|
||||||
let pat = pat_arena.alloc(pat.clone());
|
let pat = pat_arena.alloc(pat.clone());
|
||||||
expand(pat, vec, pat_arena);
|
expand(pat, vec, pat_arena);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue