loop-that-never-loops
This commit is contained in:
parent
368e0bb32f
commit
6153ea8dce
@ -251,17 +251,17 @@ impl Attrs {
|
|||||||
let enum_ = &item_tree[loc.id.value];
|
let enum_ = &item_tree[loc.id.value];
|
||||||
|
|
||||||
let cfg_options = &crate_graph[krate].cfg_options;
|
let cfg_options = &crate_graph[krate].cfg_options;
|
||||||
let variant = 'tri: loop {
|
|
||||||
let mut idx = 0;
|
let mut idx = 0;
|
||||||
for variant in enum_.variants.clone() {
|
let Some(variant) = enum_.variants.clone().find(|variant| {
|
||||||
let attrs = item_tree.attrs(db, krate, variant.into());
|
let attrs = item_tree.attrs(db, krate, (*variant).into());
|
||||||
if attrs.is_cfg_enabled(cfg_options) {
|
if attrs.is_cfg_enabled(cfg_options) {
|
||||||
if it.local_id == Idx::from_raw(RawIdx::from(idx)) {
|
if it.local_id == Idx::from_raw(RawIdx::from(idx)) {
|
||||||
break 'tri variant;
|
return true
|
||||||
}
|
}
|
||||||
idx += 1;
|
idx += 1;
|
||||||
}
|
}
|
||||||
}
|
false
|
||||||
|
}) else {
|
||||||
return Arc::new(res);
|
return Arc::new(res);
|
||||||
};
|
};
|
||||||
(item_tree[variant].fields.clone(), item_tree, krate)
|
(item_tree[variant].fields.clone(), item_tree, krate)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user