rust/compiler/rustc_mir/src/transform
David Tolnay 41baa090ad
Skip dropck::check_drop_impl in is_const_item_without_destructor
adt_destructor by default also validates the Drop impl using
dropck::check_drop_impl, which contains an expect_local(). This
leads to ICE in check_const_item_mutation if the const's type is
not a local type.

    thread 'rustc' panicked at 'DefId::expect_local: `DefId(5:4805 ~ alloc[d7e9]::vec::{impl#50})` isn't local', compiler/rustc_span/src/def_id.rs:174:43
    stack backtrace:
       0: rust_begin_unwind
       1: rustc_span::def_id::DefId::expect_local::{{closure}}
       2: rustc_typeck::check::dropck::check_drop_impl
       3: rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::calculate_dtor::{{closure}}
       4: rustc_middle::ty::trait_def::<impl rustc_middle::ty::context::TyCtxt>::for_each_relevant_impl
       5: rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::calculate_dtor
       6: rustc_typeck::check::adt_destructor
       7: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::adt_destructor>::compute
       8: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
       9: rustc_query_system::query::plumbing::get_query_impl
      10: rustc_mir::transform::check_const_item_mutation::ConstMutationChecker::is_const_item_without_destructor
2020-09-30 21:58:13 -07:00
..
check_consts Rollup merge of #77170 - ecstatic-morse:const-fn-ptr, r=oli-obk 2020-09-28 18:39:44 +02:00
add_call_guards.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
add_moves_for_packed_drops.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
add_retag.rs Change ty.kind to a method 2020-09-04 17:47:51 +02:00
check_const_item_mutation.rs Skip dropck::check_drop_impl in is_const_item_without_destructor 2020-09-30 21:58:13 -07:00
check_packed_ref.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
check_unsafety.rs Change ty.kind to a method 2020-09-04 17:47:51 +02:00
cleanup_post_borrowck.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
const_prop.rs Enable const prop into operands at mir_opt_level=2 2020-09-23 19:03:10 +02:00
copy_prop.rs [mir-opt] Introduce a new flag to enable experimental/unsound mir opts 2020-09-27 19:21:01 -04:00
deaggregator.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
dest_prop.rs Fix dest prop miscompilation around references 2020-09-22 20:19:00 +02:00
dump_mir.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
early_otherwise_branch.rs EarlyOtherwiseBranch::run_pass(): don't convert Place to Place (clippy::useless_conversion) 2020-09-24 13:38:07 +02:00
elaborate_drops.rs Add pass names to some common dataflow analyses 2020-09-14 17:56:39 -07:00
generator.rs Add pass names to some common dataflow analyses 2020-09-14 17:56:39 -07:00
inline.rs Auto merge of #76123 - tmiasko:inline-args-storage, r=wesleywiser 2020-09-14 02:13:02 +00:00
instcombine.rs Add optimization to avoid load of address 2020-09-21 22:08:27 +02:00
instrument_coverage.rs use String::from instead of format!() macro to craft string clippy::useless_format 2020-09-10 13:22:51 +02:00
match_branches.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
mod.rs Move qualify_min_const_fn out of rustc into clippy 2020-09-26 16:08:24 +02:00
no_landing_pads.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
nrvo.rs Implement a destination propagation pass 2020-09-18 21:23:00 +02:00
promote_consts.rs Validate rustc_args_required_const 2020-09-30 11:59:44 +01:00
remove_noop_landing_pads.rs Fix underflow when calculating the number of no-op jumps folded 2020-09-16 00:00:00 +00:00
remove_unneeded_drops.rs Resolve https://github.com/rust-lang/rust/pull/76673#discussion_r494426303 2020-09-24 21:02:53 +02:00
required_consts.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
rustc_peek.rs Auto merge of #76044 - ecstatic-morse:dataflow-lattice, r=oli-obk 2020-09-07 21:29:43 +00:00
simplify_branches.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
simplify_comparison_integral.rs Fix #76432 2020-09-13 10:47:20 +02:00
simplify_try.rs Add assertion for len of vecs 2020-09-19 23:22:54 +02:00
simplify.rs use matches!() macro for simple if let conditions 2020-09-18 20:28:35 +02:00
uninhabited_enum_branching.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
unreachable_prop.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
validate.rs Validate removal of AscribeUserType, FakeRead, and Shallow borrow 2020-09-10 00:00:00 +00:00