Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1383df0

Browse files
Auto merge of #145181 - Borgerr:remove-fixme-from-has-sigdrop, r=<try>
remove FIXME block from `has_significant_drop`, can handle inference
2 parents ca77504 + 75ec279 commit 1383df0

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

‎compiler/rustc_middle/src/ty/util.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,14 +1375,6 @@ impl<'tcx> Ty<'tcx> {
13751375
_ => self,
13761376
};
13771377

1378-
// FIXME(#86868): We should be canonicalizing, or else moving this to a method of inference
1379-
// context, or *something* like that, but for now just avoid passing inference
1380-
// variables to queries that can't cope with them. Instead, conservatively
1381-
// return "true" (may change drop order).
1382-
if query_ty.has_infer() {
1383-
return true;
1384-
}
1385-
13861378
// This doesn't depend on regions, so try to minimize distinct
13871379
// query keys used.
13881380
let erased = tcx.normalize_erasing_regions(typing_env, query_ty);

‎tests/ui/type-inference/has_sigdrop.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ run-pass
2+
// Inference, canonicalization, and significant drops should work nicely together.
3+
// Related issue: #86868
4+
5+
#[clippy::has_significant_drop]
6+
struct DropGuy {}
7+
8+
fn creator() -> DropGuy {
9+
DropGuy {}
10+
}
11+
12+
fn dropper() {
13+
let _ = creator();
14+
}
15+
16+
fn main() {
17+
dropper();
18+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /