Auto merge of #120843 - matthiaskrgr:rollup-med37z5, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #113671 (Make privacy visitor use types more (instead of HIR)) - #120308 (core/time: avoid divisions in Duration::new) - #120693 (Invert diagnostic lints.) - #120704 (A drive-by rewrite of `give_region_a_name()`) - #120809 (Use `transmute_unchecked` in `NonZero::new`.) - #120817 (Fix more `ty::Error` ICEs in MIR passes) - #120828 (Fix `ErrorGuaranteed` unsoundness with stash/steal.) - #120831 (Startup objects disappearing from sysroot) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
e28fae52d9
155 changed files with 674 additions and 840 deletions
|
@ -7,7 +7,7 @@ use rustc_data_structures::fx::FxIndexSet;
|
|||
use rustc_hir as hir;
|
||||
use rustc_middle::mir::visit::MutVisitor;
|
||||
use rustc_middle::mir::{self, dump_mir, MirPass};
|
||||
use rustc_middle::ty::{self, InstanceDef, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{self, InstanceDef, Ty, TyCtxt, TypeVisitableExt};
|
||||
use rustc_target::abi::FieldIdx;
|
||||
|
||||
pub struct ByMoveBody;
|
||||
|
@ -23,7 +23,10 @@ impl<'tcx> MirPass<'tcx> for ByMoveBody {
|
|||
return;
|
||||
};
|
||||
let coroutine_ty = body.local_decls[ty::CAPTURE_STRUCT_LOCAL].ty;
|
||||
let ty::Coroutine(_, args) = *coroutine_ty.kind() else { bug!() };
|
||||
if coroutine_ty.references_error() {
|
||||
return;
|
||||
}
|
||||
let ty::Coroutine(_, args) = *coroutine_ty.kind() else { bug!("{body:#?}") };
|
||||
|
||||
let coroutine_kind = args.as_coroutine().kind_ty().to_opt_closure_kind().unwrap();
|
||||
if coroutine_kind == ty::ClosureKind::FnOnce {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#![deny(rustc::untranslatable_diagnostic)]
|
||||
#![deny(rustc::diagnostic_outside_of_impl)]
|
||||
#![feature(assert_matches)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(const_type_name)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue