Skip to content

Commit 734d9d3

Browse files
committed
don't use RevealAll in elaborate_drops
1 parent 709dbca commit 734d9d3

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

compiler/rustc_mir_dataflow/src/elaborate_drops.rs

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use rustc_hir::lang_items::LangItem;
33
use rustc_index::vec::Idx;
44
use rustc_middle::mir::patch::MirPatch;
55
use rustc_middle::mir::*;
6-
use rustc_middle::traits::Reveal;
76
use rustc_middle::ty::subst::SubstsRef;
87
use rustc_middle::ty::util::IntTypeExt;
98
use rustc_middle::ty::{self, Ty, TyCtxt};
@@ -273,7 +272,6 @@ where
273272
let subpath = self.elaborator.field_subpath(variant_path, field);
274273
let tcx = self.tcx();
275274

276-
assert_eq!(self.elaborator.param_env().reveal(), Reveal::All);
277275
let field_ty =
278276
tcx.normalize_erasing_regions(self.elaborator.param_env(), f.ty(tcx, substs));
279277
(tcx.mk_place_field(base_place, field, field_ty), subpath)

compiler/rustc_mir_transform/src/elaborate_drops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<'tcx> MirPass<'tcx> for ElaborateDrops {
2525
debug!("elaborate_drops({:?} @ {:?})", body.source, body.span);
2626

2727
let def_id = body.source.def_id();
28-
let param_env = tcx.param_env_reveal_all_normalized(def_id);
28+
let param_env = tcx.param_env(def_id);
2929
let (side_table, move_data) = match MoveData::gather_moves(body, tcx, param_env) {
3030
Ok(move_data) => move_data,
3131
Err((move_data, _)) => {

src/test/ui/impl-trait/issues/issue-78722.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ type F = impl core::future::Future<Output = u8>;
77
struct Bug {
88
V1: [(); {
99
fn concrete_use() -> F {
10-
//~^ ERROR expected `impl Future<Output = ()>` to be a future that resolves to `u8`, but it resolves to `()`
1110
async {}
1211
}
1312
let f: F = async { 1 };
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: `async` blocks are not allowed in constants
2-
--> $DIR/issue-78722.rs:13:20
2+
--> $DIR/issue-78722.rs:12:20
33
|
44
LL | let f: F = async { 1 };
55
| ^^^^^^^^^^^
@@ -8,21 +8,15 @@ LL | let f: F = async { 1 };
88
= help: add `#![feature(const_async_blocks)]` to the crate attributes to enable
99

1010
error[E0493]: destructors cannot be evaluated at compile-time
11-
--> $DIR/issue-78722.rs:13:13
11+
--> $DIR/issue-78722.rs:12:13
1212
|
1313
LL | let f: F = async { 1 };
1414
| ^ constants cannot evaluate destructors
1515
...
1616
LL | }],
1717
| - value is dropped here
1818

19-
error[E0271]: expected `impl Future<Output = ()>` to be a future that resolves to `u8`, but it resolves to `()`
20-
--> $DIR/issue-78722.rs:9:30
21-
|
22-
LL | fn concrete_use() -> F {
23-
| ^ expected `()`, found `u8`
24-
25-
error: aborting due to 3 previous errors
19+
error: aborting due to 2 previous errors
2620

27-
Some errors have detailed explanations: E0271, E0493, E0658.
28-
For more information about an error, try `rustc --explain E0271`.
21+
Some errors have detailed explanations: E0493, E0658.
22+
For more information about an error, try `rustc --explain E0493`.

0 commit comments

Comments
 (0)