]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
authorDylan DPC <dylan.dpc@gmail.com>
Wed, 29 Apr 2020 17:39:34 +0000 (19:39 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Apr 2020 17:39:34 +0000 (19:39 +0200)
Fix wrong argument in autoderef process

The `overloaded_deref_ty` is a function for derefencing a type which overloads the `Deref` trait. But actually this function never uses the parameter pushed in until this PR. -_-

493 files changed:
Cargo.lock
src/bootstrap/bin/llvm-config-wrapper.rs
src/bootstrap/native.rs
src/ci/docker/dist-aarch64-linux/Dockerfile
src/ci/docker/dist-arm-linux/Dockerfile
src/ci/docker/dist-armhf-linux/Dockerfile
src/ci/docker/dist-armv7-linux/Dockerfile
src/doc/book
src/doc/embedded-book
src/doc/nomicon
src/doc/reference
src/doc/rust-by-example
src/doc/rustc/src/codegen-options/index.md
src/doc/unstable-book/src/compiler-flags/tls-model.md [new file with mode: 0644]
src/doc/unstable-book/src/language-features/cfg-sanitize.md
src/liballoc/boxed.rs
src/liballoc/collections/binary_heap.rs
src/liballoc/collections/btree/map.rs
src/liballoc/collections/btree/node.rs
src/liballoc/collections/linked_list.rs
src/liballoc/raw_vec.rs
src/libcore/macros/mod.rs
src/libcore/num/mod.rs
src/libcore/ptr/mod.rs
src/libcore/ptr/non_null.rs
src/libcore/ptr/unique.rs
src/libproc_macro/lib.rs
src/librustc_codegen_llvm/back/write.rs
src/librustc_codegen_llvm/context.rs
src/librustc_codegen_llvm/debuginfo/mod.rs
src/librustc_codegen_llvm/lib.rs
src/librustc_codegen_llvm/llvm/ffi.rs
src/librustc_codegen_llvm/llvm_util.rs
src/librustc_codegen_ssa/back/link.rs
src/librustc_codegen_ssa/back/write.rs
src/librustc_codegen_ssa/base.rs
src/librustc_codegen_ssa/traits/backend.rs
src/librustc_driver/lib.rs
src/librustc_errors/lib.rs
src/librustc_hir/hir.rs
src/librustc_infer/infer/error_reporting/need_type_info.rs
src/librustc_infer/infer/outlives/verify.rs
src/librustc_infer/traits/util.rs
src/librustc_interface/passes.rs
src/librustc_interface/queries.rs
src/librustc_interface/tests.rs
src/librustc_interface/util.rs
src/librustc_lexer/src/lib.rs
src/librustc_lexer/src/tests.rs
src/librustc_lint/lib.rs
src/librustc_metadata/creader.rs
src/librustc_metadata/dynamic_lib.rs
src/librustc_metadata/dynamic_lib/tests.rs
src/librustc_metadata/rmeta/decoder/cstore_impl.rs
src/librustc_metadata/rmeta/encoder.rs
src/librustc_middle/arena.rs
src/librustc_middle/mir/interpret/error.rs
src/librustc_middle/mir/interpret/value.rs
src/librustc_middle/mir/mod.rs
src/librustc_middle/mir/mono.rs
src/librustc_middle/mir/query.rs
src/librustc_middle/query/mod.rs
src/librustc_middle/ty/context.rs
src/librustc_middle/ty/mod.rs
src/librustc_middle/ty/query/keys.rs
src/librustc_middle/ty/trait_def.rs
src/librustc_mir/borrow_check/diagnostics/conflict_errors.rs
src/librustc_mir/borrow_check/diagnostics/explain_borrow.rs
src/librustc_mir/borrow_check/diagnostics/mod.rs
src/librustc_mir/borrow_check/mod.rs
src/librustc_mir/borrow_check/type_check/input_output.rs
src/librustc_mir/borrow_check/type_check/mod.rs
src/librustc_mir/borrow_check/universal_regions.rs
src/librustc_mir/const_eval/eval_queries.rs
src/librustc_mir/const_eval/machine.rs
src/librustc_mir/interpret/eval_context.rs
src/librustc_mir/interpret/machine.rs
src/librustc_mir/interpret/mod.rs
src/librustc_mir/interpret/validity.rs
src/librustc_mir/lib.rs
src/librustc_mir/monomorphize/collector.rs
src/librustc_mir/shim.rs
src/librustc_mir/transform/check_consts/qualifs.rs
src/librustc_mir/transform/check_consts/validation.rs
src/librustc_mir/transform/check_unsafety.rs
src/librustc_mir/transform/const_prop.rs
src/librustc_mir/transform/copy_prop.rs
src/librustc_mir/transform/generator.rs
src/librustc_mir/transform/instcombine.rs
src/librustc_mir/transform/mod.rs
src/librustc_mir/util/elaborate_drops.rs
src/librustc_mir/util/pretty.rs
src/librustc_mir_build/build/block.rs
src/librustc_mir_build/build/expr/as_rvalue.rs
src/librustc_mir_build/build/expr/stmt.rs
src/librustc_mir_build/build/mod.rs
src/librustc_mir_build/hair/pattern/const_to_pat.rs
src/librustc_mir_build/hair/pattern/mod.rs
src/librustc_mir_build/lints.rs
src/librustc_passes/dead.rs
src/librustc_passes/entry.rs
src/librustc_passes/intrinsicck.rs
src/librustc_passes/liveness.rs
src/librustc_plugin_impl/load.rs
src/librustc_privacy/lib.rs
src/librustc_resolve/late/diagnostics.rs
src/librustc_resolve/lib.rs
src/librustc_save_analysis/dump_visitor.rs
src/librustc_session/config.rs
src/librustc_session/options.rs
src/librustc_session/session.rs
src/librustc_span/source_map.rs
src/librustc_target/spec/aarch64_unknown_none.rs
src/librustc_target/spec/aarch64_unknown_none_softfloat.rs
src/librustc_target/spec/armebv7r_none_eabi.rs
src/librustc_target/spec/armebv7r_none_eabihf.rs
src/librustc_target/spec/armv7a_none_eabi.rs
src/librustc_target/spec/armv7a_none_eabihf.rs
src/librustc_target/spec/armv7r_none_eabi.rs
src/librustc_target/spec/armv7r_none_eabihf.rs
src/librustc_target/spec/cloudabi_base.rs
src/librustc_target/spec/hermit_base.rs
src/librustc_target/spec/hermit_kernel_base.rs
src/librustc_target/spec/linux_kernel_base.rs
src/librustc_target/spec/mod.rs
src/librustc_target/spec/msp430_none_elf.rs
src/librustc_target/spec/riscv32i_unknown_none_elf.rs
src/librustc_target/spec/riscv32imac_unknown_none_elf.rs
src/librustc_target/spec/riscv32imc_unknown_none_elf.rs
src/librustc_target/spec/riscv64gc_unknown_none_elf.rs
src/librustc_target/spec/riscv64imac_unknown_none_elf.rs
src/librustc_target/spec/thumb_base.rs
src/librustc_target/spec/wasm32_base.rs
src/librustc_trait_selection/opaque_types.rs
src/librustc_trait_selection/traits/auto_trait.rs
src/librustc_trait_selection/traits/error_reporting/mod.rs
src/librustc_trait_selection/traits/error_reporting/suggestions.rs
src/librustc_trait_selection/traits/mod.rs
src/librustc_trait_selection/traits/object_safety.rs
src/librustc_trait_selection/traits/project.rs
src/librustc_trait_selection/traits/select.rs
src/librustc_trait_selection/traits/specialize/mod.rs
src/librustc_trait_selection/traits/util.rs
src/librustc_trait_selection/traits/wf.rs
src/librustc_typeck/check/coercion.rs
src/librustc_typeck/check/demand.rs
src/librustc_typeck/check/method/confirm.rs
src/librustc_typeck/check/method/mod.rs
src/librustc_typeck/check/method/probe.rs
src/librustc_typeck/check/mod.rs
src/librustc_typeck/check/regionck.rs
src/librustc_typeck/check/upvar.rs
src/librustc_typeck/check/wfcheck.rs
src/librustc_typeck/check_unused.rs
src/librustc_typeck/collect.rs
src/librustc_typeck/collect/type_of.rs
src/librustc_typeck/expr_use_visitor.rs
src/librustc_typeck/impl_wf_check/min_specialization.rs
src/librustc_typeck/lib.rs
src/librustc_typeck/mem_categorization.rs
src/libstd/fs.rs
src/libstd/io/buffered.rs
src/libstd/io/cursor.rs
src/libstd/io/impls.rs
src/libstd/io/mod.rs
src/libstd/io/stdio.rs
src/libstd/io/util.rs
src/libstd/lib.rs
src/libstd/net/tcp.rs
src/libstd/process.rs
src/libstd/sync/mpsc/stream.rs
src/libstd/sys/cloudabi/shims/fs.rs
src/libstd/sys/cloudabi/shims/net.rs
src/libstd/sys/cloudabi/shims/pipe.rs
src/libstd/sys/hermit/fs.rs
src/libstd/sys/hermit/net.rs
src/libstd/sys/hermit/pipe.rs
src/libstd/sys/hermit/stdio.rs
src/libstd/sys/sgx/fd.rs
src/libstd/sys/sgx/fs.rs
src/libstd/sys/sgx/net.rs
src/libstd/sys/sgx/pipe.rs
src/libstd/sys/unix/ext/net.rs
src/libstd/sys/unix/fd.rs
src/libstd/sys/unix/fs.rs
src/libstd/sys/unix/l4re.rs
src/libstd/sys/unix/net.rs
src/libstd/sys/unix/pipe.rs
src/libstd/sys/unix/stdio.rs
src/libstd/sys/vxworks/fd.rs
src/libstd/sys/vxworks/fs.rs
src/libstd/sys/vxworks/net.rs
src/libstd/sys/vxworks/pipe.rs
src/libstd/sys/wasi/fs.rs
src/libstd/sys/wasi/net.rs
src/libstd/sys/wasi/pipe.rs
src/libstd/sys/wasi/stdio.rs
src/libstd/sys/wasm/fs.rs
src/libstd/sys/wasm/net.rs
src/libstd/sys/wasm/pipe.rs
src/libstd/sys/windows/fs.rs
src/libstd/sys/windows/handle.rs
src/libstd/sys/windows/net.rs
src/libstd/sys/windows/pipe.rs
src/libstd/sys_common/net.rs
src/rustllvm/PassWrapper.cpp
src/test/incremental/warnings-reemitted.rs
src/test/mir-opt/address-of/rustc.address_of_reborrow.SimplifyCfg-initial.after.mir
src/test/mir-opt/address-of/rustc.borrow_and_cast.SimplifyCfg-initial.after.mir
src/test/mir-opt/array-index-is-temporary/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/array-index-is-temporary/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/basic_assignment/rustc.main.SimplifyCfg-initial.after.mir
src/test/mir-opt/box_expr/rustc.main.ElaborateDrops.before.mir
src/test/mir-opt/byte_slice/rustc.main.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/combine_array_len/32bit/rustc.norm2.InstCombine.diff
src/test/mir-opt/combine_array_len/64bit/rustc.norm2.InstCombine.diff
src/test/mir-opt/const-promotion-extern-static/rustc.BAR-promoted[0].ConstProp.after.mir
src/test/mir-opt/const-promotion-extern-static/rustc.BAR.PromoteTemps.diff
src/test/mir-opt/const-promotion-extern-static/rustc.FOO-promoted[0].ConstProp.after.mir
src/test/mir-opt/const-promotion-extern-static/rustc.FOO.PromoteTemps.diff
src/test/mir-opt/const_allocation/32bit/rustc.main.ConstProp.after.mir
src/test/mir-opt/const_allocation/64bit/rustc.main.ConstProp.after.mir
src/test/mir-opt/const_allocation2/32bit/rustc.main.ConstProp.after.mir
src/test/mir-opt/const_allocation2/64bit/rustc.main.ConstProp.after.mir
src/test/mir-opt/const_allocation3/32bit/rustc.main.ConstProp.after.mir
src/test/mir-opt/const_allocation3/64bit/rustc.main.ConstProp.after.mir
src/test/mir-opt/const_prop/aggregate/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/array_index/32bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/array_index/64bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/bad_op_div_by_zero.rs [new file with mode: 0644]
src/test/mir-opt/const_prop/bad_op_div_by_zero/rustc.main.ConstProp.diff [new file with mode: 0644]
src/test/mir-opt/const_prop/bad_op_mod_by_zero.rs [new file with mode: 0644]
src/test/mir-opt/const_prop/bad_op_mod_by_zero/rustc.main.ConstProp.diff [new file with mode: 0644]
src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs [new file with mode: 0644]
src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/32bit/rustc.main.ConstProp.diff [new file with mode: 0644]
src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/64bit/rustc.main.ConstProp.diff [new file with mode: 0644]
src/test/mir-opt/const_prop/boxes/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/cast/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/checked_add/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/const_prop_fails_gracefully/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.ConstProp.diff
src/test/mir-opt/const_prop/control-flow-simplification/rustc.hello.PreCodegen.before.mir
src/test/mir-opt/const_prop/discriminant/32bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/discriminant/64bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/indirect/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/issue-66971/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/issue-67019/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/optimizes_into_variable/32bit/rustc.main.SimplifyLocals.after.mir
src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/optimizes_into_variable/64bit/rustc.main.SimplifyLocals.after.mir
src/test/mir-opt/const_prop/read_immutable_static/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/ref_deref/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/ref_deref/rustc.main.PromoteTemps.diff
src/test/mir-opt/const_prop/ref_deref_project/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/ref_deref_project/rustc.main.PromoteTemps.diff
src/test/mir-opt/const_prop/reify_fn_ptr/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/repeat/32bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/repeat/64bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/return_place/rustc.add.ConstProp.diff
src/test/mir-opt/const_prop/return_place/rustc.add.PreCodegen.before.mir
src/test/mir-opt/const_prop/scalar_literal_propagation.rs [new file with mode: 0644]
src/test/mir-opt/const_prop/scalar_literal_propagation/rustc.main.ConstProp.diff [new file with mode: 0644]
src/test/mir-opt/const_prop/slice_len/32bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/slice_len/64bit/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/switch_int/rustc.main.ConstProp.diff
src/test/mir-opt/const_prop/switch_int/rustc.main.SimplifyBranches-after-const-prop.diff
src/test/mir-opt/const_prop/tuple_literal_propagation.rs [new file with mode: 0644]
src/test/mir-opt/const_prop/tuple_literal_propagation/rustc.main.ConstProp.diff [new file with mode: 0644]
src/test/mir-opt/copy_propagation/rustc.test.CopyPropagation.diff
src/test/mir-opt/copy_propagation_arg/rustc.arg_src.CopyPropagation.diff
src/test/mir-opt/copy_propagation_arg/rustc.bar.CopyPropagation.diff
src/test/mir-opt/copy_propagation_arg/rustc.baz.CopyPropagation.diff
src/test/mir-opt/copy_propagation_arg/rustc.foo.CopyPropagation.diff
src/test/mir-opt/deaggregator_test/rustc.bar.Deaggregator.diff
src/test/mir-opt/deaggregator_test_enum/rustc.bar.Deaggregator.diff
src/test/mir-opt/deaggregator_test_enum_2/rustc.test1.Deaggregator.diff
src/test/mir-opt/deaggregator_test_multiple/rustc.test.Deaggregator.diff
src/test/mir-opt/exponential-or/rustc.match_tuple.SimplifyCfg-initial.after.mir
src/test/mir-opt/generator-drop-cleanup/rustc.main-{{closure}}.generator_drop.0.mir
src/test/mir-opt/generator-storage-dead-unwind/rustc.main-{{closure}}.StateTransform.before.mir
src/test/mir-opt/generator-tiny/rustc.main-{{closure}}.generator_resume.0.mir
src/test/mir-opt/inline/inline-any-operand/rustc.bar.Inline.after.mir
src/test/mir-opt/inline/inline-closure-borrows-arg/rustc.foo.Inline.after.mir
src/test/mir-opt/inline/inline-closure-captures/rustc.foo.Inline.after.mir
src/test/mir-opt/inline/inline-closure/rustc.foo.Inline.after.mir
src/test/mir-opt/inline/inline-into-box-place/32bit/rustc.main.Inline.diff
src/test/mir-opt/inline/inline-into-box-place/64bit/rustc.main.Inline.diff
src/test/mir-opt/inline/inline-retag/rustc.bar.Inline.after.mir
src/test/mir-opt/inline/inline-specialization/rustc.main.Inline.diff
src/test/mir-opt/inline/inline-trait-method/rustc.test.Inline.after.mir
src/test/mir-opt/inline/inline-trait-method_2/rustc.test2.Inline.after.mir
src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut.rs [new file with mode: 0644]
src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.a.Inline.after.mir [new file with mode: 0644]
src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.b.Inline.after.mir [new file with mode: 0644]
src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.c.Inline.after.mir [new file with mode: 0644]
src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.d.Inline.after.mir [new file with mode: 0644]
src/test/mir-opt/issue-38669/rustc.main.SimplifyCfg-initial.after.mir
src/test/mir-opt/issue-41110/rustc.main.ElaborateDrops.after.mir
src/test/mir-opt/issue-41110/rustc.test.ElaborateDrops.after.mir
src/test/mir-opt/issue-41697/32bit/rustc.{{impl}}-{{constant}}.SimplifyCfg-qualify-consts.after.mir
src/test/mir-opt/issue-41697/64bit/rustc.{{impl}}-{{constant}}.SimplifyCfg-qualify-consts.after.mir
src/test/mir-opt/issue-41888/rustc.main.ElaborateDrops.after.mir
src/test/mir-opt/issue-49232/rustc.main.mir_map.0.mir
src/test/mir-opt/issue-62289/rustc.test.ElaborateDrops.before.mir
src/test/mir-opt/loop_test/rustc.main.SimplifyCfg-qualify-consts.after.mir
src/test/mir-opt/match-arm-scopes/rustc.complicated_match.ElaborateDrops.after.mir
src/test/mir-opt/match-arm-scopes/rustc.complicated_match.SimplifyCfg-initial.after.mir
src/test/mir-opt/match_false_edges/rustc.full_tested_match.PromoteTemps.after.mir
src/test/mir-opt/match_false_edges/rustc.full_tested_match2.PromoteTemps.before.mir
src/test/mir-opt/match_false_edges/rustc.main.PromoteTemps.before.mir
src/test/mir-opt/match_test/rustc.main.SimplifyCfg-initial.after.mir
src/test/mir-opt/no-drop-for-inactive-variant/rustc.unwrap.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/no-spurious-drop-after-call/rustc.main.ElaborateDrops.before.mir
src/test/mir-opt/packed-struct-drop-aligned/32bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/packed-struct-drop-aligned/64bit/rustc.main.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/remove-never-const/rustc.no_codegen.PreCodegen.after.mir
src/test/mir-opt/remove_fake_borrows/rustc.match_guard.CleanupNonCodegenStatements.diff
src/test/mir-opt/retag/rustc.main-{{closure}}.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/retag/rustc.main.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/retag/rustc.ptr-drop_in_place.Test.SimplifyCfg-make_shim.after.mir
src/test/mir-opt/retag/rustc.{{impl}}-foo.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/retag/rustc.{{impl}}-foo_shr.SimplifyCfg-elaborate-drops.after.mir
src/test/mir-opt/simple-match/32bit/rustc.match_bool.mir_map.0.mir
src/test/mir-opt/simple-match/64bit/rustc.match_bool.mir_map.0.mir
src/test/mir-opt/simplify-arm-identity.rs
src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff [new file with mode: 0644]
src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff [new file with mode: 0644]
src/test/mir-opt/simplify-arm-identity/rustc.main.SimplifyArmIdentity.diff
src/test/mir-opt/simplify-locals-fixedpoint/rustc.foo.SimplifyLocals.diff
src/test/mir-opt/simplify-locals-removes-unused-consts/rustc.main.SimplifyLocals.diff
src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads/rustc.map.SimplifyLocals.diff
src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-early-opt.diff
src/test/mir-opt/simplify_cfg/rustc.main.SimplifyCfg-initial.diff
src/test/mir-opt/simplify_if/rustc.main.SimplifyBranches-after-const-prop.diff
src/test/mir-opt/simplify_match.rs
src/test/mir-opt/simplify_match/rustc.main.ConstProp.diff [new file with mode: 0644]
src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff [deleted file]
src/test/mir-opt/simplify_try/rustc.try_identity.SimplifyArmIdentity.diff
src/test/mir-opt/simplify_try/rustc.try_identity.SimplifyBranchSame.after.mir
src/test/mir-opt/simplify_try/rustc.try_identity.SimplifyLocals.after.mir
src/test/mir-opt/slice-drop-shim/32bit/rustc.ptr-drop_in_place.[std__string__String].AddMovesForPackedDrops.before.mir
src/test/mir-opt/slice-drop-shim/64bit/rustc.ptr-drop_in_place.[std__string__String].AddMovesForPackedDrops.before.mir
src/test/mir-opt/storage_live_dead_in_statics/rustc.XXX.mir_map.0.mir
src/test/mir-opt/storage_ranges/rustc.main.nll.0.mir
src/test/mir-opt/uniform_array_move_out/rustc.move_out_by_subslice.mir_map.0.mir
src/test/mir-opt/uniform_array_move_out/rustc.move_out_from_end.mir_map.0.mir
src/test/mir-opt/uninhabited-enum/rustc.process_never.SimplifyLocals.after.mir
src/test/mir-opt/uninhabited-enum/rustc.process_void.SimplifyLocals.after.mir
src/test/mir-opt/uninhabited_enum_branching/rustc.main.SimplifyCfg-after-uninhabited-enum-branching.after.mir
src/test/mir-opt/uninhabited_enum_branching/rustc.main.UninhabitedEnumBranching.diff
src/test/mir-opt/unreachable/rustc.main.UnreachablePropagation.diff
src/test/mir-opt/unreachable_asm/rustc.main.UnreachablePropagation.diff
src/test/mir-opt/unreachable_asm_2/rustc.main.UnreachablePropagation.diff
src/test/mir-opt/unreachable_diverging/rustc.main.UnreachablePropagation.diff
src/test/mir-opt/unusual-item-types/32bit/rustc.E-V-{{constant}}.mir_map.0.mir
src/test/mir-opt/unusual-item-types/32bit/rustc.Test-X-{{constructor}}.mir_map.0.mir
src/test/mir-opt/unusual-item-types/32bit/rustc.ptr-drop_in_place.std__vec__Vec_i32_.AddMovesForPackedDrops.before.mir
src/test/mir-opt/unusual-item-types/32bit/rustc.{{impl}}-ASSOCIATED_CONSTANT.mir_map.0.mir
src/test/mir-opt/unusual-item-types/64bit/rustc.E-V-{{constant}}.mir_map.0.mir
src/test/mir-opt/unusual-item-types/64bit/rustc.Test-X-{{constructor}}.mir_map.0.mir
src/test/mir-opt/unusual-item-types/64bit/rustc.ptr-drop_in_place.std__vec__Vec_i32_.AddMovesForPackedDrops.before.mir
src/test/mir-opt/unusual-item-types/64bit/rustc.{{impl}}-ASSOCIATED_CONSTANT.mir_map.0.mir
src/test/mir-opt/while-storage/rustc.while_loop.PreCodegen.after.mir
src/test/run-fail/divide-by-zero.rs
src/test/run-fail/dst-raw-slice.rs
src/test/run-fail/mod-zero.rs
src/test/run-make-fulldeps/extern-fn-reachable/main.rs
src/test/run-make-fulldeps/sanitizer-cdylib-link/Makefile
src/test/run-make-fulldeps/sanitizer-dylib-link/Makefile
src/test/run-make-fulldeps/treat-err-as-bug/Makefile
src/test/run-make-fulldeps/treat-err-as-bug/delay_span_bug.rs [new file with mode: 0644]
src/test/ui-fulldeps/auxiliary/linkage-visibility.rs [deleted file]
src/test/ui-fulldeps/linkage-visibility.rs [deleted file]
src/test/ui/anon-params/anon-params-deprecated.fixed
src/test/ui/anon-params/anon-params-deprecated.rs
src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs [new file with mode: 0644]
src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr [new file with mode: 0644]
src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.rs [new file with mode: 0644]
src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr [new file with mode: 0644]
src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs [new file with mode: 0644]
src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr [new file with mode: 0644]
src/test/ui/async-await/async-await.rs
src/test/ui/async-await/async-closure.rs
src/test/ui/async-await/drop-order/drop-order-for-async-fn-parameters.rs
src/test/ui/async-await/drop-order/drop-order-for-temporary-in-tail-return-expr.rs
src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs
src/test/ui/async-await/issues/issue-55324.rs
src/test/ui/async-await/issues/issue-58885.rs
src/test/ui/async-await/issues/issue-59001.rs
src/test/ui/async-await/issues/issue-60655-latebound-regions.rs
src/test/ui/attributes/item-attributes.rs
src/test/ui/bastion-of-the-turbofish.rs
src/test/ui/box-into-boxed-slice-fail.rs [new file with mode: 0644]
src/test/ui/box-into-boxed-slice-fail.stderr [new file with mode: 0644]
src/test/ui/box-into-boxed-slice.rs [new file with mode: 0644]
src/test/ui/codemap_tests/two_files.stderr
src/test/ui/codemap_tests/unicode_3.rs
src/test/ui/const-generics/cannot-infer-type-for-const-param.rs
src/test/ui/const-generics/issues/issue-60818-struct-constructors.rs
src/test/ui/const-generics/issues/issue-69654.rs [new file with mode: 0644]
src/test/ui/const-generics/issues/issue-69654.stderr [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/accept_structural.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/auxiliary/consts.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/cross-crate-fail.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/cross-crate-fail.stderr [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/cross-crate-pass.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/custom-eq-branch-pass.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/issue-62614.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/issue-65466.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/issue-65466.stderr [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/no-eq-branch-fail.stderr [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/reject_non_partial_eq.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/reject_non_partial_eq.stderr [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/reject_non_structural.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/reject_non_structural.stderr [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/warn_corner_cases.rs [new file with mode: 0644]
src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr [new file with mode: 0644]
src/test/ui/consts/issue-70773-mir-typeck-lt-norm.rs
src/test/ui/consts/recursive-zst-static.default.stderr [new file with mode: 0644]
src/test/ui/consts/recursive-zst-static.rs
src/test/ui/consts/recursive-zst-static.stderr [deleted file]
src/test/ui/consts/recursive-zst-static.unleash.stderr [new file with mode: 0644]
src/test/ui/deprecation/atomic_initializers.fixed
src/test/ui/deprecation/atomic_initializers.rs
src/test/ui/derive-uninhabited-enum-38885.rs
src/test/ui/editions/edition-extern-crate-allowed.rs
src/test/ui/editions/edition-feature-redundant.rs
src/test/ui/emit-artifact-notifications.rs
src/test/ui/error-codes/E0423.stderr
src/test/ui/error-codes/E0705.rs
src/test/ui/explain.rs
src/test/ui/fn_must_use.rs
src/test/ui/generator/conditional-drop.rs
src/test/ui/generator/control-flow.rs
src/test/ui/generator/drop-env.rs
src/test/ui/generator/smoke-resume-args.rs
src/test/ui/generator/smoke.rs
src/test/ui/if/if-let.rs
src/test/ui/issues/issue-32709.stderr
src/test/ui/issues/issue-55511.rs
src/test/ui/issues/issue-55511.stderr
src/test/ui/issues/issue-71406.rs [new file with mode: 0644]
src/test/ui/issues/issue-71406.stderr [new file with mode: 0644]
src/test/ui/iterators/issue-58952-filter-type-length.rs [new file with mode: 0644]
src/test/ui/loops/loops-reject-duplicate-labels-2.rs
src/test/ui/loops/loops-reject-duplicate-labels.rs
src/test/ui/loops/loops-reject-labels-shadowing-lifetimes.rs
src/test/ui/loops/loops-reject-lifetime-shadowing-label.rs
src/test/ui/macros/must-use-in-macro-55516.rs
src/test/ui/mir/mir_detects_invalid_ops.rs [new file with mode: 0644]
src/test/ui/mir/mir_detects_invalid_ops.stderr [new file with mode: 0644]
src/test/ui/nll/issue-54382-use-span-of-tail-of-block.stderr
src/test/ui/nll/issue-54556-niconii.stderr
src/test/ui/nll/issue-54556-stephaneyfx.stderr
src/test/ui/nll/issue-54556-temps-in-tail-diagnostic.stderr
src/test/ui/nll/issue-54556-used-vs-unused-tails.stderr
src/test/ui/numeric/numeric-cast-2.stderr
src/test/ui/numeric/numeric-cast.fixed
src/test/ui/numeric/numeric-cast.stderr
src/test/ui/option-to-result.stderr
src/test/ui/parser/underscore-suffix-for-string.rs
src/test/ui/proc-macro/attributes-included.rs
src/test/ui/proc-macro/auxiliary/mixed-site-span.rs
src/test/ui/resolve/issue-3907.stderr
src/test/ui/resolve/issue-5035.stderr
src/test/ui/resolve/unboxed-closure-sugar-nonexistent-trait.stderr
src/test/ui/rust-2018/macro-use-warned-against.rs
src/test/ui/rust-2018/remove-extern-crate.fixed
src/test/ui/rust-2018/remove-extern-crate.rs
src/test/ui/rust-2018/suggestions-not-always-applicable.fixed
src/test/ui/rust-2018/suggestions-not-always-applicable.rs
src/test/ui/rust-2018/try-ident.fixed
src/test/ui/rust-2018/try-ident.rs
src/test/ui/span/destructor-restrictions.stderr
src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr
src/test/ui/span/macro-span-replacement.rs
src/test/ui/span/multispan-import-lint.rs
src/test/ui/struct-literal-variant-in-if.stderr
src/test/ui/suggestions/fn-needing-specified-return-type-param.rs [new file with mode: 0644]
src/test/ui/suggestions/fn-needing-specified-return-type-param.stderr [new file with mode: 0644]
src/test/ui/test-attrs/test-should-panic-attr.rs
src/test/ui/try-on-option.stderr
src/test/ui/underscore-imports/basic.rs
src/tools/cargo
src/tools/clippy
src/tools/compiletest/src/runtest.rs
src/tools/linkchecker/main.rs
src/tools/rls
src/tools/tidy/src/error_codes_check.rs

index 816d65cb2ce23c83e22115ef8f85738b03525496..8db306ffd5455081b3d6490e3a229f6c99d53b2c 100644 (file)
@@ -135,9 +135,9 @@ dependencies = [
 
 [[package]]
 name = "backtrace-sys"
-version = "0.1.35"
+version = "0.1.36"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7de8aba10a69c8e8d7622c5710229485ec32e9d55fdad160ea559c086fdcd118"
+checksum = "78848718ee1255a2485d1309ad9cdecfc2e7d0362dd11c6829364c6b35ae1bc7"
 dependencies = [
  "cc",
  "compiler_builtins",
@@ -292,7 +292,7 @@ dependencies = [
 
 [[package]]
 name = "cargo"
-version = "0.45.0"
+version = "0.46.0"
 dependencies = [
  "anyhow",
  "atty",
@@ -1251,9 +1251,9 @@ dependencies = [
 
 [[package]]
 name = "git2"
-version = "0.13.2"
+version = "0.13.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2cfb93ca10f2934069c3aaafb753fbe0663f08ee009a01b6d62e062391447b15"
+checksum = "e1e02a51cd90229028c9bd8be0a0364f85b6b3199cccaa0ef39005ddbd5ac165"
 dependencies = [
  "bitflags",
  "libc",
@@ -1795,9 +1795,9 @@ dependencies = [
 
 [[package]]
 name = "libgit2-sys"
-version = "0.12.3+1.0.0"
+version = "0.12.5+1.0.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7637dc15e7f05a16011723e0448655081fc01a374bcd368e2c9b9c7f5c5ab3ea"
+checksum = "3eadeec65514971355bf7134967a543f71372f35b53ac6c7143e7bd157f07535"
 dependencies = [
  "cc",
  "libc",
index cf77af44ff606b85776cc764c3b49220fae729a4..89984bb55dfd82380ade435c25e362176592a593 100644 (file)
@@ -10,7 +10,14 @@ fn main() {
     let mut cmd = Command::new(real_llvm_config);
     cmd.args(env::args().skip(1)).stderr(Stdio::piped());
     let output = cmd.output().expect("failed to spawn llvm-config");
-    let stdout = String::from_utf8_lossy(&output.stdout);
+    let mut stdout = String::from_utf8_lossy(&output.stdout);
+
+    if let Ok(to_replace) = env::var("LLVM_CONFIG_SHIM_REPLACE") {
+        if let Ok(replace_with) = env::var("LLVM_CONFIG_SHIM_REPLACE_WITH") {
+            stdout = stdout.replace(&to_replace, &replace_with).into();
+        }
+    }
+
     print!("{}", stdout.replace("\\", "/"));
     io::stdout().flush().unwrap();
     process::exit(output.status.code().unwrap_or(1));
index 0c87695ff7cae53d63fdaa856c3d1b3b1505360a..0f39e33c5f46a2e346da835235bb25015ef2502a 100644 (file)
@@ -479,10 +479,29 @@ fn run(self, builder: &Builder<'_>) -> PathBuf {
         let llvm_config_shim = env::current_exe().unwrap().with_file_name("llvm-config-wrapper");
         cfg.out_dir(&out_dir)
             .profile("Release")
-            .env("LLVM_CONFIG_REAL", llvm_config)
+            .env("LLVM_CONFIG_REAL", &llvm_config)
             .define("LLVM_CONFIG_PATH", llvm_config_shim)
             .define("LLVM_INCLUDE_TESTS", "OFF");
 
+        // While we're using this horrible workaround to shim the execution of
+        // llvm-config, let's just pile on more. I can't seem to figure out how
+        // to build LLD as a standalone project and also cross-compile it at the
+        // same time. It wants a natively executable `llvm-config` to learn
+        // about LLVM, but then it learns about all the host configuration of
+        // LLVM and tries to link to host LLVM libraries.
+        //
+        // To work around that we tell our shim to replace anything with the
+        // build target with the actual target instead. This'll break parts of
+        // LLD though which try to execute host tools, such as llvm-tblgen, so
+        // we specifically tell it where to find those. This is likely super
+        // brittle and will break over time. If anyone knows better how to
+        // cross-compile LLD it would be much appreciated to fix this!
+        if target != builder.config.build {
+            cfg.env("LLVM_CONFIG_SHIM_REPLACE", &builder.config.build)
+                .env("LLVM_CONFIG_SHIM_REPLACE_WITH", &target)
+                .define("LLVM_TABLEGEN_EXE", llvm_config.with_file_name("llvm-tblgen"));
+        }
+
         cfg.build();
 
         t!(File::create(&done_stamp));
index 37e81dffc0697c5e6e32e7073c3b2bfb170fb5aa..74766dc970d9f8fbcfb173ce21c6101824c499a0 100644 (file)
@@ -33,7 +33,7 @@ ENV CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnueabi-gcc \
 ENV HOSTS=aarch64-unknown-linux-gnu
 
 ENV RUST_CONFIGURE_ARGS \
-      --enable-extended \
+      --enable-full-tools \
       --enable-profiler \
       --disable-docs
 ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
index 78f2734ed40ee0585a1024d460308a97ae523490..06870a8a982f3ab40e9c24a7c730770ac7405d12 100644 (file)
@@ -27,5 +27,5 @@ ENV CC_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-gcc \
 
 ENV HOSTS=arm-unknown-linux-gnueabi
 
-ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
+ENV RUST_CONFIGURE_ARGS --enable-full-tools --disable-docs
 ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
index 175dadfd303d751c6b87f08fe4ea499bffefbee3..155dd84891435e5ed4bb7ce4f2ed375d9b137049 100644 (file)
@@ -27,5 +27,5 @@ ENV CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc \
 
 ENV HOSTS=arm-unknown-linux-gnueabihf
 
-ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
+ENV RUST_CONFIGURE_ARGS --enable-full-tools --disable-docs
 ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
index faa2ce106068bfcd6dc57c2ce1d1352899542117..649049da5dfe314719af3cfd920eb0ad9d83def6 100644 (file)
@@ -27,5 +27,5 @@ ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \
 
 ENV HOSTS=armv7-unknown-linux-gnueabihf
 
-ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs
+ENV RUST_CONFIGURE_ARGS --enable-full-tools --disable-docs
 ENV SCRIPT python3 ../x.py dist --host $HOSTS --target $HOSTS
index f5db319e0b19c22964398d56bc63103d669e1bba..e37c0e84e2ef73d3a4ebffda8011db6814a3b02d 160000 (submodule)
@@ -1 +1 @@
-Subproject commit f5db319e0b19c22964398d56bc63103d669e1bba
+Subproject commit e37c0e84e2ef73d3a4ebffda8011db6814a3b02d
index 668fb07b6160b9c468f598e839c1e044db65de30..40beccdf1bb8eb9184a2e3b42db8b8c6e394247f 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 668fb07b6160b9c468f598e839c1e044db65de30
+Subproject commit 40beccdf1bb8eb9184a2e3b42db8b8c6e394247f
index 6eb24d6e9c0773d4aee68ed5fca121ce3cdf676a..4d2d275997746d35eabfc4d992dfbdcce2f626ed 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 6eb24d6e9c0773d4aee68ed5fca121ce3cdf676a
+Subproject commit 4d2d275997746d35eabfc4d992dfbdcce2f626ed
index 3ce94caed4cf967106c51ae86be5e098f7875f11..ed22e6fbfcb6ce436e9ea3b4bb4a55b2fb50a57e 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 3ce94caed4cf967106c51ae86be5e098f7875f11
+Subproject commit ed22e6fbfcb6ce436e9ea3b4bb4a55b2fb50a57e
index c106d1683c3a2b0960f0f0fb01728cbb19807332..ffc99581689fe2455908aaef5f5cf50dd03bb8f5 160000 (submodule)
@@ -1 +1 @@
-Subproject commit c106d1683c3a2b0960f0f0fb01728cbb19807332
+Subproject commit ffc99581689fe2455908aaef5f5cf50dd03bb8f5
index a503679f19bf74e039cbecb0b82ee6dd1b95bb87..dc5d797ebbcd191dbf5bf10652729c9a18bf7552 100644 (file)
@@ -319,11 +319,46 @@ to a valid `.profdata` file. See the chapter on
 
 ## relocation-model
 
-This option lets you choose which
-[relocation](https://en.wikipedia.org/wiki/Relocation_\(computing\)) model to
-use.
+This option controls generation of
+[position-independent code (PIC)](https://en.wikipedia.org/wiki/Position-independent_code).
 
-To find the valid options for this flag, run `rustc --print relocation-models`.
+Supported values for this option are:
+
+#### Primary relocation models
+
+- `static` - non-relocatable code, machine instructions may use absolute addressing modes.
+
+- `pic` - fully relocatable position independent code,
+machine instructions need to use relative addressing modes.  
+Equivalent to the "uppercase" `-fPIC` or `-fPIE` options in other compilers,
+depending on the produced crate types.  
+This is the default model for majority of supported targets.
+
+#### Special relocation models
+
+- `dynamic-no-pic` - relocatable external references, non-relocatable code.  
+Only makes sense on Darwin and is rarely used.  
+If StackOverflow tells you to use this as an opt-out of PIC or PIE, don't believe it,
+use `-C relocation-model=static` instead.
+- `ropi`, `rwpi` and `ropi-rwpi` - relocatable code and read-only data, relocatable read-write data,
+and combination of both, respectively.  
+Only makes sense for certain embedded ARM targets.
+- `default` - relocation model default to the current target.  
+Only makes sense as an override for some other explicitly specified relocation model
+previously set on the command line.
+
+Supported values can also be discovered by running `rustc --print relocation-models`.
+
+#### Linking effects
+
+In addition to codegen effects, `relocation-model` has effects during linking.
+
+If the relocation model is `pic` and the current target supports position-independent executables
+(PIE), the linker will be instructed (`-pie`) to produce one.  
+If the target doesn't support both position-independent and statically linked executables,
+then `-C target-feature=+crt-static` "wins" over `-C relocation-model=pic`,
+and the linker is instructed (`-static`) to produce a statically linked
+but not position-independent executable.
 
 ## remark
 
diff --git a/src/doc/unstable-book/src/compiler-flags/tls-model.md b/src/doc/unstable-book/src/compiler-flags/tls-model.md
new file mode 100644 (file)
index 0000000..0aefaa7
--- /dev/null
@@ -0,0 +1,25 @@
+# `tls_model`
+
+The tracking issue for this feature is: None.
+
+------------------------
+
+Option `-Z tls-model` controls [TLS model](https://www.akkadia.org/drepper/tls.pdf) used to
+generate code for accessing `#[thread_local]` `static` items.
+
+Supported values for this option are:
+
+- `global-dynamic` - General Dynamic TLS Model (alternatively called Global Dynamic) is the most
+general option usable in all circumstances, even if the TLS data is defined in a shared library
+loaded at runtime and is accessed from code outside of that library.  
+This is the default for most targets.
+- `local-dynamic` - model usable if the TLS data is only accessed from the shared library or
+executable it is defined in. The TLS data may be in a library loaded after startup (via `dlopen`).
+- `initial-exec` - model usable if the TLS data is defined in the executable or in a shared library
+loaded at program startup.
+The TLS data must not be in a library loaded after startup (via `dlopen`).
+- `local-exec` - model usable only if the TLS data is defined directly in the executable,
+but not in a shared library, and is accessed only from that executable.
+
+`rustc` and LLVM may use a more optimized model than specified if they know that we are producing
+and executable rather than a library, or that the `static` item is private enough.
index 949f24ab9c11eb5337050c3fadfdc51bcf3bcf91..3442abf46df86cae98e4a85482b84b5d37caa2c9 100644 (file)
@@ -11,26 +11,24 @@ depending on whether a particular sanitizer is enabled or not.
 
 ## Examples
 
-``` rust
+```rust
 #![feature(cfg_sanitize)]
 
 #[cfg(sanitize = "thread")]
 fn a() {
-  // ...
+    // ...
 }
 
 #[cfg(not(sanitize = "thread"))]
 fn a() {
-  // ...
+    // ...
 }
 
 fn b() {
-  if cfg!(sanitize = "leak") {
-    // ...
-  } else {
-    // ...
-  }
+    if cfg!(sanitize = "leak") {
+        // ...
+    } else {
+        // ...
+    }
 }
-
 ```
-
index 3d657396a9feb704e534e6ff43fda3b9e37528e6..b3a771a721d228d3c6debbfbc15bb8fe447b8339 100644 (file)
@@ -239,6 +239,16 @@ pub fn new_zeroed() -> Box<mem::MaybeUninit<T>> {
     pub fn pin(x: T) -> Pin<Box<T>> {
         (box x).into()
     }
+
+    /// Converts a `Box<T>` into a `Box<[T]>`
+    ///
+    /// This conversion does not allocate on the heap and happens in place.
+    ///
+    #[unstable(feature = "box_into_boxed_slice", issue = "71582")]
+    pub fn into_boxed_slice(boxed: Box<T>) -> Box<[T]> {
+        // *mut T and *mut [T; 1] have the same size and alignment
+        unsafe { Box::from_raw(Box::into_raw(boxed) as *mut [T; 1] as *mut [T]) }
+    }
 }
 
 impl<T> Box<[T]> {
index 8e170d970bc57260d9915274ed41170f72957d50..a3ef9989184336fb20881b878e26aa5c2f2a8d8c 100644 (file)
@@ -1269,7 +1269,7 @@ fn drop(&mut self) {
 
         impl<'r, 'a, T: Ord> Drop for DropGuard<'r, 'a, T> {
             fn drop(&mut self) {
-                while let Some(_) = self.0.inner.pop() {}
+                while self.0.inner.pop().is_some() {}
             }
         }
 
index 099687bd6b08240449b7b92b6773fd2e73fe6f42..c0b976565e41d0e7fd4f252b484cf9f9a819be40 100644 (file)
@@ -930,7 +930,7 @@ pub fn remove<Q: ?Sized>(&mut self, key: &Q) -> Option<V>
     /// assert_eq!(map.remove_entry(&1), Some((1, "a")));
     /// assert_eq!(map.remove_entry(&1), None);
     /// ```
-    #[stable(feature = "btreemap_remove_entry", since = "1.44.0")]
+    #[stable(feature = "btreemap_remove_entry", since = "1.45.0")]
     pub fn remove_entry<Q: ?Sized>(&mut self, key: &Q) -> Option<(K, V)>
     where
         K: Borrow<Q>,
index 84d34db2d458a7a38992f7e3f239389d8e04c717..5569c293e2f6605e50ba1e0f7250188b19d4337a 100644 (file)
@@ -131,7 +131,7 @@ fn from_internal(node: Box<InternalNode<K, V>>) -> Self {
     }
 
     unsafe fn from_ptr(ptr: NonNull<LeafNode<K, V>>) -> Self {
-        BoxedNode { ptr: Unique::from(ptr) }
+        BoxedNode { ptr: Unique::new_unchecked(ptr.as_ptr()) }
     }
 
     fn as_ptr(&self) -> NonNull<LeafNode<K, V>> {
index 9dd7fc6d7ee789c11fdfbeedfebe4f657b1a218e..bfa4045787f5b7141d98addc638f8a1392c0c9fb 100644 (file)
@@ -972,7 +972,7 @@ impl<'a, T> Drop for DropGuard<'a, T> {
             fn drop(&mut self) {
                 // Continue the same loop we do below. This only runs when a destructor has
                 // panicked. If another one panics this will abort.
-                while let Some(_) = self.0.pop_front_node() {}
+                while self.0.pop_front_node().is_some() {}
             }
         }
 
index 0780b33e53ae6f207a7aed3156efad46582dbf95..ca165b61e26a7da30b2c3e210992a2d8412e4d9a 100644 (file)
@@ -151,7 +151,7 @@ fn allocate_in(capacity: usize, init: AllocInit, mut alloc: A) -> Self {
 
             let memory = alloc.alloc(layout, init).unwrap_or_else(|_| handle_alloc_error(layout));
             Self {
-                ptr: memory.ptr.cast().into(),
+                ptr: unsafe { Unique::new_unchecked(memory.ptr.cast().as_ptr()) },
                 cap: Self::capacity_from_bytes(memory.size),
                 alloc,
             }
@@ -469,7 +469,7 @@ fn capacity_from_bytes(excess: usize) -> usize {
     }
 
     fn set_memory(&mut self, memory: MemoryBlock) {
-        self.ptr = memory.ptr.cast().into();
+        self.ptr = unsafe { Unique::new_unchecked(memory.ptr.cast().as_ptr()) };
         self.cap = Self::capacity_from_bytes(memory.size);
     }
 
index 85d848f54fbb776508c6bc96bcffb517dde0f966..18d5eaa9648495cd3e253e186ecf622cfa893c5c 100644 (file)
@@ -1316,7 +1316,7 @@ macro_rules! asm {
     ///
     /// Read the [unstable book] for the usage.
     ///
-    /// [unstable book]: ../unstable-book/library-features/asm.html
+    /// [unstable book]: ../unstable-book/library-features/llvm-asm.html
     #[unstable(
         feature = "llvm_asm",
         issue = "70173",
index 0349678b07b22a8f4629a3851fbd53789c744ea7..a259e293b0c1a8cd9b675a40be997a7aeb383a98 100644 (file)
@@ -111,7 +111,7 @@ fn from(nonzero: $Ty) -> Self {
                 }
             }
 
-            #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+            #[stable(feature = "nonzero_bitor", since = "1.45.0")]
             impl BitOr for $Ty {
                 type Output = Self;
                 #[inline]
@@ -122,7 +122,7 @@ fn bitor(self, rhs: Self) -> Self::Output {
                 }
             }
 
-            #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+            #[stable(feature = "nonzero_bitor", since = "1.45.0")]
             impl BitOr<$Int> for $Ty {
                 type Output = Self;
                 #[inline]
@@ -134,7 +134,7 @@ fn bitor(self, rhs: $Int) -> Self::Output {
                 }
             }
 
-            #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+            #[stable(feature = "nonzero_bitor", since = "1.45.0")]
             impl BitOr<$Ty> for $Int {
                 type Output = $Ty;
                 #[inline]
@@ -146,7 +146,7 @@ fn bitor(self, rhs: $Ty) -> Self::Output {
                 }
             }
 
-            #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+            #[stable(feature = "nonzero_bitor", since = "1.45.0")]
             impl BitOrAssign for $Ty {
                 #[inline]
                 fn bitor_assign(&mut self, rhs: Self) {
@@ -154,7 +154,7 @@ fn bitor_assign(&mut self, rhs: Self) {
                 }
             }
 
-            #[stable(feature = "nonzero_bitor", since = "1.43.0")]
+            #[stable(feature = "nonzero_bitor", since = "1.45.0")]
             impl BitOrAssign<$Int> for $Ty {
                 #[inline]
                 fn bitor_assign(&mut self, rhs: $Int) {
index 84f28488c74b678c8e28f5adf179a392478a3076..58f779106f716547b1cddb43e46c4a3f82fc7bd0 100644 (file)
@@ -65,8 +65,6 @@
 //! [`write_volatile`]: ./fn.write_volatile.html
 //! [`NonNull::dangling`]: ./struct.NonNull.html#method.dangling
 
-// ignore-tidy-undocumented-unsafe
-
 #![stable(feature = "rust1", since = "1.0.0")]
 
 use crate::cmp::Ordering;
@@ -248,14 +246,17 @@ pub(crate) struct FatPtr<T> {
 ///
 /// // create a slice pointer when starting out with a pointer to the first element
 /// let x = [5, 6, 7];
-/// let ptr = x.as_ptr();
-/// let slice = ptr::slice_from_raw_parts(ptr, 3);
+/// let raw_pointer = x.as_ptr();
+/// let slice = ptr::slice_from_raw_parts(raw_pointer, 3);
 /// assert_eq!(unsafe { &*slice }[2], 7);
 /// ```
 #[inline]
 #[stable(feature = "slice_from_raw_parts", since = "1.42.0")]
 #[rustc_const_unstable(feature = "const_slice_from_raw_parts", issue = "67456")]
 pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
+    // SAFETY: Accessing the value from the `Repr` union is safe since *const [T]
+    // and FatPtr have the same memory layouts. Only std can make this
+    // guarantee.
     unsafe { Repr { raw: FatPtr { data, len } }.rust }
 }
 
@@ -269,10 +270,28 @@ pub const fn slice_from_raw_parts<T>(data: *const T, len: usize) -> *const [T] {
 ///
 /// [`slice_from_raw_parts`]: fn.slice_from_raw_parts.html
 /// [`from_raw_parts_mut`]: ../../std/slice/fn.from_raw_parts_mut.html
+///
+/// # Examples
+///
+/// ```rust
+/// use std::ptr;
+///
+/// let x = &mut [5, 6, 7];
+/// let raw_pointer = x.as_mut_ptr();
+/// let slice = ptr::slice_from_raw_parts_mut(raw_pointer, 3);
+///
+/// unsafe {
+///     (*slice)[2] = 99; // assign a value at an index in the slice
+/// };
+///
+/// assert_eq!(unsafe { &*slice }[2], 99);
+/// ```
 #[inline]
 #[stable(feature = "slice_from_raw_parts", since = "1.42.0")]
 #[rustc_const_unstable(feature = "const_slice_from_raw_parts", issue = "67456")]
 pub const fn slice_from_raw_parts_mut<T>(data: *mut T, len: usize) -> *mut [T] {
+    // SAFETY: Accessing the value from the `Repr` union is safe since *mut [T]
+    // and FatPtr have the same memory layouts
     unsafe { Repr { raw: FatPtr { data, len } }.rust_mut }
 }
 
index 626e58d49306e1f6b76566e8a921283db7565211..7d08503215ed022bfb1920d791d9855ac1665d79 100644 (file)
@@ -7,8 +7,6 @@
 use crate::ops::{CoerceUnsized, DispatchFromDyn};
 use crate::ptr::Unique;
 
-// ignore-tidy-undocumented-unsafe
-
 /// `*mut T` but non-zero and covariant.
 ///
 /// This is often the correct thing to use when building data structures using
@@ -69,6 +67,9 @@ impl<T: Sized> NonNull<T> {
     #[rustc_const_stable(feature = "const_nonnull_dangling", since = "1.32.0")]
     #[inline]
     pub const fn dangling() -> Self {
+        // SAFETY: mem::align_of() returns a non-zero usize which is then casted
+        // to a *mut T. Therefore, `ptr` is not null and the conditions for
+        // calling new_unchecked() are respected.
         unsafe {
             let ptr = mem::align_of::<T>() as *mut T;
             NonNull::new_unchecked(ptr)
@@ -93,7 +94,12 @@ impl<T: ?Sized> NonNull<T> {
     #[stable(feature = "nonnull", since = "1.25.0")]
     #[inline]
     pub fn new(ptr: *mut T) -> Option<Self> {
-        if !ptr.is_null() { Some(unsafe { Self::new_unchecked(ptr) }) } else { None }
+        if !ptr.is_null() {
+            // SAFETY: The pointer is already checked and is not null
+            Some(unsafe { Self::new_unchecked(ptr) })
+        } else {
+            None
+        }
     }
 
     /// Acquires the underlying `*mut` pointer.
@@ -131,6 +137,7 @@ pub unsafe fn as_mut(&mut self) -> &mut T {
     #[rustc_const_stable(feature = "const_nonnull_cast", since = "1.32.0")]
     #[inline]
     pub const fn cast<U>(self) -> NonNull<U> {
+        // SAFETY: `self` is a `NonNull` pointer which is necessarily non-null
         unsafe { NonNull::new_unchecked(self.as_ptr() as *mut U) }
     }
 }
@@ -205,6 +212,8 @@ fn hash<H: hash::Hasher>(&self, state: &mut H) {
 impl<T: ?Sized> From<Unique<T>> for NonNull<T> {
     #[inline]
     fn from(unique: Unique<T>) -> Self {
+        // SAFETY: A Unique pointer cannot be null, so the conditions for
+        // new_unchecked() are respected.
         unsafe { NonNull::new_unchecked(unique.as_ptr()) }
     }
 }
@@ -213,6 +222,7 @@ fn from(unique: Unique<T>) -> Self {
 impl<T: ?Sized> From<&mut T> for NonNull<T> {
     #[inline]
     fn from(reference: &mut T) -> Self {
+        // SAFETY: A mutable reference cannot be null.
         unsafe { NonNull { pointer: reference as *mut T } }
     }
 }
@@ -221,6 +231,8 @@ fn from(reference: &mut T) -> Self {
 impl<T: ?Sized> From<&T> for NonNull<T> {
     #[inline]
     fn from(reference: &T) -> Self {
+        // SAFETY: A reference cannot be null, so the conditions for
+        // new_unchecked() are respected.
         unsafe { NonNull { pointer: reference as *const T } }
     }
 }
index 87b56d951c6ce080166d04a07830f6850d699612..f5a5baceacce875ae56099629418d364888cf844 100644 (file)
@@ -3,7 +3,6 @@
 use crate::marker::{PhantomData, Unsize};
 use crate::mem;
 use crate::ops::{CoerceUnsized, DispatchFromDyn};
-use crate::ptr::NonNull;
 
 // ignore-tidy-undocumented-unsafe
 
@@ -74,6 +73,8 @@ impl<T: Sized> Unique<T> {
     // FIXME: rename to dangling() to match NonNull?
     #[inline]
     pub const fn empty() -> Self {
+        // SAFETY: mem::align_of() returns a valid, non-null pointer. The
+        // conditions to call new_unchecked() are thus respected.
         unsafe { Unique::new_unchecked(mem::align_of::<T>() as *mut T) }
     }
 }
@@ -94,6 +95,7 @@ impl<T: ?Sized> Unique<T> {
     #[inline]
     pub fn new(ptr: *mut T) -> Option<Self> {
         if !ptr.is_null() {
+            // SAFETY: The pointer has already been checked and is not null.
             Some(unsafe { Unique { pointer: ptr as _, _marker: PhantomData } })
         } else {
             None
@@ -129,6 +131,9 @@ pub unsafe fn as_mut(&mut self) -> &mut T {
     /// Casts to a pointer of another type.
     #[inline]
     pub const fn cast<U>(self) -> Unique<U> {
+        // SAFETY: Unique::new_unchecked() creates a new unique and needs
+        // the given pointer to not be null.
+        // Since we are passing self as a pointer, it cannot be null.
         unsafe { Unique::new_unchecked(self.as_ptr() as *mut U) }
     }
 }
@@ -168,22 +173,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 impl<T: ?Sized> From<&mut T> for Unique<T> {
     #[inline]
     fn from(reference: &mut T) -> Self {
+        // SAFETY: A mutable reference cannot be null
         unsafe { Unique { pointer: reference as *mut T, _marker: PhantomData } }
     }
 }
-
-#[unstable(feature = "ptr_internals", issue = "none")]
-impl<T: ?Sized> From<&T> for Unique<T> {
-    #[inline]
-    fn from(reference: &T) -> Self {
-        unsafe { Unique { pointer: reference as *const T, _marker: PhantomData } }
-    }
-}
-
-#[unstable(feature = "ptr_internals", issue = "none")]
-impl<T: ?Sized> From<NonNull<T>> for Unique<T> {
-    #[inline]
-    fn from(p: NonNull<T>) -> Self {
-        unsafe { Unique::new_unchecked(p.as_ptr()) }
-    }
-}
index 5995f64dc78061c95f95a31ebb35ab73e712eee2..31bc61263abe682deb801863cf340a806fc244a5 100644 (file)
@@ -303,7 +303,7 @@ pub fn call_site() -> Span {
     /// definition site (local variables, labels, `$crate`) and sometimes at the macro
     /// call site (everything else).
     /// The span location is taken from the call-site.
-    #[unstable(feature = "proc_macro_mixed_site", issue = "65049")]
+    #[stable(feature = "proc_macro_mixed_site", since = "1.45.0")]
     pub fn mixed_site() -> Span {
         Span(bridge::client::Span::mixed_site())
     }
@@ -351,14 +351,14 @@ pub fn join(&self, other: Span) -> Option<Span> {
 
     /// Creates a new span with the same line/column information as `self` but
     /// that resolves symbols as though it were at `other`.
-    #[stable(feature = "proc_macro_span_resolved_at", since = "1.43.0")]
+    #[stable(feature = "proc_macro_span_resolved_at", since = "1.45.0")]
     pub fn resolved_at(&self, other: Span) -> Span {
         Span(self.0.resolved_at(other.0))
     }
 
     /// Creates a new span with the same name resolution behavior as `self` but
     /// with the line/column information of `other`.
-    #[stable(feature = "proc_macro_span_located_at", since = "1.43.0")]
+    #[stable(feature = "proc_macro_span_located_at", since = "1.45.0")]
     pub fn located_at(&self, other: Span) -> Span {
         other.resolved_at(*self)
     }
index b57ad102d634876a1a3b141229bdb4b8ded886bc..3ec7ef831b54b5b0af59c206dd647901b14f763d 100644 (file)
@@ -7,7 +7,7 @@
 use crate::base;
 use crate::common;
 use crate::consts;
-use crate::context::{get_reloc_model, is_pie_binary};
+use crate::context::all_outputs_are_pic_executables;
 use crate::llvm::{self, DiagnosticInfo, PassManager, SMDiagnostic};
 use crate::llvm_util;
 use crate::type_::Type;
@@ -25,6 +25,7 @@
 use rustc_middle::ty::TyCtxt;
 use rustc_session::config::{self, Lto, OutputType, Passes, Sanitizer, SwitchWithOptPath};
 use rustc_session::Session;
+use rustc_target::spec::RelocModel;
 
 use libc::{c_char, c_int, c_uint, c_void, size_t};
 use std::ffi::CString;
 use std::str;
 use std::sync::Arc;
 
-pub const RELOC_MODEL_ARGS: [(&str, llvm::RelocMode); 7] = [
-    ("pic", llvm::RelocMode::PIC),
-    ("static", llvm::RelocMode::Static),
-    ("default", llvm::RelocMode::Default),
-    ("dynamic-no-pic", llvm::RelocMode::DynamicNoPic),
-    ("ropi", llvm::RelocMode::ROPI),
-    ("rwpi", llvm::RelocMode::RWPI),
-    ("ropi-rwpi", llvm::RelocMode::ROPI_RWPI),
-];
-
 pub const CODE_GEN_MODEL_ARGS: &[(&str, llvm::CodeModel)] = &[
     ("small", llvm::CodeModel::Small),
     ("kernel", llvm::CodeModel::Kernel),
     ("large", llvm::CodeModel::Large),
 ];
 
-pub const TLS_MODEL_ARGS: [(&str, llvm::ThreadLocalMode); 4] = [
-    ("global-dynamic", llvm::ThreadLocalMode::GeneralDynamic),
-    ("local-dynamic", llvm::ThreadLocalMode::LocalDynamic),
-    ("initial-exec", llvm::ThreadLocalMode::InitialExec),
-    ("local-exec", llvm::ThreadLocalMode::LocalExec),
-];
-
 pub fn llvm_err(handler: &rustc_errors::Handler, msg: &str) -> FatalError {
     match llvm::last_error() {
         Some(err) => handler.fatal(&format!("{}: {}", msg, err)),
@@ -84,19 +68,13 @@ pub fn write_output_file(
     }
 }
 
-pub fn create_informational_target_machine(
-    sess: &Session,
-    find_features: bool,
-) -> &'static mut llvm::TargetMachine {
-    target_machine_factory(sess, config::OptLevel::No, find_features)()
+pub fn create_informational_target_machine(sess: &Session) -> &'static mut llvm::TargetMachine {
+    target_machine_factory(sess, config::OptLevel::No)()
         .unwrap_or_else(|err| llvm_err(sess.diagnostic(), &err).raise())
 }
 
-pub fn create_target_machine(
-    tcx: TyCtxt<'_>,
-    find_features: bool,
-) -> &'static mut llvm::TargetMachine {
-    target_machine_factory(&tcx.sess, tcx.backend_optimization_level(LOCAL_CRATE), find_features)()
+pub fn create_target_machine(tcx: TyCtxt<'_>) -> &'static mut llvm::TargetMachine {
+    target_machine_factory(&tcx.sess, tcx.backend_optimization_level(LOCAL_CRATE))()
         .unwrap_or_else(|err| llvm_err(tcx.sess.diagnostic(), &err).raise())
 }
 
@@ -126,15 +104,22 @@ fn to_pass_builder_opt_level(cfg: config::OptLevel) -> llvm::PassBuilderOptLevel
     }
 }
 
-// If find_features is true this won't access `sess.crate_types` by assuming
-// that `is_pie_binary` is false. When we discover LLVM target features
-// `sess.crate_types` is uninitialized so we cannot access it.
+fn to_llvm_relocation_model(relocation_model: RelocModel) -> llvm::RelocModel {
+    match relocation_model {
+        RelocModel::Static => llvm::RelocModel::Static,
+        RelocModel::Pic => llvm::RelocModel::PIC,
+        RelocModel::DynamicNoPic => llvm::RelocModel::DynamicNoPic,
+        RelocModel::Ropi => llvm::RelocModel::ROPI,
+        RelocModel::Rwpi => llvm::RelocModel::RWPI,
+        RelocModel::RopiRwpi => llvm::RelocModel::ROPI_RWPI,
+    }
+}
+
 pub fn target_machine_factory(
     sess: &Session,
     optlvl: config::OptLevel,
-    find_features: bool,
 ) -> Arc<dyn Fn() -> Result<&'static mut llvm::TargetMachine, String> + Send + Sync> {
-    let reloc_model = get_reloc_model(sess);
+    let reloc_model = to_llvm_relocation_model(sess.relocation_model());
 
     let (opt_level, _) = to_llvm_opt_settings(optlvl);
     let use_softfp = sess.opts.cg.soft_float;
@@ -175,7 +160,7 @@ pub fn target_machine_factory(
     let features = features.join(",");
     let features = CString::new(features).unwrap();
     let abi = SmallCStr::new(&sess.target.target.options.llvm_abiname);
-    let is_pie_binary = !find_features && is_pie_binary(sess);
+    let pic_is_pie = all_outputs_are_pic_executables(sess);
     let trap_unreachable = sess.target.target.options.trap_unreachable;
     let emit_stack_size_section = sess.opts.debugging_opts.emit_stack_sizes;
 
@@ -192,7 +177,7 @@ pub fn target_machine_factory(
                 reloc_model,
                 opt_level,
                 use_softfp,
-                is_pie_binary,
+                pic_is_pie,
                 ffunction_sections,
                 fdata_sections,
                 trap_unreachable,
index d385c073074743e181011359563268cf5daa5c19..f868385ee869a5908ecfee7441bae94c2ef2fc65 100644 (file)
@@ -21,7 +21,7 @@
 use rustc_span::source_map::{Span, DUMMY_SP};
 use rustc_span::symbol::Symbol;
 use rustc_target::abi::{HasDataLayout, LayoutOf, PointeeInfo, Size, TargetDataLayout, VariantIdx};
-use rustc_target::spec::{HasTargetSpec, Target};
+use rustc_target::spec::{HasTargetSpec, RelocModel, Target, TlsModel};
 
 use std::cell::{Cell, RefCell};
 use std::ffi::CStr;
@@ -87,44 +87,23 @@ pub struct CodegenCx<'ll, 'tcx> {
     local_gen_sym_counter: Cell<usize>,
 }
 
-pub fn get_reloc_model(sess: &Session) -> llvm::RelocMode {
-    let reloc_model_arg = match sess.opts.cg.relocation_model {
-        Some(ref s) => &s[..],
-        None => &sess.target.target.options.relocation_model[..],
-    };
-
-    match crate::back::write::RELOC_MODEL_ARGS.iter().find(|&&arg| arg.0 == reloc_model_arg) {
-        Some(x) => x.1,
-        _ => {
-            sess.err(&format!("{:?} is not a valid relocation mode", reloc_model_arg));
-            sess.abort_if_errors();
-            bug!();
-        }
-    }
-}
-
-fn get_tls_model(sess: &Session) -> llvm::ThreadLocalMode {
-    let tls_model_arg = match sess.opts.debugging_opts.tls_model {
-        Some(ref s) => &s[..],
-        None => &sess.target.target.options.tls_model[..],
-    };
-
-    match crate::back::write::TLS_MODEL_ARGS.iter().find(|&&arg| arg.0 == tls_model_arg) {
-        Some(x) => x.1,
-        _ => {
-            sess.err(&format!("{:?} is not a valid TLS model", tls_model_arg));
-            sess.abort_if_errors();
-            bug!();
-        }
+fn to_llvm_tls_model(tls_model: TlsModel) -> llvm::ThreadLocalMode {
+    match tls_model {
+        TlsModel::GeneralDynamic => llvm::ThreadLocalMode::GeneralDynamic,
+        TlsModel::LocalDynamic => llvm::ThreadLocalMode::LocalDynamic,
+        TlsModel::InitialExec => llvm::ThreadLocalMode::InitialExec,
+        TlsModel::LocalExec => llvm::ThreadLocalMode::LocalExec,
     }
 }
 
-fn is_any_library(sess: &Session) -> bool {
-    sess.crate_types.borrow().iter().any(|ty| *ty != config::CrateType::Executable)
-}
-
-pub fn is_pie_binary(sess: &Session) -> bool {
-    !is_any_library(sess) && get_reloc_model(sess) == llvm::RelocMode::PIC
+/// PIE is potentially more effective than PIC, but can only be used in executables.
+/// If all our outputs are executables, then we can relax PIC to PIE when producing object code.
+/// If the list of crate types is not yet known we conservatively return `false`.
+pub fn all_outputs_are_pic_executables(sess: &Session) -> bool {
+    sess.relocation_model() == RelocModel::Pic
+        && sess.crate_types.try_get().map_or(false, |crate_types| {
+            crate_types.iter().all(|ty| *ty == config::CrateType::Executable)
+        })
 }
 
 fn strip_function_ptr_alignment(data_layout: String) -> String {
@@ -157,7 +136,7 @@ pub unsafe fn create_module(
 
     // Ensure the data-layout values hardcoded remain the defaults.
     if sess.target.target.options.is_builtin {
-        let tm = crate::back::write::create_informational_target_machine(&tcx.sess, false);
+        let tm = crate::back::write::create_informational_target_machine(tcx.sess);
         llvm::LLVMRustSetDataLayoutFromTargetMachine(llmod, tm);
         llvm::LLVMRustDisposeTargetMachine(tm);
 
@@ -200,11 +179,11 @@ pub unsafe fn create_module(
     let llvm_target = SmallCStr::new(&sess.target.target.llvm_target);
     llvm::LLVMRustSetNormalizedTarget(llmod, llvm_target.as_ptr());
 
-    if get_reloc_model(sess) == llvm::RelocMode::PIC {
+    if sess.relocation_model() == RelocModel::Pic {
         llvm::LLVMRustSetModulePICLevel(llmod);
     }
 
-    if is_pie_binary(sess) {
+    if all_outputs_are_pic_executables(sess) {
         llvm::LLVMRustSetModulePIELevel(llmod);
     }
 
@@ -281,7 +260,7 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
 
         let check_overflow = tcx.sess.overflow_checks();
 
-        let tls_model = get_tls_model(&tcx.sess);
+        let tls_model = to_llvm_tls_model(tcx.sess.tls_model());
 
         let (llcx, llmod) = (&*llvm_module.llcx, llvm_module.llmod());
 
index 37f502c56a6d1aa321f697f00e4c274c2f0520aa..92e210cdd8cb764d8fc3577d0a89b14e6f5d257d 100644 (file)
@@ -290,7 +290,7 @@ fn create_function_debug_context(
             spflags |= DISPFlags::SPFlagOptimized;
         }
         if let Some((id, _)) = self.tcx.entry_fn(LOCAL_CRATE) {
-            if id == def_id {
+            if id.to_def_id() == def_id {
                 spflags |= DISPFlags::SPFlagMainSubprogram;
             }
         }
index 641586797407b0b24e1c781b335360a81e7e039d..42302a56b41883d78ecb5bc907a8bf0d465f78f4 100644 (file)
@@ -110,9 +110,8 @@ fn target_machine_factory(
         &self,
         sess: &Session,
         optlvl: OptLevel,
-        find_features: bool,
     ) -> Arc<dyn Fn() -> Result<&'static mut llvm::TargetMachine, String> + Send + Sync> {
-        back::write::target_machine_factory(sess, optlvl, find_features)
+        back::write::target_machine_factory(sess, optlvl)
     }
     fn target_cpu<'b>(&self, sess: &'b Session) -> &'b str {
         llvm_util::target_cpu(sess)
@@ -201,7 +200,9 @@ fn print(&self, req: PrintRequest, sess: &Session) {
         match req {
             PrintRequest::RelocationModels => {
                 println!("Available relocation models:");
-                for &(name, _) in back::write::RELOC_MODEL_ARGS.iter() {
+                for name in
+                    &["static", "pic", "dynamic-no-pic", "ropi", "rwpi", "ropi-rwpi", "default"]
+                {
                     println!("    {}", name);
                 }
                 println!();
@@ -215,7 +216,7 @@ fn print(&self, req: PrintRequest, sess: &Session) {
             }
             PrintRequest::TlsModels => {
                 println!("Available TLS models:");
-                for &(name, _) in back::write::TLS_MODEL_ARGS.iter() {
+                for name in &["global-dynamic", "local-dynamic", "initial-exec", "local-exec"] {
                     println!("    {}", name);
                 }
                 println!();
@@ -351,7 +352,7 @@ fn new(tcx: TyCtxt<'_>, mod_name: &str) -> Self {
         unsafe {
             let llcx = llvm::LLVMRustContextCreate(tcx.sess.fewer_names());
             let llmod_raw = context::create_module(tcx, llcx, mod_name) as *const _;
-            ModuleLlvm { llmod_raw, llcx, tm: create_target_machine(tcx, false) }
+            ModuleLlvm { llmod_raw, llcx, tm: create_target_machine(tcx) }
         }
     }
 
@@ -359,11 +360,7 @@ fn new_metadata(tcx: TyCtxt<'_>, mod_name: &str) -> Self {
         unsafe {
             let llcx = llvm::LLVMRustContextCreate(tcx.sess.fewer_names());
             let llmod_raw = context::create_module(tcx, llcx, mod_name) as *const _;
-            ModuleLlvm {
-                llmod_raw,
-                llcx,
-                tm: create_informational_target_machine(&tcx.sess, false),
-            }
+            ModuleLlvm { llmod_raw, llcx, tm: create_informational_target_machine(tcx.sess) }
         }
     }
 
index aeb34e5c9c95444d065ea9dedc658da315ee4196..fd03812cccdae8ccfa135d620d87512dd73d9dd8 100644 (file)
@@ -445,8 +445,7 @@ pub struct SanitizerOptions {
 /// LLVMRelocMode
 #[derive(Copy, Clone, PartialEq)]
 #[repr(C)]
-pub enum RelocMode {
-    Default,
+pub enum RelocModel {
     Static,
     PIC,
     DynamicNoPic,
@@ -1946,7 +1945,7 @@ pub fn LLVMRustCreateTargetMachine(
         Features: *const c_char,
         Abi: *const c_char,
         Model: CodeModel,
-        Reloc: RelocMode,
+        Reloc: RelocModel,
         Level: CodeGenOptLevel,
         UseSoftFP: bool,
         PositionIndependentExecutable: bool,
index 6f16b0fb79c399b0c10ce93640a6cc3ddb448ce1..a36e95771e8b973cf1db807906202c7a3b2f62f9 100644 (file)
@@ -270,7 +270,7 @@ pub fn to_llvm_feature<'a>(sess: &Session, s: &'a str) -> &'a str {
 }
 
 pub fn target_features(sess: &Session) -> Vec<Symbol> {
-    let target_machine = create_informational_target_machine(sess, true);
+    let target_machine = create_informational_target_machine(sess);
     target_feature_whitelist(sess)
         .iter()
         .filter_map(|&(feature, gate)| {
@@ -322,7 +322,7 @@ pub fn print_passes() {
 
 pub(crate) fn print(req: PrintRequest, sess: &Session) {
     require_inited();
-    let tm = create_informational_target_machine(sess, true);
+    let tm = create_informational_target_machine(sess);
     unsafe {
         match req {
             PrintRequest::TargetCPUs => llvm::LLVMRustPrintTargetCPUs(tm),
index 8725bfaa025753746be91c2c8e9bfe9424bb3877..9d42db8ec429415f317c3557ede7d364745bf3ff 100644 (file)
@@ -12,7 +12,7 @@
 /// need out of the shared crate context before we get rid of it.
 use rustc_session::{filesearch, Session};
 use rustc_span::symbol::Symbol;
-use rustc_target::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelroLevel};
+use rustc_target::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, RelroLevel};
 
 use super::archive::ArchiveBuilder;
 use super::command::Command;
@@ -1352,7 +1352,7 @@ fn add_position_independent_executable_args(
     if sess.target.target.options.position_independent_executables {
         let attr_link_args = &*codegen_results.crate_info.link_args;
         let mut user_defined_link_args = sess.opts.cg.link_args.iter().chain(attr_link_args);
-        if is_pic(sess)
+        if sess.relocation_model() == RelocModel::Pic
             && !sess.crt_static(Some(crate_type))
             && !user_defined_link_args.any(|x| x == "-static")
         {
@@ -1992,12 +1992,3 @@ fn are_upstream_rust_objects_already_included(sess: &Session) -> bool {
         config::Lto::No | config::Lto::ThinLocal => false,
     }
 }
-
-fn is_pic(sess: &Session) -> bool {
-    let reloc_model_arg = match sess.opts.cg.relocation_model {
-        Some(ref s) => &s[..],
-        None => &sess.target.target.options.relocation_model[..],
-    };
-
-    reloc_model_arg == "pic"
-}
index 37034141bb77d7475b8b4dc3a60a2d88c61f5bbb..c84f38670f77b1f64dfb4165df7e181d2d2dec4e 100644 (file)
@@ -1037,7 +1037,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
         regular_module_config: regular_config,
         metadata_module_config: metadata_config,
         allocator_module_config: allocator_config,
-        tm_factory: TargetMachineFactory(backend.target_machine_factory(tcx.sess, ol, false)),
+        tm_factory: TargetMachineFactory(backend.target_machine_factory(tcx.sess, ol)),
         total_cgus,
         msvc_imps_needed: msvc_imps_needed(tcx),
         target_pointer_width: tcx.sess.target.target.target_pointer_width.clone(),
index 74ec100ba426756c50e70d4e6ec36492bea120a1..cd43ca8257e926b7c7544d4415b721454b448898 100644 (file)
@@ -30,7 +30,7 @@
 use rustc_data_structures::profiling::print_time_passes_entry;
 use rustc_data_structures::sync::{par_iter, Lock, ParallelIterator};
 use rustc_hir as hir;
-use rustc_hir::def_id::{DefId, LOCAL_CRATE};
+use rustc_hir::def_id::{LocalDefId, LOCAL_CRATE};
 use rustc_hir::lang_items::StartFnLangItem;
 use rustc_index::vec::Idx;
 use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
@@ -397,7 +397,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
         None => return None,
     };
 
-    let instance = Instance::mono(cx.tcx(), main_def_id);
+    let instance = Instance::mono(cx.tcx(), main_def_id.to_def_id());
 
     if !cx.codegen_unit().contains_item(&MonoItem::Fn(instance)) {
         // We want to create the wrapper in the same codegen unit as Rust's main
@@ -416,7 +416,7 @@ fn create_entry_fn<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
         cx: &'a Bx::CodegenCx,
         sp: Span,
         rust_main: Bx::Value,
-        rust_main_def_id: DefId,
+        rust_main_def_id: LocalDefId,
         use_start_lang_item: bool,
     ) -> Bx::Function {
         // The entry function is either `int main(void)` or `int main(int argc, char **argv)`,
index 91be123beb0bcef36c10312eaca002f95800a3d4..6cbb47efa99f23cd2723da482014fb352ce81862 100644 (file)
@@ -110,14 +110,10 @@ fn compile_codegen_unit(
         tcx: TyCtxt<'_>,
         cgu_name: Symbol,
     ) -> (ModuleCodegen<Self::Module>, u64);
-    // If find_features is true this won't access `sess.crate_types` by assuming
-    // that `is_pie_binary` is false. When we discover LLVM target features
-    // `sess.crate_types` is uninitialized so we cannot access it.
     fn target_machine_factory(
         &self,
         sess: &Session,
         opt_level: config::OptLevel,
-        find_features: bool,
     ) -> Arc<dyn Fn() -> Result<Self::TargetMachine, String> + Send + Sync>;
     fn target_cpu<'b>(&self, sess: &'b Session) -> &'b str;
 }
index fff86ba819450fa71235be72f013ba409c576332..913ccf8e68089ab6bab489539858986eba9ac2ab 100644 (file)
@@ -618,15 +618,15 @@ pub fn list_metadata(
     ) -> Compilation {
         let r = matches.opt_strs("Z");
         if r.iter().any(|s| *s == "ls") {
-            match input {
-                &Input::File(ref ifile) => {
+            match *input {
+                Input::File(ref ifile) => {
                     let path = &(*ifile);
                     let mut v = Vec::new();
                     locator::list_file_metadata(&sess.target.target, path, metadata_loader, &mut v)
                         .unwrap();
                     println!("{}", String::from_utf8(v).unwrap());
                 }
-                &Input::Str { .. } => {
+                Input::Str { .. } => {
                     early_error(ErrorOutputType::default(), "cannot list metadata for stdin");
                 }
             }
index 151241fdb0b5f6cd5d85b3d44df0bcebd2e1ba8a..e4a560e434aaaf87cf3bef793e63b8a08cba1777 100644 (file)
@@ -869,7 +869,10 @@ fn emit_diag_at_span(&mut self, mut diag: Diagnostic, sp: impl Into<MultiSpan>)
     }
 
     fn delay_span_bug(&mut self, sp: impl Into<MultiSpan>, msg: &str) {
-        if self.treat_err_as_bug() {
+        // This is technically `self.treat_err_as_bug()` but `delay_span_bug` is called before
+        // incrementing `err_count` by one, so we need to +1 the comparing.
+        // FIXME: Would be nice to increment err_count in a more coherent way.
+        if self.flags.treat_err_as_bug.map(|c| self.err_count() + 1 >= c).unwrap_or(false) {
             // FIXME: don't abort here if report_delayed_bugs is off
             self.span_bug(sp, msg);
         }
index d342f8b0ad21c3d601b4470316bbf82be44252e8..654cd4980a4e16f3cd89db88b40f7bcef0e67570 100644 (file)
@@ -1601,7 +1601,7 @@ pub enum ExprKind<'hir> {
 ///
 /// To resolve the path to a `DefId`, call [`qpath_res`].
 ///
-/// [`qpath_res`]: ../ty/struct.TypeckTables.html#method.qpath_res
+/// [`qpath_res`]: ../rustc_middle/ty/struct.TypeckTables.html#method.qpath_res
 #[derive(RustcEncodable, RustcDecodable, Debug, HashStable_Generic)]
 pub enum QPath<'hir> {
     /// Path to a definition, optionally "fully-qualified" with a `Self`
index 1986838e4016c97af94c3fb01a56f766b23aef1e..93c8e505697b40230eace65f36e1135935a348b3 100644 (file)
@@ -257,7 +257,13 @@ pub fn need_type_info_err(
                 None
             };
             printer.name_resolver = Some(Box::new(&getter));
-            let _ = ty.print(printer);
+            let _ = if let ty::FnDef(..) = ty.kind {
+                // We don't want the regular output for `fn`s because it includes its path in
+                // invalid pseduo-syntax, we want the `fn`-pointer output instead.
+                ty.fn_sig(self.tcx).print(printer)
+            } else {
+                ty.print(printer)
+            };
             s
         };
 
index 1a601d723cb7bfe74645b4e3fcb812161c1128de..5020dc4132cc34a3d017767339feaf2e66f7cefa 100644 (file)
@@ -223,7 +223,7 @@ fn declared_generic_bounds_from_env_with_compare_fn(
         // like `T` and `T::Item`. It may not work as well for things
         // like `<T as Foo<'a>>::Item`.
         let c_b = self.param_env.caller_bounds;
-        let param_bounds = self.collect_outlives_from_predicate_list(&compare_ty, c_b);
+        let param_bounds = self.collect_outlives_from_predicate_list(&compare_ty, c_b.into_iter());
 
         // Next, collect regions we scraped from the well-formedness
         // constraints in the fn signature. To do that, we walk the list
@@ -315,15 +315,12 @@ fn region_bounds_declared_on_associated_item(
         let tcx = self.tcx;
         let assoc_item = tcx.associated_item(assoc_item_def_id);
         let trait_def_id = assoc_item.container.assert_trait();
-        let trait_predicates =
-            tcx.predicates_of(trait_def_id).predicates.iter().map(|(p, _)| *p).collect();
+        let trait_predicates = tcx.predicates_of(trait_def_id).predicates.iter().map(|(p, _)| *p);
         let identity_substs = InternalSubsts::identity_for_item(tcx, assoc_item_def_id);
         let identity_proj = tcx.mk_projection(assoc_item_def_id, identity_substs);
         self.collect_outlives_from_predicate_list(
             move |ty| ty == identity_proj,
-            traits::elaborate_predicates(tcx, trait_predicates)
-                .map(|o| o.predicate)
-                .collect::<Vec<_>>(),
+            traits::elaborate_predicates(tcx, trait_predicates).map(|o| o.predicate),
         )
         .map(|b| b.1)
     }
@@ -337,10 +334,9 @@ fn region_bounds_declared_on_associated_item(
     fn collect_outlives_from_predicate_list(
         &self,
         compare_ty: impl Fn(Ty<'tcx>) -> bool,
-        predicates: impl IntoIterator<Item = impl AsRef<ty::Predicate<'tcx>>>,
+        predicates: impl Iterator<Item = impl AsRef<ty::Predicate<'tcx>>>,
     ) -> impl Iterator<Item = ty::OutlivesPredicate<Ty<'tcx>, ty::Region<'tcx>>> {
         predicates
-            .into_iter()
             .filter_map(|p| p.as_ref().to_opt_type_outlives())
             .filter_map(|p| p.no_bound_vars())
             .filter(move |p| compare_ty(p.0))
index 3f63d25fb4723ad92109f62fb965a6843e75a20c..55bea57f3e24330d1af5f106954d38bee589d6ab 100644 (file)
@@ -97,24 +97,22 @@ pub fn elaborate_trait_ref<'tcx>(
     tcx: TyCtxt<'tcx>,
     trait_ref: ty::PolyTraitRef<'tcx>,
 ) -> Elaborator<'tcx> {
-    elaborate_predicates(tcx, vec![trait_ref.without_const().to_predicate()])
+    elaborate_predicates(tcx, std::iter::once(trait_ref.without_const().to_predicate()))
 }
 
 pub fn elaborate_trait_refs<'tcx>(
     tcx: TyCtxt<'tcx>,
     trait_refs: impl Iterator<Item = ty::PolyTraitRef<'tcx>>,
 ) -> Elaborator<'tcx> {
-    let predicates = trait_refs.map(|trait_ref| trait_ref.without_const().to_predicate()).collect();
+    let predicates = trait_refs.map(|trait_ref| trait_ref.without_const().to_predicate());
     elaborate_predicates(tcx, predicates)
 }
 
 pub fn elaborate_predicates<'tcx>(
     tcx: TyCtxt<'tcx>,
-    mut predicates: Vec<ty::Predicate<'tcx>>,
+    predicates: impl Iterator<Item = ty::Predicate<'tcx>>,
 ) -> Elaborator<'tcx> {
-    let mut visited = PredicateSet::new(tcx);
-    predicates.retain(|pred| visited.insert(pred));
-    let obligations: Vec<_> =
+    let obligations =
         predicates.into_iter().map(|predicate| predicate_obligation(predicate, None)).collect();
     elaborate_obligations(tcx, obligations)
 }
@@ -151,21 +149,20 @@ fn elaborate(&mut self, obligation: &PredicateObligation<'tcx>) {
                 // Get predicates declared on the trait.
                 let predicates = tcx.super_predicates_of(data.def_id());
 
-                let obligations = predicates.predicates.iter().map(|(pred, span)| {
+                let obligations = predicates.predicates.into_iter().map(|(pred, span)| {
                     predicate_obligation(
                         pred.subst_supertrait(tcx, &data.to_poly_trait_ref()),
                         Some(*span),
                     )
                 });
-                debug!("super_predicates: data={:?} predicates={:?}", data, &obligations);
+                debug!("super_predicates: data={:?}", data);
 
                 // Only keep those bounds that we haven't already seen.
                 // This is necessary to prevent infinite recursion in some
                 // cases. One common case is when people define
                 // `trait Sized: Sized { }` rather than `trait Sized { }`.
                 let visited = &mut self.visited;
-                let obligations =
-                    obligations.filter(|obligation| visited.insert(&obligation.predicate));
+                let obligations = obligations.filter(|o| visited.insert(&o.predicate));
 
                 self.stack.extend(obligations);
             }
index 4b09148eab61f8269c1c5a95e91650906fd8d969..9a8a05713c8d45319ea786b3058a050727b9b555 100644 (file)
@@ -835,7 +835,7 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
     });
 
     sess.time("MIR_borrow_checking", || {
-        tcx.par_body_owners(|def_id| tcx.ensure().mir_borrowck(def_id.to_def_id()));
+        tcx.par_body_owners(|def_id| tcx.ensure().mir_borrowck(def_id));
     });
 
     sess.time("dumping_chalk_like_clauses", || {
index 6a62d754f289169e55d287bb9b94523df0e11bf5..9e8f3a84e20e9b0f5714497464c89f6c3422c630 100644 (file)
@@ -293,7 +293,7 @@ fn check_for_rustc_errors_attr(tcx: TyCtxt<'_>) {
             _ => return,
         };
 
-        let attrs = &*tcx.get_attrs(def_id);
+        let attrs = &*tcx.get_attrs(def_id.to_def_id());
         let attrs = attrs.iter().filter(|attr| attr.check_name(sym::rustc_error));
         for attr in attrs {
             match attr.meta_item_list() {
index 211850486c02477eec90715ae0186f0477edf146..cee2e5b5becdb350c3d833805522370f86d06a19 100644 (file)
@@ -14,7 +14,8 @@
 use rustc_span::edition::{Edition, DEFAULT_EDITION};
 use rustc_span::symbol::sym;
 use rustc_span::SourceFileHashAlgorithm;
-use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
+use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy};
+use rustc_target::spec::{RelocModel, RelroLevel, TlsModel};
 use std::collections::{BTreeMap, BTreeSet};
 use std::iter::FromIterator;
 use std::path::PathBuf;
@@ -430,7 +431,7 @@ macro_rules! tracked {
     tracked!(prefer_dynamic, true);
     tracked!(profile_generate, SwitchWithOptPath::Enabled(None));
     tracked!(profile_use, Some(PathBuf::from("abc")));
-    tracked!(relocation_model, Some(String::from("relocation model")));
+    tracked!(relocation_model, Some(RelocModel::Pic));
     tracked!(soft_float, true);
     tracked!(target_cpu, Some(String::from("abc")));
     tracked!(target_feature, String::from("all the features, all of them"));
@@ -567,7 +568,7 @@ macro_rules! tracked {
     tracked!(symbol_mangling_version, SymbolManglingVersion::V0);
     tracked!(teach, true);
     tracked!(thinlto, Some(true));
-    tracked!(tls_model, Some(String::from("tls model")));
+    tracked!(tls_model, Some(TlsModel::GeneralDynamic));
     tracked!(treat_err_as_bug, Some(1));
     tracked!(unleash_the_miri_inside_of_you, true);
     tracked!(verify_llvm_ir, true);
index fda0172544333bc6ed630bc8786b318b07f06182..72c25270a5d6918b662877de71ccc17f3c619152 100644 (file)
@@ -205,7 +205,7 @@ pub fn spawn_thread_pool<F: FnOnce() -> R + Send, R: Send>(
 }
 
 fn load_backend_from_dylib(path: &Path) -> fn() -> Box<dyn CodegenBackend> {
-    let lib = DynamicLibrary::open(Some(path)).unwrap_or_else(|err| {
+    let lib = DynamicLibrary::open(path).unwrap_or_else(|err| {
         let err = format!("couldn't load codegen backend {:?}: {:?}", path, err);
         early_error(ErrorOutputType::default(), &err);
     });
@@ -625,8 +625,8 @@ fn involves_impl_trait(ty: &ast::Ty) -> bool {
                     | ast::TyKind::Rptr(_, ast::MutTy { ty: ref subty, .. })
                     | ast::TyKind::Paren(ref subty) => involves_impl_trait(subty),
                     ast::TyKind::Tup(ref tys) => any_involves_impl_trait(tys.iter()),
-                    ast::TyKind::Path(_, ref path) => path.segments.iter().any(|seg| {
-                        match seg.args.as_ref().map(|generic_arg| &**generic_arg) {
+                    ast::TyKind::Path(_, ref path) => {
+                        path.segments.iter().any(|seg| match seg.args.as_deref() {
                             None => false,
                             Some(&ast::GenericArgs::AngleBracketed(ref data)) => {
                                 data.args.iter().any(|arg| match arg {
@@ -647,8 +647,8 @@ fn involves_impl_trait(ty: &ast::Ty) -> bool {
                                 any_involves_impl_trait(data.inputs.iter())
                                     || ReplaceBodyWithLoop::should_ignore_fn(&data.output)
                             }
-                        }
-                    }),
+                        })
+                    }
                     _ => false,
                 }
             }
index be85a34bd395a5842e40441203169d56960f6511..5ccfc1b276bfa0e1c71372aa4f3c99e588d0eff8 100644 (file)
@@ -236,17 +236,12 @@ pub enum Base {
 /// (e.g. "#![deny(missing_docs)]").
 pub fn strip_shebang(input: &str) -> Option<usize> {
     debug_assert!(!input.is_empty());
-    let s: &str = &remove_whitespace(input);
-    if !s.starts_with("#!") || s.starts_with("#![") {
+    if !input.starts_with("#!") || input.starts_with("#![") {
         return None;
     }
     Some(input.find('\n').unwrap_or(input.len()))
 }
 
-fn remove_whitespace(s: &str) -> String {
-    s.chars().filter(|c| !c.is_whitespace()).collect()
-}
-
 /// Parses the first token from the provided input string.
 pub fn first_token(input: &str) -> Token {
     debug_assert!(!input.is_empty());
index 065e8f3f646fb7184ad0ebc8c4ce017f24e394b9..06fc159fe2516a86f5a9e3e54efb1726a12bae4d 100644 (file)
@@ -145,22 +145,4 @@ fn test_unterminated_no_pound() {
             }),
         );
     }
-
-    #[test]
-    fn test_valid_shebang() {
-        // https://github.com/rust-lang/rust/issues/70528
-        let input = "#!/usr/bin/rustrun";
-        let actual = strip_shebang(input);
-        let expected: Option<usize> = Some(18);
-        assert_eq!(expected, actual);
-    }
-
-    #[test]
-    fn test_invalid_shebang_valid_rust_syntax() {
-        // https://github.com/rust-lang/rust/issues/70528
-        let input = "#!    [bad_attribute]";
-        let actual = strip_shebang(input);
-        let expected: Option<usize> = None;
-        assert_eq!(expected, actual);
-    }
 }
index 1041ad0186681dc3aa86d3887106820e118b994e..4033c2b28494cf692c8445388f5cb46c6c31b7c4 100644 (file)
@@ -56,7 +56,7 @@
 
 use rustc_ast::ast;
 use rustc_hir as hir;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
 use rustc_middle::ty::query::Providers;
 use rustc_middle::ty::TyCtxt;
 use rustc_session::lint::builtin::{
@@ -90,12 +90,8 @@ pub fn provide(providers: &mut Providers<'_>) {
     *providers = Providers { lint_mod, ..*providers };
 }
 
-fn lint_mod(tcx: TyCtxt<'_>, module_def_id: DefId) {
-    late::late_lint_mod(
-        tcx,
-        module_def_id.expect_local(),
-        BuiltinCombinedModuleLateLintPass::new(),
-    );
+fn lint_mod(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
+    late::late_lint_mod(tcx, module_def_id, BuiltinCombinedModuleLateLintPass::new());
 }
 
 macro_rules! pre_expansion_lint_passes {
index e7a863c63ccaaa43bae17772834e8fd41e671083..6168f6e1e5c8855847a65e262f84d8038db8f030 100644 (file)
@@ -591,7 +591,7 @@ fn dlsym_proc_macros(
 
         // Make sure the path contains a / or the linker will search for it.
         let path = env::current_dir().unwrap().join(path);
-        let lib = match DynamicLibrary::open(Some(&path)) {
+        let lib = match DynamicLibrary::open(&path) {
             Ok(lib) => lib,
             Err(err) => self.sess.span_fatal(span, &err),
         };
index 3e78a5852354f47ddad23cc9ad6ecf49584031da..ce19240a009d091f52de29382790ef80f90500b3 100644 (file)
@@ -16,10 +16,9 @@ fn drop(&mut self) {
 }
 
 impl DynamicLibrary {
-    /// Lazily open a dynamic library. When passed None it gives a
-    /// handle to the calling process
-    pub fn open(filename: Option<&Path>) -> Result<DynamicLibrary, String> {
-        let maybe_library = dl::open(filename.map(|path| path.as_os_str()));
+    /// Lazily open a dynamic library.
+    pub fn open(filename: &Path) -> Result<DynamicLibrary, String> {
+        let maybe_library = dl::open(filename.as_os_str());
 
         // The dynamic library must not be constructed if there is
         // an error opening the library so the destructor does not
@@ -57,24 +56,13 @@ mod dl {
     use std::ptr;
     use std::str;
 
-    pub(super) fn open(filename: Option<&OsStr>) -> Result<*mut u8, String> {
+    pub(super) fn open(filename: &OsStr) -> Result<*mut u8, String> {
         check_for_errors_in(|| unsafe {
-            match filename {
-                Some(filename) => open_external(filename),
-                None => open_internal(),
-            }
+            let s = CString::new(filename.as_bytes()).unwrap();
+            libc::dlopen(s.as_ptr(), libc::RTLD_LAZY) as *mut u8
         })
     }
 
-    unsafe fn open_external(filename: &OsStr) -> *mut u8 {
-        let s = CString::new(filename.as_bytes()).unwrap();
-        libc::dlopen(s.as_ptr(), libc::RTLD_LAZY) as *mut u8
-    }
-
-    unsafe fn open_internal() -> *mut u8 {
-        libc::dlopen(ptr::null(), libc::RTLD_LAZY) as *mut u8
-    }
-
     fn check_for_errors_in<T, F>(f: F) -> Result<T, String>
     where
         F: FnOnce() -> T,
@@ -124,10 +112,10 @@ mod dl {
 
     use winapi::shared::minwindef::HMODULE;
     use winapi::um::errhandlingapi::SetThreadErrorMode;
-    use winapi::um::libloaderapi::{FreeLibrary, GetModuleHandleExW, GetProcAddress, LoadLibraryW};
+    use winapi::um::libloaderapi::{FreeLibrary, GetProcAddress, LoadLibraryW};
     use winapi::um::winbase::SEM_FAILCRITICALERRORS;
 
-    pub(super) fn open(filename: Option<&OsStr>) -> Result<*mut u8, String> {
+    pub(super) fn open(filename: &OsStr) -> Result<*mut u8, String> {
         // disable "dll load failed" error dialog.
         let prev_error_mode = unsafe {
             let new_error_mode = SEM_FAILCRITICALERRORS;
@@ -139,22 +127,9 @@ pub(super) fn open(filename: Option<&OsStr>) -> Result<*mut u8, String> {
             prev_error_mode
         };
 
-        let result = match filename {
-            Some(filename) => {
-                let filename_str: Vec<_> = filename.encode_wide().chain(Some(0)).collect();
-                let result = unsafe { LoadLibraryW(filename_str.as_ptr()) } as *mut u8;
-                ptr_result(result)
-            }
-            None => {
-                let mut handle = ptr::null_mut();
-                let succeeded = unsafe { GetModuleHandleExW(0, ptr::null(), &mut handle) };
-                if succeeded == 0 {
-                    Err(io::Error::last_os_error().to_string())
-                } else {
-                    Ok(handle as *mut u8)
-                }
-            }
-        };
+        let filename_str: Vec<_> = filename.encode_wide().chain(Some(0)).collect();
+        let result = unsafe { LoadLibraryW(filename_str.as_ptr()) } as *mut u8;
+        let result = ptr_result(result);
 
         unsafe {
             SetThreadErrorMode(prev_error_mode, ptr::null_mut());
index cbf2b181e3c2a04d76ebbb65fb2545b88fd345de..7090bbf61c794747cf0d57d9f54da91c77069733 100644 (file)
@@ -1,32 +1,4 @@
 use super::*;
-use std::mem;
-
-#[test]
-fn test_loading_atoi() {
-    if cfg!(windows) {
-        return;
-    }
-
-    // The C library does not need to be loaded since it is already linked in
-    let lib = match DynamicLibrary::open(None) {
-        Err(error) => panic!("Could not load self as module: {}", error),
-        Ok(lib) => lib,
-    };
-
-    let atoi: extern "C" fn(*const libc::c_char) -> libc::c_int = unsafe {
-        match lib.symbol("atoi") {
-            Err(error) => panic!("Could not load function atoi: {}", error),
-            Ok(atoi) => mem::transmute::<*mut u8, _>(atoi),
-        }
-    };
-
-    let argument = CString::new("1383428980").unwrap();
-    let expected_result = 0x52757374;
-    let result = atoi(argument.as_ptr());
-    if result != expected_result {
-        panic!("atoi({:?}) != {} but equaled {} instead", argument, expected_result, result)
-    }
-}
 
 #[test]
 fn test_errors_do_not_crash() {
@@ -39,7 +11,7 @@ fn test_errors_do_not_crash() {
     // Open /dev/null as a library to get an error, and make sure
     // that only causes an error, and not a crash.
     let path = Path::new("/dev/null");
-    match DynamicLibrary::open(Some(&path)) {
+    match DynamicLibrary::open(&path) {
         Err(_) => {}
         Ok(_) => panic!("Successfully opened the empty library."),
     }
index ecf3825dadb2d8fd77fc174a6d7dce07e1e8f44c..7d1639cbcf7a1791d2a03d43eee9f0572a1e16ce 100644 (file)
@@ -431,7 +431,7 @@ pub fn load_macro_untracked(&self, id: DefId, sess: &Session) -> LoadedMacro {
                 ident,
                 id: ast::DUMMY_NODE_ID,
                 span,
-                attrs: attrs.iter().cloned().collect(),
+                attrs: attrs.to_vec(),
                 kind: ast::ItemKind::MacroDef(data.get_macro(id.index, sess)),
                 vis: source_map::respan(span.shrink_to_lo(), ast::VisibilityKind::Inherited),
                 tokens: None,
index 746ce1a28cb62feffa65f01e51bfd3eced15797f..da1dd1e589b00605af945d1baa4361d0ae0d0f67 100644 (file)
@@ -5,12 +5,11 @@
 use rustc_ast::ast::{self, Ident};
 use rustc_ast::attr;
 use rustc_data_structures::fingerprint::Fingerprint;
-use rustc_data_structures::fx::FxHashMap;
+use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_data_structures::stable_hasher::StableHasher;
 use rustc_data_structures::sync::{join, Lrc};
 use rustc_hir as hir;
 use rustc_hir::def::CtorKind;
-use rustc_hir::def_id::DefIdSet;
 use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
 use rustc_hir::definitions::DefPathTable;
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
@@ -644,8 +643,8 @@ fn encode_enum_variant_info(&mut self, def: &ty::AdtDef, index: VariantIdx) {
         self.encode_generics(def_id);
         self.encode_explicit_predicates(def_id);
         self.encode_inferred_outlives(def_id);
-        self.encode_optimized_mir(def_id);
-        self.encode_promoted_mir(def_id);
+        self.encode_optimized_mir(def_id.expect_local());
+        self.encode_promoted_mir(def_id.expect_local());
     }
 
     fn encode_enum_variant_ctor(&mut self, def: &ty::AdtDef, index: VariantIdx) {
@@ -683,8 +682,8 @@ fn encode_enum_variant_ctor(&mut self, def: &ty::AdtDef, index: VariantIdx) {
         self.encode_generics(def_id);
         self.encode_explicit_predicates(def_id);
         self.encode_inferred_outlives(def_id);
-        self.encode_optimized_mir(def_id);
-        self.encode_promoted_mir(def_id);
+        self.encode_optimized_mir(def_id.expect_local());
+        self.encode_promoted_mir(def_id.expect_local());
     }
 
     fn encode_info_for_mod(
@@ -786,8 +785,8 @@ fn encode_struct_ctor(&mut self, adt_def: &ty::AdtDef, def_id: DefId) {
         self.encode_generics(def_id);
         self.encode_explicit_predicates(def_id);
         self.encode_inferred_outlives(def_id);
-        self.encode_optimized_mir(def_id);
-        self.encode_promoted_mir(def_id);
+        self.encode_optimized_mir(def_id.expect_local());
+        self.encode_promoted_mir(def_id.expect_local());
     }
 
     fn encode_generics(&mut self, def_id: DefId) {
@@ -896,8 +895,8 @@ fn encode_info_for_trait_item(&mut self, def_id: DefId) {
         self.encode_inferred_outlives(def_id);
 
         // This should be kept in sync with `PrefetchVisitor.visit_trait_item`.
-        self.encode_optimized_mir(def_id);
-        self.encode_promoted_mir(def_id);
+        self.encode_optimized_mir(def_id.expect_local());
+        self.encode_promoted_mir(def_id.expect_local());
     }
 
     fn metadata_output_only(&self) -> bool {
@@ -985,8 +984,8 @@ fn encode_info_for_impl_item(&mut self, def_id: DefId) {
             hir::ImplItemKind::OpaqueTy(..) | hir::ImplItemKind::TyAlias(..) => false,
         };
         if mir {
-            self.encode_optimized_mir(def_id);
-            self.encode_promoted_mir(def_id);
+            self.encode_optimized_mir(def_id.expect_local());
+            self.encode_promoted_mir(def_id.expect_local());
         }
     }
 
@@ -1004,17 +1003,17 @@ fn encode_fn_param_names(&mut self, param_names: &[ast::Ident]) -> Lazy<[ast::Na
         self.lazy(param_names.iter().map(|ident| ident.name))
     }
 
-    fn encode_optimized_mir(&mut self, def_id: DefId) {
+    fn encode_optimized_mir(&mut self, def_id: LocalDefId) {
         debug!("EntryBuilder::encode_mir({:?})", def_id);
         if self.tcx.mir_keys(LOCAL_CRATE).contains(&def_id) {
-            record!(self.tables.mir[def_id] <- self.tcx.optimized_mir(def_id));
+            record!(self.tables.mir[def_id.to_def_id()] <- self.tcx.optimized_mir(def_id));
         }
     }
 
-    fn encode_promoted_mir(&mut self, def_id: DefId) {
+    fn encode_promoted_mir(&mut self, def_id: LocalDefId) {
         debug!("EncodeContext::encode_promoted_mir({:?})", def_id);
         if self.tcx.mir_keys(LOCAL_CRATE).contains(&def_id) {
-            record!(self.tables.promoted_mir[def_id] <- self.tcx.promoted_mir(def_id));
+            record!(self.tables.promoted_mir[def_id.to_def_id()] <- self.tcx.promoted_mir(def_id));
         }
     }
 
@@ -1282,8 +1281,8 @@ fn encode_info_for_item(&mut self, def_id: DefId, item: &'tcx hir::Item<'tcx>) {
             _ => false,
         };
         if mir {
-            self.encode_optimized_mir(def_id);
-            self.encode_promoted_mir(def_id);
+            self.encode_optimized_mir(def_id.expect_local());
+            self.encode_promoted_mir(def_id.expect_local());
         }
     }
 
@@ -1316,8 +1315,7 @@ fn encode_info_for_closure(&mut self, def_id: LocalDefId) {
         let hir_id = self.tcx.hir().as_local_hir_id(def_id);
         let ty = self.tcx.typeck_tables_of(def_id).node_type(hir_id);
 
-        let def_id = def_id.to_def_id();
-        record!(self.tables.kind[def_id] <- match ty.kind {
+        record!(self.tables.kind[def_id.to_def_id()] <- match ty.kind {
             ty::Generator(..) => {
                 let data = self.tcx.generator_kind(def_id).unwrap();
                 EntryKind::Generator(data)
@@ -1327,14 +1325,14 @@ fn encode_info_for_closure(&mut self, def_id: LocalDefId) {
 
             _ => bug!("closure that is neither generator nor closure"),
         });
-        record!(self.tables.visibility[def_id] <- ty::Visibility::Public);
-        record!(self.tables.span[def_id] <- self.tcx.def_span(def_id));
-        record!(self.tables.attributes[def_id] <- &self.tcx.get_attrs(def_id)[..]);
-        self.encode_item_type(def_id);
+        record!(self.tables.visibility[def_id.to_def_id()] <- ty::Visibility::Public);
+        record!(self.tables.span[def_id.to_def_id()] <- self.tcx.def_span(def_id));
+        record!(self.tables.attributes[def_id.to_def_id()] <- &self.tcx.get_attrs(def_id.to_def_id())[..]);
+        self.encode_item_type(def_id.to_def_id());
         if let ty::Closure(def_id, substs) = ty.kind {
             record!(self.tables.fn_sig[def_id] <- substs.as_closure().sig());
         }
-        self.encode_generics(def_id);
+        self.encode_generics(def_id.to_def_id());
         self.encode_optimized_mir(def_id);
         self.encode_promoted_mir(def_id);
     }
@@ -1344,16 +1342,15 @@ fn encode_info_for_anon_const(&mut self, def_id: LocalDefId) {
         let id = self.tcx.hir().as_local_hir_id(def_id);
         let body_id = self.tcx.hir().body_owned_by(id);
         let const_data = self.encode_rendered_const_for_body(body_id);
-        let def_id = def_id.to_def_id();
         let qualifs = self.tcx.mir_const_qualif(def_id);
 
-        record!(self.tables.kind[def_id] <- EntryKind::Const(qualifs, const_data));
-        record!(self.tables.visibility[def_id] <- ty::Visibility::Public);
-        record!(self.tables.span[def_id] <- self.tcx.def_span(def_id));
-        self.encode_item_type(def_id);
-        self.encode_generics(def_id);
-        self.encode_explicit_predicates(def_id);
-        self.encode_inferred_outlives(def_id);
+        record!(self.tables.kind[def_id.to_def_id()] <- EntryKind::Const(qualifs, const_data));
+        record!(self.tables.visibility[def_id.to_def_id()] <- ty::Visibility::Public);
+        record!(self.tables.span[def_id.to_def_id()] <- self.tcx.def_span(def_id));
+        self.encode_item_type(def_id.to_def_id());
+        self.encode_generics(def_id.to_def_id());
+        self.encode_explicit_predicates(def_id.to_def_id());
+        self.encode_inferred_outlives(def_id.to_def_id());
         self.encode_optimized_mir(def_id);
         self.encode_promoted_mir(def_id);
     }
@@ -1726,12 +1723,11 @@ fn visit_impl_item(&mut self, _impl_item: &'v hir::ImplItem<'v>) {
 /// Only a subset of the queries are actually prefetched to keep this code smaller.
 struct PrefetchVisitor<'tcx> {
     tcx: TyCtxt<'tcx>,
-    mir_keys: &'tcx DefIdSet,
+    mir_keys: &'tcx FxHashSet<LocalDefId>,
 }
 
 impl<'tcx> PrefetchVisitor<'tcx> {
     fn prefetch_mir(&self, def_id: LocalDefId) {
-        let def_id = def_id.to_def_id();
         if self.mir_keys.contains(&def_id) {
             self.tcx.optimized_mir(def_id);
             self.tcx.promoted_mir(def_id);
index 0409f1f38e14a67a6538cae69b3bb9bdab4f9f60..d0f700299477045166f1792dfda4c150443005e5 100644 (file)
@@ -34,7 +34,8 @@ macro_rules! arena_types {
                 rustc_hir::def_id::DefId,
                 rustc_middle::ty::subst::SubstsRef<$tcx>
             )>,
-            [few, decode] mir_keys: rustc_hir::def_id::DefIdSet,
+            [few, decode] collect_and_partition_mono_items: rustc_hir::def_id::DefIdSet,
+            [few, decode] mir_keys: rustc_data_structures::fx::FxHashSet<rustc_hir::def_id::LocalDefId>,
             [decode] specialization_graph: rustc_middle::traits::specialization_graph::Graph,
             [] region_scope_tree: rustc_middle::middle::region::ScopeTree,
             [] item_local_set: rustc_hir::ItemLocalSet,
index 4b5c6177b2532562ddc3a37f293f8cf9c3b85567..e6557c9fbd59d4e61aacd27e58eb29f943d78e40 100644 (file)
@@ -360,6 +360,11 @@ pub enum UndefinedBehaviorInfo {
     InvalidUndefBytes(Option<Pointer>),
     /// Working with a local that is not currently live.
     DeadLocal,
+    /// Data size is not equal to target size.
+    ScalarSizeMismatch {
+        target_size: u64,
+        data_size: u64,
+    },
 }
 
 impl fmt::Debug for UndefinedBehaviorInfo {
@@ -421,6 +426,11 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                 "using uninitialized data, but this operation requires initialized memory"
             ),
             DeadLocal => write!(f, "accessing a dead local variable"),
+            ScalarSizeMismatch { target_size, data_size } => write!(
+                f,
+                "scalar size mismatch: expected {} bytes but got {} bytes instead",
+                target_size, data_size
+            ),
         }
     }
 }
index f3c1c87dad484b5aead0f759570aa4a332644ac2..6e013f75ed7590fa148e175fbe230d943aabcbe4 100644 (file)
@@ -393,7 +393,12 @@ fn to_bits(self, target_size: Size) -> InterpResult<'tcx, u128> {
         assert_ne!(target_size.bytes(), 0, "you should never look at the bits of a ZST");
         match self {
             Scalar::Raw { data, size } => {
-                assert_eq!(target_size.bytes(), u64::from(size));
+                if target_size.bytes() != u64::from(size) {
+                    throw_ub!(ScalarSizeMismatch {
+                        target_size: target_size.bytes(),
+                        data_size: u64::from(size),
+                    });
+                }
                 Scalar::check_data(data, size);
                 Ok(data)
             }
index 34c05ec59f38812438f8825514521b932b2eae04..4d7104531753c386ddd43a356f1d3ff808680074 100644 (file)
@@ -672,6 +672,9 @@ pub struct BlockTailInfo {
     /// Examples include `{ ...; tail };` and `let _ = { ...; tail };`
     /// but not e.g., `let _x = { ...; tail };`
     pub tail_result_is_ignored: bool,
+
+    /// `Span` of the tail expression.
+    pub span: Span,
 }
 
 /// A MIR local.
index fd1d410f0516079be5096df84519393608c0648c..632607e3356266f8d18a56443645764512113b6b 100644 (file)
@@ -7,7 +7,7 @@
 use rustc_data_structures::fingerprint::Fingerprint;
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
-use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
+use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
 use rustc_hir::HirId;
 use rustc_session::config::OptLevel;
 use rustc_span::source_map::Span;
@@ -95,7 +95,7 @@ pub fn instantiation_mode(&self, tcx: TyCtxt<'tcx>) -> InstantiationMode {
                 // linkage, then we'll be creating a globally shared version.
                 if self.explicit_linkage(tcx).is_some()
                     || !instance.def.generates_cgu_internal_copy(tcx)
-                    || Some(instance.def_id()) == entry_def_id
+                    || Some(instance.def_id()) == entry_def_id.map(LocalDefId::to_def_id)
                 {
                     return InstantiationMode::GloballyShared { may_conflict: false };
                 }
index 8c81f5227d26099dddde2f9a3b7794aef1dcb424..95a28df99aad0a2b53d4a1ff2476ef833caa7352 100644 (file)
@@ -80,6 +80,7 @@ pub struct BorrowCheckResult<'tcx> {
 pub struct ConstQualifs {
     pub has_mut_interior: bool,
     pub needs_drop: bool,
+    pub custom_eq: bool,
 }
 
 /// After we borrow check a closure, we are left with various
index 8b0509e314ce6eb2e2e5c7da5d8d95ef18f73ad1..c3e023f40299ed29275c96e75ba799ee0170dd04 100644 (file)
@@ -156,7 +156,7 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
         /// Set of all the `DefId`s in this crate that have MIR associated with
         /// them. This includes all the body owners, but also things like struct
         /// constructors.
-        query mir_keys(_: CrateNum) -> &'tcx DefIdSet {
+        query mir_keys(_: CrateNum) -> &'tcx FxHashSet<LocalDefId> {
             desc { "getting a list of all mir_keys" }
         }
 
@@ -170,7 +170,7 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
 
         /// Fetch the MIR for a given `DefId` right after it's built - this includes
         /// unreachable code.
-        query mir_built(_: DefId) -> &'tcx Steal<mir::Body<'tcx>> {
+        query mir_built(_: LocalDefId) -> &'tcx Steal<mir::Body<'tcx>> {
             desc { "building MIR for" }
         }
 
@@ -182,12 +182,13 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
             no_hash
         }
 
-        query mir_validated(_: DefId) ->
+        query mir_validated(key: LocalDefId) ->
             (
                 &'tcx Steal<mir::Body<'tcx>>,
                 &'tcx Steal<IndexVec<mir::Promoted, mir::Body<'tcx>>>
             ) {
             no_hash
+            desc { |tcx| "processing `{}`", tcx.def_path_str(key.to_def_id()) }
         }
 
         /// MIR after our optimization passes have run. This is MIR that is ready
@@ -275,9 +276,9 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
 
         /// To avoid cycles within the predicates of a single item we compute
         /// per-type-parameter predicates for resolving `T::AssocTy`.
-        query type_param_predicates(key: (DefId, DefId)) -> ty::GenericPredicates<'tcx> {
+        query type_param_predicates(key: (DefId, LocalDefId)) -> ty::GenericPredicates<'tcx> {
             desc { |tcx| "computing the bounds for type parameter `{}`", {
-                let id = tcx.hir().as_local_hir_id(key.1.expect_local());
+                let id = tcx.hir().as_local_hir_id(key.1);
                 tcx.hir().ty_param_name(id)
             }}
         }
@@ -389,9 +390,9 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
 
     TypeChecking {
         /// The result of unsafety-checking this `DefId`.
-        query unsafety_check_result(key: DefId) -> mir::UnsafetyCheckResult {
-            desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key) }
-            cache_on_disk_if { key.is_local() }
+        query unsafety_check_result(key: LocalDefId) -> mir::UnsafetyCheckResult {
+            desc { |tcx| "unsafety-checking `{}`", tcx.def_path_str(key.to_def_id()) }
+            cache_on_disk_if { true }
         }
 
         /// HACK: when evaluated, this reports a "unsafe derive on repr(packed)" error
@@ -402,8 +403,8 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
     }
 
     Other {
-        query lint_mod(key: DefId) -> () {
-            desc { |tcx| "linting {}", describe_as_module(key, tcx) }
+        query lint_mod(key: LocalDefId) -> () {
+            desc { |tcx| "linting {}", describe_as_module(key.to_def_id(), tcx) }
         }
 
         /// Checks the attributes in the module.
@@ -429,8 +430,8 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
             desc { |tcx| "checking item types in {}", describe_as_module(key, tcx) }
         }
 
-        query check_mod_privacy(key: DefId) -> () {
-            desc { |tcx| "checking privacy in {}", describe_as_module(key, tcx) }
+        query check_mod_privacy(key: LocalDefId) -> () {
+            desc { |tcx| "checking privacy in {}", describe_as_module(key.to_def_id(), tcx) }
         }
 
         query check_mod_intrinsics(key: DefId) -> () {
@@ -459,12 +460,13 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
             desc { "type-checking all item bodies" }
         }
 
-        query typeck_tables_of(key: DefId) -> &'tcx ty::TypeckTables<'tcx> {
-            desc { |tcx| "type-checking `{}`", tcx.def_path_str(key) }
-            cache_on_disk_if { key.is_local() }
+        query typeck_tables_of(key: LocalDefId) -> &'tcx ty::TypeckTables<'tcx> {
+            desc { |tcx| "type-checking `{}`", tcx.def_path_str(key.to_def_id()) }
+            cache_on_disk_if { true }
         }
-        query diagnostic_only_typeck_tables_of(key: DefId) -> &'tcx ty::TypeckTables<'tcx> {
-            cache_on_disk_if { key.is_local() }
+        query diagnostic_only_typeck_tables_of(key: LocalDefId) -> &'tcx ty::TypeckTables<'tcx> {
+            desc { |tcx| "type-checking `{}`", tcx.def_path_str(key.to_def_id()) }
+            cache_on_disk_if { true }
             load_cached(tcx, id) {
                 let typeck_tables: Option<ty::TypeckTables<'tcx>> = tcx
                     .queries.on_disk_cache
@@ -476,8 +478,9 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
     }
 
     Other {
-        query used_trait_imports(key: DefId) -> &'tcx DefIdSet {
-            cache_on_disk_if { key.is_local() }
+        query used_trait_imports(key: LocalDefId) -> &'tcx DefIdSet {
+            desc { |tcx| "used_trait_imports `{}`", tcx.def_path_str(key.to_def_id()) }
+            cache_on_disk_if { true }
         }
     }
 
@@ -492,12 +495,11 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
     BorrowChecking {
         /// Borrow-checks the function body. If this is a closure, returns
         /// additional requirements that the closure's creator must verify.
-        query mir_borrowck(key: DefId) -> &'tcx mir::BorrowCheckResult<'tcx> {
-            desc { |tcx| "borrow-checking `{}`", tcx.def_path_str(key) }
+        query mir_borrowck(key: LocalDefId) -> &'tcx mir::BorrowCheckResult<'tcx> {
+            desc { |tcx| "borrow-checking `{}`", tcx.def_path_str(key.to_def_id()) }
             cache_on_disk_if(tcx, opt_result) {
-                key.is_local()
-                    && (tcx.is_closure(key)
-                        || opt_result.map_or(false, |r| !r.concrete_opaque_types.is_empty()))
+                tcx.is_closure(key.to_def_id())
+                    || opt_result.map_or(false, |r| !r.concrete_opaque_types.is_empty())
             }
         }
     }
@@ -802,9 +804,15 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
     TypeChecking {
         query impl_defaultness(_: DefId) -> hir::Defaultness {}
 
-        query check_item_well_formed(_: DefId) -> () {}
-        query check_trait_item_well_formed(_: DefId) -> () {}
-        query check_impl_item_well_formed(_: DefId) -> () {}
+        query check_item_well_formed(key: LocalDefId) -> () {
+            desc { |tcx| "processing `{}`", tcx.def_path_str(key.to_def_id()) }
+        }
+        query check_trait_item_well_formed(key: LocalDefId) -> () {
+            desc { |tcx| "processing `{}`", tcx.def_path_str(key.to_def_id()) }
+        }
+        query check_impl_item_well_formed(key: LocalDefId) -> () {
+            desc { |tcx| "processing `{}`", tcx.def_path_str(key.to_def_id()) }
+        }
     }
 
     Linking {
@@ -878,7 +886,7 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
 
         /// Identifies the entry-point (e.g., the `main` function) for a given
         /// crate, returning `None` if there is no entry point (such as for library crates).
-        query entry_fn(_: CrateNum) -> Option<(DefId, EntryFnType)> {
+        query entry_fn(_: CrateNum) -> Option<(LocalDefId, EntryFnType)> {
             desc { "looking up the entry function of a crate" }
         }
         query plugin_registrar_fn(_: CrateNum) -> Option<DefId> {
@@ -1028,17 +1036,19 @@ fn describe_as_module(def_id: DefId, tcx: TyCtxt<'_>) -> String {
         query upvars(_: DefId) -> Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>> {
             eval_always
         }
-        query maybe_unused_trait_import(_: DefId) -> bool {
+        query maybe_unused_trait_import(def_id: LocalDefId) -> bool {
             eval_always
+            desc { |tcx| "maybe_unused_trait_import for `{}`", tcx.def_path_str(def_id.to_def_id()) }
         }
         query maybe_unused_extern_crates(_: CrateNum)
             -> &'tcx [(DefId, Span)] {
             eval_always
             desc { "looking up all possibly unused extern crates" }
         }
-        query names_imported_by_glob_use(_: DefId)
+        query names_imported_by_glob_use(def_id: LocalDefId)
             -> &'tcx FxHashSet<ast::Name> {
             eval_always
+            desc { |tcx| "names_imported_by_glob_use for `{}`", tcx.def_path_str(def_id.to_def_id()) }
         }
 
         query stability_index(_: CrateNum) -> &'tcx stability::Index<'tcx> {
index eae4055877b2a8f9fe4c036e84744b7a6951841a..c5813ae57a653bde7468ed9c3e1b7efdd29b3c4d 100644 (file)
@@ -945,11 +945,11 @@ pub struct GlobalCtxt<'tcx> {
 
     pub queries: query::Queries<'tcx>,
 
-    maybe_unused_trait_imports: FxHashSet<DefId>,
+    maybe_unused_trait_imports: FxHashSet<LocalDefId>,
     maybe_unused_extern_crates: Vec<(DefId, Span)>,
     /// A map of glob use to a set of names it actually imports. Currently only
     /// used in save-analysis.
-    glob_map: FxHashMap<DefId, FxHashSet<ast::Name>>,
+    glob_map: FxHashMap<LocalDefId, FxHashSet<ast::Name>>,
     /// Extern prelude entries. The value is `true` if the entry was introduced
     /// via `extern crate` item and not `--extern` option or compiler built-in.
     pub extern_prelude: FxHashMap<ast::Name, bool>,
@@ -1165,7 +1165,7 @@ pub fn create_global_ctxt(
             maybe_unused_trait_imports: resolutions
                 .maybe_unused_trait_imports
                 .into_iter()
-                .map(|id| definitions.local_def_id(id).to_def_id())
+                .map(|id| definitions.local_def_id(id))
                 .collect(),
             maybe_unused_extern_crates: resolutions
                 .maybe_unused_extern_crates
@@ -1175,7 +1175,7 @@ pub fn create_global_ctxt(
             glob_map: resolutions
                 .glob_map
                 .into_iter()
-                .map(|(id, names)| (definitions.local_def_id(id).to_def_id(), names))
+                .map(|(id, names)| (definitions.local_def_id(id), names))
                 .collect(),
             extern_prelude: resolutions.extern_prelude,
             untracked_crate: krate,
@@ -2716,10 +2716,8 @@ pub fn provide(providers: &mut ty::query::Providers<'_>) {
         assert_eq!(cnum, LOCAL_CRATE);
         &tcx.maybe_unused_extern_crates[..]
     };
-    providers.names_imported_by_glob_use = |tcx, id| {
-        assert_eq!(id.krate, LOCAL_CRATE);
-        tcx.arena.alloc(tcx.glob_map.get(&id).cloned().unwrap_or_default())
-    };
+    providers.names_imported_by_glob_use =
+        |tcx, id| tcx.arena.alloc(tcx.glob_map.get(&id).cloned().unwrap_or_default());
 
     providers.lookup_stability = |tcx, id| {
         let id = tcx.hir().local_def_id_to_hir_id(id.expect_local());
index d6c8ccf5ea62a98ededf5498ee8b0f5a7c813c1c..0abe44b31065d2171a1ab4c316df7090196ad778 100644 (file)
@@ -2637,7 +2637,7 @@ pub enum ImplOverlapKind {
 
 impl<'tcx> TyCtxt<'tcx> {
     pub fn body_tables(self, body: hir::BodyId) -> &'tcx TypeckTables<'tcx> {
-        self.typeck_tables_of(self.hir().body_owner_def_id(body).to_def_id())
+        self.typeck_tables_of(self.hir().body_owner_def_id(body))
     }
 
     /// Returns an iterator of the `DefId`s for all body-owners in this
index a261e484a85faada4d493a0fc16df0a29f74f62e..7354e89001cec7ba4da433ea67bee2d33dafc663 100644 (file)
@@ -117,6 +117,17 @@ fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
     }
 }
 
+impl Key for (DefId, LocalDefId) {
+    type CacheSelector = DefaultCacheSelector;
+
+    fn query_crate(&self) -> CrateNum {
+        self.0.krate
+    }
+    fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
+        self.1.default_span(tcx)
+    }
+}
+
 impl Key for (CrateNum, DefId) {
     type CacheSelector = DefaultCacheSelector;
 
index 2686759ab971b965fccd41507c1752320fdf37f4..72dfebd8ccd44e79c8e4eca565324162e73031c6 100644 (file)
@@ -168,15 +168,13 @@ pub fn for_each_relevant_impl<F: FnMut(DefId)>(
     }
 
     /// Returns a vector containing all impls
-    pub fn all_impls(self, def_id: DefId) -> Vec<DefId> {
-        let impls = self.trait_impls_of(def_id);
+    pub fn all_impls(self, def_id: DefId) -> impl Iterator<Item = DefId> + 'tcx {
+        let TraitImpls { blanket_impls, non_blanket_impls } = self.trait_impls_of(def_id);
 
-        impls
-            .blanket_impls
-            .iter()
-            .chain(impls.non_blanket_impls.values().flatten())
+        blanket_impls
+            .into_iter()
+            .chain(non_blanket_impls.into_iter().map(|(_, v)| v).flatten())
             .cloned()
-            .collect()
     }
 }
 
index d424d0525fdd8eef306efb796af23ec2dbc7506a..749265458302554de459068eca8112e203f9cdf0 100644 (file)
@@ -191,7 +191,7 @@ pub(in crate::borrow_check) fn report_use_of_moved_or_uninitialized(
                     .ty;
             let needs_note = match ty.kind {
                 ty::Closure(id, _) => {
-                    let tables = self.infcx.tcx.typeck_tables_of(id);
+                    let tables = self.infcx.tcx.typeck_tables_of(id.expect_local());
                     let hir_id = self.infcx.tcx.hir().as_local_hir_id(id.expect_local());
 
                     tables.closure_kind_origins().get(hir_id).is_none()
@@ -880,7 +880,7 @@ fn report_local_value_does_not_live_long_enough(
                                 match &self
                                     .infcx
                                     .tcx
-                                    .typeck_tables_of(self.mir_def_id)
+                                    .typeck_tables_of(def_id)
                                     .node_type(fn_hir_id)
                                     .kind
                                 {
index 7645182ad1fb33a39809bd08cef6ea354343e83e..5253acbba7f1c0feb30370f68b9e804bedd53ed4 100644 (file)
@@ -156,23 +156,32 @@ pub(in crate::borrow_check) fn add_explanation_to_diagnostic<'tcx>(
                         err.span_label(body.source_info(drop_loc).span, message);
 
                         if let Some(info) = &local_decl.is_block_tail {
-                            // FIXME: use span_suggestion instead, highlighting the
-                            // whole block tail expression.
-                            let msg = if info.tail_result_is_ignored {
-                                "The temporary is part of an expression at the end of a block. \
-                                 Consider adding semicolon after the expression so its temporaries \
-                                 are dropped sooner, before the local variables declared by the \
-                                 block are dropped."
+                            if info.tail_result_is_ignored {
+                                err.span_suggestion_verbose(
+                                    info.span.shrink_to_hi(),
+                                    "consider adding semicolon after the expression so its \
+                                     temporaries are dropped sooner, before the local variables \
+                                     declared by the block are dropped",
+                                    ";".to_string(),
+                                    Applicability::MaybeIncorrect,
+                                );
                             } else {
-                                "The temporary is part of an expression at the end of a block. \
-                                 Consider forcing this temporary to be dropped sooner, before \
-                                 the block's local variables are dropped. \
-                                 For example, you could save the expression's value in a new \
-                                 local variable `x` and then make `x` be the expression \
-                                 at the end of the block."
+                                err.note(
+                                    "the temporary is part of an expression at the end of a \
+                                     block;\nconsider forcing this temporary to be dropped sooner, \
+                                     before the block's local variables are dropped",
+                                );
+                                err.multipart_suggestion(
+                                    "for example, you could save the expression's value in a new \
+                                     local variable `x` and then make `x` be the expression at the \
+                                     end of the block",
+                                    vec![
+                                        (info.span.shrink_to_lo(), "let x = ".to_string()),
+                                        (info.span.shrink_to_hi(), "; x".to_string()),
+                                    ],
+                                    Applicability::MaybeIncorrect,
+                                );
                             };
-
-                            err.note(msg);
                         }
                     }
                 }
index 16c5bf1518dabe2bf30d8684c86de09c0af1e275..9e4458e7104ff6b5bb5a049b44e6c0f7e20b60d3 100644 (file)
@@ -97,7 +97,8 @@ pub(super) fn add_moved_or_invoked_closure_note(
 
                 debug!("add_moved_or_invoked_closure_note: closure={:?}", closure);
                 if let ty::Closure(did, _) = self.body.local_decls[closure].ty.kind {
-                    let hir_id = self.infcx.tcx.hir().as_local_hir_id(did.expect_local());
+                    let did = did.expect_local();
+                    let hir_id = self.infcx.tcx.hir().as_local_hir_id(did);
 
                     if let Some((span, name)) =
                         self.infcx.tcx.typeck_tables_of(did).closure_kind_origins().get(hir_id)
@@ -119,7 +120,8 @@ pub(super) fn add_moved_or_invoked_closure_note(
         // Check if we are just moving a closure after it has been invoked.
         if let Some(target) = target {
             if let ty::Closure(did, _) = self.body.local_decls[target].ty.kind {
-                let hir_id = self.infcx.tcx.hir().as_local_hir_id(did.expect_local());
+                let did = did.expect_local();
+                let hir_id = self.infcx.tcx.hir().as_local_hir_id(did);
 
                 if let Some((span, name)) =
                     self.infcx.tcx.typeck_tables_of(did).closure_kind_origins().get(hir_id)
index 7c7251c913492e8b7a1e59dbd0e9b3830db93237..af5c392aa986e7872c887cce16fb9d60dd87d0b7 100644 (file)
@@ -92,14 +92,14 @@ pub fn provide(providers: &mut Providers<'_>) {
     *providers = Providers { mir_borrowck, ..*providers };
 }
 
-fn mir_borrowck(tcx: TyCtxt<'_>, def_id: DefId) -> &BorrowCheckResult<'_> {
+fn mir_borrowck(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &BorrowCheckResult<'_> {
     let (input_body, promoted) = tcx.mir_validated(def_id);
-    debug!("run query mir_borrowck: {}", tcx.def_path_str(def_id));
+    debug!("run query mir_borrowck: {}", tcx.def_path_str(def_id.to_def_id()));
 
     let opt_closure_req = tcx.infer_ctxt().enter(|infcx| {
         let input_body: &Body<'_> = &input_body.borrow();
         let promoted: &IndexVec<_, _> = &promoted.borrow();
-        do_mir_borrowck(&infcx, input_body, promoted, def_id.expect_local())
+        do_mir_borrowck(&infcx, input_body, promoted, def_id)
     });
     debug!("mir_borrowck done");
 
@@ -1268,7 +1268,7 @@ fn consume_rvalue(
                 match **aggregate_kind {
                     AggregateKind::Closure(def_id, _) | AggregateKind::Generator(def_id, _, _) => {
                         let BorrowCheckResult { used_mut_upvars, .. } =
-                            self.infcx.tcx.mir_borrowck(def_id);
+                            self.infcx.tcx.mir_borrowck(def_id.expect_local());
                         debug!("{:?} used_mut_upvars={:?}", def_id, used_mut_upvars);
                         for field in used_mut_upvars {
                             self.propagate_closure_used_mut_upvar(&operands[field.index()]);
index 83ee46acdc45bb98517d9011d924a89a67eb1902..894a997ea7a4da4d781f561bf4d797f3f623bed8 100644 (file)
@@ -36,7 +36,7 @@ pub(super) fn equate_inputs_and_outputs(
         if !self.tcx().is_closure(self.mir_def_id) {
             user_provided_sig = None;
         } else {
-            let typeck_tables = self.tcx().typeck_tables_of(self.mir_def_id);
+            let typeck_tables = self.tcx().typeck_tables_of(self.mir_def_id.expect_local());
             user_provided_sig = match typeck_tables.user_provided_sigs.get(&self.mir_def_id) {
                 None => None,
                 Some(user_provided_poly_sig) => {
index 931e01d30718524fdd83452406d10c41ea899892..7f554742777e2fba137f7ee901d5e266a979550c 100644 (file)
@@ -9,7 +9,7 @@
 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
 use rustc_errors::struct_span_err;
 use rustc_hir as hir;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::{DefId, LocalDefId};
 use rustc_index::vec::{Idx, IndexVec};
 use rustc_infer::infer::canonical::QueryRegionConstraints;
 use rustc_infer::infer::outlives::env::RegionBoundPairs;
@@ -689,6 +689,7 @@ fn sanitize_projection(
                 let fty = self.sanitize_type(place, fty);
                 match self.field_ty(place, base, field, location) {
                     Ok(ty) => {
+                        let ty = self.cx.normalize(ty, location);
                         if let Err(terr) = self.cx.eq_types(
                             ty,
                             fty,
@@ -1232,7 +1233,8 @@ fn eq_opaque_type_and_type(
         let tcx = infcx.tcx;
         let param_env = self.param_env;
         let body = self.body;
-        let concrete_opaque_types = &tcx.typeck_tables_of(anon_owner_def_id).concrete_opaque_types;
+        let concrete_opaque_types =
+            &tcx.typeck_tables_of(anon_owner_def_id.expect_local()).concrete_opaque_types;
         let mut opaque_type_values = Vec::new();
 
         debug!("eq_opaque_type_and_type: mir_def_id={:?}", self.mir_def_id);
@@ -2568,7 +2570,7 @@ fn prove_aggregate_predicates(
             // clauses on the struct.
             AggregateKind::Closure(def_id, substs)
             | AggregateKind::Generator(def_id, substs, _) => {
-                self.prove_closure_bounds(tcx, *def_id, substs, location)
+                self.prove_closure_bounds(tcx, def_id.expect_local(), substs, location)
             }
 
             AggregateKind::Array(_) | AggregateKind::Tuple => ty::InstantiatedPredicates::empty(),
@@ -2583,14 +2585,18 @@ fn prove_aggregate_predicates(
     fn prove_closure_bounds(
         &mut self,
         tcx: TyCtxt<'tcx>,
-        def_id: DefId,
+        def_id: LocalDefId,
         substs: SubstsRef<'tcx>,
         location: Location,
     ) -> ty::InstantiatedPredicates<'tcx> {
         if let Some(ref closure_region_requirements) = tcx.mir_borrowck(def_id).closure_requirements
         {
             let closure_constraints = QueryRegionConstraints {
-                outlives: closure_region_requirements.apply_requirements(tcx, def_id, substs),
+                outlives: closure_region_requirements.apply_requirements(
+                    tcx,
+                    def_id.to_def_id(),
+                    substs,
+                ),
 
                 // Presently, closures never propagate member
                 // constraints to their parents -- they are enforced
index e6099ba91922526019bf90d01fadb9537502f1df..d70ee8f9d5ec56c4780f75d71407a98247da70e4 100644 (file)
@@ -498,7 +498,7 @@ fn defining_ty(&self) -> DefiningTy<'tcx> {
                 let defining_ty = if self.mir_def_id == closure_base_def_id {
                     tcx.type_of(closure_base_def_id)
                 } else {
-                    let tables = tcx.typeck_tables_of(self.mir_def_id);
+                    let tables = tcx.typeck_tables_of(self.mir_def_id.expect_local());
                     tables.node_type(self.mir_hir_id)
                 };
 
index b6d10d1e3701da886b68a6f82af30ef380e0e8f1..95c5d0f0b10590df317cc63025999a29237a40e7 100644 (file)
@@ -289,9 +289,11 @@ pub fn const_eval_raw_provider<'tcx>(
     let cid = key.value;
     let def_id = cid.instance.def.def_id();
 
-    if def_id.is_local() && tcx.has_typeck_tables(def_id) {
-        if let Some(error_reported) = tcx.typeck_tables_of(def_id).tainted_by_errors {
-            return Err(ErrorHandled::Reported(error_reported));
+    if let Some(def_id) = def_id.as_local() {
+        if tcx.has_typeck_tables(def_id) {
+            if let Some(error_reported) = tcx.typeck_tables_of(def_id).tainted_by_errors {
+                return Err(ErrorHandled::Reported(error_reported));
+            }
         }
     }
 
index cb146059fb1bf93ddea4cbc60b27de92c6b74dc3..84031ec0f17649aea4b0046ad45ca5c91b0cde93 100644 (file)
@@ -1,7 +1,7 @@
 use rustc_middle::mir;
 use rustc_middle::ty::layout::HasTyCtxt;
 use rustc_middle::ty::{self, Ty};
-use std::borrow::{Borrow, Cow};
+use std::borrow::Borrow;
 use std::collections::hash_map::Entry;
 use std::hash::Hash;
 
@@ -13,8 +13,8 @@
 use rustc_span::symbol::Symbol;
 
 use crate::interpret::{
-    self, AllocId, Allocation, Frame, GlobalId, ImmTy, InterpCx, InterpResult, Memory, MemoryKind,
-    OpTy, PlaceTy, Pointer, Scalar,
+    self, compile_time_machine, AllocId, Allocation, Frame, GlobalId, ImmTy, InterpCx,
+    InterpResult, Memory, OpTy, PlaceTy, Pointer, Scalar,
 };
 
 use super::error::*;
@@ -171,29 +171,9 @@ fn may_leak(self) -> bool {
 }
 
 impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for CompileTimeInterpreter<'mir, 'tcx> {
-    type MemoryKind = !;
-    type PointerTag = ();
-    type ExtraFnVal = !;
+    compile_time_machine!(<'mir, 'tcx>);
 
-    type FrameExtra = ();
     type MemoryExtra = MemoryExtra;
-    type AllocExtra = ();
-
-    type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation)>;
-
-    const GLOBAL_KIND: Option<!> = None; // no copying of globals from `tcx` to machine memory
-
-    #[inline(always)]
-    fn enforce_alignment(_memory_extra: &Self::MemoryExtra) -> bool {
-        // We do not check for alignment to avoid having to carry an `Align`
-        // in `ConstValue::ByRef`.
-        false
-    }
-
-    #[inline(always)]
-    fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
-        false // for now, we don't enforce validity
-    }
 
     fn find_mir_or_eval_fn(
         ecx: &mut InterpCx<'mir, 'tcx, Self>,
@@ -241,16 +221,6 @@ fn find_mir_or_eval_fn(
         }))
     }
 
-    fn call_extra_fn(
-        _ecx: &mut InterpCx<'mir, 'tcx, Self>,
-        fn_val: !,
-        _args: &[OpTy<'tcx>],
-        _ret: Option<(PlaceTy<'tcx>, mir::BasicBlock)>,
-        _unwind: Option<mir::BasicBlock>,
-    ) -> InterpResult<'tcx> {
-        match fn_val {}
-    }
-
     fn call_intrinsic(
         ecx: &mut InterpCx<'mir, 'tcx, Self>,
         instance: ty::Instance<'tcx>,
@@ -310,20 +280,6 @@ fn binary_ptr_op(
         Err(ConstEvalErrKind::NeedsRfc("pointer arithmetic or comparison".to_string()).into())
     }
 
-    #[inline(always)]
-    fn init_allocation_extra<'b>(
-        _memory_extra: &MemoryExtra,
-        _id: AllocId,
-        alloc: Cow<'b, Allocation>,
-        _kind: Option<MemoryKind<!>>,
-    ) -> (Cow<'b, Allocation<Self::PointerTag>>, Self::PointerTag) {
-        // We do not use a tag so we can just cheaply forward the allocation
-        (alloc, ())
-    }
-
-    #[inline(always)]
-    fn tag_global_base_pointer(_memory_extra: &MemoryExtra, _id: AllocId) -> Self::PointerTag {}
-
     fn box_alloc(
         _ecx: &mut InterpCx<'mir, 'tcx, Self>,
         _dest: PlaceTy<'tcx>,
@@ -345,14 +301,6 @@ fn before_terminator(ecx: &mut InterpCx<'mir, 'tcx, Self>) -> InterpResult<'tcx>
         Ok(())
     }
 
-    #[inline(always)]
-    fn init_frame_extra(
-        _ecx: &mut InterpCx<'mir, 'tcx, Self>,
-        frame: Frame<'mir, 'tcx>,
-    ) -> InterpResult<'tcx, Frame<'mir, 'tcx>> {
-        Ok(frame)
-    }
-
     #[inline(always)]
     fn stack(
         ecx: &'a InterpCx<'mir, 'tcx, Self>,
index a497a6784ff6bc1bd143a06078c48dc506fa8599..82e1984e4623d69abdbd6b9368eff1dd031d7255 100644 (file)
@@ -402,9 +402,11 @@ pub fn load_mir(
     ) -> InterpResult<'tcx, &'tcx mir::Body<'tcx>> {
         // do not continue if typeck errors occurred (can only occur in local crate)
         let did = instance.def_id();
-        if did.is_local() && self.tcx.has_typeck_tables(did) {
-            if let Some(error_reported) = self.tcx.typeck_tables_of(did).tainted_by_errors {
-                throw_inval!(TypeckError(error_reported))
+        if let Some(did) = did.as_local() {
+            if self.tcx.has_typeck_tables(did) {
+                if let Some(error_reported) = self.tcx.typeck_tables_of(did).tainted_by_errors {
+                    throw_inval!(TypeckError(error_reported))
+                }
             }
         }
         trace!("load mir(instance={:?}, promoted={:?})", instance, promoted);
index dfdd95c95a36482fe80b997427f1fc592f39b99d..03a617993e916e08ba0b0cbf6ff37ebe2576d0ac 100644 (file)
@@ -357,3 +357,67 @@ fn ptr_to_int(
         _ptr: Pointer<Self::PointerTag>,
     ) -> InterpResult<'tcx, u64>;
 }
+
+// A lot of the flexibility above is just needed for `Miri`, but all "compile-time" machines
+// (CTFE and ConstProp) use the same instance.  Here, we share that code.
+pub macro compile_time_machine(<$mir: lifetime, $tcx: lifetime>) {
+    type PointerTag = ();
+    type ExtraFnVal = !;
+
+    type MemoryKind = !;
+    type MemoryMap = rustc_data_structures::fx::FxHashMap<AllocId, (MemoryKind<!>, Allocation)>;
+    const GLOBAL_KIND: Option<!> = None; // no copying of globals from `tcx` to machine memory
+
+    type AllocExtra = ();
+    type FrameExtra = ();
+
+    #[inline(always)]
+    fn enforce_alignment(_memory_extra: &Self::MemoryExtra) -> bool {
+        // We do not check for alignment to avoid having to carry an `Align`
+        // in `ConstValue::ByRef`.
+        false
+    }
+
+    #[inline(always)]
+    fn enforce_validity(_ecx: &InterpCx<$mir, $tcx, Self>) -> bool {
+        false // for now, we don't enforce validity
+    }
+
+    #[inline(always)]
+    fn call_extra_fn(
+        _ecx: &mut InterpCx<$mir, $tcx, Self>,
+        fn_val: !,
+        _args: &[OpTy<$tcx>],
+        _ret: Option<(PlaceTy<$tcx>, mir::BasicBlock)>,
+        _unwind: Option<mir::BasicBlock>,
+    ) -> InterpResult<$tcx> {
+        match fn_val {}
+    }
+
+    #[inline(always)]
+    fn init_allocation_extra<'b>(
+        _memory_extra: &Self::MemoryExtra,
+        _id: AllocId,
+        alloc: Cow<'b, Allocation>,
+        _kind: Option<MemoryKind<!>>,
+    ) -> (Cow<'b, Allocation<Self::PointerTag>>, Self::PointerTag) {
+        // We do not use a tag so we can just cheaply forward the allocation
+        (alloc, ())
+    }
+
+    #[inline(always)]
+    fn tag_global_base_pointer(
+        _memory_extra: &Self::MemoryExtra,
+        _id: AllocId,
+    ) -> Self::PointerTag {
+        ()
+    }
+
+    #[inline(always)]
+    fn init_frame_extra(
+        _ecx: &mut InterpCx<$mir, $tcx, Self>,
+        frame: Frame<$mir, $tcx>,
+    ) -> InterpResult<$tcx, Frame<$mir, $tcx>> {
+        Ok(frame)
+    }
+}
index fb59a177b971637066937a43aa6726faa7782871..d46010d98a5aa82349559a0fb1e13bb3a0183bd1 100644 (file)
@@ -19,7 +19,7 @@
 
 pub use self::eval_context::{Frame, InterpCx, LocalState, LocalValue, StackPopCleanup};
 pub use self::intern::{intern_const_alloc_recursive, InternKind};
-pub use self::machine::{AllocMap, Machine, MayLeak, StackPopJump};
+pub use self::machine::{compile_time_machine, AllocMap, Machine, MayLeak, StackPopJump};
 pub use self::memory::{AllocCheck, FnVal, Memory, MemoryKind};
 pub use self::operand::{ImmTy, Immediate, OpTy, Operand};
 pub use self::place::{MPlaceTy, MemPlace, MemPlaceMeta, Place, PlaceTy};
index e97a39f8c6fec347d6d7d4651d6fe38469c477eb..838a5b32fc80b403cd7876faf78ac43368c1a113 100644 (file)
@@ -199,9 +199,9 @@ fn aggregate_field_path_elem(&mut self, layout: TyAndLayout<'tcx>, field: usize)
             // generators and closures.
             ty::Closure(def_id, _) | ty::Generator(def_id, _, _) => {
                 let mut name = None;
-                if def_id.is_local() {
+                if let Some(def_id) = def_id.as_local() {
                     let tables = self.ecx.tcx.typeck_tables_of(def_id);
-                    if let Some(upvars) = tables.upvar_list.get(&def_id) {
+                    if let Some(upvars) = tables.upvar_list.get(&def_id.to_def_id()) {
                         // Sometimes the index is beyond the number of upvars (seen
                         // for a generator).
                         if let Some((&var_hir_id, _)) = upvars.get_index(field) {
index 07822f865d2bd545370d245ec2dc7e41366571e0..ae7bbe9f36a3a2bc8b8dda5a552485100fbea0c7 100644 (file)
@@ -13,6 +13,7 @@
 #![feature(const_fn)]
 #![feature(const_panic)]
 #![feature(crate_visibility_modifier)]
+#![feature(decl_macro)]
 #![feature(drain_filter)]
 #![feature(exhaustive_patterns)]
 #![feature(iter_order_by)]
index 6d1984fd20f9df3d0e2b2da31fa7073199a6ea39..dfcd2c3c93600d85a82d319167b5c996008d062e 100644 (file)
@@ -919,7 +919,7 @@ struct RootCollector<'a, 'tcx> {
     tcx: TyCtxt<'tcx>,
     mode: MonoItemCollectionMode,
     output: &'a mut Vec<MonoItem<'tcx>>,
-    entry_fn: Option<(DefId, EntryFnType)>,
+    entry_fn: Option<(LocalDefId, EntryFnType)>,
 }
 
 impl ItemLikeVisitor<'v> for RootCollector<'_, 'v> {
@@ -1008,7 +1008,7 @@ fn is_root(&self, def_id: LocalDefId) -> bool {
             && match self.mode {
                 MonoItemCollectionMode::Eager => true,
                 MonoItemCollectionMode::Lazy => {
-                    self.entry_fn.map(|(id, _)| id) == Some(def_id.to_def_id())
+                    self.entry_fn.map(|(id, _)| id) == Some(def_id)
                         || self.tcx.is_reachable_non_generic(def_id)
                         || self
                             .tcx
index 6dc6935179be159a32fe026fd93c95f5c25465da..4bef2bc711ba95d2173864016e871033bc272d70 100644 (file)
@@ -117,13 +117,13 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> &'tcx
         instance,
         None,
         MirPhase::Const,
-        &[
+        &[&[
             &add_moves_for_packed_drops::AddMovesForPackedDrops,
             &no_landing_pads::NoLandingPads::new(tcx),
             &remove_noop_landing_pads::RemoveNoopLandingPads,
             &simplify::SimplifyCfg::new("make_shim"),
             &add_call_guards::CriticalCallEdges,
-        ],
+        ]],
     );
 
     debug!("make_shim({:?}) = {:?}", instance, result);
index f82f06599b74a0f0d5703d555f7592b4952a68b2..fc6860b40e8d27528c433313fda4f16e4a7d7294 100644 (file)
@@ -2,9 +2,11 @@
 //!
 //! See the `Qualif` trait for more info.
 
+use rustc_infer::infer::TyCtxtInferExt;
 use rustc_middle::mir::*;
-use rustc_middle::ty::{self, AdtDef, Ty};
+use rustc_middle::ty::{self, subst::SubstsRef, AdtDef, Ty};
 use rustc_span::DUMMY_SP;
+use rustc_trait_selection::traits;
 
 use super::ConstCx;
 
@@ -12,6 +14,7 @@ pub fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> ConstQualifs
     ConstQualifs {
         has_mut_interior: HasMutInterior::in_any_value_of_ty(cx, ty),
         needs_drop: NeedsDrop::in_any_value_of_ty(cx, ty),
+        custom_eq: CustomEq::in_any_value_of_ty(cx, ty),
     }
 }
 
@@ -53,7 +56,11 @@ pub trait Qualif {
     /// with a custom `Drop` impl is inherently `NeedsDrop`.
     ///
     /// Returning `true` for `in_adt_inherently` but `false` for `in_any_value_of_ty` is unsound.
-    fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &AdtDef) -> bool;
+    fn in_adt_inherently(
+        cx: &ConstCx<'_, 'tcx>,
+        adt: &'tcx AdtDef,
+        substs: SubstsRef<'tcx>,
+    ) -> bool;
 }
 
 /// Constant containing interior mutability (`UnsafeCell<T>`).
@@ -74,7 +81,7 @@ fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool {
         !ty.is_freeze(cx.tcx, cx.param_env, DUMMY_SP)
     }
 
-    fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &AdtDef) -> bool {
+    fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &'tcx AdtDef, _: SubstsRef<'tcx>) -> bool {
         // Exactly one type, `UnsafeCell`, has the `HasMutInterior` qualif inherently.
         // It arises structurally for all other types.
         Some(adt.did) == cx.tcx.lang_items().unsafe_cell_type()
@@ -99,11 +106,44 @@ fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool {
         ty.needs_drop(cx.tcx, cx.param_env)
     }
 
-    fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &AdtDef) -> bool {
+    fn in_adt_inherently(cx: &ConstCx<'_, 'tcx>, adt: &'tcx AdtDef, _: SubstsRef<'tcx>) -> bool {
         adt.has_dtor(cx.tcx)
     }
 }
 
+/// A constant that cannot be used as part of a pattern in a `match` expression.
+pub struct CustomEq;
+
+impl Qualif for CustomEq {
+    const ANALYSIS_NAME: &'static str = "flow_custom_eq";
+
+    fn in_qualifs(qualifs: &ConstQualifs) -> bool {
+        qualifs.custom_eq
+    }
+
+    fn in_any_value_of_ty(cx: &ConstCx<'_, 'tcx>, ty: Ty<'tcx>) -> bool {
+        // If *any* component of a composite data type does not implement `Structural{Partial,}Eq`,
+        // we know that at least some values of that type are not structural-match. I say "some"
+        // because that component may be part of an enum variant (e.g.,
+        // `Option::<NonStructuralMatchTy>::Some`), in which case some values of this type may be
+        // structural-match (`Option::None`).
+        let id = cx.tcx.hir().local_def_id_to_hir_id(cx.def_id.as_local().unwrap());
+        traits::search_for_structural_match_violation(id, cx.body.span, cx.tcx, ty).is_some()
+    }
+
+    fn in_adt_inherently(
+        cx: &ConstCx<'_, 'tcx>,
+        adt: &'tcx AdtDef,
+        substs: SubstsRef<'tcx>,
+    ) -> bool {
+        let ty = cx.tcx.mk_ty(ty::Adt(adt, substs));
+        let id = cx.tcx.hir().local_def_id_to_hir_id(cx.def_id.as_local().unwrap());
+        cx.tcx
+            .infer_ctxt()
+            .enter(|infcx| !traits::type_marked_structural(id, cx.body.span, &infcx, ty))
+    }
+}
+
 // FIXME: Use `mir::visit::Visitor` for the `in_*` functions if/when it supports early return.
 
 /// Returns `true` if this `Rvalue` contains qualif `Q`.
@@ -147,8 +187,8 @@ pub fn in_rvalue<Q, F>(cx: &ConstCx<'_, 'tcx>, in_local: &mut F, rvalue: &Rvalue
         Rvalue::Aggregate(kind, operands) => {
             // Return early if we know that the struct or enum being constructed is always
             // qualified.
-            if let AggregateKind::Adt(def, ..) = **kind {
-                if Q::in_adt_inherently(cx, def) {
+            if let AggregateKind::Adt(def, _, substs, ..) = **kind {
+                if Q::in_adt_inherently(cx, def, substs) {
                     return true;
                 }
             }
index b87429199ec3a0f421b96137848165e8a69424dc..c5938426f61a93cccc16e7ceb9a42b853d3c38bb 100644 (file)
@@ -17,7 +17,7 @@
 use std::ops::Deref;
 
 use super::ops::{self, NonConstOp};
-use super::qualifs::{self, HasMutInterior, NeedsDrop};
+use super::qualifs::{self, CustomEq, HasMutInterior, NeedsDrop};
 use super::resolver::FlowSensitiveAnalysis;
 use super::{is_lang_panic_fn, ConstCx, ConstKind, Qualif};
 use crate::const_eval::{is_const_fn, is_unstable_const_fn};
@@ -142,9 +142,35 @@ fn in_return_place(&mut self, ccx: &'mir ConstCx<'mir, 'tcx>) -> ConstQualifs {
 
         let return_loc = ccx.body.terminator_loc(return_block);
 
+        let custom_eq = match ccx.const_kind() {
+            // We don't care whether a `const fn` returns a value that is not structurally
+            // matchable. Functions calls are opaque and always use type-based qualification, so
+            // this value should never be used.
+            ConstKind::ConstFn => true,
+
+            // If we know that all values of the return type are structurally matchable, there's no
+            // need to run dataflow.
+            ConstKind::Const | ConstKind::Static | ConstKind::StaticMut
+                if !CustomEq::in_any_value_of_ty(ccx, ccx.body.return_ty()) =>
+            {
+                false
+            }
+
+            ConstKind::Const | ConstKind::Static | ConstKind::StaticMut => {
+                let mut cursor = FlowSensitiveAnalysis::new(CustomEq, ccx)
+                    .into_engine(ccx.tcx, &ccx.body, ccx.def_id)
+                    .iterate_to_fixpoint()
+                    .into_results_cursor(&ccx.body);
+
+                cursor.seek_after(return_loc);
+                cursor.contains(RETURN_PLACE)
+            }
+        };
+
         ConstQualifs {
             needs_drop: self.needs_drop(ccx, RETURN_PLACE, return_loc),
             has_mut_interior: self.has_mut_interior(ccx, RETURN_PLACE, return_loc),
+            custom_eq,
         }
     }
 }
index 567fb61e0e8c9ebcf52e6dc69e7f01e2b00f5370..1c1560cbf9de711461615c8361113b4dd588086d 100644 (file)
@@ -132,7 +132,7 @@ fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
                 }
                 &AggregateKind::Closure(def_id, _) | &AggregateKind::Generator(def_id, _, _) => {
                     let UnsafetyCheckResult { violations, unsafe_blocks } =
-                        self.tcx.unsafety_check_result(def_id);
+                        self.tcx.unsafety_check_result(def_id.expect_local());
                     self.register_violations(&violations, &unsafe_blocks);
                 }
             },
@@ -485,7 +485,7 @@ fn check_unused_unsafe(
     intravisit::Visitor::visit_body(&mut visitor, body);
 }
 
-fn unsafety_check_result(tcx: TyCtxt<'_>, def_id: DefId) -> UnsafetyCheckResult {
+fn unsafety_check_result(tcx: TyCtxt<'_>, def_id: LocalDefId) -> UnsafetyCheckResult {
     debug!("unsafety_violations({:?})", def_id);
 
     // N.B., this borrow is valid because all the consumers of
@@ -494,21 +494,18 @@ fn unsafety_check_result(tcx: TyCtxt<'_>, def_id: DefId) -> UnsafetyCheckResult
 
     let param_env = tcx.param_env(def_id);
 
-    let id = tcx.hir().as_local_hir_id(def_id.expect_local());
+    let id = tcx.hir().as_local_hir_id(def_id);
     let (const_context, min_const_fn) = match tcx.hir().body_owner_kind(id) {
         hir::BodyOwnerKind::Closure => (false, false),
-        hir::BodyOwnerKind::Fn => (is_const_fn(tcx, def_id), is_min_const_fn(tcx, def_id)),
+        hir::BodyOwnerKind::Fn => {
+            (is_const_fn(tcx, def_id.to_def_id()), is_min_const_fn(tcx, def_id.to_def_id()))
+        }
         hir::BodyOwnerKind::Const | hir::BodyOwnerKind::Static(_) => (true, false),
     };
     let mut checker = UnsafetyChecker::new(const_context, min_const_fn, body, tcx, param_env);
     checker.visit_body(&body);
 
-    check_unused_unsafe(
-        tcx,
-        def_id.expect_local(),
-        &checker.used_unsafe,
-        &mut checker.inherited_blocks,
-    );
+    check_unused_unsafe(tcx, def_id, &checker.used_unsafe, &mut checker.inherited_blocks);
     UnsafetyCheckResult {
         violations: checker.violations.into(),
         unsafe_blocks: checker.inherited_blocks.into(),
@@ -600,7 +597,8 @@ pub fn check_unsafety(tcx: TyCtxt<'_>, def_id: DefId) {
         return;
     }
 
-    let UnsafetyCheckResult { violations, unsafe_blocks } = tcx.unsafety_check_result(def_id);
+    let UnsafetyCheckResult { violations, unsafe_blocks } =
+        tcx.unsafety_check_result(def_id.expect_local());
 
     for &UnsafetyViolation { source_info, description, details, kind } in violations.iter() {
         // Report an error.
index bad0b94f3ece71b03eead3f0a98c188418356fa4..09d8f89676a66609a77e632eaeebf66de4e20f08 100644 (file)
@@ -1,11 +1,9 @@
 //! Propagates constants for early reporting of statically known
 //! assertion failures
 
-use std::borrow::Cow;
 use std::cell::Cell;
 
 use rustc_ast::ast::Mutability;
-use rustc_data_structures::fx::FxHashMap;
 use rustc_hir::def::DefKind;
 use rustc_hir::HirId;
 use rustc_index::bit_set::BitSet;
@@ -29,9 +27,9 @@
 
 use crate::const_eval::error_to_const_error;
 use crate::interpret::{
-    self, intern_const_alloc_recursive, AllocId, Allocation, Frame, ImmTy, Immediate, InternKind,
-    InterpCx, LocalState, LocalValue, Memory, MemoryKind, OpTy, Operand as InterpOperand, PlaceTy,
-    Pointer, ScalarMaybeUndef, StackPopCleanup,
+    self, compile_time_machine, intern_const_alloc_recursive, AllocId, Allocation, Frame, ImmTy,
+    Immediate, InternKind, InterpCx, LocalState, LocalValue, Memory, MemoryKind, OpTy,
+    Operand as InterpOperand, PlaceTy, Pointer, ScalarMaybeUndef, StackPopCleanup,
 };
 use crate::transform::{MirPass, MirSource};
 
@@ -116,8 +114,7 @@ fn run_pass(&self, tcx: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'
             .predicates_of(source.def_id())
             .predicates
             .iter()
-            .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None })
-            .collect();
+            .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None });
         if !traits::normalize_and_test_predicates(
             tcx,
             traits::elaborate_predicates(tcx, predicates).map(|o| o.predicate).collect(),
@@ -163,27 +160,9 @@ fn new() -> Self {
 }
 
 impl<'mir, 'tcx> interpret::Machine<'mir, 'tcx> for ConstPropMachine<'mir, 'tcx> {
-    type MemoryKind = !;
-    type PointerTag = ();
-    type ExtraFnVal = !;
+    compile_time_machine!(<'mir, 'tcx>);
 
-    type FrameExtra = ();
     type MemoryExtra = ();
-    type AllocExtra = ();
-
-    type MemoryMap = FxHashMap<AllocId, (MemoryKind<!>, Allocation)>;
-
-    const GLOBAL_KIND: Option<!> = None; // no copying of globals from `tcx` to machine memory
-
-    #[inline(always)]
-    fn enforce_alignment(_memory_extra: &Self::MemoryExtra) -> bool {
-        false
-    }
-
-    #[inline(always)]
-    fn enforce_validity(_ecx: &InterpCx<'mir, 'tcx, Self>) -> bool {
-        false
-    }
 
     fn find_mir_or_eval_fn(
         _ecx: &mut InterpCx<'mir, 'tcx, Self>,
@@ -195,16 +174,6 @@ fn find_mir_or_eval_fn(
         Ok(None)
     }
 
-    fn call_extra_fn(
-        _ecx: &mut InterpCx<'mir, 'tcx, Self>,
-        fn_val: !,
-        _args: &[OpTy<'tcx>],
-        _ret: Option<(PlaceTy<'tcx>, BasicBlock)>,
-        _unwind: Option<BasicBlock>,
-    ) -> InterpResult<'tcx> {
-        match fn_val {}
-    }
-
     fn call_intrinsic(
         _ecx: &mut InterpCx<'mir, 'tcx, Self>,
         _instance: ty::Instance<'tcx>,
@@ -237,20 +206,6 @@ fn binary_ptr_op(
         throw_machine_stop_str!("pointer arithmetic or comparisons aren't supported in ConstProp")
     }
 
-    #[inline(always)]
-    fn init_allocation_extra<'b>(
-        _memory_extra: &(),
-        _id: AllocId,
-        alloc: Cow<'b, Allocation>,
-        _kind: Option<MemoryKind<!>>,
-    ) -> (Cow<'b, Allocation<Self::PointerTag>>, Self::PointerTag) {
-        // We do not use a tag so we can just cheaply forward the allocation
-        (alloc, ())
-    }
-
-    #[inline(always)]
-    fn tag_global_base_pointer(_memory_extra: &(), _id: AllocId) -> Self::PointerTag {}
-
     fn box_alloc(
         _ecx: &mut InterpCx<'mir, 'tcx, Self>,
         _dest: PlaceTy<'tcx>,
@@ -291,14 +246,6 @@ fn before_access_global(
         Ok(())
     }
 
-    #[inline(always)]
-    fn init_frame_extra(
-        _ecx: &mut InterpCx<'mir, 'tcx, Self>,
-        frame: Frame<'mir, 'tcx>,
-    ) -> InterpResult<'tcx, Frame<'mir, 'tcx>> {
-        Ok(frame)
-    }
-
     #[inline(always)]
     fn stack(
         ecx: &'a InterpCx<'mir, 'tcx, Self>,
@@ -327,6 +274,8 @@ struct ConstPropagator<'mir, 'tcx> {
     // Because we have `MutVisitor` we can't obtain the `SourceInfo` from a `Location`. So we store
     // the last known `SourceInfo` here and just keep revisiting it.
     source_info: Option<SourceInfo>,
+    // Locals we need to forget at the end of the current block
+    locals_of_current_block: BitSet<Local>,
 }
 
 impl<'mir, 'tcx> LayoutOf for ConstPropagator<'mir, 'tcx> {
@@ -396,6 +345,7 @@ fn new(
             //FIXME(wesleywiser) we can't steal this because `Visitor::super_visit_body()` needs it
             local_decls: body.local_decls.clone(),
             source_info: None,
+            locals_of_current_block: BitSet::new_empty(body.local_decls.len()),
         }
     }
 
@@ -410,8 +360,10 @@ fn get_const(&self, local: Local) -> Option<OpTy<'tcx>> {
         }
     }
 
-    fn remove_const(&mut self, local: Local) {
-        self.ecx.frame_mut().locals[local] =
+    /// Remove `local` from the pool of `Locals`. Allows writing to them,
+    /// but not reading from them anymore.
+    fn remove_const(ecx: &mut InterpCx<'mir, 'tcx, ConstPropMachine<'mir, 'tcx>>, local: Local) {
+        ecx.frame_mut().locals[local] =
             LocalState { value: LocalValue::Uninitialized, layout: Cell::new(None) };
     }
 
@@ -442,6 +394,7 @@ fn use_ecx<F, T>(&mut self, f: F) -> Option<T>
         }
     }
 
+    /// Returns the value, if any, of evaluating `c`.
     fn eval_constant(&mut self, c: &Constant<'tcx>, source_info: SourceInfo) -> Option<OpTy<'tcx>> {
         // FIXME we need to revisit this for #67176
         if c.needs_subst() {
@@ -482,11 +435,14 @@ fn eval_constant(&mut self, c: &Constant<'tcx>, source_info: SourceInfo) -> Opti
         }
     }
 
+    /// Returns the value, if any, of evaluating `place`.
     fn eval_place(&mut self, place: Place<'tcx>) -> Option<OpTy<'tcx>> {
         trace!("eval_place(place={:?})", place);
         self.use_ecx(|this| this.ecx.eval_place_to_op(place, None))
     }
 
+    /// Returns the value, if any, of evaluating `op`. Calls upon `eval_constant`
+    /// or `eval_place`, depending on the variant of `Operand` used.
     fn eval_operand(&mut self, op: &Operand<'tcx>, source_info: SourceInfo) -> Option<OpTy<'tcx>> {
         match *op {
             Operand::Constant(ref c) => self.eval_constant(c, source_info),
@@ -645,6 +601,7 @@ fn const_prop(
         })
     }
 
+    /// Creates a new `Operand::Constant` from a `Scalar` value
     fn operand_from_scalar(&self, scalar: Scalar, ty: Ty<'tcx>, span: Span) -> Operand<'tcx> {
         Operand::Constant(Box::new(Constant {
             span,
@@ -690,6 +647,7 @@ fn replace_with_const(
                     // Found a value represented as a pair. For now only do cont-prop if type of
                     // Rvalue is also a pair with two scalars. The more general case is more
                     // complicated to implement so we'll do it later.
+                    // FIXME: implement the general case stated above ^.
                     let ty = &value.layout.ty.kind;
                     // Only do it for tuples
                     if let ty::Tuple(substs) = ty {
@@ -726,6 +684,7 @@ fn replace_with_const(
         }
     }
 
+    /// Returns `true` if and only if this `op` should be const-propagated into.
     fn should_const_prop(&mut self, op: OpTy<'tcx>) -> bool {
         let mir_opt_level = self.tcx.sess.opts.debugging_opts.mir_opt_level;
 
@@ -757,6 +716,8 @@ fn should_const_prop(&mut self, op: OpTy<'tcx>) -> bool {
 enum ConstPropMode {
     /// The `Local` can be propagated into and reads of this `Local` can also be propagated.
     FullConstProp,
+    /// The `Local` can only be propagated into and from its own block.
+    OnlyInsideOwnBlock,
     /// The `Local` can be propagated into but reads cannot be propagated.
     OnlyPropagateInto,
     /// No propagation is allowed at all.
@@ -765,28 +726,41 @@ enum ConstPropMode {
 
 struct CanConstProp {
     can_const_prop: IndexVec<Local, ConstPropMode>,
-    // false at the beginning, once set, there are not allowed to be any more assignments
+    // False at the beginning. Once set, no more assignments are allowed to that local.
     found_assignment: BitSet<Local>,
+    // Cache of locals' information
+    local_kinds: IndexVec<Local, LocalKind>,
 }
 
 impl CanConstProp {
-    /// returns true if `local` can be propagated
+    /// Returns true if `local` can be propagated
     fn check(body: &Body<'_>) -> IndexVec<Local, ConstPropMode> {
         let mut cpv = CanConstProp {
             can_const_prop: IndexVec::from_elem(ConstPropMode::FullConstProp, &body.local_decls),
             found_assignment: BitSet::new_empty(body.local_decls.len()),
+            local_kinds: IndexVec::from_fn_n(
+                |local| body.local_kind(local),
+                body.local_decls.len(),
+            ),
         };
         for (local, val) in cpv.can_const_prop.iter_enumerated_mut() {
-            // cannot use args at all
-            // cannot use locals because if x < y { y - x } else { x - y } would
+            // Cannot use args at all
+            // Cannot use locals because if x < y { y - x } else { x - y } would
             //        lint for x != y
             // FIXME(oli-obk): lint variables until they are used in a condition
             // FIXME(oli-obk): lint if return value is constant
-            let local_kind = body.local_kind(local);
-
-            if local_kind == LocalKind::Arg || local_kind == LocalKind::Var {
+            if cpv.local_kinds[local] == LocalKind::Arg {
                 *val = ConstPropMode::OnlyPropagateInto;
-                trace!("local {:?} can't be const propagated because it's not a temporary", local);
+                trace!(
+                    "local {:?} can't be const propagated because it's a function argument",
+                    local
+                );
+            } else if cpv.local_kinds[local] == LocalKind::Var {
+                *val = ConstPropMode::OnlyInsideOwnBlock;
+                trace!(
+                    "local {:?} will only be propagated inside its block, because it's a user variable",
+                    local
+                );
             }
         }
         cpv.visit_body(&body);
@@ -812,8 +786,12 @@ fn visit_local(&mut self, &local: &Local, context: PlaceContext, _: Location) {
             | NonMutatingUse(NonMutatingUseContext::Move)
             | NonMutatingUse(NonMutatingUseContext::Inspect)
             | NonMutatingUse(NonMutatingUseContext::Projection)
-            | MutatingUse(MutatingUseContext::Projection)
             | NonUse(_) => {}
+            MutatingUse(MutatingUseContext::Projection) => {
+                if self.local_kinds[local] != LocalKind::Temp {
+                    self.can_const_prop[local] = ConstPropMode::NoPropagation;
+                }
+            }
             _ => {
                 trace!("local {:?} can't be propagaged because it's used: {:?}", local, context);
                 self.can_const_prop[local] = ConstPropMode::NoPropagation;
@@ -850,25 +828,35 @@ fn visit_statement(&mut self, statement: &mut Statement<'tcx>, location: Locatio
                 if let Some(local) = place.as_local() {
                     let can_const_prop = self.can_const_prop[local];
                     if let Some(()) = self.const_prop(rval, place_layout, source_info, place) {
-                        if can_const_prop == ConstPropMode::FullConstProp
-                            || can_const_prop == ConstPropMode::OnlyPropagateInto
-                        {
+                        if can_const_prop != ConstPropMode::NoPropagation {
+                            // This will return None for Locals that are from other blocks,
+                            // so it should be okay to propagate from here on down.
                             if let Some(value) = self.get_const(local) {
                                 if self.should_const_prop(value) {
                                     trace!("replacing {:?} with {:?}", rval, value);
                                     self.replace_with_const(rval, value, statement.source_info);
-
-                                    if can_const_prop == ConstPropMode::FullConstProp {
+                                    if can_const_prop == ConstPropMode::FullConstProp
+                                        || can_const_prop == ConstPropMode::OnlyInsideOwnBlock
+                                    {
                                         trace!("propagated into {:?}", local);
                                     }
                                 }
+                                if can_const_prop == ConstPropMode::OnlyInsideOwnBlock {
+                                    trace!(
+                                        "found local restricted to its block. Will remove it from const-prop after block is finished. Local: {:?}",
+                                        local
+                                    );
+                                    self.locals_of_current_block.insert(local);
+                                }
                             }
                         }
                     }
-                    if self.can_const_prop[local] != ConstPropMode::FullConstProp {
+                    if self.can_const_prop[local] == ConstPropMode::OnlyPropagateInto
+                        || self.can_const_prop[local] == ConstPropMode::NoPropagation
+                    {
                         trace!("can't propagate into {:?}", local);
                         if local != RETURN_PLACE {
-                            self.remove_const(local);
+                            Self::remove_const(&mut self.ecx, local);
                         }
                     }
                 }
@@ -903,11 +891,11 @@ fn visit_terminator(&mut self, terminator: &mut Terminator<'tcx>, location: Loca
                     let expected = ScalarMaybeUndef::from(Scalar::from_bool(*expected));
                     let value_const = self.ecx.read_scalar(value).unwrap();
                     if expected != value_const {
-                        // poison all places this operand references so that further code
+                        // Poison all places this operand references so that further code
                         // doesn't use the invalid value
                         match cond {
                             Operand::Move(ref place) | Operand::Copy(ref place) => {
-                                self.remove_const(place.local);
+                                Self::remove_const(&mut self.ecx, place.local);
                             }
                             Operand::Constant(_) => {}
                         }
@@ -969,7 +957,7 @@ fn visit_terminator(&mut self, terminator: &mut Terminator<'tcx>, location: Loca
                     }
                 }
             }
-            //none of these have Operands to const-propagate
+            // None of these have Operands to const-propagate
             TerminatorKind::Goto { .. }
             | TerminatorKind::Resume
             | TerminatorKind::Abort
@@ -984,5 +972,13 @@ fn visit_terminator(&mut self, terminator: &mut Terminator<'tcx>, location: Loca
             //FIXME(wesleywiser) Call does have Operands that could be const-propagated
             TerminatorKind::Call { .. } => {}
         }
+        // We remove all Locals which are restricted in propagation to their containing blocks.
+        // We wouldn't need to clone, but the borrow checker can't see that we're not aliasing
+        // the locals_of_current_block field, so we need to clone it first.
+        // let ecx = &mut self.ecx;
+        for local in self.locals_of_current_block.iter() {
+            Self::remove_const(&mut self.ecx, local);
+        }
+        self.locals_of_current_block.clear();
     }
 }
index bc1cb52ae855f8ce0ac43bbd36ea06459788fe8f..b9eb58f800e5c0d388af07cec6e054e0df8e3015 100644 (file)
@@ -246,7 +246,7 @@ fn local_copy(
     }
 
     fn constant(src_constant: &Constant<'tcx>) -> Option<Action<'tcx>> {
-        Some(Action::PropagateConstant((*src_constant).clone()))
+        Some(Action::PropagateConstant(*src_constant))
     }
 
     fn perform(
@@ -371,7 +371,7 @@ fn visit_operand(&mut self, operand: &mut Operand<'tcx>, location: Location) {
             _ => return,
         }
 
-        *operand = Operand::Constant(box self.constant.clone());
+        *operand = Operand::Constant(box self.constant);
         self.uses_replaced += 1
     }
 }
index 8e7302dae449eae14231c9a97ad040c79775a486..611d03405e2c84149f90530300e3bfe6cb279334 100644 (file)
@@ -210,8 +210,7 @@ struct TransformVisitor<'tcx> {
     remap: FxHashMap<Local, (Ty<'tcx>, VariantIdx, usize)>,
 
     // A map from a suspension point in a block to the locals which have live storage at that point
-    // FIXME(eddyb) This should use `IndexVec<BasicBlock, Option<_>>`.
-    storage_liveness: FxHashMap<BasicBlock, liveness::LiveVarSet>,
+    storage_liveness: IndexVec<BasicBlock, Option<liveness::LiveVarSet>>,
 
     // A list of suspension points, generated during the transform
     suspension_points: Vec<SuspensionPoint<'tcx>>,
@@ -338,7 +337,7 @@ fn visit_basic_block_data(&mut self, block: BasicBlock, data: &mut BasicBlockDat
                     resume,
                     resume_arg,
                     drop,
-                    storage_liveness: self.storage_liveness.get(&block).unwrap().clone(),
+                    storage_liveness: self.storage_liveness[block].clone().unwrap(),
                 });
 
                 VariantIdx::new(state)
@@ -404,8 +403,7 @@ fn replace_local<'tcx>(
         is_block_tail: None,
         local_info: LocalInfo::Other,
     };
-    let new_local = Local::new(body.local_decls.len());
-    body.local_decls.push(new_decl);
+    let new_local = body.local_decls.push(new_decl);
     body.local_decls.swap(local, new_local);
 
     RenameLocalVisitor { from: local, to: new_local, tcx }.visit_body(body);
@@ -431,7 +429,7 @@ struct LivenessInfo {
 
     /// For every suspending block, the locals which are storage-live across
     /// that suspension point.
-    storage_liveness: FxHashMap<BasicBlock, liveness::LiveVarSet>,
+    storage_liveness: IndexVec<BasicBlock, Option<liveness::LiveVarSet>>,
 }
 
 fn locals_live_across_suspend_points(
@@ -472,7 +470,7 @@ fn locals_live_across_suspend_points(
     let mut liveness = liveness::liveness_of_locals(body);
     liveness::dump_mir(tcx, "generator_liveness", source, body_ref, &liveness);
 
-    let mut storage_liveness_map = FxHashMap::default();
+    let mut storage_liveness_map = IndexVec::from_elem(None, body.basic_blocks());
     let mut live_locals_at_suspension_points = Vec::new();
 
     for (block, data) in body.basic_blocks().iter_enumerated() {
@@ -502,7 +500,7 @@ fn locals_live_across_suspend_points(
 
             // Store the storage liveness for later use so we can restore the state
             // after a suspension point
-            storage_liveness_map.insert(block, storage_liveness);
+            storage_liveness_map[block] = Some(storage_liveness);
 
             requires_storage_cursor.seek_before(loc);
             let storage_required = requires_storage_cursor.get().clone();
@@ -690,7 +688,7 @@ fn compute_layout<'tcx>(
 ) -> (
     FxHashMap<Local, (Ty<'tcx>, VariantIdx, usize)>,
     GeneratorLayout<'tcx>,
-    FxHashMap<BasicBlock, liveness::LiveVarSet>,
+    IndexVec<BasicBlock, Option<liveness::LiveVarSet>>,
 ) {
     // Use a liveness analysis to compute locals which are live across a suspension point
     let LivenessInfo {
@@ -925,14 +923,12 @@ fn create_generator_drop_shim<'tcx>(
 }
 
 fn insert_term_block<'tcx>(body: &mut Body<'tcx>, kind: TerminatorKind<'tcx>) -> BasicBlock {
-    let term_block = BasicBlock::new(body.basic_blocks().len());
     let source_info = source_info(body);
     body.basic_blocks_mut().push(BasicBlockData {
         statements: Vec::new(),
         terminator: Some(Terminator { source_info, kind }),
         is_cleanup: false,
-    });
-    term_block
+    })
 }
 
 fn insert_panic_block<'tcx>(
@@ -1030,9 +1026,8 @@ fn create_generator_resume_function<'tcx>(
 
     // Poison the generator when it unwinds
     if can_unwind {
-        let poison_block = BasicBlock::new(body.basic_blocks().len());
         let source_info = source_info(body);
-        body.basic_blocks_mut().push(BasicBlockData {
+        let poison_block = body.basic_blocks_mut().push(BasicBlockData {
             statements: vec![transform.set_discr(VariantIdx::new(POISONED), source_info)],
             terminator: Some(Terminator { source_info, kind: TerminatorKind::Resume }),
             is_cleanup: true,
@@ -1105,21 +1100,19 @@ fn source_info(body: &Body<'_>) -> SourceInfo {
 fn insert_clean_drop(body: &mut Body<'_>) -> BasicBlock {
     let return_block = insert_term_block(body, TerminatorKind::Return);
 
-    // Create a block to destroy an unresumed generators. This can only destroy upvars.
-    let drop_clean = BasicBlock::new(body.basic_blocks().len());
     let term = TerminatorKind::Drop {
         location: Place::from(SELF_ARG),
         target: return_block,
         unwind: None,
     };
     let source_info = source_info(body);
+
+    // Create a block to destroy an unresumed generators. This can only destroy upvars.
     body.basic_blocks_mut().push(BasicBlockData {
         statements: Vec::new(),
         terminator: Some(Terminator { source_info, kind: term }),
         is_cleanup: false,
-    });
-
-    drop_clean
+    })
 }
 
 /// An operation that can be performed on a generator.
@@ -1151,7 +1144,6 @@ fn create_cases<'tcx>(
         .filter_map(|point| {
             // Find the target for this suspension point, if applicable
             operation.target_block(point).map(|target| {
-                let block = BasicBlock::new(body.basic_blocks().len());
                 let mut statements = Vec::new();
 
                 // Create StorageLive instructions for locals with live storage
@@ -1186,7 +1178,7 @@ fn create_cases<'tcx>(
                 }
 
                 // Then jump to the real target
-                body.basic_blocks_mut().push(BasicBlockData {
+                let block = body.basic_blocks_mut().push(BasicBlockData {
                     statements,
                     terminator: Some(Terminator {
                         source_info,
index d570e093353ab10c231ceb476369172f9ee55934..dee37f767e9797c66710718e07c0eee2001b889c 100644 (file)
 
 impl<'tcx> MirPass<'tcx> for InstCombine {
     fn run_pass(&self, tcx: TyCtxt<'tcx>, _: MirSource<'tcx>, body: &mut Body<'tcx>) {
-        // We only run when optimizing MIR (at any level).
-        if tcx.sess.opts.debugging_opts.mir_opt_level == 0 {
-            return;
-        }
-
         // First, find optimization opportunities. This is done in a pre-pass to keep the MIR
         // read-only so that we can do global analyses on the MIR in the process (e.g.
         // `Place::ty()`).
index 48a6fe2273919976e2c70e2f46f0c84aab8ae072..9f63340065fbff598572d1eb7183be70d4e9ce67 100644 (file)
@@ -1,8 +1,9 @@
 use crate::{shim, util};
 use required_consts::RequiredConstsVisitor;
 use rustc_ast::ast;
+use rustc_data_structures::fx::FxHashSet;
 use rustc_hir as hir;
-use rustc_hir::def_id::{CrateNum, DefId, DefIdSet, LocalDefId, LOCAL_CRATE};
+use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
 use rustc_index::vec::IndexVec;
 use rustc_middle::mir::visit::Visitor as _;
@@ -54,24 +55,24 @@ pub(crate) fn provide(providers: &mut Providers<'_>) {
 }
 
 fn is_mir_available(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
-    tcx.mir_keys(def_id.krate).contains(&def_id)
+    tcx.mir_keys(def_id.krate).contains(&def_id.expect_local())
 }
 
 /// Finds the full set of `DefId`s within the current crate that have
 /// MIR associated with them.
-fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> &DefIdSet {
+fn mir_keys(tcx: TyCtxt<'_>, krate: CrateNum) -> &FxHashSet<LocalDefId> {
     assert_eq!(krate, LOCAL_CRATE);
 
-    let mut set = DefIdSet::default();
+    let mut set = FxHashSet::default();
 
     // All body-owners have MIR associated with them.
-    set.extend(tcx.body_owners().map(LocalDefId::to_def_id));
+    set.extend(tcx.body_owners());
 
     // Additionally, tuple struct/variant constructors have MIR, but
     // they don't have a BodyId, so we need to build them separately.
     struct GatherCtors<'a, 'tcx> {
         tcx: TyCtxt<'tcx>,
-        set: &'a mut DefIdSet,
+        set: &'a mut FxHashSet<LocalDefId>,
     }
     impl<'a, 'tcx> Visitor<'tcx> for GatherCtors<'a, 'tcx> {
         fn visit_variant_data(
@@ -83,7 +84,7 @@ fn visit_variant_data(
             _: Span,
         ) {
             if let hir::VariantData::Tuple(_, hir_id) = *v {
-                self.set.insert(self.tcx.hir().local_def_id(hir_id).to_def_id());
+                self.set.insert(self.tcx.hir().local_def_id(hir_id));
             }
             intravisit::walk_struct_def(self, v)
         }
@@ -143,7 +144,7 @@ pub fn run_passes(
     instance: InstanceDef<'tcx>,
     promoted: Option<Promoted>,
     mir_phase: MirPhase,
-    passes: &[&dyn MirPass<'tcx>],
+    passes: &[&[&dyn MirPass<'tcx>]],
 ) {
     let phase_index = mir_phase.phase_index();
 
@@ -171,8 +172,10 @@ pub fn run_passes(
         index += 1;
     };
 
-    for pass in passes {
-        run_pass(*pass);
+    for pass_group in passes {
+        for pass in *pass_group {
+            run_pass(*pass);
+        }
     }
 
     body.phase = mir_phase;
@@ -209,37 +212,41 @@ fn mir_const_qualif(tcx: TyCtxt<'_>, def_id: DefId) -> ConstQualifs {
 }
 
 fn mir_const(tcx: TyCtxt<'_>, def_id: DefId) -> &Steal<Body<'_>> {
+    let def_id = def_id.expect_local();
+
     // Unsafety check uses the raw mir, so make sure it is run
     let _ = tcx.unsafety_check_result(def_id);
 
     let mut body = tcx.mir_built(def_id).steal();
 
-    util::dump_mir(tcx, None, "mir_map", &0, MirSource::item(def_id), &body, |_, _| Ok(()));
+    util::dump_mir(tcx, None, "mir_map", &0, MirSource::item(def_id.to_def_id()), &body, |_, _| {
+        Ok(())
+    });
 
     run_passes(
         tcx,
         &mut body,
-        InstanceDef::Item(def_id),
+        InstanceDef::Item(def_id.to_def_id()),
         None,
         MirPhase::Const,
-        &[
+        &[&[
             // What we need to do constant evaluation.
             &simplify::SimplifyCfg::new("initial"),
             &rustc_peek::SanityCheck,
-        ],
+        ]],
     );
     tcx.alloc_steal_mir(body)
 }
 
 fn mir_validated(
     tcx: TyCtxt<'tcx>,
-    def_id: DefId,
+    def_id: LocalDefId,
 ) -> (&'tcx Steal<Body<'tcx>>, &'tcx Steal<IndexVec<Promoted, Body<'tcx>>>) {
     // Ensure that we compute the `mir_const_qualif` for constants at
     // this point, before we steal the mir-const result.
-    let _ = tcx.mir_const_qualif(def_id);
+    let _ = tcx.mir_const_qualif(def_id.to_def_id());
 
-    let mut body = tcx.mir_const(def_id).steal();
+    let mut body = tcx.mir_const(def_id.to_def_id()).steal();
 
     let mut required_consts = Vec::new();
     let mut required_consts_visitor = RequiredConstsVisitor::new(&mut required_consts);
@@ -252,14 +259,14 @@ fn mir_validated(
     run_passes(
         tcx,
         &mut body,
-        InstanceDef::Item(def_id),
+        InstanceDef::Item(def_id.to_def_id()),
         None,
         MirPhase::Validated,
-        &[
+        &[&[
             // What we need to run borrowck etc.
             &promote_pass,
             &simplify::SimplifyCfg::new("qualify-consts"),
-        ],
+        ]],
     );
 
     let promoted = promote_pass.promoted_fragments.into_inner();
@@ -269,57 +276,86 @@ fn mir_validated(
 fn run_optimization_passes<'tcx>(
     tcx: TyCtxt<'tcx>,
     body: &mut Body<'tcx>,
-    def_id: DefId,
+    def_id: LocalDefId,
     promoted: Option<Promoted>,
 ) {
+    let post_borrowck_cleanup: &[&dyn MirPass<'tcx>] = &[
+        // Remove all things only needed by analysis
+        &no_landing_pads::NoLandingPads::new(tcx),
+        &simplify_branches::SimplifyBranches::new("initial"),
+        &remove_noop_landing_pads::RemoveNoopLandingPads,
+        &cleanup_post_borrowck::CleanupNonCodegenStatements,
+        &simplify::SimplifyCfg::new("early-opt"),
+        // These next passes must be executed together
+        &add_call_guards::CriticalCallEdges,
+        &elaborate_drops::ElaborateDrops,
+        &no_landing_pads::NoLandingPads::new(tcx),
+        // AddMovesForPackedDrops needs to run after drop
+        // elaboration.
+        &add_moves_for_packed_drops::AddMovesForPackedDrops,
+        // `AddRetag` needs to run after `ElaborateDrops`. Otherwise it should run fairly late,
+        // but before optimizations begin.
+        &add_retag::AddRetag,
+        &simplify::SimplifyCfg::new("elaborate-drops"),
+        // No lifetime analysis based on borrowing can be done from here on out.
+    ];
+
+    let optimizations: &[&dyn MirPass<'tcx>] = &[
+        &unreachable_prop::UnreachablePropagation,
+        &uninhabited_enum_branching::UninhabitedEnumBranching,
+        &simplify::SimplifyCfg::new("after-uninhabited-enum-branching"),
+        &inline::Inline,
+        // Lowering generator control-flow and variables has to happen before we do anything else
+        // to them. We do this inside the "optimizations" block so that it can benefit from
+        // optimizations that run before, that might be harder to do on the state machine than MIR
+        // with async primitives.
+        &generator::StateTransform,
+        &instcombine::InstCombine,
+        &const_prop::ConstProp,
+        &simplify_branches::SimplifyBranches::new("after-const-prop"),
+        // Run deaggregation here because:
+        //   1. Some codegen backends require it
+        //   2. It creates additional possibilities for some MIR optimizations to trigger
+        // FIXME(#70073): Why is this done here and not in `post_borrowck_cleanup`?
+        &deaggregator::Deaggregator,
+        &copy_prop::CopyPropagation,
+        &simplify_branches::SimplifyBranches::new("after-copy-prop"),
+        &remove_noop_landing_pads::RemoveNoopLandingPads,
+        &simplify::SimplifyCfg::new("after-remove-noop-landing-pads"),
+        &simplify_try::SimplifyArmIdentity,
+        &simplify_try::SimplifyBranchSame,
+        &simplify::SimplifyCfg::new("final"),
+        &simplify::SimplifyLocals,
+    ];
+
+    let no_optimizations: &[&dyn MirPass<'tcx>] = &[
+        // Even if we don't do optimizations, we still have to lower generators for codegen.
+        &generator::StateTransform,
+        // FIXME(#70073): This pass is responsible for both optimization as well as some lints.
+        &const_prop::ConstProp,
+        // Even if we don't do optimizations, still run deaggregation because some backends assume
+        // that deaggregation always occurs.
+        &deaggregator::Deaggregator,
+    ];
+
+    let pre_codegen_cleanup: &[&dyn MirPass<'tcx>] = &[
+        &add_call_guards::CriticalCallEdges,
+        // Dump the end result for testing and debugging purposes.
+        &dump_mir::Marker("PreCodegen"),
+    ];
+
+    let mir_opt_level = tcx.sess.opts.debugging_opts.mir_opt_level;
+
     run_passes(
         tcx,
         body,
-        InstanceDef::Item(def_id),
+        InstanceDef::Item(def_id.to_def_id()),
         promoted,
         MirPhase::Optimized,
         &[
-            // Remove all things only needed by analysis
-            &no_landing_pads::NoLandingPads::new(tcx),
-            &simplify_branches::SimplifyBranches::new("initial"),
-            &remove_noop_landing_pads::RemoveNoopLandingPads,
-            &cleanup_post_borrowck::CleanupNonCodegenStatements,
-            &simplify::SimplifyCfg::new("early-opt"),
-            // These next passes must be executed together
-            &add_call_guards::CriticalCallEdges,
-            &elaborate_drops::ElaborateDrops,
-            &no_landing_pads::NoLandingPads::new(tcx),
-            // AddMovesForPackedDrops needs to run after drop
-            // elaboration.
-            &add_moves_for_packed_drops::AddMovesForPackedDrops,
-            // `AddRetag` needs to run after `ElaborateDrops`. Otherwise it should run fairly late,
-            // but before optimizations begin.
-            &add_retag::AddRetag,
-            &simplify::SimplifyCfg::new("elaborate-drops"),
-            // No lifetime analysis based on borrowing can be done from here on out.
-
-            // Optimizations begin.
-            &unreachable_prop::UnreachablePropagation,
-            &uninhabited_enum_branching::UninhabitedEnumBranching,
-            &simplify::SimplifyCfg::new("after-uninhabited-enum-branching"),
-            &inline::Inline,
-            // Lowering generator control-flow and variables
-            // has to happen before we do anything else to them.
-            &generator::StateTransform,
-            &instcombine::InstCombine,
-            &const_prop::ConstProp,
-            &simplify_branches::SimplifyBranches::new("after-const-prop"),
-            &deaggregator::Deaggregator,
-            &copy_prop::CopyPropagation,
-            &simplify_branches::SimplifyBranches::new("after-copy-prop"),
-            &remove_noop_landing_pads::RemoveNoopLandingPads,
-            &simplify::SimplifyCfg::new("after-remove-noop-landing-pads"),
-            &simplify_try::SimplifyArmIdentity,
-            &simplify_try::SimplifyBranchSame,
-            &simplify::SimplifyCfg::new("final"),
-            &simplify::SimplifyLocals,
-            &add_call_guards::CriticalCallEdges,
-            &dump_mir::Marker("PreCodegen"),
+            post_borrowck_cleanup,
+            if mir_opt_level > 0 { optimizations } else { no_optimizations },
+            pre_codegen_cleanup,
         ],
     );
 }
@@ -333,6 +369,8 @@ fn optimized_mir(tcx: TyCtxt<'_>, def_id: DefId) -> &Body<'_> {
         return shim::build_adt_ctor(tcx, def_id);
     }
 
+    let def_id = def_id.expect_local();
+
     // (Mir-)Borrowck uses `mir_validated`, so we have to force it to
     // execute before we can steal.
     tcx.ensure().mir_borrowck(def_id);
@@ -351,6 +389,8 @@ fn promoted_mir(tcx: TyCtxt<'_>, def_id: DefId) -> &IndexVec<Promoted, Body<'_>>
         return tcx.intern_promoted(IndexVec::new());
     }
 
+    let def_id = def_id.expect_local();
+
     tcx.ensure().mir_borrowck(def_id);
     let (_, promoted) = tcx.mir_validated(def_id);
     let mut promoted = promoted.steal();
index 8286793b532309c404a19aa728dc04cc2f0a0f8b..43fa7b9922d746b6843f9bdf2051b50c38d5e739 100644 (file)
@@ -835,13 +835,6 @@ fn open_drop(&mut self) -> BasicBlock {
         }
     }
 
-    /// Returns a basic block that drop a place using the context
-    /// and path in `c`. If `mode` is something, also clear `c`
-    /// according to it.
-    ///
-    /// if FLAG(self.path)
-    ///     if let Some(mode) = mode: FLAG(self.path)[mode] = false
-    ///     drop(self.place)
     fn complete_drop(
         &mut self,
         drop_mode: Option<DropFlagMode>,
index 8829b10d5dd79c3d09f049ebc0b789c1e817e9bb..5ff7fbf742a0c900f280bc8b8156c560578d5e42 100644 (file)
@@ -305,9 +305,9 @@ pub fn write_basic_block<'tcx, F>(
         let indented_body = format!("{0}{0}{1:?};", INDENT, statement);
         writeln!(
             w,
-            "{:A$} // {:?}: {}",
+            "{:A$} // {}{}",
             indented_body,
-            current_location,
+            if tcx.sess.verbose() { format!("{:?}: ", current_location) } else { String::new() },
             comment(tcx, statement.source_info),
             A = ALIGN,
         )?;
@@ -326,9 +326,9 @@ pub fn write_basic_block<'tcx, F>(
     let indented_terminator = format!("{0}{0}{1:?};", INDENT, data.terminator().kind);
     writeln!(
         w,
-        "{:A$} // {:?}: {}",
+        "{:A$} // {}{}",
         indented_terminator,
-        current_location,
+        if tcx.sess.verbose() { format!("{:?}: ", current_location) } else { String::new() },
         comment(tcx, data.terminator().source_info),
         A = ALIGN,
     )?;
@@ -455,7 +455,7 @@ fn write_scope_tree(
         )?;
     }
 
-    // Local variable types (including the user's name in a comment).
+    // Local variable types.
     for (local, local_decl) in body.local_decls.iter_enumerated() {
         if (1..body.arg_count + 1).contains(&local.index()) {
             // Skip over argument locals, they're printed in the signature.
@@ -868,5 +868,9 @@ fn write_user_type_annotations(body: &Body<'_>, w: &mut dyn Write) -> io::Result
 }
 
 pub fn dump_mir_def_ids(tcx: TyCtxt<'_>, single: Option<DefId>) -> Vec<DefId> {
-    if let Some(i) = single { vec![i] } else { tcx.mir_keys(LOCAL_CRATE).iter().cloned().collect() }
+    if let Some(i) = single {
+        vec![i]
+    } else {
+        tcx.mir_keys(LOCAL_CRATE).iter().map(|def_id| def_id.to_def_id()).collect()
+    }
 }
index 3f94fb828903113866f465bf16b804ebfdabc862..c2fe41169c117bbc999517b4e5d11e0130f0aa02 100644 (file)
@@ -173,7 +173,11 @@ fn ast_block_stmts(
         if let Some(expr) = expr {
             let tail_result_is_ignored =
                 destination_ty.is_unit() || this.block_context.currently_ignores_tail_results();
-            this.block_context.push(BlockFrame::TailExpr { tail_result_is_ignored });
+            let span = match expr {
+                ExprRef::Hair(expr) => expr.span,
+                ExprRef::Mirror(ref expr) => expr.span,
+            };
+            this.block_context.push(BlockFrame::TailExpr { tail_result_is_ignored, span });
 
             unpack!(block = this.into(destination, block, expr));
             let popped = this.block_context.pop();
index b6f46aab4161268adc99f681dd260b4d6e22b3f3..38f71135c7d928558df37a5e8d98ed0c4992d048 100644 (file)
@@ -292,7 +292,7 @@ fn expr_as_rvalue(
             let of_fld = Field::new(1);
 
             let tcx = self.hir.tcx();
-            let val = tcx.mk_place_field(result_value.clone(), val_fld, ty);
+            let val = tcx.mk_place_field(result_value, val_fld, ty);
             let of = tcx.mk_place_field(result_value, of_fld, bool_ty);
 
             let err = AssertKind::Overflow(op);
index 92e1e10518506afff50a89c32cbaf91d2dd20d17..49d6ce39ddfa4df17b2edd99a8e754a4e1b15c72 100644 (file)
@@ -151,7 +151,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                                 }
                             }
                             this.block_context
-                                .push(BlockFrame::TailExpr { tail_result_is_ignored: true });
+                                .push(BlockFrame::TailExpr { tail_result_is_ignored: true, span: expr.span });
                             return Some(expr.span);
                         }
                     }
index 4dbe4bf7628e0f5e01b84961f053a707a6cd5fb8..4c5c7f79b6cba61a1c2c18193fb47532315dd1b7 100644 (file)
@@ -21,8 +21,8 @@
 
 use super::lints;
 
-crate fn mir_built(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::steal::Steal<Body<'_>> {
-    tcx.alloc_steal_mir(mir_build(tcx, def_id.expect_local()))
+crate fn mir_built(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &ty::steal::Steal<Body<'_>> {
+    tcx.alloc_steal_mir(mir_build(tcx, def_id))
 }
 
 /// Construct the MIR for a given `DefId`.
@@ -181,7 +181,7 @@ fn mir_build(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Body<'_> {
             build::construct_const(cx, body_id, return_ty, return_ty_span)
         };
 
-        lints::check(tcx, &body, def_id.to_def_id());
+        lints::check(tcx, &body, def_id);
 
         // The borrow checker will replace all the regions here with its own
         // inference variables. There's no point having non-erased regions here.
@@ -242,6 +242,9 @@ enum BlockFrame {
         ///
         /// Example: `let _ = { STMT_1; EXPR };`
         tail_result_is_ignored: bool,
+
+        /// `Span` of the tail expression.
+        span: Span,
     },
 
     /// Generic mark meaning that the block occurred as a subexpression
@@ -369,8 +372,8 @@ fn currently_in_block_tail(&self) -> Option<BlockTailInfo> {
             match bf {
                 BlockFrame::SubExpr => continue,
                 BlockFrame::Statement { .. } => break,
-                &BlockFrame::TailExpr { tail_result_is_ignored } => {
-                    return Some(BlockTailInfo { tail_result_is_ignored });
+                &BlockFrame::TailExpr { tail_result_is_ignored, span } => {
+                    return Some(BlockTailInfo { tail_result_is_ignored, span });
                 }
             }
         }
@@ -394,7 +397,7 @@ fn currently_ignores_tail_results(&self) -> bool {
 
             // otherwise: use accumulated is_ignored state.
             Some(
-                BlockFrame::TailExpr { tail_result_is_ignored: ignored }
+                BlockFrame::TailExpr { tail_result_is_ignored: ignored, .. }
                 | BlockFrame::Statement { ignores_expr_result: ignored },
             ) => *ignored,
         }
index 50034fb02ace9c3b2ebaaddb46fdc416aee7183e..ad87afc3e0301b659a1e09176df7cee0456c15d1 100644 (file)
@@ -22,13 +22,14 @@ pub(super) fn const_to_pat(
         cv: &'tcx ty::Const<'tcx>,
         id: hir::HirId,
         span: Span,
+        mir_structural_match_violation: bool,
     ) -> Pat<'tcx> {
         debug!("const_to_pat: cv={:#?} id={:?}", cv, id);
         debug!("const_to_pat: cv.ty={:?} span={:?}", cv.ty, span);
 
         self.tcx.infer_ctxt().enter(|infcx| {
             let mut convert = ConstToPat::new(self, id, span, infcx);
-            convert.to_pat(cv)
+            convert.to_pat(cv, mir_structural_match_violation)
         })
     }
 }
@@ -81,7 +82,11 @@ fn type_marked_structural(&self, ty: Ty<'tcx>) -> bool {
         traits::type_marked_structural(self.id, self.span, &self.infcx, ty)
     }
 
-    fn to_pat(&mut self, cv: &'tcx ty::Const<'tcx>) -> Pat<'tcx> {
+    fn to_pat(
+        &mut self,
+        cv: &'tcx ty::Const<'tcx>,
+        mir_structural_match_violation: bool,
+    ) -> Pat<'tcx> {
         // This method is just a wrapper handling a validity check; the heavy lifting is
         // performed by the recursive `recur` method, which is not meant to be
         // invoked except by this method.
@@ -100,6 +105,11 @@ fn to_pat(&mut self, cv: &'tcx ty::Const<'tcx>) -> Pat<'tcx> {
                 "search_for_structural_match_violation cv.ty: {:?} returned: {:?}",
                 cv.ty, structural
             );
+
+            if structural.is_none() && mir_structural_match_violation {
+                bug!("MIR const-checker found novel structural match violation");
+            }
+
             if let Some(non_sm_ty) = structural {
                 let adt_def = match non_sm_ty {
                     traits::NonStructuralMatchTy::Adt(adt_def) => adt_def,
@@ -146,13 +156,18 @@ fn to_pat(&mut self, cv: &'tcx ty::Const<'tcx>) -> Pat<'tcx> {
                 if !ty_is_partial_eq {
                     // span_fatal avoids ICE from resolution of non-existent method (rare case).
                     self.tcx().sess.span_fatal(self.span, &make_msg());
-                } else {
+                } else if mir_structural_match_violation {
                     self.tcx().struct_span_lint_hir(
                         lint::builtin::INDIRECT_STRUCTURAL_MATCH,
                         self.id,
                         self.span,
                         |lint| lint.build(&make_msg()).emit(),
                     );
+                } else {
+                    debug!(
+                        "`search_for_structural_match_violation` found one, but `CustomEq` was \
+                          not in the qualifs for that `const`"
+                    );
                 }
             }
         }
index 20ee98b0a9c0fe82e3f069b896f187d7606aebc4..bd75f11fb8f9465d4516964057e84fc74de0560e 100644 (file)
@@ -15,7 +15,7 @@
 use rustc_hir::pat_util::EnumerateAndAdjustIterator;
 use rustc_hir::RangeEnd;
 use rustc_index::vec::Idx;
-use rustc_middle::mir::interpret::{get_slice_bytes, sign_extend, ConstValue, ErrorHandled};
+use rustc_middle::mir::interpret::{get_slice_bytes, sign_extend, ConstValue};
 use rustc_middle::mir::interpret::{LitToConstError, LitToConstInput};
 use rustc_middle::mir::UserTypeProjection;
 use rustc_middle::mir::{BorrowKind, Field, Mutability};
@@ -762,69 +762,80 @@ fn lower_variant_or_leaf(
     fn lower_path(&mut self, qpath: &hir::QPath<'_>, id: hir::HirId, span: Span) -> Pat<'tcx> {
         let ty = self.tables.node_type(id);
         let res = self.tables.qpath_res(qpath, id);
-        let is_associated_const = match res {
-            Res::Def(DefKind::AssocConst, _) => true,
-            _ => false,
+
+        let pat_from_kind = |kind| Pat { span, ty, kind: Box::new(kind) };
+
+        let (def_id, is_associated_const) = match res {
+            Res::Def(DefKind::Const, def_id) => (def_id, false),
+            Res::Def(DefKind::AssocConst, def_id) => (def_id, true),
+
+            _ => return pat_from_kind(self.lower_variant_or_leaf(res, id, span, ty, vec![])),
         };
-        let kind = match res {
-            Res::Def(DefKind::Const | DefKind::AssocConst, def_id) => {
-                let substs = self.tables.node_substs(id);
-                // Use `Reveal::All` here because patterns are always monomorphic even if their function isn't.
-                match self.tcx.const_eval_resolve(
-                    self.param_env.with_reveal_all(),
-                    def_id,
-                    substs,
-                    None,
-                    Some(span),
-                ) {
-                    Ok(value) => {
-                        let const_ =
-                            ty::Const::from_value(self.tcx, value, self.tables.node_type(id));
-
-                        let pattern = self.const_to_pat(&const_, id, span);
-                        if !is_associated_const {
-                            return pattern;
-                        }
 
-                        let user_provided_types = self.tables().user_provided_types();
-                        return if let Some(u_ty) = user_provided_types.get(id) {
-                            let user_ty = PatTyProj::from_user_type(*u_ty);
-                            Pat {
-                                span,
-                                kind: Box::new(PatKind::AscribeUserType {
-                                    subpattern: pattern,
-                                    ascription: Ascription {
-                                        /// Note that use `Contravariant` here. See the
-                                        /// `variance` field documentation for details.
-                                        variance: ty::Variance::Contravariant,
-                                        user_ty,
-                                        user_ty_span: span,
-                                    },
-                                }),
-                                ty: const_.ty,
-                            }
-                        } else {
-                            pattern
-                        };
-                    }
-                    Err(ErrorHandled::TooGeneric) => {
-                        self.errors.push(if is_associated_const {
-                            PatternError::AssocConstInPattern(span)
-                        } else {
-                            PatternError::StaticInPattern(span)
-                        });
-                        PatKind::Wild
-                    }
-                    Err(_) => {
-                        self.tcx.sess.span_err(span, "could not evaluate constant pattern");
-                        PatKind::Wild
-                    }
-                }
+        // Use `Reveal::All` here because patterns are always monomorphic even if their function
+        // isn't.
+        let param_env_reveal_all = self.param_env.with_reveal_all();
+        let substs = self.tables.node_substs(id);
+        let instance = match ty::Instance::resolve(self.tcx, param_env_reveal_all, def_id, substs) {
+            Ok(Some(i)) => i,
+            Ok(None) => {
+                self.errors.push(if is_associated_const {
+                    PatternError::AssocConstInPattern(span)
+                } else {
+                    PatternError::StaticInPattern(span)
+                });
+
+                return pat_from_kind(PatKind::Wild);
+            }
+
+            Err(_) => {
+                self.tcx.sess.span_err(span, "could not evaluate constant pattern");
+                return pat_from_kind(PatKind::Wild);
             }
-            _ => self.lower_variant_or_leaf(res, id, span, ty, vec![]),
         };
 
-        Pat { span, ty, kind: Box::new(kind) }
+        // `mir_const_qualif` must be called with the `DefId` of the item where the const is
+        // defined, not where it is declared. The difference is significant for associated
+        // constants.
+        let mir_structural_match_violation = self.tcx.mir_const_qualif(instance.def_id()).custom_eq;
+        debug!("mir_structural_match_violation({:?}) -> {}", qpath, mir_structural_match_violation);
+
+        match self.tcx.const_eval_instance(param_env_reveal_all, instance, Some(span)) {
+            Ok(value) => {
+                let const_ = ty::Const::from_value(self.tcx, value, self.tables.node_type(id));
+
+                let pattern = self.const_to_pat(&const_, id, span, mir_structural_match_violation);
+
+                if !is_associated_const {
+                    return pattern;
+                }
+
+                let user_provided_types = self.tables().user_provided_types();
+                if let Some(u_ty) = user_provided_types.get(id) {
+                    let user_ty = PatTyProj::from_user_type(*u_ty);
+                    Pat {
+                        span,
+                        kind: Box::new(PatKind::AscribeUserType {
+                            subpattern: pattern,
+                            ascription: Ascription {
+                                /// Note that use `Contravariant` here. See the
+                                /// `variance` field documentation for details.
+                                variance: ty::Variance::Contravariant,
+                                user_ty,
+                                user_ty_span: span,
+                            },
+                        }),
+                        ty: const_.ty,
+                    }
+                } else {
+                    pattern
+                }
+            }
+            Err(_) => {
+                self.tcx.sess.span_err(span, "could not evaluate constant pattern");
+                pat_from_kind(PatKind::Wild)
+            }
+        }
     }
 
     /// Converts literals, paths and negation of literals to patterns.
@@ -849,7 +860,7 @@ fn lower_lit(&mut self, expr: &'tcx hir::Expr<'tcx>) -> PatKind<'tcx> {
 
             let lit_input = LitToConstInput { lit: &lit.node, ty: self.tables.expr_ty(expr), neg };
             match self.tcx.at(expr.span).lit_to_const(lit_input) {
-                Ok(val) => *self.const_to_pat(val, expr.hir_id, lit.span).kind,
+                Ok(val) => *self.const_to_pat(val, expr.hir_id, lit.span, false).kind,
                 Err(LitToConstError::UnparseableFloat) => {
                     self.errors.push(PatternError::FloatBug);
                     PatKind::Wild
index 38f5df3e70557bd3d130b3f379724211a06e918f..990f55f6d422fba5c4e4792af4537a10b044be78 100644 (file)
@@ -1,7 +1,7 @@
 use rustc_data_structures::graph::iterate::{
     ControlFlow, NodeStatus, TriColorDepthFirstSearch, TriColorVisitor,
 };
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
 use rustc_hir::intravisit::FnKind;
 use rustc_middle::hir::map::blocks::FnLikeNode;
 use rustc_middle::mir::{BasicBlock, Body, Operand, TerminatorKind};
@@ -10,8 +10,8 @@
 use rustc_session::lint::builtin::UNCONDITIONAL_RECURSION;
 use rustc_span::Span;
 
-crate fn check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: DefId) {
-    let hir_id = tcx.hir().as_local_hir_id(def_id.expect_local());
+crate fn check<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, def_id: LocalDefId) {
+    let hir_id = tcx.hir().as_local_hir_id(def_id);
 
     if let Some(fn_like_node) = FnLikeNode::from_node(tcx.hir().get(hir_id)) {
         if let FnKind::Closure(_) = fn_like_node.kind() {
         }
 
         // If this is trait/impl method, extract the trait's substs.
-        let trait_substs = match tcx.opt_associated_item(def_id) {
+        let trait_substs = match tcx.opt_associated_item(def_id.to_def_id()) {
             Some(AssocItem {
                 container: AssocItemContainer::TraitContainer(trait_def_id), ..
             }) => {
                 let trait_substs_count = tcx.generics_of(trait_def_id).count();
-                &InternalSubsts::identity_for_item(tcx, def_id)[..trait_substs_count]
+                &InternalSubsts::identity_for_item(tcx, def_id.to_def_id())[..trait_substs_count]
             }
             _ => &[],
         };
@@ -37,7 +37,7 @@
 
         vis.reachable_recursive_calls.sort();
 
-        let hir_id = tcx.hir().as_local_hir_id(def_id.expect_local());
+        let hir_id = tcx.hir().as_local_hir_id(def_id);
         let sp = tcx.sess.source_map().guess_head_span(tcx.hir().span(hir_id));
         tcx.struct_span_lint_hir(UNCONDITIONAL_RECURSION, hir_id, sp, |lint| {
             let mut db = lint.build("function cannot return without recursing");
@@ -57,7 +57,7 @@
 struct Search<'mir, 'tcx> {
     tcx: TyCtxt<'tcx>,
     body: &'mir Body<'tcx>,
-    def_id: DefId,
+    def_id: LocalDefId,
     trait_substs: &'tcx [GenericArg<'tcx>],
 
     reachable_recursive_calls: Vec<Span>,
@@ -84,7 +84,8 @@ fn is_recursive_call(&self, func: &Operand<'tcx>) -> bool {
             // calling into an entirely different method (for example, a call from the default
             // method in the trait to `<A as Trait<B>>::method`, where `A` and/or `B` are
             // specific types).
-            return call_fn_id == def_id && &call_substs[..trait_substs.len()] == trait_substs;
+            return call_fn_id == def_id.to_def_id()
+                && &call_substs[..trait_substs.len()] == trait_substs;
         }
 
         false
index 3b778cacefe13f7f5940a54b68679481250d71e9..1b8c053b16e0b92bbf9bf4fa4457dd4fc93b5556 100644 (file)
@@ -452,8 +452,7 @@ fn create_and_seed_worklist<'tcx>(
         )
         .chain(
             // Seed entry point
-            tcx.entry_fn(LOCAL_CRATE)
-                .map(|(def_id, _)| tcx.hir().as_local_hir_id(def_id.expect_local())),
+            tcx.entry_fn(LOCAL_CRATE).map(|(def_id, _)| tcx.hir().as_local_hir_id(def_id)),
         )
         .collect::<Vec<_>>();
 
index 35805db8d59efad9c3bd18b943221b0412b85a8d..6a6d0316609078b82f960761cca6876df53e81e7 100644 (file)
@@ -1,7 +1,7 @@
 use rustc_ast::attr;
 use rustc_ast::entry::EntryPointType;
 use rustc_errors::struct_span_err;
-use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
+use rustc_hir::def_id::{CrateNum, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
 use rustc_hir::{HirId, ImplItem, Item, ItemKind, TraitItem};
 use rustc_middle::hir::map::Map;
@@ -48,7 +48,7 @@ fn visit_impl_item(&mut self, _impl_item: &'tcx ImplItem<'tcx>) {
     }
 }
 
-fn entry_fn(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<(DefId, EntryFnType)> {
+fn entry_fn(tcx: TyCtxt<'_>, cnum: CrateNum) -> Option<(LocalDefId, EntryFnType)> {
     assert_eq!(cnum, LOCAL_CRATE);
 
     let any_exe =
@@ -143,13 +143,16 @@ fn find_item(item: &Item<'_>, ctxt: &mut EntryContext<'_, '_>, at_root: bool) {
     }
 }
 
-fn configure_main(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) -> Option<(DefId, EntryFnType)> {
+fn configure_main(
+    tcx: TyCtxt<'_>,
+    visitor: &EntryContext<'_, '_>,
+) -> Option<(LocalDefId, EntryFnType)> {
     if let Some((hir_id, _)) = visitor.start_fn {
-        Some((tcx.hir().local_def_id(hir_id).to_def_id(), EntryFnType::Start))
+        Some((tcx.hir().local_def_id(hir_id), EntryFnType::Start))
     } else if let Some((hir_id, _)) = visitor.attr_main_fn {
-        Some((tcx.hir().local_def_id(hir_id).to_def_id(), EntryFnType::Main))
+        Some((tcx.hir().local_def_id(hir_id), EntryFnType::Main))
     } else if let Some((hir_id, _)) = visitor.main_fn {
-        Some((tcx.hir().local_def_id(hir_id).to_def_id(), EntryFnType::Main))
+        Some((tcx.hir().local_def_id(hir_id), EntryFnType::Main))
     } else {
         no_main_err(tcx, visitor);
         None
@@ -211,7 +214,7 @@ fn no_main_err(tcx: TyCtxt<'_>, visitor: &EntryContext<'_, '_>) {
     err.emit();
 }
 
-pub fn find_entry_point(tcx: TyCtxt<'_>) -> Option<(DefId, EntryFnType)> {
+pub fn find_entry_point(tcx: TyCtxt<'_>) -> Option<(LocalDefId, EntryFnType)> {
     tcx.entry_fn(LOCAL_CRATE)
 }
 
index ad5a649a24a9feaf880c296df492e80ae46c1075..b407276cfbecd8fb17db174fe761ee0413f1c061 100644 (file)
@@ -132,7 +132,7 @@ fn visit_nested_body(&mut self, body_id: hir::BodyId) {
         let owner_def_id = self.tcx.hir().body_owner_def_id(body_id);
         let body = self.tcx.hir().body(body_id);
         let param_env = self.tcx.param_env(owner_def_id.to_def_id());
-        let tables = self.tcx.typeck_tables_of(owner_def_id.to_def_id());
+        let tables = self.tcx.typeck_tables_of(owner_def_id);
         ExprVisitor { tcx: self.tcx, param_env, tables }.visit_body(body);
         self.visit_body(body);
     }
index 25d53485bc54dc1180b9c35e3433e1e2bcafb8ce..8f736c1dd549bbf810536c2245882e5701d04308 100644 (file)
 use rustc_errors::Applicability;
 use rustc_hir as hir;
 use rustc_hir::def::*;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::{DefId, LocalDefId};
 use rustc_hir::intravisit::{self, FnKind, NestedVisitorMap, Visitor};
 use rustc_hir::{Expr, HirId, HirIdMap, HirIdSet, Node};
 use rustc_middle::hir::map::Map;
@@ -398,7 +398,7 @@ fn visit_fn<'tcx>(
     intravisit::walk_fn(&mut fn_maps, fk, decl, body_id, sp, id);
 
     // compute liveness
-    let mut lsets = Liveness::new(&mut fn_maps, def_id.to_def_id());
+    let mut lsets = Liveness::new(&mut fn_maps, def_id);
     let entry_ln = lsets.compute(&body.value);
 
     // check for various error conditions
@@ -671,7 +671,7 @@ struct Liveness<'a, 'tcx> {
 }
 
 impl<'a, 'tcx> Liveness<'a, 'tcx> {
-    fn new(ir: &'a mut IrMaps<'tcx>, def_id: DefId) -> Liveness<'a, 'tcx> {
+    fn new(ir: &'a mut IrMaps<'tcx>, def_id: LocalDefId) -> Liveness<'a, 'tcx> {
         // Special nodes and variables:
         // - exit_ln represents the end of the fn, either by return or panic
         // - implicit_ret_var is a pseudo-variable that represents
index f41bc44d17705c7eda59273f5f738a30e8eb6eed..f48d2b6c8b5e61dc18cf01ef6ddb88fa386e0ffd 100644 (file)
@@ -76,7 +76,7 @@ fn dylink_registrar(
     // Make sure the path contains a / or the linker will search for it.
     let path = env::current_dir().unwrap().join(&path);
 
-    let lib = match DynamicLibrary::open(Some(&path)) {
+    let lib = match DynamicLibrary::open(&path) {
         Ok(lib) => lib,
         // this is fatal: there are almost certainly macros we need
         // inside this crate, so continue would spew "macro undefined"
index e4501b5c3b562d1a0d0047769b732793bc902867..82b45cf7cf884156cd81c6029abf1ae322bf288e 100644 (file)
@@ -10,7 +10,7 @@
 use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
-use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
+use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
 use rustc_hir::intravisit::{self, DeepVisitor, NestedVisitorMap, Visitor};
 use rustc_hir::{AssocItemKind, HirIdSet, Node, PatKind};
 use rustc_middle::bug;
@@ -1174,7 +1174,7 @@ fn visit_pat(&mut self, pat: &'tcx hir::Pat<'tcx>) {
 struct TypePrivacyVisitor<'a, 'tcx> {
     tcx: TyCtxt<'tcx>,
     tables: &'a ty::TypeckTables<'tcx>,
-    current_item: DefId,
+    current_item: LocalDefId,
     in_body: bool,
     span: Span,
     empty_tables: &'a ty::TypeckTables<'tcx>,
@@ -1182,7 +1182,9 @@ struct TypePrivacyVisitor<'a, 'tcx> {
 
 impl<'a, 'tcx> TypePrivacyVisitor<'a, 'tcx> {
     fn item_is_accessible(&self, did: DefId) -> bool {
-        def_id_visibility(self.tcx, did).0.is_accessible_from(self.current_item, self.tcx)
+        def_id_visibility(self.tcx, did)
+            .0
+            .is_accessible_from(self.current_item.to_def_id(), self.tcx)
     }
 
     // Take node-id of an expression or pattern and check its type for privacy.
@@ -1387,10 +1389,8 @@ fn visit_local(&mut self, local: &'tcx hir::Local<'tcx>) {
 
     // Check types in item interfaces.
     fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
-        let orig_current_item = mem::replace(
-            &mut self.current_item,
-            self.tcx.hir().local_def_id(item.hir_id).to_def_id(),
-        );
+        let orig_current_item =
+            mem::replace(&mut self.current_item, self.tcx.hir().local_def_id(item.hir_id));
         let orig_in_body = mem::replace(&mut self.in_body, false);
         let orig_tables =
             mem::replace(&mut self.tables, item_tables(self.tcx, item.hir_id, self.empty_tables));
@@ -2076,7 +2076,7 @@ pub fn provide(providers: &mut Providers<'_>) {
     };
 }
 
-fn check_mod_privacy(tcx: TyCtxt<'_>, module_def_id: DefId) {
+fn check_mod_privacy(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
     let empty_tables = ty::TypeckTables::empty(None);
 
     // Check privacy of names not checked in previous compilation stages.
@@ -2086,7 +2086,7 @@ fn check_mod_privacy(tcx: TyCtxt<'_>, module_def_id: DefId) {
         current_item: None,
         empty_tables: &empty_tables,
     };
-    let (module, span, hir_id) = tcx.hir().get_module(module_def_id.expect_local());
+    let (module, span, hir_id) = tcx.hir().get_module(module_def_id);
 
     intravisit::walk_mod(&mut visitor, module, hir_id);
 
index c25a3524dc1087f4c6f92003d3a443fdd2e0116c..f6213189d9443fbf98715e19a4fb9fb88cdc72fc 100644 (file)
@@ -383,7 +383,7 @@ fn call_has_self_arg(&self, source: PathSource<'_>) -> Option<(Span, Option<Span
         has_self_arg
     }
 
-    fn followed_by_brace(&self, span: Span) -> (bool, Option<(Span, String)>) {
+    fn followed_by_brace(&self, span: Span) -> (bool, Option<Span>) {
         // HACK(estebank): find a better way to figure out that this was a
         // parser issue where a struct literal is being used on an expression
         // where a brace being opened means a block is being started. Look
@@ -406,7 +406,7 @@ fn followed_by_brace(&self, span: Span) -> (bool, Option<(Span, String)>) {
             _ => false,
         };
         // In case this could be a struct literal that needs to be surrounded
-        // by parenthesis, find the appropriate span.
+        // by parentheses, find the appropriate span.
         let mut i = 0;
         let mut closing_brace = None;
         loop {
@@ -414,10 +414,7 @@ fn followed_by_brace(&self, span: Span) -> (bool, Option<(Span, String)>) {
             match sm.span_to_snippet(sp) {
                 Ok(ref snippet) => {
                     if snippet == "}" {
-                        let sp = span.to(sp);
-                        if let Ok(snippet) = sm.span_to_snippet(sp) {
-                            closing_brace = Some((sp, snippet));
-                        }
+                        closing_brace = Some(span.to(sp));
                         break;
                     }
                 }
@@ -479,17 +476,23 @@ fn smart_resolve_context_dependent_help(
                     suggested = path_sep(err, &parent);
                 }
                 PathSource::Expr(None) if followed_by_brace => {
-                    if let Some((sp, snippet)) = closing_brace {
-                        err.span_suggestion(
-                            sp,
-                            "surround the struct literal with parenthesis",
-                            format!("({})", snippet),
+                    if let Some(sp) = closing_brace {
+                        err.multipart_suggestion(
+                            "surround the struct literal with parentheses",
+                            vec![
+                                (sp.shrink_to_lo(), "(".to_string()),
+                                (sp.shrink_to_hi(), ")".to_string()),
+                            ],
                             Applicability::MaybeIncorrect,
                         );
                     } else {
                         err.span_label(
-                            span, // Note the parenthesis surrounding the suggestion below
-                            format!("did you mean `({} {{ /* fields */ }})`?", path_str),
+                            span, // Note the parentheses surrounding the suggestion below
+                            format!(
+                                "you might want to surround a struct literal with parentheses: \
+                                 `({} {{ /* fields */ }})`?",
+                                path_str
+                            ),
                         );
                     }
                     suggested = true;
@@ -516,10 +519,16 @@ fn smart_resolve_context_dependent_help(
                     err.note("if you want the `try` keyword, you need to be in the 2018 edition");
                 }
             }
-            (Res::Def(DefKind::TyAlias, _), PathSource::Trait(_)) => {
+            (Res::Def(DefKind::TyAlias, def_id), PathSource::Trait(_)) => {
                 err.span_label(span, "type aliases cannot be used as traits");
                 if nightly_options::is_nightly_build() {
-                    err.note("did you mean to use a trait alias?");
+                    let msg = "you might have meant to use `#![feature(trait_alias)]` instead of a \
+                               `type` alias";
+                    if let Some(span) = self.r.definitions.opt_span(def_id) {
+                        err.span_help(span, msg);
+                    } else {
+                        err.help(msg);
+                    }
                 }
             }
             (Res::Def(DefKind::Mod, _), PathSource::Expr(Some(parent))) => {
index 26ea75ad7ef6471d26baf3e21ee31f99fec70724..d84edbe3ad77b0378b70c07c737e5322be8805fc 100644 (file)
@@ -2066,52 +2066,64 @@ fn resolve_path_with_ribs(
                 };
             }
 
-            let binding = if let Some(module) = module {
-                self.resolve_ident_in_module(
-                    module,
-                    ident,
-                    ns,
-                    parent_scope,
-                    record_used,
-                    path_span,
-                )
-            } else if ribs.is_none() || opt_ns.is_none() || opt_ns == Some(MacroNS) {
-                let scopes = ScopeSet::All(ns, opt_ns.is_none());
-                self.early_resolve_ident_in_lexical_scope(
-                    ident,
-                    scopes,
-                    parent_scope,
-                    record_used,
-                    record_used,
-                    path_span,
-                )
-            } else {
-                let record_used_id =
-                    if record_used { crate_lint.node_id().or(Some(CRATE_NODE_ID)) } else { None };
-                match self.resolve_ident_in_lexical_scope(
-                    ident,
-                    ns,
-                    parent_scope,
-                    record_used_id,
-                    path_span,
-                    &ribs.unwrap()[ns],
-                ) {
-                    // we found a locally-imported or available item/module
-                    Some(LexicalScopeBinding::Item(binding)) => Ok(binding),
-                    // we found a local variable or type param
-                    Some(LexicalScopeBinding::Res(res))
-                        if opt_ns == Some(TypeNS) || opt_ns == Some(ValueNS) =>
-                    {
-                        record_segment_res(self, res);
-                        return PathResult::NonModule(PartialRes::with_unresolved_segments(
-                            res,
-                            path.len() - 1,
-                        ));
+            enum FindBindingResult<'a> {
+                Binding(Result<&'a NameBinding<'a>, Determinacy>),
+                PathResult(PathResult<'a>),
+            }
+            let find_binding_in_ns = |this: &mut Self, ns| {
+                let binding = if let Some(module) = module {
+                    this.resolve_ident_in_module(
+                        module,
+                        ident,
+                        ns,
+                        parent_scope,
+                        record_used,
+                        path_span,
+                    )
+                } else if ribs.is_none() || opt_ns.is_none() || opt_ns == Some(MacroNS) {
+                    let scopes = ScopeSet::All(ns, opt_ns.is_none());
+                    this.early_resolve_ident_in_lexical_scope(
+                        ident,
+                        scopes,
+                        parent_scope,
+                        record_used,
+                        record_used,
+                        path_span,
+                    )
+                } else {
+                    let record_used_id = if record_used {
+                        crate_lint.node_id().or(Some(CRATE_NODE_ID))
+                    } else {
+                        None
+                    };
+                    match this.resolve_ident_in_lexical_scope(
+                        ident,
+                        ns,
+                        parent_scope,
+                        record_used_id,
+                        path_span,
+                        &ribs.unwrap()[ns],
+                    ) {
+                        // we found a locally-imported or available item/module
+                        Some(LexicalScopeBinding::Item(binding)) => Ok(binding),
+                        // we found a local variable or type param
+                        Some(LexicalScopeBinding::Res(res))
+                            if opt_ns == Some(TypeNS) || opt_ns == Some(ValueNS) =>
+                        {
+                            record_segment_res(this, res);
+                            return FindBindingResult::PathResult(PathResult::NonModule(
+                                PartialRes::with_unresolved_segments(res, path.len() - 1),
+                            ));
+                        }
+                        _ => Err(Determinacy::determined(record_used)),
                     }
-                    _ => Err(Determinacy::determined(record_used)),
-                }
+                };
+                FindBindingResult::Binding(binding)
+            };
+            let binding = match find_binding_in_ns(self, ns) {
+                FindBindingResult::PathResult(x) => return x,
+                FindBindingResult::Binding(binding) => binding,
             };
-
             match binding {
                 Ok(binding) => {
                     if i == 1 {
@@ -2201,7 +2213,33 @@ fn resolve_path_with_ribs(
                     } else if i == 0 {
                         (format!("use of undeclared type or module `{}`", ident), None)
                     } else {
-                        (format!("could not find `{}` in `{}`", ident, path[i - 1].ident), None)
+                        let mut msg =
+                            format!("could not find `{}` in `{}`", ident, path[i - 1].ident);
+                        if ns == TypeNS || ns == ValueNS {
+                            let ns_to_try = if ns == TypeNS { ValueNS } else { TypeNS };
+                            if let FindBindingResult::Binding(Ok(binding)) =
+                                find_binding_in_ns(self, ns_to_try)
+                            {
+                                let mut found = |what| {
+                                    msg = format!(
+                                        "expected {}, found {} `{}` in `{}`",
+                                        ns.descr(),
+                                        what,
+                                        ident,
+                                        path[i - 1].ident
+                                    )
+                                };
+                                if binding.module().is_some() {
+                                    found("module")
+                                } else {
+                                    match binding.res() {
+                                        def::Res::<NodeId>::Def(kind, id) => found(kind.descr(id)),
+                                        _ => found(ns_to_try.descr()),
+                                    }
+                                }
+                            };
+                        }
+                        (msg, None)
                     };
                     return PathResult::Failed {
                         span: ident.span,
index 431478500b42bd19b63fd15d383a7fc3a28f4763..ccce72fb0ac2468dd809245a628d38e0772a147d 100644 (file)
@@ -107,7 +107,7 @@ fn nest_tables<F>(&mut self, item_id: NodeId, f: F)
     where
         F: FnOnce(&mut Self),
     {
-        let item_def_id = self.tcx.hir().local_def_id_from_node_id(item_id).to_def_id();
+        let item_def_id = self.tcx.hir().local_def_id_from_node_id(item_id);
 
         let tables = if self.tcx.has_typeck_tables(item_def_id) {
             self.tcx.typeck_tables_of(item_def_id)
@@ -1183,7 +1183,7 @@ fn process_use_tree(
 
                 // Make a comma-separated list of names of imported modules.
                 let def_id = self.tcx.hir().local_def_id_from_node_id(id);
-                let names = self.tcx.names_imported_by_glob_use(def_id.to_def_id());
+                let names = self.tcx.names_imported_by_glob_use(def_id);
                 let names: Vec<_> = names.iter().map(|n| n.to_string()).collect();
 
                 // Otherwise it's a span with wrong macro expansion info, which
index f6d7e091e00d6b6c5a74825152be8a7275ab9967..0dfc391d9cd3bf6634c77b32e937d3bbe52cad60 100644 (file)
@@ -1311,18 +1311,10 @@ fn collect_print_requests(
         prints.push(PrintRequest::TargetFeatures);
         cg.target_feature = String::new();
     }
-    if cg.relocation_model.as_ref().map_or(false, |s| s == "help") {
-        prints.push(PrintRequest::RelocationModels);
-        cg.relocation_model = None;
-    }
     if cg.code_model.as_ref().map_or(false, |s| s == "help") {
         prints.push(PrintRequest::CodeModels);
         cg.code_model = None;
     }
-    if dopts.tls_model.as_ref().map_or(false, |s| s == "help") {
-        prints.push(PrintRequest::TlsModels);
-        dopts.tls_model = None;
-    }
 
     prints.extend(matches.opt_strs("print").into_iter().map(|s| match &*s {
         "crate-name" => PrintRequest::CrateName,
@@ -2005,7 +1997,8 @@ pub fn needs_analysis(&self) -> bool {
     use crate::utils::NativeLibraryKind;
     use rustc_feature::UnstableFeatures;
     use rustc_span::edition::Edition;
-    use rustc_target::spec::{MergeFunctions, PanicStrategy, RelroLevel, TargetTriple};
+    use rustc_target::spec::{MergeFunctions, PanicStrategy, RelocModel};
+    use rustc_target::spec::{RelroLevel, TargetTriple, TlsModel};
     use std::collections::hash_map::DefaultHasher;
     use std::collections::BTreeMap;
     use std::hash::Hash;
@@ -2053,6 +2046,8 @@ fn hash(&self, hasher: &mut DefaultHasher, error_format: ErrorOutputType) {
     impl_dep_tracking_hash_via_hash!(Option<(String, u64)>);
     impl_dep_tracking_hash_via_hash!(Option<Vec<String>>);
     impl_dep_tracking_hash_via_hash!(Option<MergeFunctions>);
+    impl_dep_tracking_hash_via_hash!(Option<RelocModel>);
+    impl_dep_tracking_hash_via_hash!(Option<TlsModel>);
     impl_dep_tracking_hash_via_hash!(Option<PanicStrategy>);
     impl_dep_tracking_hash_via_hash!(Option<RelroLevel>);
     impl_dep_tracking_hash_via_hash!(Option<lint::Level>);
index 54b2f2fe470302a8872cbba94a9c8399f140897c..5b983d1105de46039ca8d18c959ca5376ee2a3dc 100644 (file)
@@ -6,7 +6,8 @@
 use crate::utils::NativeLibraryKind;
 
 use rustc_target::spec::TargetTriple;
-use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
+use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy};
+use rustc_target::spec::{RelocModel, RelroLevel, TlsModel};
 
 use rustc_feature::UnstableFeatures;
 use rustc_span::edition::Edition;
@@ -265,14 +266,15 @@ mod $mod_desc {
         pub const parse_merge_functions: &str = "one of: `disabled`, `trampolines`, or `aliases`";
         pub const parse_symbol_mangling_version: &str = "either `legacy` or `v0` (RFC 2603)";
         pub const parse_src_file_hash: &str = "either `md5` or `sha1`";
+        pub const parse_relocation_model: &str =
+            "one of supported relocation models (`rustc --print relocation-models`)";
+        pub const parse_tls_model: &str =
+            "one of supported TLS models (`rustc --print tls-models`)";
     }
 
     #[allow(dead_code)]
     mod $mod_set {
-        use super::{$struct_name, Passes, Sanitizer, LtoCli, LinkerPluginLto, SwitchWithOptPath,
-            SymbolManglingVersion, CFGuard, SourceFileHashAlgorithm};
-        use rustc_target::spec::{LinkerFlavor, MergeFunctions, PanicStrategy, RelroLevel};
-        use std::path::PathBuf;
+        use super::*;
         use std::str::FromStr;
 
         // Sometimes different options need to build a common structure.
@@ -598,6 +600,23 @@ fn parse_merge_functions(slot: &mut Option<MergeFunctions>, v: Option<&str>) ->
             true
         }
 
+        fn parse_relocation_model(slot: &mut Option<RelocModel>, v: Option<&str>) -> bool {
+            match v.and_then(|s| RelocModel::from_str(s).ok()) {
+                Some(relocation_model) => *slot = Some(relocation_model),
+                None if v == Some("default") => *slot = None,
+                _ => return false,
+            }
+            true
+        }
+
+        fn parse_tls_model(slot: &mut Option<TlsModel>, v: Option<&str>) -> bool {
+            match v.and_then(|s| TlsModel::from_str(s).ok()) {
+                Some(tls_model) => *slot = Some(tls_model),
+                _ => return false,
+            }
+            true
+        }
+
         fn parse_symbol_mangling_version(
             slot: &mut SymbolManglingVersion,
             v: Option<&str>,
@@ -697,8 +716,9 @@ fn parse_src_file_hash(slot: &mut Option<SourceFileHashAlgorithm>, v: Option<&st
         "compile the program with profiling instrumentation"),
     profile_use: Option<PathBuf> = (None, parse_opt_pathbuf, [TRACKED],
         "use the given `.profdata` file for profile-guided optimization"),
-    relocation_model: Option<String> = (None, parse_opt_string, [TRACKED],
-        "choose the relocation model to use (`rustc --print relocation-models` for details)"),
+    relocation_model: Option<RelocModel> = (None, parse_relocation_model, [TRACKED],
+        "control generation of position-independent code (PIC) \
+        (`rustc --print relocation-models` for details)"),
     remark: Passes = (Passes::Some(Vec::new()), parse_passes, [UNTRACKED],
         "print remarks for these optimization passes (space separated, or \"all\")"),
     rpath: bool = (false, parse_bool, [UNTRACKED],
@@ -968,7 +988,7 @@ fn parse_src_file_hash(slot: &mut Option<SourceFileHashAlgorithm>, v: Option<&st
         "measure time of each LLVM pass (default: no)"),
     time_passes: bool = (false, parse_bool, [UNTRACKED],
         "measure time of each rustc pass (default: no)"),
-    tls_model: Option<String> = (None, parse_opt_string, [TRACKED],
+    tls_model: Option<TlsModel> = (None, parse_tls_model, [TRACKED],
         "choose the TLS model to use (`rustc --print tls-models` for details)"),
     trace_macros: bool = (false, parse_bool, [UNTRACKED],
         "for every macro invocation, print its name and arguments (default: no)"),
index f0bbe1d0a18bce11a1cc86eab7bd36a61449a9bf..42f9a8d6b05949320ebd5146e7bad7e452c4d1e8 100644 (file)
@@ -22,7 +22,7 @@
 use rustc_span::edition::Edition;
 use rustc_span::source_map::{self, FileLoader, MultiSpan, RealFileLoader, SourceMap, Span};
 use rustc_span::SourceFileHashAlgorithm;
-use rustc_target::spec::{PanicStrategy, RelroLevel, Target, TargetTriple};
+use rustc_target::spec::{PanicStrategy, RelocModel, RelroLevel, Target, TargetTriple, TlsModel};
 
 use std::cell::{self, RefCell};
 use std::env;
@@ -584,6 +584,14 @@ pub fn crt_static_feature(&self, crate_type: Option<config::CrateType>) -> bool
         }
     }
 
+    pub fn relocation_model(&self) -> RelocModel {
+        self.opts.cg.relocation_model.unwrap_or(self.target.target.options.relocation_model)
+    }
+
+    pub fn tls_model(&self) -> TlsModel {
+        self.opts.debugging_opts.tls_model.unwrap_or(self.target.target.options.tls_model)
+    }
+
     pub fn must_not_eliminate_frame_pointers(&self) -> bool {
         // "mcount" function relies on stack pointer.
         // See <https://sourceware.org/binutils/docs/gprof/Implementation.html>.
index 49e2144b3e38011a74ee4411af56d68530518cb9..d27aae0d6ed9b4e87d33a8af62489746005e70b5 100644 (file)
@@ -20,7 +20,6 @@
 use std::sync::atomic::Ordering;
 
 use log::debug;
-use std::env;
 use std::fs;
 use std::io;
 
@@ -64,9 +63,6 @@ pub trait FileLoader {
     /// Query the existence of a file.
     fn file_exists(&self, path: &Path) -> bool;
 
-    /// Returns an absolute path to a file, if possible.
-    fn abs_path(&self, path: &Path) -> Option<PathBuf>;
-
     /// Read the contents of an UTF-8 file into memory.
     fn read_file(&self, path: &Path) -> io::Result<String>;
 }
@@ -79,14 +75,6 @@ fn file_exists(&self, path: &Path) -> bool {
         fs::metadata(path).is_ok()
     }
 
-    fn abs_path(&self, path: &Path) -> Option<PathBuf> {
-        if path.is_absolute() {
-            Some(path.to_path_buf())
-        } else {
-            env::current_dir().ok().map(|cwd| cwd.join(path))
-        }
-    }
-
     fn read_file(&self, path: &Path) -> io::Result<String> {
         fs::read_to_string(path)
     }
index 13e62b60ca8f5bd418015a20b16319c6cb28e306..7177c4e251e771082d905b6aacd211f9576aa262 100644 (file)
@@ -6,14 +6,14 @@
 //
 // For example, `-C target-cpu=cortex-a53`.
 
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
 
 pub fn target() -> Result<Target, String> {
     let opts = TargetOptions {
         linker: Some("rust-lld".to_owned()),
         features: "+strict-align,+neon,+fp-armv8".to_string(),
         executables: true,
-        relocation_model: "static".to_string(),
+        relocation_model: RelocModel::Static,
         disable_redzone: true,
         linker_is_gnu: true,
         max_atomic_width: Some(128),
index cf46252555cd8beec9d9c2bca2dc2fd905dc0bbe..986300c677dfc2e82aec968616fee05f3bb40346 100644 (file)
@@ -6,14 +6,14 @@
 //
 // For example, `-C target-cpu=cortex-a53`.
 
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
 
 pub fn target() -> Result<Target, String> {
     let opts = TargetOptions {
         linker: Some("rust-lld".to_owned()),
         features: "+strict-align,-neon,-fp-armv8".to_string(),
         executables: true,
-        relocation_model: "static".to_string(),
+        relocation_model: RelocModel::Static,
         disable_redzone: true,
         linker_is_gnu: true,
         max_atomic_width: Some(128),
index ebe901e4f274d1bdac78fd21a9105926d529fd6c..a1f68f6706a2aabc2b3526330c0609d4d12a9fb8 100644 (file)
@@ -1,6 +1,7 @@
 // Targets the Big endian Cortex-R4/R5 processor (ARMv7-R)
 
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -18,7 +19,7 @@ pub fn target() -> TargetResult {
         options: TargetOptions {
             executables: true,
             linker: Some("rust-lld".to_owned()),
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
             panic_strategy: PanicStrategy::Abort,
             max_atomic_width: Some(32),
             abi_blacklist: super::arm_base::abi_blacklist(),
index 8652d1051ad05094f2562bdf5cd7f645902a225a..4d81c21f52a7b2f16e171c9149661ce6a652dbf2 100644 (file)
@@ -1,6 +1,7 @@
 // Targets the Cortex-R4F/R5F processor (ARMv7-R)
 
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -18,7 +19,7 @@ pub fn target() -> TargetResult {
         options: TargetOptions {
             executables: true,
             linker: Some("rust-lld".to_owned()),
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
             panic_strategy: PanicStrategy::Abort,
             features: "+vfp3,-d32,-fp16".to_string(),
             max_atomic_width: Some(32),
index 2fbef154f814c19046a8999be1bd6a33dde6ce63..09f1494e81cdb8b20786c7e21985517509e006d7 100644 (file)
 // - `relocation-model` set to `static`; also no PIE, no relro and no dynamic
 // linking. rationale: matches `thumb` targets
 
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
 
 pub fn target() -> Result<Target, String> {
     let opts = TargetOptions {
         linker: Some("rust-lld".to_owned()),
         features: "+v7,+thumb2,+soft-float,-neon,+strict-align".to_string(),
         executables: true,
-        relocation_model: "static".to_string(),
+        relocation_model: RelocModel::Static,
         disable_redzone: true,
         max_atomic_width: Some(64),
         panic_strategy: PanicStrategy::Abort,
index f31e68c5bd12a51f05e173ead51c590706df5d0b..653ca76435bc5341f6e75f7cd3208e7d455cb060 100644 (file)
@@ -5,14 +5,14 @@
 // changes (list in `armv7a_none_eabi.rs`) to bring it closer to the bare-metal
 // `thumb` & `aarch64` targets.
 
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
 
 pub fn target() -> Result<Target, String> {
     let opts = TargetOptions {
         linker: Some("rust-lld".to_owned()),
         features: "+v7,+vfp3,-d32,+thumb2,-neon,+strict-align".to_string(),
         executables: true,
-        relocation_model: "static".to_string(),
+        relocation_model: RelocModel::Static,
         disable_redzone: true,
         max_atomic_width: Some(64),
         panic_strategy: PanicStrategy::Abort,
index b7fcda63db00b9bffd93d91ba3a202772fca4da2..29dfa170397361c559c1cbb22717691d61231ec0 100644 (file)
@@ -1,6 +1,7 @@
 // Targets the Little-endian Cortex-R4/R5 processor (ARMv7-R)
 
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -18,7 +19,7 @@ pub fn target() -> TargetResult {
         options: TargetOptions {
             executables: true,
             linker: Some("rust-lld".to_owned()),
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
             panic_strategy: PanicStrategy::Abort,
             max_atomic_width: Some(32),
             abi_blacklist: super::arm_base::abi_blacklist(),
index 340090fd43b7c9ff29d0be1f9c700e752a817a45..e6b0187c3313aadf8c43a09140114812af11f454 100644 (file)
@@ -1,6 +1,7 @@
 // Targets the Little-endian Cortex-R4F/R5F processor (ARMv7-R)
 
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -18,7 +19,7 @@ pub fn target() -> TargetResult {
         options: TargetOptions {
             executables: true,
             linker: Some("rust-lld".to_owned()),
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
             panic_strategy: PanicStrategy::Abort,
             features: "+vfp3,-d32,-fp16".to_string(),
             max_atomic_width: Some(32),
index 53af9dcc1861012925212d6e63deb89bd96a234c..3659c9ecdfca654cd206a37583b39a75c1bfda19 100644 (file)
@@ -1,4 +1,4 @@
-use crate::spec::{LinkArgs, LinkerFlavor, RelroLevel, TargetOptions};
+use crate::spec::{LinkArgs, LinkerFlavor, RelroLevel, TargetOptions, TlsModel};
 
 pub fn opts() -> TargetOptions {
     let mut args = LinkArgs::new();
@@ -29,7 +29,7 @@ pub fn opts() -> TargetOptions {
         // (Global Offset Table) to obtain the effective address of a
         // thread-local variable. Using a GOT is useful only when doing
         // dynamic linking.
-        tls_model: "local-exec".to_string(),
+        tls_model: TlsModel::LocalExec,
         relro_level: RelroLevel::Full,
         ..Default::default()
     }
index b9f94023e7a791b9c03dcf124036c6be8e9c028f..18fb2aa3d5693f00ab0afbde139a8fb1ec5d8d84 100644 (file)
@@ -1,4 +1,5 @@
-use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy, TargetOptions};
+use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy};
+use crate::spec::{RelocModel, TargetOptions, TlsModel};
 
 pub fn opts() -> TargetOptions {
     let mut pre_link_args = LinkArgs::new();
@@ -15,9 +16,9 @@ pub fn opts() -> TargetOptions {
         pre_link_args,
         panic_strategy: PanicStrategy::Abort,
         position_independent_executables: true,
-        relocation_model: "static".to_string(),
+        relocation_model: RelocModel::Static,
         target_family: None,
-        tls_model: "initial-exec".to_string(),
+        tls_model: TlsModel::InitialExec,
         ..Default::default()
     }
 }
index 1f9b195e2e6980049e7b65ddfd6eacae684a14c7..7f2dada714d8f721145d3968dc3ce4924a0befa5 100644 (file)
@@ -1,4 +1,5 @@
-use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy, TargetOptions};
+use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, PanicStrategy};
+use crate::spec::{RelocModel, TargetOptions, TlsModel};
 
 pub fn opts() -> TargetOptions {
     let mut pre_link_args = LinkArgs::new();
@@ -16,9 +17,9 @@ pub fn opts() -> TargetOptions {
         pre_link_args,
         panic_strategy: PanicStrategy::Abort,
         position_independent_executables: true,
-        relocation_model: "static".to_string(),
+        relocation_model: RelocModel::Static,
         target_family: None,
-        tls_model: "initial-exec".to_string(),
+        tls_model: TlsModel::InitialExec,
         ..Default::default()
     }
 }
index 4a900d1b02cbfc47050a02230305df1c0530a1f3..201d6a0fff93b071c4333cff83ccbed2e5960b3b 100644 (file)
@@ -1,4 +1,4 @@
-use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, RelroLevel, TargetOptions};
+use crate::spec::{LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, RelroLevel, TargetOptions};
 
 pub fn opts() -> TargetOptions {
     let mut pre_link_args = LinkArgs::new();
@@ -16,7 +16,7 @@ pub fn opts() -> TargetOptions {
         position_independent_executables: true,
         needs_plt: true,
         relro_level: RelroLevel::Full,
-        relocation_model: "static".to_string(),
+        relocation_model: RelocModel::Static,
         target_family: Some("unix".to_string()),
         pre_link_args,
 
index d904046331723ac1c419b8f100ded4cf3860f730..e853c07632f9043fb744750373580bca2e9e620c 100644 (file)
@@ -265,6 +265,82 @@ fn to_json(&self) -> Json {
     }
 }
 
+#[derive(Clone, Copy, PartialEq, Hash, Debug)]
+pub enum RelocModel {
+    Static,
+    Pic,
+    DynamicNoPic,
+    Ropi,
+    Rwpi,
+    RopiRwpi,
+}
+
+impl FromStr for RelocModel {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<RelocModel, ()> {
+        Ok(match s {
+            "static" => RelocModel::Static,
+            "pic" => RelocModel::Pic,
+            "dynamic-no-pic" => RelocModel::DynamicNoPic,
+            "ropi" => RelocModel::Ropi,
+            "rwpi" => RelocModel::Rwpi,
+            "ropi-rwpi" => RelocModel::RopiRwpi,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl ToJson for RelocModel {
+    fn to_json(&self) -> Json {
+        match *self {
+            RelocModel::Static => "static",
+            RelocModel::Pic => "pic",
+            RelocModel::DynamicNoPic => "dynamic-no-pic",
+            RelocModel::Ropi => "ropi",
+            RelocModel::Rwpi => "rwpi",
+            RelocModel::RopiRwpi => "ropi-rwpi",
+        }
+        .to_json()
+    }
+}
+
+#[derive(Clone, Copy, PartialEq, Hash, Debug)]
+pub enum TlsModel {
+    GeneralDynamic,
+    LocalDynamic,
+    InitialExec,
+    LocalExec,
+}
+
+impl FromStr for TlsModel {
+    type Err = ();
+
+    fn from_str(s: &str) -> Result<TlsModel, ()> {
+        Ok(match s {
+            // Note the difference "general" vs "global" difference. The model name is "general",
+            // but the user-facing option name is "global" for consistency with other compilers.
+            "global-dynamic" => TlsModel::GeneralDynamic,
+            "local-dynamic" => TlsModel::LocalDynamic,
+            "initial-exec" => TlsModel::InitialExec,
+            "local-exec" => TlsModel::LocalExec,
+            _ => return Err(()),
+        })
+    }
+}
+
+impl ToJson for TlsModel {
+    fn to_json(&self) -> Json {
+        match *self {
+            TlsModel::GeneralDynamic => "global-dynamic",
+            TlsModel::LocalDynamic => "local-dynamic",
+            TlsModel::InitialExec => "initial-exec",
+            TlsModel::LocalExec => "local-exec",
+        }
+        .to_json()
+    }
+}
+
 pub enum LoadTargetError {
     BuiltinTargetNotFound(String),
     Other(String),
@@ -614,13 +690,13 @@ pub struct TargetOptions {
     /// libraries. Defaults to false.
     pub executables: bool,
     /// Relocation model to use in object file. Corresponds to `llc
-    /// -relocation-model=$relocation_model`. Defaults to "pic".
-    pub relocation_model: String,
+    /// -relocation-model=$relocation_model`. Defaults to `Pic`.
+    pub relocation_model: RelocModel,
     /// Code model to use. Corresponds to `llc -code-model=$code_model`.
     pub code_model: Option<String>,
     /// TLS model to use. Options are "global-dynamic" (default), "local-dynamic", "initial-exec"
     /// and "local-exec". This is similar to the -ftls-model option in GCC/Clang.
-    pub tls_model: String,
+    pub tls_model: TlsModel,
     /// Do not emit code that uses the "red zone", if the ABI has one. Defaults to false.
     pub disable_redzone: bool,
     /// Eliminate frame pointers from stack frames if possible. Defaults to true.
@@ -821,9 +897,9 @@ fn default() -> TargetOptions {
             dynamic_linking: false,
             only_cdylib: false,
             executables: false,
-            relocation_model: "pic".to_string(),
+            relocation_model: RelocModel::Pic,
             code_model: None,
-            tls_model: "global-dynamic".to_string(),
+            tls_model: TlsModel::GeneralDynamic,
             disable_redzone: false,
             eliminate_frame_pointer: true,
             function_sections: true,
@@ -1008,6 +1084,30 @@ macro_rules! key {
                     Some(Ok(()))
                 })).unwrap_or(Ok(()))
             } );
+            ($key_name:ident, RelocModel) => ( {
+                let name = (stringify!($key_name)).replace("_", "-");
+                obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                    match s.parse::<RelocModel>() {
+                        Ok(relocation_model) => base.options.$key_name = relocation_model,
+                        _ => return Some(Err(format!("'{}' is not a valid relocation model. \
+                                                      Run `rustc --print relocation-models` to \
+                                                      see the list of supported values.", s))),
+                    }
+                    Some(Ok(()))
+                })).unwrap_or(Ok(()))
+            } );
+            ($key_name:ident, TlsModel) => ( {
+                let name = (stringify!($key_name)).replace("_", "-");
+                obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
+                    match s.parse::<TlsModel>() {
+                        Ok(tls_model) => base.options.$key_name = tls_model,
+                        _ => return Some(Err(format!("'{}' is not a valid TLS model. \
+                                                      Run `rustc --print tls-models` to \
+                                                      see the list of supported values.", s))),
+                    }
+                    Some(Ok(()))
+                })).unwrap_or(Ok(()))
+            } );
             ($key_name:ident, PanicStrategy) => ( {
                 let name = (stringify!($key_name)).replace("_", "-");
                 obj.find(&name[..]).and_then(|o| o.as_string().and_then(|s| {
@@ -1146,9 +1246,9 @@ macro_rules! key {
         key!(dynamic_linking, bool);
         key!(only_cdylib, bool);
         key!(executables, bool);
-        key!(relocation_model);
+        key!(relocation_model, RelocModel)?;
         key!(code_model, optional);
-        key!(tls_model);
+        key!(tls_model, TlsModel)?;
         key!(disable_redzone, bool);
         key!(eliminate_frame_pointer, bool);
         key!(function_sections, bool);
index 9a90ac7ccecea2a4044f82d9db9522de18dd599a..c6d0308f8f82feec5ef3022e3dab8b44a304cb12 100644 (file)
@@ -1,4 +1,4 @@
-use crate::spec::{LinkerFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -40,7 +40,7 @@ pub fn target() -> TargetResult {
 
             // Similarly, one almost always never wants to use relocatable
             // code because of the extra costs it involves.
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
 
             // Right now we invoke an external assembler and this isn't
             // compatible with multiple codegen units, and plus we probably
index a7020bc8f919e26775e06d3709562ee3b80dc152..aade1e708232e502f6105333fd3b1521bdc5563d 100644 (file)
@@ -1,4 +1,5 @@
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -21,7 +22,7 @@ pub fn target() -> TargetResult {
             features: String::new(),
             executables: true,
             panic_strategy: PanicStrategy::Abort,
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
             eliminate_frame_pointer: false,
index 6ec49410aebe22e40c1f2b91627f17a486f51767..e2990eeb826f72972ec8ab715231ecd1e11ee4e9 100644 (file)
@@ -1,4 +1,5 @@
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -21,7 +22,7 @@ pub fn target() -> TargetResult {
             features: "+m,+a,+c".to_string(),
             executables: true,
             panic_strategy: PanicStrategy::Abort,
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
             eliminate_frame_pointer: false,
index 70346347fb38f4ae317cfea5fc2e61a90927541e..55a4d58dfccca6083e89a5d7902959d6830c9e1f 100644 (file)
@@ -1,4 +1,5 @@
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -21,7 +22,7 @@ pub fn target() -> TargetResult {
             features: "+m,+c".to_string(),
             executables: true,
             panic_strategy: PanicStrategy::Abort,
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
             eliminate_frame_pointer: false,
index ca0f3d64d4a0302c53326de74c245ad579e3cc9f..9dbbcb1f4bd6e3bcb155e52035ac8e8a44d768b3 100644 (file)
@@ -1,4 +1,5 @@
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -21,7 +22,7 @@ pub fn target() -> TargetResult {
             features: "+m,+a,+f,+d,+c".to_string(),
             executables: true,
             panic_strategy: PanicStrategy::Abort,
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
             code_model: Some("medium".to_string()),
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
index 614403fe02af018e612457deda21342a60ebfd37..7e9390561a7007873c073f678de15e2ee6d8472e 100644 (file)
@@ -1,4 +1,5 @@
-use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, Target, TargetOptions, TargetResult};
+use crate::spec::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions, TargetResult};
 
 pub fn target() -> TargetResult {
     Ok(Target {
@@ -21,7 +22,7 @@ pub fn target() -> TargetResult {
             features: "+m,+a,+c".to_string(),
             executables: true,
             panic_strategy: PanicStrategy::Abort,
-            relocation_model: "static".to_string(),
+            relocation_model: RelocModel::Static,
             code_model: Some("medium".to_string()),
             emit_debug_gdb_scripts: false,
             abi_blacklist: super::riscv_base::abi_blacklist(),
index eca095b5942898298036c837b5e7dd369df56389..646a149a33621c2a752161681900cf6ff4b8abec 100644 (file)
@@ -27,7 +27,7 @@
 // differentiate these targets from our other `arm(v7)-*-*-gnueabi(hf)` targets in the context of
 // build scripts / gcc flags.
 
-use crate::spec::{PanicStrategy, TargetOptions};
+use crate::spec::{PanicStrategy, RelocModel, TargetOptions};
 
 pub fn opts() -> TargetOptions {
     // See rust-lang/rfcs#1645 for a discussion about these defaults
@@ -40,7 +40,7 @@ pub fn opts() -> TargetOptions {
         panic_strategy: PanicStrategy::Abort,
         // Similarly, one almost always never wants to use relocatable code because of the extra
         // costs it involves.
-        relocation_model: "static".to_string(),
+        relocation_model: RelocModel::Static,
         abi_blacklist: super::arm_base::abi_blacklist(),
         // When this section is added a volatile load to its start address is also generated. This
         // volatile load is a footgun as it can end up loading an invalid memory address, depending
index 47e80e8db19f66229ab5f99d0934390e841bd535..bb19b9d00e8bf5e235541665332e47296a9e7d14 100644 (file)
@@ -1,4 +1,4 @@
-use super::{LinkerFlavor, LldFlavor, PanicStrategy, TargetOptions};
+use super::{LinkerFlavor, LldFlavor, PanicStrategy, RelocModel, TargetOptions, TlsModel};
 use std::collections::BTreeMap;
 
 pub fn options() -> TargetOptions {
@@ -130,7 +130,7 @@ pub fn options() -> TargetOptions {
         // that eventually we can ship a `pic`-compatible standard library which
         // works with `static` as well (or works with some method of generating
         // non-relative calls and such later on).
-        relocation_model: "static".to_string(),
+        relocation_model: RelocModel::Static,
 
         // When the atomics feature is activated then these two keys matter,
         // otherwise they're basically ignored by the standard library. In this
@@ -138,7 +138,7 @@ pub fn options() -> TargetOptions {
         // `has_elf_tls`) and we need to get it to work by specifying
         // `local-exec` as that's all that's implemented in LLVM today for wasm.
         has_elf_tls: true,
-        tls_model: "local-exec".to_string(),
+        tls_model: TlsModel::LocalExec,
 
         // gdb scripts don't work on wasm blobs
         emit_debug_gdb_scripts: false,
index 8ff8f5734c9b06524e4a0d1a80bf0c6391e7267f..e208698e962f9d30eb0b230e47d73f74ad592dab 100644 (file)
@@ -418,7 +418,7 @@ fn constrain_opaque_type<FRR: FreeRegionRelations<'tcx>>(
             let opaque_type = tcx.mk_opaque(def_id, opaque_defn.substs);
 
             let required_region_bounds =
-                required_region_bounds(tcx, opaque_type, bounds.predicates);
+                required_region_bounds(tcx, opaque_type, bounds.predicates.into_iter());
             debug_assert!(!required_region_bounds.is_empty());
 
             for required_region in required_region_bounds {
@@ -1137,7 +1137,8 @@ fn fold_opaque_ty(
 
         debug!("instantiate_opaque_types: bounds={:?}", bounds);
 
-        let required_region_bounds = required_region_bounds(tcx, ty, bounds.predicates.clone());
+        let required_region_bounds =
+            required_region_bounds(tcx, ty, bounds.predicates.iter().cloned());
         debug!("instantiate_opaque_types: required_region_bounds={:?}", required_region_bounds);
 
         // Make sure that we are in fact defining the *entire* type
@@ -1259,17 +1260,15 @@ pub fn may_define_opaque_type(
 crate fn required_region_bounds(
     tcx: TyCtxt<'tcx>,
     erased_self_ty: Ty<'tcx>,
-    predicates: Vec<ty::Predicate<'tcx>>,
+    predicates: impl Iterator<Item = ty::Predicate<'tcx>>,
 ) -> Vec<ty::Region<'tcx>> {
-    debug!(
-        "required_region_bounds(erased_self_ty={:?}, predicates={:?})",
-        erased_self_ty, predicates
-    );
+    debug!("required_region_bounds(erased_self_ty={:?})", erased_self_ty);
 
     assert!(!erased_self_ty.has_escaping_bound_vars());
 
     traits::elaborate_predicates(tcx, predicates)
         .filter_map(|obligation| {
+            debug!("required_region_bounds(obligation={:?})", obligation);
             match obligation.predicate {
                 ty::Predicate::Projection(..)
                 | ty::Predicate::Trait(..)
index 052de4a4e5b555682ea13162fb964a15449cf12c..6326a87c5edc366014692dc5aeb4ab8f3254347f 100644 (file)
@@ -281,7 +281,7 @@ fn evaluate_predicates(
             },
         }));
 
-        let mut computed_preds: FxHashSet<_> = param_env.caller_bounds.iter().cloned().collect();
+        let computed_preds = param_env.caller_bounds.iter().cloned();
         let mut user_computed_preds: FxHashSet<_> =
             user_env.caller_bounds.iter().cloned().collect();
 
@@ -358,10 +358,11 @@ fn evaluate_predicates(
                 _ => panic!("Unexpected error for '{:?}': {:?}", ty, result),
             };
 
-            computed_preds.extend(user_computed_preds.iter().cloned());
-            let normalized_preds =
-                elaborate_predicates(tcx, computed_preds.iter().cloned().collect())
-                    .map(|o| o.predicate);
+            let normalized_preds = elaborate_predicates(
+                tcx,
+                computed_preds.clone().chain(user_computed_preds.iter().cloned()),
+            )
+            .map(|o| o.predicate);
             new_env =
                 ty::ParamEnv::new(tcx.mk_predicates(normalized_preds), param_env.reveal, None);
         }
@@ -739,7 +740,7 @@ fn evaluate_nested_obligations(
                             if p.ty().skip_binder().has_infer_types() {
                                 if !self.evaluate_nested_obligations(
                                     ty,
-                                    v.clone().iter().cloned(),
+                                    v.into_iter(),
                                     computed_preds,
                                     fresh_preds,
                                     predicates,
index fa9f1c9a7d97a8291ea1cd4c797960c236f0c13f..fa2af24c9453464b1aec30a9dbee0c3eba8a2a0f 100644 (file)
@@ -317,20 +317,30 @@ fn report_selection_error(
                                 .starts_with("std::convert::From<std::option::NoneError");
                         let should_convert_result_to_option = format!("{}", trait_ref)
                             .starts_with("<std::option::NoneError as std::convert::From<");
-                        if is_try && is_from && should_convert_option_to_result {
-                            err.span_suggestion_verbose(
-                                span.shrink_to_lo(),
-                                "consider converting the `Option<T>` into a `Result<T, _>` using `Option::ok_or` or `Option::ok_or_else`",
-                                ".ok_or_else(|| /* error value */)".to_string(),
-                                Applicability::HasPlaceholders,
-                            );
-                        } else if is_try && is_from && should_convert_result_to_option {
-                            err.span_suggestion_verbose(
-                                span.shrink_to_lo(),
-                                "consider converting the `Result<T, _>` into an `Option<T>` using `Result::ok`",
-                                ".ok()".to_string(),
-                                Applicability::MachineApplicable,
-                            );
+                        if is_try && is_from {
+                            if should_convert_option_to_result {
+                                err.span_suggestion_verbose(
+                                    span.shrink_to_lo(),
+                                    "consider converting the `Option<T>` into a `Result<T, _>` \
+                                     using `Option::ok_or` or `Option::ok_or_else`",
+                                    ".ok_or_else(|| /* error value */)".to_string(),
+                                    Applicability::HasPlaceholders,
+                                );
+                            } else if should_convert_result_to_option {
+                                err.span_suggestion_verbose(
+                                    span.shrink_to_lo(),
+                                    "consider converting the `Result<T, _>` into an `Option<T>` \
+                                     using `Result::ok`",
+                                    ".ok()".to_string(),
+                                    Applicability::MachineApplicable,
+                                );
+                            }
+                            if let Some(ret_span) = self.return_type_span(obligation) {
+                                err.span_label(
+                                    ret_span,
+                                    &format!("expected `{}` because of this", trait_ref.self_ty()),
+                                );
+                            }
                         }
 
                         let explanation =
@@ -1007,7 +1017,7 @@ fn error_implies(&self, cond: &ty::Predicate<'tcx>, error: &ty::Predicate<'tcx>)
             }
         };
 
-        for obligation in super::elaborate_predicates(self.tcx, vec![*cond]) {
+        for obligation in super::elaborate_predicates(self.tcx, std::iter::once(*cond)) {
             if let ty::Predicate::Trait(implication, _) = obligation.predicate {
                 let error = error.to_poly_trait_ref();
                 let implication = implication.to_poly_trait_ref();
@@ -1208,8 +1218,7 @@ fn find_similar_impl_candidates(
 
         match simp {
             Some(simp) => all_impls
-                .iter()
-                .filter_map(|&def_id| {
+                .filter_map(|def_id| {
                     let imp = self.tcx.impl_trait_ref(def_id).unwrap();
                     let imp_simp = fast_reject::simplify_type(self.tcx, imp.self_ty(), true);
                     if let Some(imp_simp) = imp_simp {
@@ -1217,13 +1226,10 @@ fn find_similar_impl_candidates(
                             return None;
                         }
                     }
-
                     Some(imp)
                 })
                 .collect(),
-            None => {
-                all_impls.iter().map(|&def_id| self.tcx.impl_trait_ref(def_id).unwrap()).collect()
-            }
+            None => all_impls.map(|def_id| self.tcx.impl_trait_ref(def_id).unwrap()).collect(),
         }
     }
 
index 19260f4d573ac446a42af6dacfe6c61a8560f266..5ec2d68ab2a7d52048b9ff211796181a9a694918 100644 (file)
@@ -84,6 +84,8 @@ fn suggest_semicolon_removal(
         trait_ref: &ty::Binder<ty::TraitRef<'tcx>>,
     );
 
+    fn return_type_span(&self, obligation: &PredicateObligation<'tcx>) -> Option<Span>;
+
     fn suggest_impl_trait(
         &self,
         err: &mut DiagnosticBuilder<'tcx>,
@@ -761,6 +763,17 @@ fn suggest_semicolon_removal(
         }
     }
 
+    fn return_type_span(&self, obligation: &PredicateObligation<'tcx>) -> Option<Span> {
+        let hir = self.tcx.hir();
+        let parent_node = hir.get_parent_node(obligation.cause.body_id);
+        let sig = match hir.find(parent_node) {
+            Some(hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn(sig, ..), .. })) => sig,
+            _ => return None,
+        };
+
+        if let hir::FnRetTy::Return(ret_ty) = sig.decl.output { Some(ret_ty.span) } else { None }
+    }
+
     /// If all conditions are met to identify a returned `dyn Trait`, suggest using `impl Trait` if
     /// applicable and signal that the error has been expanded appropriately and needs to be
     /// emitted.
@@ -1230,7 +1243,7 @@ fn maybe_note_obligation_cause_for_async_await(
         let tables: &TypeckTables<'tcx> = match &in_progress_tables {
             Some(t) if t.hir_owner.map(|owner| owner.to_def_id()) == Some(generator_did_root) => t,
             _ => {
-                query_tables = self.tcx.typeck_tables_of(generator_did);
+                query_tables = self.tcx.typeck_tables_of(generator_did.expect_local());
                 &query_tables
             }
         };
index f8fc155f582b82e6d7c0611f8bf50aef4f3eb6f2..c5dbe816295504c7d391b03b0c27ebe35d4fce50 100644 (file)
@@ -110,8 +110,8 @@ pub enum TraitQueryMode {
 pub fn predicates_for_generics<'tcx>(
     cause: ObligationCause<'tcx>,
     param_env: ty::ParamEnv<'tcx>,
-    generic_bounds: &ty::InstantiatedPredicates<'tcx>,
-) -> PredicateObligations<'tcx> {
+    generic_bounds: ty::InstantiatedPredicates<'tcx>,
+) -> impl Iterator<Item = PredicateObligation<'tcx>> {
     util::predicates_for_generics(cause, 0, param_env, generic_bounds)
 }
 
@@ -297,7 +297,7 @@ pub fn normalize_param_env_or_error<'tcx>(
     );
 
     let mut predicates: Vec<_> =
-        util::elaborate_predicates(tcx, unnormalized_env.caller_bounds.to_vec())
+        util::elaborate_predicates(tcx, unnormalized_env.caller_bounds.into_iter().cloned())
             .map(|obligation| obligation.predicate)
             .collect();
 
index d9fba1fd78392e69e11f41c2fc799729dd788311..96b2b904e65436fe26709ffc06e8c388da38b5ef 100644 (file)
@@ -302,7 +302,7 @@ fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
     // Search for a predicate like `Self : Sized` amongst the trait bounds.
     let predicates = tcx.predicates_of(def_id);
     let predicates = predicates.instantiate_identity(tcx).predicates;
-    elaborate_predicates(tcx, predicates).any(|obligation| match obligation.predicate {
+    elaborate_predicates(tcx, predicates.into_iter()).any(|obligation| match obligation.predicate {
         ty::Predicate::Trait(ref trait_pred, _) => {
             trait_pred.def_id() == sized_def_id && trait_pred.skip_binder().self_ty().is_param(0)
         }
index 4d02c5eb2301d3a44a9bc3391f2eca7f30cdbf3e..2b4a0409fd1e23a2e90f95d3e34f6ad318259e8e 100644 (file)
@@ -900,7 +900,7 @@ fn assemble_candidates_from_trait_def<'cx, 'tcx>(
     // If so, extract what we know from the trait and try to come up with a good answer.
     let trait_predicates = tcx.predicates_of(def_id);
     let bounds = trait_predicates.instantiate(tcx, substs);
-    let bounds = elaborate_predicates(tcx, bounds.predicates).map(|o| o.predicate);
+    let bounds = elaborate_predicates(tcx, bounds.predicates.into_iter()).map(|o| o.predicate);
     assemble_candidates_from_predicates(
         selcx,
         obligation,
@@ -911,16 +911,14 @@ fn assemble_candidates_from_trait_def<'cx, 'tcx>(
     )
 }
 
-fn assemble_candidates_from_predicates<'cx, 'tcx, I>(
+fn assemble_candidates_from_predicates<'cx, 'tcx>(
     selcx: &mut SelectionContext<'cx, 'tcx>,
     obligation: &ProjectionTyObligation<'tcx>,
     obligation_trait_ref: &ty::TraitRef<'tcx>,
     candidate_set: &mut ProjectionTyCandidateSet<'tcx>,
     ctor: fn(ty::PolyProjectionPredicate<'tcx>) -> ProjectionTyCandidate<'tcx>,
-    env_predicates: I,
-) where
-    I: IntoIterator<Item = ty::Predicate<'tcx>>,
-{
+    env_predicates: impl Iterator<Item = ty::Predicate<'tcx>>,
+) {
     debug!("assemble_candidates_from_predicates(obligation={:?})", obligation);
     let infcx = selcx.infcx();
     for predicate in env_predicates {
@@ -1153,10 +1151,8 @@ fn confirm_object_candidate<'cx, 'tcx>(
             object_ty
         ),
     };
-    let env_predicates = data
-        .projection_bounds()
-        .map(|p| p.with_self_ty(selcx.tcx(), object_ty).to_predicate())
-        .collect();
+    let env_predicates =
+        data.projection_bounds().map(|p| p.with_self_ty(selcx.tcx(), object_ty).to_predicate());
     let env_predicate = {
         let env_predicates = elaborate_predicates(selcx.tcx(), env_predicates);
 
index 45fda3004b09b42b77a79c1644cb394888d3568a..dfbb07424487d43a786ec1c62a117a8fb71cb62f 100644 (file)
@@ -1443,7 +1443,8 @@ fn match_projection_obligation_against_definition_bounds(
             bounds
         );
 
-        let elaborated_predicates = util::elaborate_predicates(self.tcx(), bounds.predicates);
+        let elaborated_predicates =
+            util::elaborate_predicates(self.tcx(), bounds.predicates.into_iter());
         let matching_bound = elaborated_predicates.filter_to_traits().find(|bound| {
             self.infcx.probe(|_| {
                 self.match_projection(
index beebddd72a82033f1314dddd4be727013e0f812b..897ac0d736e08fb1858b92d6339171f7f042a590 100644 (file)
@@ -189,26 +189,22 @@ fn fulfill_implication<'a, 'tcx>(
 
     let selcx = &mut SelectionContext::new(&infcx);
     let target_substs = infcx.fresh_substs_for_item(DUMMY_SP, target_impl);
-    let (target_trait_ref, mut obligations) =
+    let (target_trait_ref, obligations) =
         impl_trait_ref_and_oblig(selcx, param_env, target_impl, target_substs);
-    debug!(
-        "fulfill_implication: target_trait_ref={:?}, obligations={:?}",
-        target_trait_ref, obligations
-    );
 
     // do the impls unify? If not, no specialization.
-    match infcx.at(&ObligationCause::dummy(), param_env).eq(source_trait_ref, target_trait_ref) {
-        Ok(InferOk { obligations: o, .. }) => {
-            obligations.extend(o);
-        }
-        Err(_) => {
-            debug!(
-                "fulfill_implication: {:?} does not unify with {:?}",
-                source_trait_ref, target_trait_ref
-            );
-            return Err(());
-        }
-    }
+    let more_obligations =
+        match infcx.at(&ObligationCause::dummy(), param_env).eq(source_trait_ref, target_trait_ref)
+        {
+            Ok(InferOk { obligations, .. }) => obligations,
+            Err(_) => {
+                debug!(
+                    "fulfill_implication: {:?} does not unify with {:?}",
+                    source_trait_ref, target_trait_ref
+                );
+                return Err(());
+            }
+        };
 
     // attempt to prove all of the predicates for impl2 given those for impl1
     // (which are packed up in penv)
@@ -226,7 +222,7 @@ fn fulfill_implication<'a, 'tcx>(
         // we already make a mockery out of the region system, so
         // why not ignore them a bit earlier?
         let mut fulfill_cx = FulfillmentContext::new_ignoring_regions();
-        for oblig in obligations.into_iter() {
+        for oblig in obligations.chain(more_obligations) {
             fulfill_cx.register_predicate_obligation(&infcx, oblig);
         }
         match fulfill_cx.select_all_or_error(infcx) {
@@ -261,7 +257,7 @@ pub(super) fn specialization_graph_provider(
 ) -> &specialization_graph::Graph {
     let mut sg = specialization_graph::Graph::new();
 
-    let mut trait_impls = tcx.all_impls(trait_id);
+    let mut trait_impls: Vec<_> = tcx.all_impls(trait_id).collect();
 
     // The coherence checking implementation seems to rely on impls being
     // iterated over (roughly) in definition order, so we are sorting by
index ffece42ec306ce3e18d8cb177942b91d3aaa725c..4aceccf64ce65156351dacf01680099a14fe6047 100644 (file)
@@ -81,12 +81,10 @@ fn clone_and_push(&self, trait_ref: ty::PolyTraitRef<'tcx>, span: Span) -> Self
 
 pub fn expand_trait_aliases<'tcx>(
     tcx: TyCtxt<'tcx>,
-    trait_refs: impl IntoIterator<Item = (ty::PolyTraitRef<'tcx>, Span)>,
+    trait_refs: impl Iterator<Item = (ty::PolyTraitRef<'tcx>, Span)>,
 ) -> TraitAliasExpander<'tcx> {
-    let items: Vec<_> = trait_refs
-        .into_iter()
-        .map(|(trait_ref, span)| TraitAliasExpansionInfo::new(trait_ref, span))
-        .collect();
+    let items: Vec<_> =
+        trait_refs.map(|(trait_ref, span)| TraitAliasExpansionInfo::new(trait_ref, span)).collect();
     TraitAliasExpander { tcx, stack: items }
 }
 
@@ -199,7 +197,7 @@ pub fn impl_trait_ref_and_oblig<'a, 'tcx>(
     param_env: ty::ParamEnv<'tcx>,
     impl_def_id: DefId,
     impl_substs: SubstsRef<'tcx>,
-) -> (ty::TraitRef<'tcx>, Vec<PredicateObligation<'tcx>>) {
+) -> (ty::TraitRef<'tcx>, impl Iterator<Item = PredicateObligation<'tcx>>) {
     let impl_trait_ref = selcx.tcx().impl_trait_ref(impl_def_id).unwrap();
     let impl_trait_ref = impl_trait_ref.subst(selcx.tcx(), impl_substs);
     let Normalized { value: impl_trait_ref, obligations: normalization_obligations1 } =
@@ -210,13 +208,11 @@ pub fn impl_trait_ref_and_oblig<'a, 'tcx>(
     let Normalized { value: predicates, obligations: normalization_obligations2 } =
         super::normalize(selcx, param_env, ObligationCause::dummy(), &predicates);
     let impl_obligations =
-        predicates_for_generics(ObligationCause::dummy(), 0, param_env, &predicates);
+        predicates_for_generics(ObligationCause::dummy(), 0, param_env, predicates);
 
-    let impl_obligations: Vec<_> = impl_obligations
-        .into_iter()
-        .chain(normalization_obligations1)
-        .chain(normalization_obligations2)
-        .collect();
+    let impl_obligations = impl_obligations
+        .chain(normalization_obligations1.into_iter())
+        .chain(normalization_obligations2.into_iter());
 
     (impl_trait_ref, impl_obligations)
 }
@@ -226,20 +222,16 @@ pub fn predicates_for_generics<'tcx>(
     cause: ObligationCause<'tcx>,
     recursion_depth: usize,
     param_env: ty::ParamEnv<'tcx>,
-    generic_bounds: &ty::InstantiatedPredicates<'tcx>,
-) -> Vec<PredicateObligation<'tcx>> {
+    generic_bounds: ty::InstantiatedPredicates<'tcx>,
+) -> impl Iterator<Item = PredicateObligation<'tcx>> {
     debug!("predicates_for_generics(generic_bounds={:?})", generic_bounds);
 
-    generic_bounds
-        .predicates
-        .iter()
-        .map(|&predicate| Obligation {
-            cause: cause.clone(),
-            recursion_depth,
-            param_env,
-            predicate,
-        })
-        .collect()
+    generic_bounds.predicates.into_iter().map(move |predicate| Obligation {
+        cause: cause.clone(),
+        recursion_depth,
+        param_env,
+        predicate,
+    })
 }
 
 pub fn predicate_for_trait_ref<'tcx>(
index f6953971ef5bcbbc74e618caa43caedd597f5585..7eabdf706ef9f0941e0689cc9172ef7a7dba007c 100644 (file)
@@ -140,7 +140,7 @@ fn extend_cause_with_original_assoc_item_obligation<'tcx>(
     item: Option<&hir::Item<'tcx>>,
     cause: &mut traits::ObligationCause<'tcx>,
     pred: &ty::Predicate<'_>,
-    mut trait_assoc_items: impl Iterator<Item = ty::AssocItem>,
+    mut trait_assoc_items: impl Iterator<Item = &'tcx ty::AssocItem>,
 ) {
     debug!(
         "extended_cause_with_original_assoc_item_obligation {:?} {:?} {:?} {:?}",
@@ -232,35 +232,34 @@ fn compute_trait_ref(&mut self, trait_ref: &ty::TraitRef<'tcx>, elaborate: Elabo
 
         let item = self.item;
 
+        let extend = |obligation: traits::PredicateObligation<'tcx>| {
+            let mut cause = cause.clone();
+            if let Some(parent_trait_ref) = obligation.predicate.to_opt_poly_trait_ref() {
+                let derived_cause = traits::DerivedObligationCause {
+                    parent_trait_ref,
+                    parent_code: Rc::new(obligation.cause.code.clone()),
+                };
+                cause.code = traits::ObligationCauseCode::DerivedObligation(derived_cause);
+            }
+            extend_cause_with_original_assoc_item_obligation(
+                tcx,
+                trait_ref,
+                item,
+                &mut cause,
+                &obligation.predicate,
+                tcx.associated_items(trait_ref.def_id).in_definition_order(),
+            );
+            traits::Obligation::new(cause, param_env, obligation.predicate)
+        };
+
         if let Elaborate::All = elaborate {
-            let implied_obligations = traits::util::elaborate_obligations(tcx, obligations.clone());
-            let implied_obligations = implied_obligations.map(|obligation| {
-                debug!("compute_trait_ref implied_obligation {:?}", obligation);
-                debug!("compute_trait_ref implied_obligation cause {:?}", obligation.cause);
-                let mut cause = cause.clone();
-                if let Some(parent_trait_ref) = obligation.predicate.to_opt_poly_trait_ref() {
-                    let derived_cause = traits::DerivedObligationCause {
-                        parent_trait_ref,
-                        parent_code: Rc::new(obligation.cause.code.clone()),
-                    };
-                    cause.code = traits::ObligationCauseCode::DerivedObligation(derived_cause);
-                }
-                extend_cause_with_original_assoc_item_obligation(
-                    tcx,
-                    trait_ref,
-                    item,
-                    &mut cause,
-                    &obligation.predicate,
-                    tcx.associated_items(trait_ref.def_id).in_definition_order().copied(),
-                );
-                debug!("compute_trait_ref new cause {:?}", cause);
-                traits::Obligation::new(cause, param_env, obligation.predicate)
-            });
+            let implied_obligations = traits::util::elaborate_obligations(tcx, obligations);
+            let implied_obligations = implied_obligations.map(extend);
             self.out.extend(implied_obligations);
+        } else {
+            self.out.extend(obligations);
         }
 
-        self.out.extend(obligations);
-
         self.out.extend(trait_ref.substs.types().filter(|ty| !ty.has_escaping_bound_vars()).map(
             |ty| traits::Obligation::new(cause.clone(), param_env, ty::Predicate::WellFormed(ty)),
         ));
@@ -627,16 +626,13 @@ pub fn object_region_bounds<'tcx>(
     // a placeholder type.
     let open_ty = tcx.mk_ty_infer(ty::FreshTy(0));
 
-    let predicates = existential_predicates
-        .iter()
-        .filter_map(|predicate| {
-            if let ty::ExistentialPredicate::Projection(_) = *predicate.skip_binder() {
-                None
-            } else {
-                Some(predicate.with_self_ty(tcx, open_ty))
-            }
-        })
-        .collect();
+    let predicates = existential_predicates.iter().filter_map(|predicate| {
+        if let ty::ExistentialPredicate::Projection(_) = *predicate.skip_binder() {
+            None
+        } else {
+            Some(predicate.with_self_ty(tcx, open_ty))
+        }
+    });
 
     required_region_bounds(tcx, open_ty, predicates)
 }
index 8070ad1712025a6758bdb5285a099dd689eb28e2..3d665123f6767dd07b268b35fa5e2857ef3cf410 100644 (file)
@@ -211,12 +211,9 @@ fn coerce(&self, a: Ty<'tcx>, b: Ty<'tcx>) -> CoerceResult<'tcx> {
             ty::RawPtr(mt_b) => {
                 return self.coerce_unsafe_ptr(a, b, mt_b.mutbl);
             }
-
-            ty::Ref(r_b, ty, mutbl) => {
-                let mt_b = ty::TypeAndMut { ty, mutbl };
-                return self.coerce_borrowed_pointer(a, b, r_b, mt_b);
+            ty::Ref(r_b, _, mutbl_b) => {
+                return self.coerce_borrowed_pointer(a, b, r_b, mutbl_b);
             }
-
             _ => {}
         }
 
@@ -255,7 +252,7 @@ fn coerce_borrowed_pointer(
         a: Ty<'tcx>,
         b: Ty<'tcx>,
         r_b: ty::Region<'tcx>,
-        mt_b: TypeAndMut<'tcx>,
+        mutbl_b: hir::Mutability,
     ) -> CoerceResult<'tcx> {
         debug!("coerce_borrowed_pointer(a={:?}, b={:?})", a, b);
 
@@ -268,7 +265,7 @@ fn coerce_borrowed_pointer(
         let (r_a, mt_a) = match a.kind {
             ty::Ref(r_a, ty, mutbl) => {
                 let mt_a = ty::TypeAndMut { ty, mutbl };
-                coerce_mutbls(mt_a.mutbl, mt_b.mutbl)?;
+                coerce_mutbls(mt_a.mutbl, mutbl_b)?;
                 (r_a, mt_a)
             }
             _ => return self.unify_and(a, b, identity),
@@ -364,7 +361,7 @@ fn coerce_borrowed_pointer(
                 r_a // [3] above
             } else {
                 if r_borrow_var.is_none() {
-                    // create var lazilly, at most once
+                    // create var lazily, at most once
                     let coercion = Coercion(span);
                     let r = self.next_region_var(coercion);
                     r_borrow_var = Some(r); // [4] above
@@ -375,7 +372,7 @@ fn coerce_borrowed_pointer(
                 r,
                 TypeAndMut {
                     ty: referent_ty,
-                    mutbl: mt_b.mutbl, // [1] above
+                    mutbl: mutbl_b, // [1] above
                 },
             );
             match self.unify(derefd_ty_a, b) {
@@ -417,11 +414,11 @@ fn coerce_borrowed_pointer(
             // `self.x` both have `&mut `type would be a move of
             // `self.x`, but we auto-coerce it to `foo(&mut *self.x)`,
             // which is a borrow.
-            assert_eq!(mt_b.mutbl, hir::Mutability::Not); // can only coerce &T -> &U
+            assert_eq!(mutbl_b, hir::Mutability::Not); // can only coerce &T -> &U
             return success(vec![], ty, obligations);
         }
 
-        let needs = Needs::maybe_mut_place(mt_b.mutbl);
+        let needs = Needs::maybe_mut_place(mutbl_b);
         let InferOk { value: mut adjustments, obligations: o } =
             autoderef.adjust_steps_as_infer_ok(self, needs);
         obligations.extend(o);
@@ -433,7 +430,7 @@ fn coerce_borrowed_pointer(
             ty::Ref(r_borrow, _, _) => r_borrow,
             _ => span_bug!(span, "expected a ref type, got {:?}", ty),
         };
-        let mutbl = match mt_b.mutbl {
+        let mutbl = match mutbl_b {
             hir::Mutability::Not => AutoBorrowMutability::Not,
             hir::Mutability::Mut => {
                 AutoBorrowMutability::Mut { allow_two_phase_borrow: self.allow_two_phase }
index c75283e419a6d5da928552e1c75a46afbcecfaa1..aa36bec6e1e8813f5d543f108f0c59d5bbfeb4ca 100644 (file)
@@ -767,7 +767,16 @@ pub fn check_for_cast(
                     suggest_to_change_suffix_or_into(err, is_fallible);
                     true
                 }
-                (&ty::Int(_), &ty::Uint(_)) | (&ty::Uint(_), &ty::Int(_)) => {
+                (&ty::Int(exp), &ty::Uint(found)) => {
+                    let is_fallible = match (exp.bit_width(), found.bit_width()) {
+                        (Some(exp), Some(found)) if found < exp => false,
+                        (None, Some(8)) => false,
+                        _ => true,
+                    };
+                    suggest_to_change_suffix_or_into(err, is_fallible);
+                    true
+                }
+                (&ty::Uint(_), &ty::Int(_)) => {
                     suggest_to_change_suffix_or_into(err, true);
                     true
                 }
index 23c7954d088786e1183cab6d1acc01150520adef..64dc34ab3b0a7d0bec9a238e60b594a5b74ed2fc 100644 (file)
@@ -114,7 +114,7 @@ fn confirm(
         // a custom error in that case.
         if illegal_sized_bound.is_none() {
             let method_ty = self.tcx.mk_fn_ptr(ty::Binder::bind(method_sig));
-            self.add_obligations(method_ty, all_substs, &method_predicates);
+            self.add_obligations(method_ty, all_substs, method_predicates);
         }
 
         // Create the final `MethodCallee`.
@@ -394,7 +394,7 @@ fn add_obligations(
         &mut self,
         fty: Ty<'tcx>,
         all_substs: SubstsRef<'tcx>,
-        method_predicates: &ty::InstantiatedPredicates<'tcx>,
+        method_predicates: ty::InstantiatedPredicates<'tcx>,
     ) {
         debug!(
             "add_obligations: fty={:?} all_substs={:?} method_predicates={:?}",
@@ -571,7 +571,7 @@ fn predicates_require_illegal_sized_bound(
             None => return None,
         };
 
-        traits::elaborate_predicates(self.tcx, predicates.predicates.clone())
+        traits::elaborate_predicates(self.tcx, predicates.predicates.iter().copied())
             .filter_map(|obligation| match obligation.predicate {
                 ty::Predicate::Trait(trait_pred, _) if trait_pred.def_id() == sized_def_id => {
                     let span = predicates
index 90a9f8a4d6f7705d938d4a86a1efdfaad3d02f58..ae2061a2e3f3c96520bfb4406b5987d3dde39779 100644 (file)
@@ -390,7 +390,7 @@ pub fn lookup_method_in_trait(
         assert!(!bounds.has_escaping_bound_vars());
 
         let cause = traits::ObligationCause::misc(span, self.body_id);
-        obligations.extend(traits::predicates_for_generics(cause.clone(), self.param_env, &bounds));
+        obligations.extend(traits::predicates_for_generics(cause.clone(), self.param_env, bounds));
 
         // Also add an obligation for the method type being well-formed.
         let method_ty = tcx.mk_fn_ptr(ty::Binder::bind(fn_sig));
index 3f159fe5e302967faa0416af54cd198e3b4f84db..03e32c21a54ac846b2dd1d4ddf68a29a39898681 100644 (file)
@@ -1342,7 +1342,7 @@ fn consider_probe(
             // clauses) that must be considered. Make sure that those
             // match as well (or at least may match, sometimes we
             // don't have enough information to fully evaluate).
-            let candidate_obligations: Vec<_> = match probe.kind {
+            match probe.kind {
                 InherentImplCandidate(ref substs, ref ref_obligations) => {
                     // Check whether the impl imposes obligations we have to worry about.
                     let impl_def_id = probe.item.container.id();
@@ -1353,19 +1353,23 @@ fn consider_probe(
 
                     // Convert the bounds into obligations.
                     let impl_obligations =
-                        traits::predicates_for_generics(cause, self.param_env, &impl_bounds);
+                        traits::predicates_for_generics(cause, self.param_env, impl_bounds);
 
-                    debug!("impl_obligations={:?}", impl_obligations);
-                    impl_obligations
-                        .into_iter()
+                    let candidate_obligations = impl_obligations
                         .chain(norm_obligations.into_iter())
-                        .chain(ref_obligations.iter().cloned())
-                        .collect()
+                        .chain(ref_obligations.iter().cloned());
+                    // Evaluate those obligations to see if they might possibly hold.
+                    for o in candidate_obligations {
+                        let o = self.resolve_vars_if_possible(&o);
+                        if !self.predicate_may_hold(&o) {
+                            result = ProbeResult::NoMatch;
+                            possibly_unsatisfied_predicates.push((o.predicate, None));
+                        }
+                    }
                 }
 
                 ObjectCandidate | WhereClauseCandidate(..) => {
                     // These have no additional conditions to check.
-                    vec![]
                 }
 
                 TraitCandidate(trait_ref) => {
@@ -1412,17 +1416,11 @@ fn consider_probe(
                             return ProbeResult::NoMatch;
                         }
                     }
-                    vec![]
                 }
-            };
-
-            debug!(
-                "consider_probe - candidate_obligations={:?} sub_obligations={:?}",
-                candidate_obligations, sub_obligations
-            );
+            }
 
             // Evaluate those obligations to see if they might possibly hold.
-            for o in candidate_obligations.into_iter().chain(sub_obligations) {
+            for o in sub_obligations {
                 let o = self.resolve_vars_if_possible(&o);
                 if !self.predicate_may_hold(&o) {
                     result = ProbeResult::NoMatch;
index d631d3c33405ec8f420f68d928b357411fe1c935..5877c6d269ad65d30198c34f12fe191d597fb0c9 100644 (file)
@@ -754,16 +754,16 @@ fn typeck_item_bodies(tcx: TyCtxt<'_>, crate_num: CrateNum) {
     });
 }
 
-fn check_item_well_formed(tcx: TyCtxt<'_>, def_id: DefId) {
-    wfcheck::check_item_well_formed(tcx, def_id.expect_local());
+fn check_item_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) {
+    wfcheck::check_item_well_formed(tcx, def_id);
 }
 
-fn check_trait_item_well_formed(tcx: TyCtxt<'_>, def_id: DefId) {
-    wfcheck::check_trait_item(tcx, def_id.expect_local());
+fn check_trait_item_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) {
+    wfcheck::check_trait_item(tcx, def_id);
 }
 
-fn check_impl_item_well_formed(tcx: TyCtxt<'_>, def_id: DefId) {
-    wfcheck::check_impl_item(tcx, def_id.expect_local());
+fn check_impl_item_well_formed(tcx: TyCtxt<'_>, def_id: LocalDefId) {
+    wfcheck::check_impl_item(tcx, def_id);
 }
 
 pub fn provide(providers: &mut Providers<'_>) {
@@ -853,7 +853,7 @@ fn has_typeck_tables(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
     }
 }
 
-fn used_trait_imports(tcx: TyCtxt<'_>, def_id: DefId) -> &DefIdSet {
+fn used_trait_imports(tcx: TyCtxt<'_>, def_id: LocalDefId) -> &DefIdSet {
     &*tcx.typeck_tables_of(def_id).used_trait_imports
 }
 
@@ -968,8 +968,8 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
     val.fold_with(&mut FixupFolder { tcx })
 }
 
-fn typeck_tables_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &ty::TypeckTables<'tcx> {
-    let fallback = move || tcx.type_of(def_id);
+fn typeck_tables_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &ty::TypeckTables<'tcx> {
+    let fallback = move || tcx.type_of(def_id.to_def_id());
     typeck_tables_of_with_fallback(tcx, def_id, fallback)
 }
 
@@ -977,11 +977,10 @@ fn typeck_tables_of<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId) -> &ty::TypeckTables
 /// Currently only used for type inference of `static`s and `const`s to avoid type cycle errors.
 fn diagnostic_only_typeck_tables_of<'tcx>(
     tcx: TyCtxt<'tcx>,
-    def_id: DefId,
+    def_id: LocalDefId,
 ) -> &ty::TypeckTables<'tcx> {
-    assert!(def_id.is_local());
     let fallback = move || {
-        let span = tcx.hir().span(tcx.hir().as_local_hir_id(def_id.expect_local()));
+        let span = tcx.hir().span(tcx.hir().as_local_hir_id(def_id));
         tcx.sess.delay_span_bug(span, "diagnostic only typeck table used");
         tcx.types.err
     };
@@ -990,17 +989,17 @@ fn diagnostic_only_typeck_tables_of<'tcx>(
 
 fn typeck_tables_of_with_fallback<'tcx>(
     tcx: TyCtxt<'tcx>,
-    def_id: DefId,
+    def_id: LocalDefId,
     fallback: impl Fn() -> Ty<'tcx> + 'tcx,
 ) -> &'tcx ty::TypeckTables<'tcx> {
     // Closures' tables come from their outermost function,
     // as they are part of the same "inference environment".
-    let outer_def_id = tcx.closure_base_def_id(def_id);
+    let outer_def_id = tcx.closure_base_def_id(def_id.to_def_id()).expect_local();
     if outer_def_id != def_id {
         return tcx.typeck_tables_of(outer_def_id);
     }
 
-    let id = tcx.hir().as_local_hir_id(def_id.expect_local());
+    let id = tcx.hir().as_local_hir_id(def_id);
     let span = tcx.hir().span(id);
 
     // Figure out what primary body this item has.
@@ -1009,7 +1008,7 @@ fn typeck_tables_of_with_fallback<'tcx>(
     });
     let body = tcx.hir().body(body_id);
 
-    let tables = Inherited::build(tcx, def_id.expect_local()).enter(|inh| {
+    let tables = Inherited::build(tcx, def_id).enter(|inh| {
         let param_env = tcx.param_env(def_id);
         let fcx = if let (Some(header), Some(decl)) = (fn_header, fn_decl) {
             let fn_sig = if crate::collect::get_infer_ret_ty(&decl.output).is_some() {
@@ -1029,7 +1028,7 @@ fn typeck_tables_of_with_fallback<'tcx>(
             check_abi(tcx, span, fn_sig.abi());
 
             // Compute the fty from point of view of inside the fn.
-            let fn_sig = tcx.liberate_late_bound_regions(def_id, &fn_sig);
+            let fn_sig = tcx.liberate_late_bound_regions(def_id.to_def_id(), &fn_sig);
             let fn_sig = inh.normalize_associated_types_in(
                 body.value.span,
                 body_id.hir_id,
@@ -1121,7 +1120,7 @@ fn typeck_tables_of_with_fallback<'tcx>(
         // because they don't constrain other type variables.
         fcx.closure_analyze(body);
         assert!(fcx.deferred_call_resolutions.borrow().is_empty());
-        fcx.resolve_generator_interiors(def_id);
+        fcx.resolve_generator_interiors(def_id.to_def_id());
 
         for (ty, span, code) in fcx.deferred_sized_obligations.borrow_mut().drain(..) {
             let ty = fcx.normalize_ty(span, ty);
@@ -1452,7 +1451,7 @@ fn check_fn<'a, 'tcx>(
     // Check that the main return type implements the termination trait.
     if let Some(term_id) = tcx.lang_items().termination() {
         if let Some((def_id, EntryFnType::Main)) = tcx.entry_fn(LOCAL_CRATE) {
-            let main_id = hir.as_local_hir_id(def_id.expect_local());
+            let main_id = hir.as_local_hir_id(def_id);
             if main_id == fn_id {
                 let substs = tcx.mk_substs_trait(declared_ret_ty, &[]);
                 let trait_ref = ty::TraitRef::new(term_id, substs);
@@ -3460,7 +3459,7 @@ pub fn add_wf_bounds(&self, substs: SubstsRef<'tcx>, expr: &hir::Expr<'_>) {
     pub fn add_obligations_for_parameters(
         &self,
         cause: traits::ObligationCause<'tcx>,
-        predicates: &ty::InstantiatedPredicates<'tcx>,
+        predicates: ty::InstantiatedPredicates<'tcx>,
     ) {
         assert!(!predicates.has_escaping_bound_vars());
 
@@ -4411,7 +4410,7 @@ pub fn check_struct_path(
             let (bounds, _) = self.instantiate_bounds(path_span, did, substs);
             let cause =
                 traits::ObligationCause::new(path_span, self.body_id, traits::ItemObligation(did));
-            self.add_obligations_for_parameters(cause, &bounds);
+            self.add_obligations_for_parameters(cause, bounds);
 
             Some((variant, ty))
         } else {
@@ -5681,9 +5680,8 @@ fn add_required_obligations(&self, span: Span, def_id: DefId, substs: &SubstsRef
         for (i, mut obligation) in traits::predicates_for_generics(
             traits::ObligationCause::new(span, self.body_id, traits::ItemObligation(def_id)),
             self.param_env,
-            &bounds,
+            bounds,
         )
-        .into_iter()
         .enumerate()
         {
             // This makes the error point at the bound, but we want to point at the argument
index 58c8d56b55838883c19bcc23fe4d2e4ca10c4474..53d6ec96bd251be7a43341d0348634e029447031 100644 (file)
@@ -77,7 +77,7 @@
 use crate::mem_categorization as mc;
 use crate::middle::region;
 use rustc_hir as hir;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
 use rustc_hir::PatKind;
 use rustc_infer::infer::outlives::env::OutlivesEnvironment;
@@ -109,7 +109,7 @@ macro_rules! ignore_err {
 
 impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
     pub fn regionck_expr(&self, body: &'tcx hir::Body<'tcx>) {
-        let subject = self.tcx.hir().body_owner_def_id(body.id()).to_def_id();
+        let subject = self.tcx.hir().body_owner_def_id(body.id());
         let id = body.value.hir_id;
         let mut rcx =
             RegionCtxt::new(self, RepeatingScope(id), id, Subject(subject), self.param_env);
@@ -135,7 +135,7 @@ pub fn regionck_item(&self, item_id: hir::HirId, span: Span, wf_tys: &[Ty<'tcx>]
             self,
             RepeatingScope(item_id),
             item_id,
-            Subject(subject.to_def_id()),
+            Subject(subject),
             self.param_env,
         );
         rcx.outlives_environment.add_implied_bounds(self, wf_tys, item_id, span);
@@ -154,7 +154,7 @@ pub fn regionck_item(&self, item_id: hir::HirId, span: Span, wf_tys: &[Ty<'tcx>]
     /// constraints to add.
     pub fn regionck_fn(&self, fn_id: hir::HirId, body: &'tcx hir::Body<'tcx>) {
         debug!("regionck_fn(id={})", fn_id);
-        let subject = self.tcx.hir().body_owner_def_id(body.id()).to_def_id();
+        let subject = self.tcx.hir().body_owner_def_id(body.id());
         let hir_id = body.value.hir_id;
         let mut rcx =
             RegionCtxt::new(self, RepeatingScope(hir_id), hir_id, Subject(subject), self.param_env);
@@ -180,7 +180,7 @@ pub struct RegionCtxt<'a, 'tcx> {
 
     // id of innermost fn body id
     body_id: hir::HirId,
-    body_owner: DefId,
+    body_owner: LocalDefId,
 
     // call_site scope of innermost fn
     call_site_scope: Option<region::Scope>,
@@ -189,7 +189,7 @@ pub struct RegionCtxt<'a, 'tcx> {
     repeating_scope: hir::HirId,
 
     // id of AST node being analyzed (the subject of the analysis).
-    subject_def_id: DefId,
+    subject_def_id: LocalDefId,
 }
 
 impl<'a, 'tcx> Deref for RegionCtxt<'a, 'tcx> {
@@ -200,7 +200,7 @@ fn deref(&self) -> &Self::Target {
 }
 
 pub struct RepeatingScope(hir::HirId);
-pub struct Subject(DefId);
+pub struct Subject(LocalDefId);
 
 impl<'a, 'tcx> RegionCtxt<'a, 'tcx> {
     pub fn new(
@@ -290,7 +290,7 @@ fn visit_fn_body(
 
         let body_id = body.id();
         self.body_id = body_id.hir_id;
-        self.body_owner = self.tcx.hir().body_owner_def_id(body_id).to_def_id();
+        self.body_owner = self.tcx.hir().body_owner_def_id(body_id);
 
         let call_site =
             region::Scope { id: body.value.hir_id.local_id, data: region::ScopeData::CallSite };
@@ -353,7 +353,7 @@ fn resolve_regions_and_report_errors(&self, mode: RegionckMode) {
         );
 
         self.fcx.resolve_regions_and_report_errors(
-            self.subject_def_id,
+            self.subject_def_id.to_def_id(),
             &self.region_scope_tree,
             &self.outlives_environment,
             mode,
index 3ff79a6b5de6c921b6b9f8c036b28061f489cee4..55802c140bc9f3207a323d7ca6e65c5f18f8faa4 100644 (file)
@@ -146,8 +146,8 @@ fn analyze_closure(
             }
         }
 
-        let body_owner_def_id = self.tcx.hir().body_owner_def_id(body.id()).to_def_id();
-        assert_eq!(body_owner_def_id, closure_def_id);
+        let body_owner_def_id = self.tcx.hir().body_owner_def_id(body.id());
+        assert_eq!(body_owner_def_id.to_def_id(), closure_def_id);
         let mut delegate = InferBorrowKind {
             fcx: self,
             closure_def_id,
index ffe1dcbd444039c6702ac13a991c63e2d8ce34f4..7eb8bf7c6be97803a89daffbd07b1263444cffb0 100644 (file)
@@ -1233,7 +1233,7 @@ fn check_false_global_bounds(fcx: &FnCtxt<'_, '_>, span: Span, id: hir::HirId) {
     let empty_env = ty::ParamEnv::empty();
 
     let def_id = fcx.tcx.hir().local_def_id(id);
-    let predicates = fcx.tcx.predicates_of(def_id).predicates.iter().map(|(p, _)| *p).collect();
+    let predicates = fcx.tcx.predicates_of(def_id).predicates.iter().map(|(p, _)| *p);
     // Check elaborated bounds.
     let implied_obligations = traits::elaborate_predicates(fcx.tcx, predicates);
 
index da93462fe2681330bb20f973f73967966b9adcc4..ce1538bfa49c351298832a67f9a6906f4069914e 100644 (file)
@@ -12,7 +12,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
     let mut used_trait_imports = DefIdSet::default();
     for &body_id in tcx.hir().krate().bodies.keys() {
         let item_def_id = tcx.hir().body_owner_def_id(body_id);
-        let imports = tcx.used_trait_imports(item_def_id.to_def_id());
+        let imports = tcx.used_trait_imports(item_def_id);
         debug!("GatherVisitor: item_def_id={:?} with imports {:#?}", item_def_id, imports);
         used_trait_imports.extend(imports.iter());
     }
index a831beb2be253089a22d4b95d118262dd32d0c69..9f70a0fbc246274c3e008ba9245cc07afa921a39 100644 (file)
@@ -295,7 +295,7 @@ fn default_constness_for_trait_bounds(&self) -> hir::Constness {
     }
 
     fn get_type_parameter_bounds(&self, span: Span, def_id: DefId) -> ty::GenericPredicates<'tcx> {
-        self.tcx.at(span).type_param_predicates((self.item_def_id, def_id))
+        self.tcx.at(span).type_param_predicates((self.item_def_id, def_id.expect_local()))
     }
 
     fn re_infer(&self, _: Option<&ty::GenericParamDef>, _: Span) -> Option<ty::Region<'tcx>> {
@@ -478,7 +478,7 @@ fn get_new_lifetime_name<'tcx>(
 /// `X: Foo` where `X` is the type parameter `def_id`.
 fn type_param_predicates(
     tcx: TyCtxt<'_>,
-    (item_def_id, def_id): (DefId, DefId),
+    (item_def_id, def_id): (DefId, LocalDefId),
 ) -> ty::GenericPredicates<'_> {
     use rustc_hir::*;
 
@@ -486,11 +486,11 @@ fn type_param_predicates(
     // written inline like `<T: Foo>` or in a where-clause like
     // `where T: Foo`.
 
-    let param_id = tcx.hir().as_local_hir_id(def_id.expect_local());
+    let param_id = tcx.hir().as_local_hir_id(def_id);
     let param_owner = tcx.hir().ty_param_owner(param_id);
     let param_owner_def_id = tcx.hir().local_def_id(param_owner);
     let generics = tcx.generics_of(param_owner_def_id);
-    let index = generics.param_def_id_to_index[&def_id];
+    let index = generics.param_def_id_to_index[&def_id.to_def_id()];
     let ty = tcx.mk_ty_param(index, tcx.hir().ty_param_name(param_id));
 
     // Don't look for bounds where the type parameter isn't in scope.
@@ -503,7 +503,7 @@ fn type_param_predicates(
     let mut result = parent
         .map(|parent| {
             let icx = ItemCtxt::new(tcx, parent);
-            icx.get_type_parameter_bounds(DUMMY_SP, def_id)
+            icx.get_type_parameter_bounds(DUMMY_SP, def_id.to_def_id())
         })
         .unwrap_or_default();
     let mut extend = None;
@@ -1459,9 +1459,10 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
     use rustc_hir::Node::*;
     use rustc_hir::*;
 
-    let hir_id = tcx.hir().as_local_hir_id(def_id.expect_local());
+    let def_id = def_id.expect_local();
+    let hir_id = tcx.hir().as_local_hir_id(def_id);
 
-    let icx = ItemCtxt::new(tcx, def_id);
+    let icx = ItemCtxt::new(tcx, def_id.to_def_id());
 
     match tcx.hir().get(hir_id) {
         TraitItem(hir::TraitItem {
@@ -1516,7 +1517,7 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
             ..
         }) => {
             let abi = tcx.hir().get_foreign_abi(hir_id);
-            compute_sig_of_foreign_fn_decl(tcx, def_id, fn_decl, abi, ident)
+            compute_sig_of_foreign_fn_decl(tcx, def_id.to_def_id(), fn_decl, abi, ident)
         }
 
         Ctor(data) | Variant(hir::Variant { data, .. }) if data.ctor_hir_id().is_some() => {
index 5903adc94cb1bc99faf63e619cf3e9f336680b05..cf0e3f9cdf592008c8b1ee69b1ec1f2bd72a43db 100644 (file)
@@ -34,7 +34,13 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
             TraitItemKind::Const(ref ty, body_id) => body_id
                 .and_then(|body_id| {
                     if is_suggestable_infer_ty(ty) {
-                        Some(infer_placeholder_type(tcx, def_id, body_id, ty.span, item.ident))
+                        Some(infer_placeholder_type(
+                            tcx,
+                            def_id.expect_local(),
+                            body_id,
+                            ty.span,
+                            item.ident,
+                        ))
                     } else {
                         None
                     }
@@ -53,7 +59,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
             }
             ImplItemKind::Const(ref ty, body_id) => {
                 if is_suggestable_infer_ty(ty) {
-                    infer_placeholder_type(tcx, def_id, body_id, ty.span, item.ident)
+                    infer_placeholder_type(tcx, def_id.expect_local(), body_id, ty.span, item.ident)
                 } else {
                     icx.to_ty(ty)
                 }
@@ -78,7 +84,13 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
             match item.kind {
                 ItemKind::Static(ref ty, .., body_id) | ItemKind::Const(ref ty, body_id) => {
                     if is_suggestable_infer_ty(ty) {
-                        infer_placeholder_type(tcx, def_id, body_id, ty.span, item.ident)
+                        infer_placeholder_type(
+                            tcx,
+                            def_id.expect_local(),
+                            body_id,
+                            ty.span,
+                            item.ident,
+                        )
                     } else {
                         icx.to_ty(ty)
                     }
@@ -102,13 +114,13 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
                 ItemKind::OpaqueTy(OpaqueTy { impl_trait_fn: Some(owner), origin, .. }) => {
                     let concrete_types = match origin {
                         OpaqueTyOrigin::FnReturn | OpaqueTyOrigin::AsyncFn => {
-                            &tcx.mir_borrowck(owner).concrete_opaque_types
+                            &tcx.mir_borrowck(owner.expect_local()).concrete_opaque_types
                         }
                         OpaqueTyOrigin::Misc => {
                             // We shouldn't leak borrowck results through impl trait in bindings.
                             // For example, we shouldn't be able to tell if `x` in
                             // `let x: impl Sized + 'a = &()` has type `&'static ()` or `&'a ()`.
-                            &tcx.typeck_tables_of(owner).concrete_opaque_types
+                            &tcx.typeck_tables_of(owner.expect_local()).concrete_opaque_types
                         }
                         OpaqueTyOrigin::TypeAlias => {
                             span_bug!(item.span, "Type alias impl trait shouldn't have an owner")
@@ -126,7 +138,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
                                 ),
                             );
                             if let Some(ErrorReported) =
-                                tcx.typeck_tables_of(owner).tainted_by_errors
+                                tcx.typeck_tables_of(owner.expect_local()).tainted_by_errors
                             {
                                 // Some error in the
                                 // owner fn prevented us from populating
@@ -405,7 +417,7 @@ struct ConstraintLocator<'tcx> {
     }
 
     impl ConstraintLocator<'_> {
-        fn check(&mut self, def_id: DefId) {
+        fn check(&mut self, def_id: LocalDefId) {
             // Don't try to check items that cannot possibly constrain the type.
             if !self.tcx.has_typeck_tables(def_id) {
                 debug!(
@@ -512,24 +524,24 @@ fn nested_visit_map(&mut self) -> intravisit::NestedVisitorMap<Self::Map> {
         fn visit_expr(&mut self, ex: &'tcx Expr<'tcx>) {
             if let hir::ExprKind::Closure(..) = ex.kind {
                 let def_id = self.tcx.hir().local_def_id(ex.hir_id);
-                self.check(def_id.to_def_id());
+                self.check(def_id);
             }
             intravisit::walk_expr(self, ex);
         }
         fn visit_item(&mut self, it: &'tcx Item<'tcx>) {
             debug!("find_existential_constraints: visiting {:?}", it);
-            let def_id = self.tcx.hir().local_def_id(it.hir_id).to_def_id();
+            let def_id = self.tcx.hir().local_def_id(it.hir_id);
             // The opaque type itself or its children are not within its reveal scope.
-            if def_id != self.def_id {
+            if def_id.to_def_id() != self.def_id {
                 self.check(def_id);
                 intravisit::walk_item(self, it);
             }
         }
         fn visit_impl_item(&mut self, it: &'tcx ImplItem<'tcx>) {
             debug!("find_existential_constraints: visiting {:?}", it);
-            let def_id = self.tcx.hir().local_def_id(it.hir_id).to_def_id();
+            let def_id = self.tcx.hir().local_def_id(it.hir_id);
             // The opaque type itself or its children are not within its reveal scope.
-            if def_id != self.def_id {
+            if def_id.to_def_id() != self.def_id {
                 self.check(def_id);
                 intravisit::walk_impl_item(self, it);
             }
@@ -537,7 +549,7 @@ fn visit_impl_item(&mut self, it: &'tcx ImplItem<'tcx>) {
         fn visit_trait_item(&mut self, it: &'tcx TraitItem<'tcx>) {
             debug!("find_existential_constraints: visiting {:?}", it);
             let def_id = self.tcx.hir().local_def_id(it.hir_id);
-            self.check(def_id.to_def_id());
+            self.check(def_id);
             intravisit::walk_trait_item(self, it);
         }
     }
@@ -586,7 +598,7 @@ fn visit_trait_item(&mut self, it: &'tcx TraitItem<'tcx>) {
 
 fn infer_placeholder_type(
     tcx: TyCtxt<'_>,
-    def_id: DefId,
+    def_id: LocalDefId,
     body_id: hir::BodyId,
     span: Span,
     item_ident: Ident,
index 2244a89f12963ad47bd826e4924ba923f5d850f3..cdebd63b5942fe78749b4c66d19cd060b2636541 100644 (file)
@@ -9,7 +9,7 @@
 
 use rustc_hir as hir;
 use rustc_hir::def::Res;
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
 use rustc_hir::PatKind;
 use rustc_infer::infer::InferCtxt;
 use rustc_middle::ty::{self, adjustment, TyCtxt};
@@ -84,7 +84,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
     pub fn new(
         delegate: &'a mut (dyn Delegate<'tcx> + 'a),
         infcx: &'a InferCtxt<'a, 'tcx>,
-        body_owner: DefId,
+        body_owner: LocalDefId,
         param_env: ty::ParamEnv<'tcx>,
         tables: &'a ty::TypeckTables<'tcx>,
     ) -> Self {
index c7ef07bde30cf9c8ad1ea68e0997d56f8856672a..8b12535b3a2cf2c57873f29a9319bca9c35ae26b 100644 (file)
@@ -329,7 +329,7 @@ fn check_predicates<'tcx>(
     // which is sound because we forbid impls like the following
     //
     // impl<D: Debug> AlwaysApplicable for D { }
-    let always_applicable_traits: Vec<_> = impl1_predicates
+    let always_applicable_traits = impl1_predicates
         .predicates
         .iter()
         .filter(|predicate| {
@@ -338,8 +338,7 @@ fn check_predicates<'tcx>(
                 Some(TraitSpecializationKind::AlwaysApplicable)
             )
         })
-        .copied()
-        .collect();
+        .copied();
 
     // Include the well-formed predicates of the type parameters of the impl.
     for ty in tcx.impl_trait_ref(impl1_def_id).unwrap().substs.types() {
index 7ca81e5d6b6c6569dd8a12bb15d15d3e34192e2f..8d8a1b4d9676169c67d4c6dfc77b131a6fb65b1e 100644 (file)
@@ -303,8 +303,8 @@ fn check_start_fn_ty(tcx: TyCtxt<'_>, start_def_id: LocalDefId) {
 
 fn check_for_entry_fn(tcx: TyCtxt<'_>) {
     match tcx.entry_fn(LOCAL_CRATE) {
-        Some((def_id, EntryFnType::Main)) => check_main_fn_ty(tcx, def_id.expect_local()),
-        Some((def_id, EntryFnType::Start)) => check_start_fn_ty(tcx, def_id.expect_local()),
+        Some((def_id, EntryFnType::Main)) => check_main_fn_ty(tcx, def_id),
+        Some((def_id, EntryFnType::Start)) => check_start_fn_ty(tcx, def_id),
         _ => {}
     }
 }
index cd1aad267add468ad6fd27b1ccf683c7553b719e..f6edb6b754534f1a4f5bb35a6941ebf508ceaf30 100644 (file)
@@ -55,7 +55,7 @@
 use rustc_data_structures::fx::FxIndexMap;
 use rustc_hir as hir;
 use rustc_hir::def::{DefKind, Res};
-use rustc_hir::def_id::DefId;
+use rustc_hir::def_id::LocalDefId;
 use rustc_hir::PatKind;
 use rustc_infer::infer::InferCtxt;
 use rustc_span::Span;
@@ -140,7 +140,7 @@ fn span(&self) -> Span {
     crate tables: &'a ty::TypeckTables<'tcx>,
     infcx: &'a InferCtxt<'a, 'tcx>,
     param_env: ty::ParamEnv<'tcx>,
-    body_owner: DefId,
+    body_owner: LocalDefId,
     upvars: Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>>,
 }
 
@@ -151,7 +151,7 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
     crate fn new(
         infcx: &'a InferCtxt<'a, 'tcx>,
         param_env: ty::ParamEnv<'tcx>,
-        body_owner: DefId,
+        body_owner: LocalDefId,
         tables: &'a ty::TypeckTables<'tcx>,
     ) -> MemCategorizationContext<'a, 'tcx> {
         MemCategorizationContext {
@@ -473,7 +473,7 @@ fn cat_upvar(
 
         let upvar_id = ty::UpvarId {
             var_path: ty::UpvarPath { hir_id: var_id },
-            closure_expr_id: closure_expr_def_id.expect_local(),
+            closure_expr_id: closure_expr_def_id,
         };
         let var_ty = self.node_ty(var_id)?;
 
index 119bdfcb0f4425807b6a2d529ac989ae2ddc7de9..f4c164a324e32e387bd157dbc6f2f78993e7d348 100644 (file)
@@ -659,6 +659,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.inner.read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.inner.is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -674,6 +679,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.inner.write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.inner.is_write_vectored()
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         self.inner.flush()
     }
@@ -694,6 +704,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.inner.read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.inner.is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -709,6 +724,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.inner.write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.inner.is_write_vectored()
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         self.inner.flush()
     }
index 16ca539b3c178e0177f2f7899696916920db9b8a..046b1a68880248577058f819601a6f34e541cd08 100644 (file)
@@ -292,6 +292,10 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         Ok(nread)
     }
 
+    fn is_read_vectored(&self) -> bool {
+        self.inner.is_read_vectored()
+    }
+
     // we can't skip unconditionally because of the large buffer case in read.
     unsafe fn initializer(&self) -> Initializer {
         self.inner.initializer()
@@ -680,6 +684,10 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         }
     }
 
+    fn is_write_vectored(&self) -> bool {
+        self.get_ref().is_write_vectored()
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         self.flush_buf().and_then(|()| self.get_mut().flush())
     }
index f36aa1846a16c172333b1397ed01204fbeaa890b..f3e3fc81a5d8249d029ed65d82de764bdeddf2dd 100644 (file)
@@ -266,6 +266,10 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         Ok(nread)
     }
 
+    fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> {
         let n = buf.len();
         Read::read_exact(&mut self.fill_buf()?, buf)?;
@@ -372,6 +376,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         slice_write_vectored(&mut self.pos, self.inner, bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     #[inline]
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
@@ -388,6 +397,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         vec_write_vectored(&mut self.pos, self.inner, bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     #[inline]
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
@@ -404,6 +418,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         vec_write_vectored(&mut self.pos, &mut self.inner, bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     #[inline]
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
@@ -422,6 +441,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         slice_write_vectored(&mut self.pos, &mut self.inner, bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     #[inline]
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
index b7f82e652990d993b27dd6d5c977856884e09bd5..01dff0b3eb3909c25b05057e84089a43ca763699 100644 (file)
@@ -20,6 +20,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         (**self).read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        (**self).is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         (**self).initializer()
@@ -52,6 +57,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         (**self).write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        (**self).is_write_vectored()
+    }
+
     #[inline]
     fn flush(&mut self) -> io::Result<()> {
         (**self).flush()
@@ -109,6 +119,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         (**self).read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        (**self).is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         (**self).initializer()
@@ -141,6 +156,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         (**self).write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        (**self).is_write_vectored()
+    }
+
     #[inline]
     fn flush(&mut self) -> io::Result<()> {
         (**self).flush()
@@ -240,6 +260,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         Ok(nread)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -316,6 +341,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         Ok(nwritten)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     #[inline]
     fn write_all(&mut self, data: &[u8]) -> io::Result<()> {
         if self.write(data)? == data.len() {
@@ -351,6 +381,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         Ok(len)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     #[inline]
     fn write_all(&mut self, buf: &[u8]) -> io::Result<()> {
         self.extend_from_slice(buf);
index 5ab88260d6ac1888fd3d9657da14094d60d2342a..36c6aa620d5790b5de5391fb15afdb60ea2a91fd 100644 (file)
 //! [`Read::read`]: trait.Read.html#tymethod.read
 //! [`Result`]: ../result/enum.Result.html
 //! [`.unwrap()`]: ../result/enum.Result.html#method.unwrap
+// ignore-tidy-filelength
 
 #![stable(feature = "rust1", since = "1.0.0")]
 
@@ -570,8 +571,9 @@ pub trait Read {
     /// Like `read`, except that it reads into a slice of buffers.
     ///
     /// Data is copied to fill each buffer in order, with the final buffer
-    /// written to possibly being only partially filled. This method must behave
-    /// as a single call to `read` with the buffers concatenated would.
+    /// written to possibly being only partially filled. This method must
+    /// behave equivalently to a single call to `read` with concatenated
+    /// buffers.
     ///
     /// The default implementation calls `read` with either the first nonempty
     /// buffer provided, or an empty one if none exists.
@@ -580,6 +582,19 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize> {
         default_read_vectored(|b| self.read(b), bufs)
     }
 
+    /// Determines if this `Read`er has an efficient `read_vectored`
+    /// implementation.
+    ///
+    /// If a `Read`er does not override the default `read_vectored`
+    /// implementation, code using it may want to avoid the method all together
+    /// and coalesce writes into a single buffer for higher performance.
+    ///
+    /// The default implementation returns `false`.
+    #[unstable(feature = "can_vector", issue = "69941")]
+    fn is_read_vectored(&self) -> bool {
+        false
+    }
+
     /// Determines if this `Read`er can work with buffers of uninitialized
     /// memory.
     ///
@@ -1304,6 +1319,19 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result<usize> {
         default_write_vectored(|b| self.write(b), bufs)
     }
 
+    /// Determines if this `Write`er has an efficient `write_vectored`
+    /// implementation.
+    ///
+    /// If a `Write`er does not override the default `write_vectored`
+    /// implementation, code using it may want to avoid the method all together
+    /// and coalesce writes into a single buffer for higher performance.
+    ///
+    /// The default implementation returns `false`.
+    #[unstable(feature = "can_vector", issue = "69941")]
+    fn is_write_vectored(&self) -> bool {
+        false
+    }
+
     /// Flush this output stream, ensuring that all intermediately buffered
     /// contents reach their destination.
     ///
index a064c552c84f5e6a6203ecf9f29cca38c5fbd814..b65b150d2c3a18ef41bf55d91b36abbce3dd5dac 100644 (file)
@@ -87,6 +87,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -101,6 +106,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         self.0.flush()
     }
@@ -114,6 +124,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         self.0.flush()
     }
@@ -140,6 +155,14 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         }
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        match self {
+            Maybe::Real(w) => w.is_write_vectored(),
+            Maybe::Fake => true,
+        }
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         match *self {
             Maybe::Real(ref mut w) => handle_ebadf(w.flush(), ()),
@@ -162,6 +185,14 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
             Maybe::Fake => Ok(0),
         }
     }
+
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        match self {
+            Maybe::Real(w) => w.is_read_vectored(),
+            Maybe::Fake => true,
+        }
+    }
 }
 
 fn handle_ebadf<T>(r: io::Result<T>, default: T) -> io::Result<T> {
@@ -352,6 +383,10 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.lock().read_vectored(bufs)
     }
     #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.lock().is_read_vectored()
+    }
+    #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
     }
@@ -376,6 +411,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.inner.read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.inner.is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -543,6 +583,10 @@ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
     fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.lock().write_vectored(bufs)
     }
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.lock().is_write_vectored()
+    }
     fn flush(&mut self) -> io::Result<()> {
         self.lock().flush()
     }
@@ -561,6 +605,10 @@ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
     fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.inner.borrow_mut().write_vectored(bufs)
     }
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.inner.borrow_mut().is_write_vectored()
+    }
     fn flush(&mut self) -> io::Result<()> {
         self.inner.borrow_mut().flush()
     }
@@ -709,6 +757,10 @@ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
     fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.lock().write_vectored(bufs)
     }
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.lock().is_write_vectored()
+    }
     fn flush(&mut self) -> io::Result<()> {
         self.lock().flush()
     }
@@ -727,6 +779,10 @@ fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
     fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.inner.borrow_mut().write_vectored(bufs)
     }
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.inner.borrow_mut().is_write_vectored()
+    }
     fn flush(&mut self) -> io::Result<()> {
         self.inner.borrow_mut().flush()
     }
index b09161b97aa5e8d2cd67fc7ef8da53e100146bae..b9d5dc27db0063d80bde763d74e51400f361e6e0 100644 (file)
@@ -179,6 +179,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         Ok(nwritten)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -235,6 +240,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         Ok(total_len)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     #[inline]
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
index 5fd15bb8fe4f3f67102b669bfea27a1624f3867c..ac07af5e278fbe902425aeaab38e12799cebf8bb 100644 (file)
 #![feature(box_syntax)]
 #![feature(c_variadic)]
 #![feature(cfg_accessible)]
+#![feature(can_vector)]
 #![feature(cfg_target_has_atomic)]
 #![feature(cfg_target_thread_local)]
 #![feature(char_error_internals)]
index 5023d69240893914e028376824eba017173d0e2b..9ac54dd5f7a65e328092e72bf1aae22438310125 100644 (file)
@@ -576,6 +576,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -591,6 +596,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
     }
@@ -605,6 +615,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -620,6 +635,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
     }
index 3eee45d000cd10ea6ac1237833606fcb2ad3e302..b457d190b951066d429b92cafbd1b6b0564de0a4 100644 (file)
@@ -245,6 +245,10 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.inner.write_vectored(bufs)
     }
 
+    fn is_write_vectored(&self) -> bool {
+        self.inner.is_write_vectored()
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
     }
@@ -300,6 +304,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.inner.read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.inner.is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -356,6 +365,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.inner.read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.inner.is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
index 26b4faebd861420957431d3c117ee90eedd53336..9f7c1af8951991500723eafd6e6ed16b27d1134c 100644 (file)
@@ -329,7 +329,7 @@ pub fn drop_port(&self) {
             );
             cnt != DISCONNECTED && cnt != steals
         } {
-            while let Some(_) = self.queue.pop() {
+            while self.queue.pop().is_some() {
                 steals += 1;
             }
         }
index e6160d1457d269176ba95e96409b6eda799d4bb7..ecb5b51cccdcd965d85e9ee8e22ecb878d876719 100644 (file)
@@ -202,6 +202,10 @@ pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -210,6 +214,10 @@ pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         match self.0 {}
     }
index 67c436fa7955d5c623fbecd69e23df0d35e28a20..375aaab405dff13b9de4ae81c4d104b622182647 100644 (file)
@@ -47,6 +47,10 @@ pub fn read_vectored(&self, _: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -55,6 +59,10 @@ pub fn write_vectored(&self, _: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn peer_addr(&self) -> io::Result<SocketAddr> {
         match self.0 {}
     }
index fb14dc591018116ea405550f4697f60378b2d7e8..10d0925823eb94660278ce2390c892c093d7e3c6 100644 (file)
@@ -12,6 +12,10 @@ pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -20,6 +24,10 @@ pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn diverge(&self) -> ! {
         match self.0 {}
     }
index 287a039066780839b1cb0baee3c8ed624aa964cc..82ccab1462ba868bc3a9315bcac5a0716ca2830e 100644 (file)
@@ -301,6 +301,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         crate::io::default_read_vectored(|buf| self.read(buf), bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        false
+    }
+
     pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         self.0.write(buf)
     }
@@ -309,6 +314,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         crate::io::default_write_vectored(|buf| self.write(buf), bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        false
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         Ok(())
     }
index 377c3132c5a32b1476f554af0be335692eb56211..5b5379c8b0581fe334096dd77a2940c55f5634df 100644 (file)
@@ -99,6 +99,11 @@ pub fn read_vectored(&self, ioslice: &mut [IoSliceMut<'_>]) -> io::Result<usize>
         Ok(size)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     pub fn write(&self, buffer: &[u8]) -> io::Result<usize> {
         self.write_vectored(&[IoSlice::new(buffer)])
     }
@@ -114,6 +119,11 @@ pub fn write_vectored(&self, ioslice: &[IoSlice<'_>]) -> io::Result<usize> {
         Ok(size)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn peer_addr(&self) -> io::Result<SocketAddr> {
         Err(io::Error::new(ErrorKind::Other, "peer_addr isn't supported"))
     }
index fb14dc591018116ea405550f4697f60378b2d7e8..10d0925823eb94660278ce2390c892c093d7e3c6 100644 (file)
@@ -12,6 +12,10 @@ pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -20,6 +24,10 @@ pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn diverge(&self) -> ! {
         match self.0 {}
     }
index 2eb011ccb3974d311597fe83228b441d6d6ca919..208265de465adf3a1b81120c1eabe0f7f599a159 100644 (file)
@@ -20,6 +20,11 @@ pub fn read_vectored(&self, _data: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         //    .read(data)
         Ok(0)
     }
+
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        true
+    }
 }
 
 impl Stdout {
@@ -51,6 +56,11 @@ pub fn write_vectored(&self, data: &[IoSlice<'_>]) -> io::Result<usize> {
         }
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         Ok(())
     }
@@ -85,6 +95,11 @@ pub fn write_vectored(&self, data: &[IoSlice<'_>]) -> io::Result<usize> {
         }
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         Ok(())
     }
index 7da2424a6426195437b0ef48c1a3b5dfbf5f875b..90158030c7fbe19c8a6c00f8d2e367fb8bc6fa45 100644 (file)
@@ -34,6 +34,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         usercalls::read(self.fd, bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         usercalls::write(self.fd, &[IoSlice::new(buf)])
     }
@@ -42,6 +47,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         usercalls::write(self.fd, bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         usercalls::flush(self.fd)
     }
index e6160d1457d269176ba95e96409b6eda799d4bb7..ecb5b51cccdcd965d85e9ee8e22ecb878d876719 100644 (file)
@@ -202,6 +202,10 @@ pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -210,6 +214,10 @@ pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         match self.0 {}
     }
index bd0652ab4649a3b093834fb26ad153e4db676f61..666a157b09cd0e88ebaf79709bbc0b5a164d015e 100644 (file)
@@ -149,6 +149,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.inner.inner.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.inner.inner.is_read_vectored()
+    }
+
     pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         self.inner.inner.write(buf)
     }
@@ -157,6 +162,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.inner.inner.write_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.inner.inner.is_write_vectored()
+    }
+
     pub fn peer_addr(&self) -> io::Result<SocketAddr> {
         addr_to_sockaddr(&self.peer_addr)
     }
index fb14dc591018116ea405550f4697f60378b2d7e8..10d0925823eb94660278ce2390c892c093d7e3c6 100644 (file)
@@ -12,6 +12,10 @@ pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -20,6 +24,10 @@ pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn diverge(&self) -> ! {
         match self.0 {}
     }
index 4c3cb67c9ee0f795eff34a31f57acc960966cf72..bfdc39ada75ebaf99d78f34d75c85ca6a2e1c906 100644 (file)
@@ -613,6 +613,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         io::Read::read_vectored(&mut &*self, bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        io::Read::is_read_vectored(&&*self)
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -629,6 +634,11 @@ fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     #[inline]
     unsafe fn initializer(&self) -> Initializer {
         Initializer::nop()
@@ -645,6 +655,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         io::Write::write_vectored(&mut &*self, bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        io::Write::is_write_vectored(&&*self)
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         io::Write::flush(&mut &*self)
     }
@@ -660,6 +675,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
     }
index 1bba56e334a2e86c8245cf376a548ad3b5d45d5e..1ef7ffacfcf1413d2143ceea2477cbe0b44c9bda 100644 (file)
@@ -64,6 +64,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         Ok(ret as usize)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
         let mut me = self;
         (&mut me).read_to_end(buf)
@@ -116,6 +121,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         Ok(ret as usize)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
         #[cfg(target_os = "android")]
         use super::android::cvt_pwrite64;
index a233aa47dff5807d777d2319c849f7ee7eabc850..2cfc63d94922daea14b0894edbf848192eb84ca2 100644 (file)
@@ -828,6 +828,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
         self.0.read_at(buf, offset)
     }
@@ -840,6 +845,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
         self.0.write_at(buf, offset)
     }
index c6e4f5693ed5af4ac48eaec26ed367b46debd76c..a2912387108e136ebdac33134937e9a95d6ff444 100644 (file)
@@ -55,6 +55,10 @@ pub fn read_vectored(&self, _: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
             unimpl!();
         }
 
+        pub fn is_read_vectored(&self) -> bool {
+            unimpl!();
+        }
+
         pub fn peek(&self, _: &mut [u8]) -> io::Result<usize> {
             unimpl!();
         }
@@ -75,6 +79,10 @@ pub fn write_vectored(&self, _: &[IoSlice<'_>]) -> io::Result<usize> {
             unimpl!();
         }
 
+        pub fn is_write_vectored(&self) -> bool {
+            unimpl!();
+        }
+
         pub fn set_timeout(&self, _: Option<Duration>, _: libc::c_int) -> io::Result<()> {
             unimpl!();
         }
@@ -171,6 +179,10 @@ pub fn read_vectored(&self, _: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
             unimpl!();
         }
 
+        pub fn is_read_vectored(&self) -> bool {
+            unimpl!();
+        }
+
         pub fn write(&self, _: &[u8]) -> io::Result<usize> {
             unimpl!();
         }
@@ -179,6 +191,10 @@ pub fn write_vectored(&self, _: &[IoSlice<'_>]) -> io::Result<usize> {
             unimpl!();
         }
 
+        pub fn is_write_vectored(&self) -> bool {
+            unimpl!();
+        }
+
         pub fn peer_addr(&self) -> io::Result<SocketAddr> {
             unimpl!();
         }
index d18c22b0573f375b9515eff8bbea4d3a77f70ee7..f062bc012f7ef2c14c1e6900cb2da04bcaf7ba81 100644 (file)
@@ -226,6 +226,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     fn recv_from_with_flags(
         &self,
         buf: &mut [u8],
@@ -263,6 +268,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     pub fn set_timeout(&self, dur: Option<Duration>, kind: libc::c_int) -> io::Result<()> {
         let timeout = match dur {
             Some(dur) => {
index 2a861c878015e254098339a8802dad3e1dc73473..f2a2eabef9132509db4c864a40ba769b0974fb0f 100644 (file)
@@ -64,6 +64,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         self.0.write(buf)
     }
@@ -72,6 +77,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     pub fn fd(&self) -> &FileDesc {
         &self.0
     }
index b9c56963885c0d6bd38f2360e4680bdb7442bff4..f8353214cbca037fa635f342bf6e700a0aabf8e1 100644 (file)
@@ -20,6 +20,11 @@ fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
     fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         ManuallyDrop::new(FileDesc::new(libc::STDIN_FILENO)).read_vectored(bufs)
     }
+
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        true
+    }
 }
 
 impl Stdout {
@@ -37,6 +42,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         ManuallyDrop::new(FileDesc::new(libc::STDOUT_FILENO)).write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
     }
@@ -57,6 +67,11 @@ fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         ManuallyDrop::new(FileDesc::new(libc::STDERR_FILENO)).write_vectored(bufs)
     }
 
+    #[inline]
+    fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     fn flush(&mut self) -> io::Result<()> {
         Ok(())
     }
index 65c67dabc1ad0075cc5befe58bcbbfedb8cc63b5..23e9dc428ce2366999c52a3b6855f8799c8c4adb 100644 (file)
@@ -54,6 +54,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         Ok(ret as usize)
     }
 
+    #[inline]
+    fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
         let mut me = self;
         (&mut me).read_to_end(buf)
@@ -99,6 +104,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         Ok(ret as usize)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
         unsafe fn cvt_pwrite(
             fd: c_int,
index 68f2c133170244431a6ed4368f425073d4ff98d7..557e65ca01b1cca63e92b556335042e81ed5acee 100644 (file)
@@ -351,6 +351,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
         self.0.read_at(buf, offset)
     }
@@ -363,6 +368,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
         self.0.write_at(buf, offset)
     }
index 7d4e5624f7e395bc5a8e22d737c7d3b13510928b..de0b15b43a2e2dd12918bfd0c978469df3a75e11 100644 (file)
@@ -163,6 +163,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     fn recv_from_with_flags(
         &self,
         buf: &mut [u8],
@@ -200,6 +205,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     pub fn set_timeout(&self, dur: Option<Duration>, kind: libc::c_int) -> io::Result<()> {
         let timeout = match dur {
             Some(dur) => {
index 0990cb8e83cf8c9798fe9dc2d035583b3670d377..a18376212af51a32e8044194fa39892aced42b1d 100644 (file)
@@ -24,10 +24,16 @@ impl AnonPipe {
     pub fn read(&self, buf: &mut [u8]) -> io::Result<usize> {
         self.0.read(buf)
     }
+
     pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.0.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.0.is_read_vectored()
+    }
+
     pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         self.0.write(buf)
     }
@@ -36,6 +42,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.0.write_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.0.is_write_vectored()
+    }
+
     pub fn fd(&self) -> &FileDesc {
         &self.0
     }
index a11f61fdd69fde3545567766c1993f7ae7a52bb1..793daea43c215baf07149e2157d73781a7102634 100644 (file)
@@ -399,6 +399,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.fd.read(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         self.write_vectored(&[IoSlice::new(buf)])
     }
@@ -407,6 +412,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.fd.write(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         Ok(())
     }
index 8a69028ff1dcf42e2bb01b399fb0ec5da36cb3ff..e186453588de5762af42ba6bdcd5c47a8f3870ce 100644 (file)
@@ -48,6 +48,10 @@ pub fn read_vectored(&self, _: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         unsupported()
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     pub fn write(&self, _: &[u8]) -> io::Result<usize> {
         unsupported()
     }
@@ -56,6 +60,10 @@ pub fn write_vectored(&self, _: &[IoSlice<'_>]) -> io::Result<usize> {
         unsupported()
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn peer_addr(&self) -> io::Result<SocketAddr> {
         unsupported()
     }
index fb14dc591018116ea405550f4697f60378b2d7e8..10d0925823eb94660278ce2390c892c093d7e3c6 100644 (file)
@@ -12,6 +12,10 @@ pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -20,6 +24,10 @@ pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn diverge(&self) -> ! {
         match self.0 {}
     }
index 1d53884f2d6b40a6779718ea4c0387777c90b6b5..9f9e35566ecf59bcbc46291a6deed0558f09740b 100644 (file)
@@ -19,6 +19,11 @@ pub fn read_vectored(&self, data: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         ManuallyDrop::new(unsafe { WasiFd::from_raw(self.as_raw_fd()) }).read(data)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     pub fn as_raw_fd(&self) -> u32 {
         0
     }
@@ -37,6 +42,11 @@ pub fn write_vectored(&self, data: &[IoSlice<'_>]) -> io::Result<usize> {
         ManuallyDrop::new(unsafe { WasiFd::from_raw(self.as_raw_fd()) }).write(data)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         Ok(())
     }
@@ -59,6 +69,11 @@ pub fn write_vectored(&self, data: &[IoSlice<'_>]) -> io::Result<usize> {
         ManuallyDrop::new(unsafe { WasiFd::from_raw(self.as_raw_fd()) }).write(data)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         Ok(())
     }
index e6160d1457d269176ba95e96409b6eda799d4bb7..ecb5b51cccdcd965d85e9ee8e22ecb878d876719 100644 (file)
@@ -202,6 +202,10 @@ pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -210,6 +214,10 @@ pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn flush(&self) -> io::Result<()> {
         match self.0 {}
     }
index b7c3108f172f608c743b79e5c64390791b3d471d..5c9f1098f9b7f0e8422840ffcce0a91d5ae1223b 100644 (file)
@@ -44,6 +44,10 @@ pub fn read_vectored(&self, _: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -52,6 +56,10 @@ pub fn write_vectored(&self, _: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn peer_addr(&self) -> io::Result<SocketAddr> {
         match self.0 {}
     }
index fb14dc591018116ea405550f4697f60378b2d7e8..10d0925823eb94660278ce2390c892c093d7e3c6 100644 (file)
@@ -12,6 +12,10 @@ pub fn read_vectored(&self, _bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_read_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn write(&self, _buf: &[u8]) -> io::Result<usize> {
         match self.0 {}
     }
@@ -20,6 +24,10 @@ pub fn write_vectored(&self, _bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         match self.0 {}
     }
 
+    pub fn is_write_vectored(&self) -> bool {
+        match self.0 {}
+    }
+
     pub fn diverge(&self) -> ! {
         match self.0 {}
     }
index 427f4b684e14ae9ca4630c50f2261ae694bfd98b..cdbfac267b9a1ac60722998f49df00165116f88b 100644 (file)
@@ -409,6 +409,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.handle.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.handle.is_read_vectored()
+    }
+
     pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
         self.handle.read_at(buf, offset)
     }
@@ -421,6 +426,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.handle.write_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.handle.is_write_vectored()
+    }
+
     pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
         self.handle.write_at(buf, offset)
     }
index d00381792e351dfe185f54adad843c6c0bc53ec7..2131cfc2c94bccba1458215e7b4d5c8ba7c03b14 100644 (file)
@@ -92,6 +92,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         crate::io::default_read_vectored(|buf| self.read(buf), bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        false
+    }
+
     pub fn read_at(&self, buf: &mut [u8], offset: u64) -> io::Result<usize> {
         let mut read = 0;
         let len = cmp::min(buf.len(), <c::DWORD>::max_value() as usize) as c::DWORD;
@@ -171,6 +176,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         crate::io::default_write_vectored(|buf| self.write(buf), bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        false
+    }
+
     pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
         let mut written = 0;
         let len = cmp::min(buf.len(), <c::DWORD>::max_value() as usize) as c::DWORD;
index d8d4fdfce2fe4c9a7a49367e8024d304ba2e41a8..a15ded92f08c4a463510774d8ced2ce43c7820a8 100644 (file)
@@ -266,6 +266,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         }
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        true
+    }
+
     pub fn peek(&self, buf: &mut [u8]) -> io::Result<usize> {
         self.recv_with_flags(buf, c::MSG_PEEK)
     }
@@ -324,6 +329,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         Ok(nwritten as usize)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        true
+    }
+
     pub fn set_timeout(&self, dur: Option<Duration>, kind: c_int) -> io::Result<()> {
         let timeout = match dur {
             Some(dur) => {
index 992e634dea510f6e852d40fbddd6003c4a35c34e..104a8db46596e17c3067983b8b0ebab04f98ea78 100644 (file)
@@ -182,6 +182,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.inner.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.inner.is_read_vectored()
+    }
+
     pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         self.inner.write(buf)
     }
@@ -189,6 +194,11 @@ pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
     pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.inner.write_vectored(bufs)
     }
+
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.inner.is_write_vectored()
+    }
 }
 
 pub fn read2(p1: AnonPipe, v1: &mut Vec<u8>, p2: AnonPipe, v2: &mut Vec<u8>) -> io::Result<()> {
index cdd3d2edf1fa1c5cd769a204ef5bc3f3fe40ef03..a9b6079de7564e612d3b0efa88bdb04a9f0b9c5c 100644 (file)
@@ -265,6 +265,11 @@ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
         self.inner.read_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_read_vectored(&self) -> bool {
+        self.inner.is_read_vectored()
+    }
+
     pub fn write(&self, buf: &[u8]) -> io::Result<usize> {
         let len = cmp::min(buf.len(), <wrlen_t>::max_value() as usize) as wrlen_t;
         let ret = cvt(unsafe {
@@ -277,6 +282,11 @@ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
         self.inner.write_vectored(bufs)
     }
 
+    #[inline]
+    pub fn is_write_vectored(&self) -> bool {
+        self.inner.is_write_vectored()
+    }
+
     pub fn peer_addr(&self) -> io::Result<SocketAddr> {
         sockname(|buf, len| unsafe { c::getpeername(*self.inner.as_inner(), buf, len) })
     }
index b221c17b422f5de36f3361534f19975683e78f55..e31dd77d8afdc3eeb77925f030c3a7dd44ee63ee 100644 (file)
@@ -346,8 +346,7 @@ static PassBuilder::OptimizationLevel fromRust(LLVMRustPassBuilderOptLevel Level
   }
 }
 
-enum class LLVMRustRelocMode {
-  Default,
+enum class LLVMRustRelocModel {
   Static,
   PIC,
   DynamicNoPic,
@@ -356,21 +355,19 @@ enum class LLVMRustRelocMode {
   ROPIRWPI,
 };
 
-static Optional<Reloc::Model> fromRust(LLVMRustRelocMode RustReloc) {
+static Reloc::Model fromRust(LLVMRustRelocModel RustReloc) {
   switch (RustReloc) {
-  case LLVMRustRelocMode::Default:
-    return None;
-  case LLVMRustRelocMode::Static:
+  case LLVMRustRelocModel::Static:
     return Reloc::Static;
-  case LLVMRustRelocMode::PIC:
+  case LLVMRustRelocModel::PIC:
     return Reloc::PIC_;
-  case LLVMRustRelocMode::DynamicNoPic:
+  case LLVMRustRelocModel::DynamicNoPic:
     return Reloc::DynamicNoPIC;
-  case LLVMRustRelocMode::ROPI:
+  case LLVMRustRelocModel::ROPI:
     return Reloc::ROPI;
-  case LLVMRustRelocMode::RWPI:
+  case LLVMRustRelocModel::RWPI:
     return Reloc::RWPI;
-  case LLVMRustRelocMode::ROPIRWPI:
+  case LLVMRustRelocModel::ROPIRWPI:
     return Reloc::ROPI_RWPI;
   }
   report_fatal_error("Bad RelocModel.");
@@ -440,7 +437,7 @@ extern "C" const char* LLVMRustGetHostCPUName(size_t *len) {
 
 extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
     const char *TripleStr, const char *CPU, const char *Feature,
-    const char *ABIStr, LLVMRustCodeModel RustCM, LLVMRustRelocMode RustReloc,
+    const char *ABIStr, LLVMRustCodeModel RustCM, LLVMRustRelocModel RustReloc,
     LLVMRustCodeGenOptLevel RustOptLevel, bool UseSoftFloat,
     bool PositionIndependentExecutable, bool FunctionSections,
     bool DataSections,
index 0eac2a1d57f8f291567dff0242d1a49727e527d3..0e6b8823241c21318de521ce608afddfa8f0e9b3 100644 (file)
@@ -1,6 +1,6 @@
 // revisions: cfail1 cfail2 cfail3
 // compile-flags: -Coverflow-checks=on
-// build-pass (FIXME(62277): could be check-pass?)
+// build-pass
 
 #![warn(arithmetic_overflow)]
 
index d0b5c401beabaaedfde007cbf1a24021085ad42e..9742530bd812fef1f0cbf20becfc29cf1153a110 100644 (file)
@@ -126,201 +126,201 @@ fn address_of_reborrow() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/address-of.rs:4:9: 4:10
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/address-of.rs:4:14: 4:21
-        _2 = [const 0i32; 10];           // bb0[2]: scope 0 at $DIR/address-of.rs:4:14: 4:21
+        StorageLive(_1);                 // scope 0 at $DIR/address-of.rs:4:9: 4:10
+        StorageLive(_2);                 // scope 0 at $DIR/address-of.rs:4:14: 4:21
+        _2 = [const 0i32; 10];           // scope 0 at $DIR/address-of.rs:4:14: 4:21
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/address-of.rs:4:15: 4:16
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-        _1 = &_2;                        // bb0[3]: scope 0 at $DIR/address-of.rs:4:13: 4:21
-        FakeRead(ForLet, _1);            // bb0[4]: scope 0 at $DIR/address-of.rs:4:9: 4:10
-        StorageLive(_3);                 // bb0[5]: scope 1 at $DIR/address-of.rs:5:9: 5:14
-        StorageLive(_4);                 // bb0[6]: scope 1 at $DIR/address-of.rs:5:22: 5:29
-        _4 = [const 0i32; 10];           // bb0[7]: scope 1 at $DIR/address-of.rs:5:22: 5:29
+        _1 = &_2;                        // scope 0 at $DIR/address-of.rs:4:13: 4:21
+        FakeRead(ForLet, _1);            // scope 0 at $DIR/address-of.rs:4:9: 4:10
+        StorageLive(_3);                 // scope 1 at $DIR/address-of.rs:5:9: 5:14
+        StorageLive(_4);                 // scope 1 at $DIR/address-of.rs:5:22: 5:29
+        _4 = [const 0i32; 10];           // scope 1 at $DIR/address-of.rs:5:22: 5:29
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/address-of.rs:5:23: 5:24
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-        _3 = &mut _4;                    // bb0[8]: scope 1 at $DIR/address-of.rs:5:17: 5:29
-        FakeRead(ForLet, _3);            // bb0[9]: scope 1 at $DIR/address-of.rs:5:9: 5:14
-        StorageLive(_5);                 // bb0[10]: scope 2 at $DIR/address-of.rs:7:5: 7:18
-        StorageLive(_6);                 // bb0[11]: scope 2 at $DIR/address-of.rs:7:5: 7:18
-        _6 = &raw const (*_1);           // bb0[12]: scope 2 at $DIR/address-of.rs:7:5: 7:6
-        AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] }); // bb0[13]: scope 2 at $DIR/address-of.rs:7:5: 7:18
-        _5 = _6;                         // bb0[14]: scope 2 at $DIR/address-of.rs:7:5: 7:18
-        StorageDead(_6);                 // bb0[15]: scope 2 at $DIR/address-of.rs:7:18: 7:19
-        StorageDead(_5);                 // bb0[16]: scope 2 at $DIR/address-of.rs:7:18: 7:19
-        StorageLive(_7);                 // bb0[17]: scope 2 at $DIR/address-of.rs:8:5: 8:26
-        _7 = &raw const (*_1);           // bb0[18]: scope 2 at $DIR/address-of.rs:8:5: 8:6
-        StorageDead(_7);                 // bb0[19]: scope 2 at $DIR/address-of.rs:8:26: 8:27
-        StorageLive(_8);                 // bb0[20]: scope 2 at $DIR/address-of.rs:9:5: 9:25
-        StorageLive(_9);                 // bb0[21]: scope 2 at $DIR/address-of.rs:9:5: 9:25
-        StorageLive(_10);                // bb0[22]: scope 2 at $DIR/address-of.rs:9:5: 9:6
-        _10 = &raw const (*_1);          // bb0[23]: scope 2 at $DIR/address-of.rs:9:5: 9:6
-        _9 = move _10 as *const dyn std::marker::Send (Pointer(Unsize)); // bb0[24]: scope 2 at $DIR/address-of.rs:9:5: 9:6
-        StorageDead(_10);                // bb0[25]: scope 2 at $DIR/address-of.rs:9:5: 9:6
-        AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] }); // bb0[26]: scope 2 at $DIR/address-of.rs:9:5: 9:25
-        _8 = _9;                         // bb0[27]: scope 2 at $DIR/address-of.rs:9:5: 9:25
-        StorageDead(_9);                 // bb0[28]: scope 2 at $DIR/address-of.rs:9:25: 9:26
-        StorageDead(_8);                 // bb0[29]: scope 2 at $DIR/address-of.rs:9:25: 9:26
-        StorageLive(_11);                // bb0[30]: scope 2 at $DIR/address-of.rs:10:5: 10:22
-        StorageLive(_12);                // bb0[31]: scope 2 at $DIR/address-of.rs:10:5: 10:6
-        _12 = &raw const (*_1);          // bb0[32]: scope 2 at $DIR/address-of.rs:10:5: 10:6
-        _11 = move _12 as *const [i32] (Pointer(Unsize)); // bb0[33]: scope 2 at $DIR/address-of.rs:10:5: 10:6
-        StorageDead(_12);                // bb0[34]: scope 2 at $DIR/address-of.rs:10:5: 10:6
-        StorageDead(_11);                // bb0[35]: scope 2 at $DIR/address-of.rs:10:22: 10:23
-        StorageLive(_13);                // bb0[36]: scope 2 at $DIR/address-of.rs:11:5: 11:20
-        StorageLive(_14);                // bb0[37]: scope 2 at $DIR/address-of.rs:11:5: 11:6
-        _14 = &raw const (*_1);          // bb0[38]: scope 2 at $DIR/address-of.rs:11:5: 11:6
-        _13 = move _14 as *const i32 (Pointer(ArrayToPointer)); // bb0[39]: scope 2 at $DIR/address-of.rs:11:5: 11:20
-        StorageDead(_14);                // bb0[40]: scope 2 at $DIR/address-of.rs:11:19: 11:20
-        StorageDead(_13);                // bb0[41]: scope 2 at $DIR/address-of.rs:11:20: 11:21
-        StorageLive(_15);                // bb0[42]: scope 2 at $DIR/address-of.rs:13:9: 13:10
-        _15 = &raw const (*_1);          // bb0[43]: scope 2 at $DIR/address-of.rs:13:23: 13:24
-        FakeRead(ForLet, _15);           // bb0[44]: scope 2 at $DIR/address-of.rs:13:9: 13:10
-        AscribeUserType(_15, o, UserTypeProjection { base: UserType(3), projs: [] }); // bb0[45]: scope 2 at $DIR/address-of.rs:13:12: 13:20
-        StorageLive(_16);                // bb0[46]: scope 3 at $DIR/address-of.rs:14:9: 14:10
-        _16 = &raw const (*_1);          // bb0[47]: scope 3 at $DIR/address-of.rs:14:31: 14:32
-        FakeRead(ForLet, _16);           // bb0[48]: scope 3 at $DIR/address-of.rs:14:9: 14:10
-        AscribeUserType(_16, o, UserTypeProjection { base: UserType(5), projs: [] }); // bb0[49]: scope 3 at $DIR/address-of.rs:14:12: 14:28
-        StorageLive(_17);                // bb0[50]: scope 4 at $DIR/address-of.rs:15:9: 15:10
-        StorageLive(_18);                // bb0[51]: scope 4 at $DIR/address-of.rs:15:30: 15:31
-        _18 = &raw const (*_1);          // bb0[52]: scope 4 at $DIR/address-of.rs:15:30: 15:31
-        _17 = move _18 as *const dyn std::marker::Send (Pointer(Unsize)); // bb0[53]: scope 4 at $DIR/address-of.rs:15:30: 15:31
-        StorageDead(_18);                // bb0[54]: scope 4 at $DIR/address-of.rs:15:30: 15:31
-        FakeRead(ForLet, _17);           // bb0[55]: scope 4 at $DIR/address-of.rs:15:9: 15:10
-        AscribeUserType(_17, o, UserTypeProjection { base: UserType(7), projs: [] }); // bb0[56]: scope 4 at $DIR/address-of.rs:15:12: 15:27
-        StorageLive(_19);                // bb0[57]: scope 5 at $DIR/address-of.rs:16:9: 16:10
-        StorageLive(_20);                // bb0[58]: scope 5 at $DIR/address-of.rs:16:27: 16:28
-        _20 = &raw const (*_1);          // bb0[59]: scope 5 at $DIR/address-of.rs:16:27: 16:28
-        _19 = move _20 as *const [i32] (Pointer(Unsize)); // bb0[60]: scope 5 at $DIR/address-of.rs:16:27: 16:28
-        StorageDead(_20);                // bb0[61]: scope 5 at $DIR/address-of.rs:16:27: 16:28
-        FakeRead(ForLet, _19);           // bb0[62]: scope 5 at $DIR/address-of.rs:16:9: 16:10
-        AscribeUserType(_19, o, UserTypeProjection { base: UserType(9), projs: [] }); // bb0[63]: scope 5 at $DIR/address-of.rs:16:12: 16:24
-        StorageLive(_21);                // bb0[64]: scope 6 at $DIR/address-of.rs:18:5: 18:18
-        StorageLive(_22);                // bb0[65]: scope 6 at $DIR/address-of.rs:18:5: 18:18
-        _22 = &raw const (*_3);          // bb0[66]: scope 6 at $DIR/address-of.rs:18:5: 18:6
-        AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] }); // bb0[67]: scope 6 at $DIR/address-of.rs:18:5: 18:18
-        _21 = _22;                       // bb0[68]: scope 6 at $DIR/address-of.rs:18:5: 18:18
-        StorageDead(_22);                // bb0[69]: scope 6 at $DIR/address-of.rs:18:18: 18:19
-        StorageDead(_21);                // bb0[70]: scope 6 at $DIR/address-of.rs:18:18: 18:19
-        StorageLive(_23);                // bb0[71]: scope 6 at $DIR/address-of.rs:19:5: 19:26
-        _23 = &raw const (*_3);          // bb0[72]: scope 6 at $DIR/address-of.rs:19:5: 19:6
-        StorageDead(_23);                // bb0[73]: scope 6 at $DIR/address-of.rs:19:26: 19:27
-        StorageLive(_24);                // bb0[74]: scope 6 at $DIR/address-of.rs:20:5: 20:25
-        StorageLive(_25);                // bb0[75]: scope 6 at $DIR/address-of.rs:20:5: 20:25
-        StorageLive(_26);                // bb0[76]: scope 6 at $DIR/address-of.rs:20:5: 20:6
-        _26 = &raw const (*_3);          // bb0[77]: scope 6 at $DIR/address-of.rs:20:5: 20:6
-        _25 = move _26 as *const dyn std::marker::Send (Pointer(Unsize)); // bb0[78]: scope 6 at $DIR/address-of.rs:20:5: 20:6
-        StorageDead(_26);                // bb0[79]: scope 6 at $DIR/address-of.rs:20:5: 20:6
-        AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] }); // bb0[80]: scope 6 at $DIR/address-of.rs:20:5: 20:25
-        _24 = _25;                       // bb0[81]: scope 6 at $DIR/address-of.rs:20:5: 20:25
-        StorageDead(_25);                // bb0[82]: scope 6 at $DIR/address-of.rs:20:25: 20:26
-        StorageDead(_24);                // bb0[83]: scope 6 at $DIR/address-of.rs:20:25: 20:26
-        StorageLive(_27);                // bb0[84]: scope 6 at $DIR/address-of.rs:21:5: 21:22
-        StorageLive(_28);                // bb0[85]: scope 6 at $DIR/address-of.rs:21:5: 21:6
-        _28 = &raw const (*_3);          // bb0[86]: scope 6 at $DIR/address-of.rs:21:5: 21:6
-        _27 = move _28 as *const [i32] (Pointer(Unsize)); // bb0[87]: scope 6 at $DIR/address-of.rs:21:5: 21:6
-        StorageDead(_28);                // bb0[88]: scope 6 at $DIR/address-of.rs:21:5: 21:6
-        StorageDead(_27);                // bb0[89]: scope 6 at $DIR/address-of.rs:21:22: 21:23
-        StorageLive(_29);                // bb0[90]: scope 6 at $DIR/address-of.rs:23:9: 23:10
-        _29 = &raw const (*_3);          // bb0[91]: scope 6 at $DIR/address-of.rs:23:23: 23:24
-        FakeRead(ForLet, _29);           // bb0[92]: scope 6 at $DIR/address-of.rs:23:9: 23:10
-        AscribeUserType(_29, o, UserTypeProjection { base: UserType(13), projs: [] }); // bb0[93]: scope 6 at $DIR/address-of.rs:23:12: 23:20
-        StorageLive(_30);                // bb0[94]: scope 7 at $DIR/address-of.rs:24:9: 24:10
-        _30 = &raw const (*_3);          // bb0[95]: scope 7 at $DIR/address-of.rs:24:31: 24:32
-        FakeRead(ForLet, _30);           // bb0[96]: scope 7 at $DIR/address-of.rs:24:9: 24:10
-        AscribeUserType(_30, o, UserTypeProjection { base: UserType(15), projs: [] }); // bb0[97]: scope 7 at $DIR/address-of.rs:24:12: 24:28
-        StorageLive(_31);                // bb0[98]: scope 8 at $DIR/address-of.rs:25:9: 25:10
-        StorageLive(_32);                // bb0[99]: scope 8 at $DIR/address-of.rs:25:30: 25:31
-        _32 = &raw const (*_3);          // bb0[100]: scope 8 at $DIR/address-of.rs:25:30: 25:31
-        _31 = move _32 as *const dyn std::marker::Send (Pointer(Unsize)); // bb0[101]: scope 8 at $DIR/address-of.rs:25:30: 25:31
-        StorageDead(_32);                // bb0[102]: scope 8 at $DIR/address-of.rs:25:30: 25:31
-        FakeRead(ForLet, _31);           // bb0[103]: scope 8 at $DIR/address-of.rs:25:9: 25:10
-        AscribeUserType(_31, o, UserTypeProjection { base: UserType(17), projs: [] }); // bb0[104]: scope 8 at $DIR/address-of.rs:25:12: 25:27
-        StorageLive(_33);                // bb0[105]: scope 9 at $DIR/address-of.rs:26:9: 26:10
-        StorageLive(_34);                // bb0[106]: scope 9 at $DIR/address-of.rs:26:27: 26:28
-        _34 = &raw const (*_3);          // bb0[107]: scope 9 at $DIR/address-of.rs:26:27: 26:28
-        _33 = move _34 as *const [i32] (Pointer(Unsize)); // bb0[108]: scope 9 at $DIR/address-of.rs:26:27: 26:28
-        StorageDead(_34);                // bb0[109]: scope 9 at $DIR/address-of.rs:26:27: 26:28
-        FakeRead(ForLet, _33);           // bb0[110]: scope 9 at $DIR/address-of.rs:26:9: 26:10
-        AscribeUserType(_33, o, UserTypeProjection { base: UserType(19), projs: [] }); // bb0[111]: scope 9 at $DIR/address-of.rs:26:12: 26:24
-        StorageLive(_35);                // bb0[112]: scope 10 at $DIR/address-of.rs:28:5: 28:16
-        StorageLive(_36);                // bb0[113]: scope 10 at $DIR/address-of.rs:28:5: 28:16
-        _36 = &raw mut (*_3);            // bb0[114]: scope 10 at $DIR/address-of.rs:28:5: 28:6
-        AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] }); // bb0[115]: scope 10 at $DIR/address-of.rs:28:5: 28:16
-        _35 = _36;                       // bb0[116]: scope 10 at $DIR/address-of.rs:28:5: 28:16
-        StorageDead(_36);                // bb0[117]: scope 10 at $DIR/address-of.rs:28:16: 28:17
-        StorageDead(_35);                // bb0[118]: scope 10 at $DIR/address-of.rs:28:16: 28:17
-        StorageLive(_37);                // bb0[119]: scope 10 at $DIR/address-of.rs:29:5: 29:24
-        _37 = &raw mut (*_3);            // bb0[120]: scope 10 at $DIR/address-of.rs:29:5: 29:6
-        StorageDead(_37);                // bb0[121]: scope 10 at $DIR/address-of.rs:29:24: 29:25
-        StorageLive(_38);                // bb0[122]: scope 10 at $DIR/address-of.rs:30:5: 30:23
-        StorageLive(_39);                // bb0[123]: scope 10 at $DIR/address-of.rs:30:5: 30:23
-        StorageLive(_40);                // bb0[124]: scope 10 at $DIR/address-of.rs:30:5: 30:6
-        _40 = &raw mut (*_3);            // bb0[125]: scope 10 at $DIR/address-of.rs:30:5: 30:6
-        _39 = move _40 as *mut dyn std::marker::Send (Pointer(Unsize)); // bb0[126]: scope 10 at $DIR/address-of.rs:30:5: 30:6
-        StorageDead(_40);                // bb0[127]: scope 10 at $DIR/address-of.rs:30:5: 30:6
-        AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] }); // bb0[128]: scope 10 at $DIR/address-of.rs:30:5: 30:23
-        _38 = _39;                       // bb0[129]: scope 10 at $DIR/address-of.rs:30:5: 30:23
-        StorageDead(_39);                // bb0[130]: scope 10 at $DIR/address-of.rs:30:23: 30:24
-        StorageDead(_38);                // bb0[131]: scope 10 at $DIR/address-of.rs:30:23: 30:24
-        StorageLive(_41);                // bb0[132]: scope 10 at $DIR/address-of.rs:31:5: 31:20
-        StorageLive(_42);                // bb0[133]: scope 10 at $DIR/address-of.rs:31:5: 31:6
-        _42 = &raw mut (*_3);            // bb0[134]: scope 10 at $DIR/address-of.rs:31:5: 31:6
-        _41 = move _42 as *mut [i32] (Pointer(Unsize)); // bb0[135]: scope 10 at $DIR/address-of.rs:31:5: 31:6
-        StorageDead(_42);                // bb0[136]: scope 10 at $DIR/address-of.rs:31:5: 31:6
-        StorageDead(_41);                // bb0[137]: scope 10 at $DIR/address-of.rs:31:20: 31:21
-        StorageLive(_43);                // bb0[138]: scope 10 at $DIR/address-of.rs:33:9: 33:10
-        _43 = &raw mut (*_3);            // bb0[139]: scope 10 at $DIR/address-of.rs:33:21: 33:22
-        FakeRead(ForLet, _43);           // bb0[140]: scope 10 at $DIR/address-of.rs:33:9: 33:10
-        AscribeUserType(_43, o, UserTypeProjection { base: UserType(23), projs: [] }); // bb0[141]: scope 10 at $DIR/address-of.rs:33:12: 33:18
-        StorageLive(_44);                // bb0[142]: scope 11 at $DIR/address-of.rs:34:9: 34:10
-        _44 = &raw mut (*_3);            // bb0[143]: scope 11 at $DIR/address-of.rs:34:29: 34:30
-        FakeRead(ForLet, _44);           // bb0[144]: scope 11 at $DIR/address-of.rs:34:9: 34:10
-        AscribeUserType(_44, o, UserTypeProjection { base: UserType(25), projs: [] }); // bb0[145]: scope 11 at $DIR/address-of.rs:34:12: 34:26
-        StorageLive(_45);                // bb0[146]: scope 12 at $DIR/address-of.rs:35:9: 35:10
-        StorageLive(_46);                // bb0[147]: scope 12 at $DIR/address-of.rs:35:28: 35:29
-        _46 = &raw mut (*_3);            // bb0[148]: scope 12 at $DIR/address-of.rs:35:28: 35:29
-        _45 = move _46 as *mut dyn std::marker::Send (Pointer(Unsize)); // bb0[149]: scope 12 at $DIR/address-of.rs:35:28: 35:29
-        StorageDead(_46);                // bb0[150]: scope 12 at $DIR/address-of.rs:35:28: 35:29
-        FakeRead(ForLet, _45);           // bb0[151]: scope 12 at $DIR/address-of.rs:35:9: 35:10
-        AscribeUserType(_45, o, UserTypeProjection { base: UserType(27), projs: [] }); // bb0[152]: scope 12 at $DIR/address-of.rs:35:12: 35:25
-        StorageLive(_47);                // bb0[153]: scope 13 at $DIR/address-of.rs:36:9: 36:10
-        StorageLive(_48);                // bb0[154]: scope 13 at $DIR/address-of.rs:36:25: 36:26
-        _48 = &raw mut (*_3);            // bb0[155]: scope 13 at $DIR/address-of.rs:36:25: 36:26
-        _47 = move _48 as *mut [i32] (Pointer(Unsize)); // bb0[156]: scope 13 at $DIR/address-of.rs:36:25: 36:26
-        StorageDead(_48);                // bb0[157]: scope 13 at $DIR/address-of.rs:36:25: 36:26
-        FakeRead(ForLet, _47);           // bb0[158]: scope 13 at $DIR/address-of.rs:36:9: 36:10
-        AscribeUserType(_47, o, UserTypeProjection { base: UserType(29), projs: [] }); // bb0[159]: scope 13 at $DIR/address-of.rs:36:12: 36:22
-        _0 = const ();                   // bb0[160]: scope 0 at $DIR/address-of.rs:3:26: 37:2
+        _3 = &mut _4;                    // scope 1 at $DIR/address-of.rs:5:17: 5:29
+        FakeRead(ForLet, _3);            // scope 1 at $DIR/address-of.rs:5:9: 5:14
+        StorageLive(_5);                 // scope 2 at $DIR/address-of.rs:7:5: 7:18
+        StorageLive(_6);                 // scope 2 at $DIR/address-of.rs:7:5: 7:18
+        _6 = &raw const (*_1);           // scope 2 at $DIR/address-of.rs:7:5: 7:6
+        AscribeUserType(_6, o, UserTypeProjection { base: UserType(0), projs: [] }); // scope 2 at $DIR/address-of.rs:7:5: 7:18
+        _5 = _6;                         // scope 2 at $DIR/address-of.rs:7:5: 7:18
+        StorageDead(_6);                 // scope 2 at $DIR/address-of.rs:7:18: 7:19
+        StorageDead(_5);                 // scope 2 at $DIR/address-of.rs:7:18: 7:19
+        StorageLive(_7);                 // scope 2 at $DIR/address-of.rs:8:5: 8:26
+        _7 = &raw const (*_1);           // scope 2 at $DIR/address-of.rs:8:5: 8:6
+        StorageDead(_7);                 // scope 2 at $DIR/address-of.rs:8:26: 8:27
+        StorageLive(_8);                 // scope 2 at $DIR/address-of.rs:9:5: 9:25
+        StorageLive(_9);                 // scope 2 at $DIR/address-of.rs:9:5: 9:25
+        StorageLive(_10);                // scope 2 at $DIR/address-of.rs:9:5: 9:6
+        _10 = &raw const (*_1);          // scope 2 at $DIR/address-of.rs:9:5: 9:6
+        _9 = move _10 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 2 at $DIR/address-of.rs:9:5: 9:6
+        StorageDead(_10);                // scope 2 at $DIR/address-of.rs:9:5: 9:6
+        AscribeUserType(_9, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 2 at $DIR/address-of.rs:9:5: 9:25
+        _8 = _9;                         // scope 2 at $DIR/address-of.rs:9:5: 9:25
+        StorageDead(_9);                 // scope 2 at $DIR/address-of.rs:9:25: 9:26
+        StorageDead(_8);                 // scope 2 at $DIR/address-of.rs:9:25: 9:26
+        StorageLive(_11);                // scope 2 at $DIR/address-of.rs:10:5: 10:22
+        StorageLive(_12);                // scope 2 at $DIR/address-of.rs:10:5: 10:6
+        _12 = &raw const (*_1);          // scope 2 at $DIR/address-of.rs:10:5: 10:6
+        _11 = move _12 as *const [i32] (Pointer(Unsize)); // scope 2 at $DIR/address-of.rs:10:5: 10:6
+        StorageDead(_12);                // scope 2 at $DIR/address-of.rs:10:5: 10:6
+        StorageDead(_11);                // scope 2 at $DIR/address-of.rs:10:22: 10:23
+        StorageLive(_13);                // scope 2 at $DIR/address-of.rs:11:5: 11:20
+        StorageLive(_14);                // scope 2 at $DIR/address-of.rs:11:5: 11:6
+        _14 = &raw const (*_1);          // scope 2 at $DIR/address-of.rs:11:5: 11:6
+        _13 = move _14 as *const i32 (Pointer(ArrayToPointer)); // scope 2 at $DIR/address-of.rs:11:5: 11:20
+        StorageDead(_14);                // scope 2 at $DIR/address-of.rs:11:19: 11:20
+        StorageDead(_13);                // scope 2 at $DIR/address-of.rs:11:20: 11:21
+        StorageLive(_15);                // scope 2 at $DIR/address-of.rs:13:9: 13:10
+        _15 = &raw const (*_1);          // scope 2 at $DIR/address-of.rs:13:23: 13:24
+        FakeRead(ForLet, _15);           // scope 2 at $DIR/address-of.rs:13:9: 13:10
+        AscribeUserType(_15, o, UserTypeProjection { base: UserType(3), projs: [] }); // scope 2 at $DIR/address-of.rs:13:12: 13:20
+        StorageLive(_16);                // scope 3 at $DIR/address-of.rs:14:9: 14:10
+        _16 = &raw const (*_1);          // scope 3 at $DIR/address-of.rs:14:31: 14:32
+        FakeRead(ForLet, _16);           // scope 3 at $DIR/address-of.rs:14:9: 14:10
+        AscribeUserType(_16, o, UserTypeProjection { base: UserType(5), projs: [] }); // scope 3 at $DIR/address-of.rs:14:12: 14:28
+        StorageLive(_17);                // scope 4 at $DIR/address-of.rs:15:9: 15:10
+        StorageLive(_18);                // scope 4 at $DIR/address-of.rs:15:30: 15:31
+        _18 = &raw const (*_1);          // scope 4 at $DIR/address-of.rs:15:30: 15:31
+        _17 = move _18 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 4 at $DIR/address-of.rs:15:30: 15:31
+        StorageDead(_18);                // scope 4 at $DIR/address-of.rs:15:30: 15:31
+        FakeRead(ForLet, _17);           // scope 4 at $DIR/address-of.rs:15:9: 15:10
+        AscribeUserType(_17, o, UserTypeProjection { base: UserType(7), projs: [] }); // scope 4 at $DIR/address-of.rs:15:12: 15:27
+        StorageLive(_19);                // scope 5 at $DIR/address-of.rs:16:9: 16:10
+        StorageLive(_20);                // scope 5 at $DIR/address-of.rs:16:27: 16:28
+        _20 = &raw const (*_1);          // scope 5 at $DIR/address-of.rs:16:27: 16:28
+        _19 = move _20 as *const [i32] (Pointer(Unsize)); // scope 5 at $DIR/address-of.rs:16:27: 16:28
+        StorageDead(_20);                // scope 5 at $DIR/address-of.rs:16:27: 16:28
+        FakeRead(ForLet, _19);           // scope 5 at $DIR/address-of.rs:16:9: 16:10
+        AscribeUserType(_19, o, UserTypeProjection { base: UserType(9), projs: [] }); // scope 5 at $DIR/address-of.rs:16:12: 16:24
+        StorageLive(_21);                // scope 6 at $DIR/address-of.rs:18:5: 18:18
+        StorageLive(_22);                // scope 6 at $DIR/address-of.rs:18:5: 18:18
+        _22 = &raw const (*_3);          // scope 6 at $DIR/address-of.rs:18:5: 18:6
+        AscribeUserType(_22, o, UserTypeProjection { base: UserType(10), projs: [] }); // scope 6 at $DIR/address-of.rs:18:5: 18:18
+        _21 = _22;                       // scope 6 at $DIR/address-of.rs:18:5: 18:18
+        StorageDead(_22);                // scope 6 at $DIR/address-of.rs:18:18: 18:19
+        StorageDead(_21);                // scope 6 at $DIR/address-of.rs:18:18: 18:19
+        StorageLive(_23);                // scope 6 at $DIR/address-of.rs:19:5: 19:26
+        _23 = &raw const (*_3);          // scope 6 at $DIR/address-of.rs:19:5: 19:6
+        StorageDead(_23);                // scope 6 at $DIR/address-of.rs:19:26: 19:27
+        StorageLive(_24);                // scope 6 at $DIR/address-of.rs:20:5: 20:25
+        StorageLive(_25);                // scope 6 at $DIR/address-of.rs:20:5: 20:25
+        StorageLive(_26);                // scope 6 at $DIR/address-of.rs:20:5: 20:6
+        _26 = &raw const (*_3);          // scope 6 at $DIR/address-of.rs:20:5: 20:6
+        _25 = move _26 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 6 at $DIR/address-of.rs:20:5: 20:6
+        StorageDead(_26);                // scope 6 at $DIR/address-of.rs:20:5: 20:6
+        AscribeUserType(_25, o, UserTypeProjection { base: UserType(11), projs: [] }); // scope 6 at $DIR/address-of.rs:20:5: 20:25
+        _24 = _25;                       // scope 6 at $DIR/address-of.rs:20:5: 20:25
+        StorageDead(_25);                // scope 6 at $DIR/address-of.rs:20:25: 20:26
+        StorageDead(_24);                // scope 6 at $DIR/address-of.rs:20:25: 20:26
+        StorageLive(_27);                // scope 6 at $DIR/address-of.rs:21:5: 21:22
+        StorageLive(_28);                // scope 6 at $DIR/address-of.rs:21:5: 21:6
+        _28 = &raw const (*_3);          // scope 6 at $DIR/address-of.rs:21:5: 21:6
+        _27 = move _28 as *const [i32] (Pointer(Unsize)); // scope 6 at $DIR/address-of.rs:21:5: 21:6
+        StorageDead(_28);                // scope 6 at $DIR/address-of.rs:21:5: 21:6
+        StorageDead(_27);                // scope 6 at $DIR/address-of.rs:21:22: 21:23
+        StorageLive(_29);                // scope 6 at $DIR/address-of.rs:23:9: 23:10
+        _29 = &raw const (*_3);          // scope 6 at $DIR/address-of.rs:23:23: 23:24
+        FakeRead(ForLet, _29);           // scope 6 at $DIR/address-of.rs:23:9: 23:10
+        AscribeUserType(_29, o, UserTypeProjection { base: UserType(13), projs: [] }); // scope 6 at $DIR/address-of.rs:23:12: 23:20
+        StorageLive(_30);                // scope 7 at $DIR/address-of.rs:24:9: 24:10
+        _30 = &raw const (*_3);          // scope 7 at $DIR/address-of.rs:24:31: 24:32
+        FakeRead(ForLet, _30);           // scope 7 at $DIR/address-of.rs:24:9: 24:10
+        AscribeUserType(_30, o, UserTypeProjection { base: UserType(15), projs: [] }); // scope 7 at $DIR/address-of.rs:24:12: 24:28
+        StorageLive(_31);                // scope 8 at $DIR/address-of.rs:25:9: 25:10
+        StorageLive(_32);                // scope 8 at $DIR/address-of.rs:25:30: 25:31
+        _32 = &raw const (*_3);          // scope 8 at $DIR/address-of.rs:25:30: 25:31
+        _31 = move _32 as *const dyn std::marker::Send (Pointer(Unsize)); // scope 8 at $DIR/address-of.rs:25:30: 25:31
+        StorageDead(_32);                // scope 8 at $DIR/address-of.rs:25:30: 25:31
+        FakeRead(ForLet, _31);           // scope 8 at $DIR/address-of.rs:25:9: 25:10
+        AscribeUserType(_31, o, UserTypeProjection { base: UserType(17), projs: [] }); // scope 8 at $DIR/address-of.rs:25:12: 25:27
+        StorageLive(_33);                // scope 9 at $DIR/address-of.rs:26:9: 26:10
+        StorageLive(_34);                // scope 9 at $DIR/address-of.rs:26:27: 26:28
+        _34 = &raw const (*_3);          // scope 9 at $DIR/address-of.rs:26:27: 26:28
+        _33 = move _34 as *const [i32] (Pointer(Unsize)); // scope 9 at $DIR/address-of.rs:26:27: 26:28
+        StorageDead(_34);                // scope 9 at $DIR/address-of.rs:26:27: 26:28
+        FakeRead(ForLet, _33);           // scope 9 at $DIR/address-of.rs:26:9: 26:10
+        AscribeUserType(_33, o, UserTypeProjection { base: UserType(19), projs: [] }); // scope 9 at $DIR/address-of.rs:26:12: 26:24
+        StorageLive(_35);                // scope 10 at $DIR/address-of.rs:28:5: 28:16
+        StorageLive(_36);                // scope 10 at $DIR/address-of.rs:28:5: 28:16
+        _36 = &raw mut (*_3);            // scope 10 at $DIR/address-of.rs:28:5: 28:6
+        AscribeUserType(_36, o, UserTypeProjection { base: UserType(20), projs: [] }); // scope 10 at $DIR/address-of.rs:28:5: 28:16
+        _35 = _36;                       // scope 10 at $DIR/address-of.rs:28:5: 28:16
+        StorageDead(_36);                // scope 10 at $DIR/address-of.rs:28:16: 28:17
+        StorageDead(_35);                // scope 10 at $DIR/address-of.rs:28:16: 28:17
+        StorageLive(_37);                // scope 10 at $DIR/address-of.rs:29:5: 29:24
+        _37 = &raw mut (*_3);            // scope 10 at $DIR/address-of.rs:29:5: 29:6
+        StorageDead(_37);                // scope 10 at $DIR/address-of.rs:29:24: 29:25
+        StorageLive(_38);                // scope 10 at $DIR/address-of.rs:30:5: 30:23
+        StorageLive(_39);                // scope 10 at $DIR/address-of.rs:30:5: 30:23
+        StorageLive(_40);                // scope 10 at $DIR/address-of.rs:30:5: 30:6
+        _40 = &raw mut (*_3);            // scope 10 at $DIR/address-of.rs:30:5: 30:6
+        _39 = move _40 as *mut dyn std::marker::Send (Pointer(Unsize)); // scope 10 at $DIR/address-of.rs:30:5: 30:6
+        StorageDead(_40);                // scope 10 at $DIR/address-of.rs:30:5: 30:6
+        AscribeUserType(_39, o, UserTypeProjection { base: UserType(21), projs: [] }); // scope 10 at $DIR/address-of.rs:30:5: 30:23
+        _38 = _39;                       // scope 10 at $DIR/address-of.rs:30:5: 30:23
+        StorageDead(_39);                // scope 10 at $DIR/address-of.rs:30:23: 30:24
+        StorageDead(_38);                // scope 10 at $DIR/address-of.rs:30:23: 30:24
+        StorageLive(_41);                // scope 10 at $DIR/address-of.rs:31:5: 31:20
+        StorageLive(_42);                // scope 10 at $DIR/address-of.rs:31:5: 31:6
+        _42 = &raw mut (*_3);            // scope 10 at $DIR/address-of.rs:31:5: 31:6
+        _41 = move _42 as *mut [i32] (Pointer(Unsize)); // scope 10 at $DIR/address-of.rs:31:5: 31:6
+        StorageDead(_42);                // scope 10 at $DIR/address-of.rs:31:5: 31:6
+        StorageDead(_41);                // scope 10 at $DIR/address-of.rs:31:20: 31:21
+        StorageLive(_43);                // scope 10 at $DIR/address-of.rs:33:9: 33:10
+        _43 = &raw mut (*_3);            // scope 10 at $DIR/address-of.rs:33:21: 33:22
+        FakeRead(ForLet, _43);           // scope 10 at $DIR/address-of.rs:33:9: 33:10
+        AscribeUserType(_43, o, UserTypeProjection { base: UserType(23), projs: [] }); // scope 10 at $DIR/address-of.rs:33:12: 33:18
+        StorageLive(_44);                // scope 11 at $DIR/address-of.rs:34:9: 34:10
+        _44 = &raw mut (*_3);            // scope 11 at $DIR/address-of.rs:34:29: 34:30
+        FakeRead(ForLet, _44);           // scope 11 at $DIR/address-of.rs:34:9: 34:10
+        AscribeUserType(_44, o, UserTypeProjection { base: UserType(25), projs: [] }); // scope 11 at $DIR/address-of.rs:34:12: 34:26
+        StorageLive(_45);                // scope 12 at $DIR/address-of.rs:35:9: 35:10
+        StorageLive(_46);                // scope 12 at $DIR/address-of.rs:35:28: 35:29
+        _46 = &raw mut (*_3);            // scope 12 at $DIR/address-of.rs:35:28: 35:29
+        _45 = move _46 as *mut dyn std::marker::Send (Pointer(Unsize)); // scope 12 at $DIR/address-of.rs:35:28: 35:29
+        StorageDead(_46);                // scope 12 at $DIR/address-of.rs:35:28: 35:29
+        FakeRead(ForLet, _45);           // scope 12 at $DIR/address-of.rs:35:9: 35:10
+        AscribeUserType(_45, o, UserTypeProjection { base: UserType(27), projs: [] }); // scope 12 at $DIR/address-of.rs:35:12: 35:25
+        StorageLive(_47);                // scope 13 at $DIR/address-of.rs:36:9: 36:10
+        StorageLive(_48);                // scope 13 at $DIR/address-of.rs:36:25: 36:26
+        _48 = &raw mut (*_3);            // scope 13 at $DIR/address-of.rs:36:25: 36:26
+        _47 = move _48 as *mut [i32] (Pointer(Unsize)); // scope 13 at $DIR/address-of.rs:36:25: 36:26
+        StorageDead(_48);                // scope 13 at $DIR/address-of.rs:36:25: 36:26
+        FakeRead(ForLet, _47);           // scope 13 at $DIR/address-of.rs:36:9: 36:10
+        AscribeUserType(_47, o, UserTypeProjection { base: UserType(29), projs: [] }); // scope 13 at $DIR/address-of.rs:36:12: 36:22
+        _0 = const ();                   // scope 0 at $DIR/address-of.rs:3:26: 37:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/address-of.rs:3:26: 37:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_47);                // bb0[161]: scope 13 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_45);                // bb0[162]: scope 12 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_44);                // bb0[163]: scope 11 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_43);                // bb0[164]: scope 10 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_33);                // bb0[165]: scope 9 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_31);                // bb0[166]: scope 8 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_30);                // bb0[167]: scope 7 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_29);                // bb0[168]: scope 6 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_19);                // bb0[169]: scope 5 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_17);                // bb0[170]: scope 4 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_16);                // bb0[171]: scope 3 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_15);                // bb0[172]: scope 2 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_4);                 // bb0[173]: scope 1 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_3);                 // bb0[174]: scope 1 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_2);                 // bb0[175]: scope 0 at $DIR/address-of.rs:37:1: 37:2
-        StorageDead(_1);                 // bb0[176]: scope 0 at $DIR/address-of.rs:37:1: 37:2
-        return;                          // bb0[177]: scope 0 at $DIR/address-of.rs:37:2: 37:2
+        StorageDead(_47);                // scope 13 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_45);                // scope 12 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_44);                // scope 11 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_43);                // scope 10 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_33);                // scope 9 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_31);                // scope 8 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_30);                // scope 7 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_29);                // scope 6 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_19);                // scope 5 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_17);                // scope 4 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_16);                // scope 3 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_15);                // scope 2 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_4);                 // scope 1 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_3);                 // scope 1 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_2);                 // scope 0 at $DIR/address-of.rs:37:1: 37:2
+        StorageDead(_1);                 // scope 0 at $DIR/address-of.rs:37:1: 37:2
+        return;                          // scope 0 at $DIR/address-of.rs:37:2: 37:2
     }
 }
index 0ed76f230fda22beeba9ffd1ec931750531891e3..4a7e8de29ec226854a55158fa0cbeae25402f863 100644 (file)
@@ -20,34 +20,34 @@ fn borrow_and_cast(_1: i32) -> () {
     }
 
     bb0: {
-        StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/address-of.rs:42:9: 42:10
-        StorageLive(_3);                 // bb0[1]: scope 0 at $DIR/address-of.rs:42:13: 42:15
-        _3 = &_1;                        // bb0[2]: scope 0 at $DIR/address-of.rs:42:13: 42:15
-        _2 = &raw const (*_3);           // bb0[3]: scope 0 at $DIR/address-of.rs:42:13: 42:15
-        FakeRead(ForLet, _2);            // bb0[4]: scope 0 at $DIR/address-of.rs:42:9: 42:10
-        StorageDead(_3);                 // bb0[5]: scope 0 at $DIR/address-of.rs:42:29: 42:30
-        StorageLive(_4);                 // bb0[6]: scope 1 at $DIR/address-of.rs:43:9: 43:10
-        StorageLive(_5);                 // bb0[7]: scope 1 at $DIR/address-of.rs:43:13: 43:19
-        _5 = &mut _1;                    // bb0[8]: scope 1 at $DIR/address-of.rs:43:13: 43:19
-        _4 = &raw const (*_5);           // bb0[9]: scope 1 at $DIR/address-of.rs:43:13: 43:19
-        FakeRead(ForLet, _4);            // bb0[10]: scope 1 at $DIR/address-of.rs:43:9: 43:10
-        StorageDead(_5);                 // bb0[11]: scope 1 at $DIR/address-of.rs:43:33: 43:34
-        StorageLive(_6);                 // bb0[12]: scope 2 at $DIR/address-of.rs:44:9: 44:10
-        StorageLive(_7);                 // bb0[13]: scope 2 at $DIR/address-of.rs:44:13: 44:19
-        _7 = &mut _1;                    // bb0[14]: scope 2 at $DIR/address-of.rs:44:13: 44:19
-        _6 = &raw mut (*_7);             // bb0[15]: scope 2 at $DIR/address-of.rs:44:13: 44:19
-        FakeRead(ForLet, _6);            // bb0[16]: scope 2 at $DIR/address-of.rs:44:9: 44:10
-        StorageDead(_7);                 // bb0[17]: scope 2 at $DIR/address-of.rs:44:31: 44:32
-        _0 = const ();                   // bb0[18]: scope 0 at $DIR/address-of.rs:41:32: 45:2
+        StorageLive(_2);                 // scope 0 at $DIR/address-of.rs:42:9: 42:10
+        StorageLive(_3);                 // scope 0 at $DIR/address-of.rs:42:13: 42:15
+        _3 = &_1;                        // scope 0 at $DIR/address-of.rs:42:13: 42:15
+        _2 = &raw const (*_3);           // scope 0 at $DIR/address-of.rs:42:13: 42:15
+        FakeRead(ForLet, _2);            // scope 0 at $DIR/address-of.rs:42:9: 42:10
+        StorageDead(_3);                 // scope 0 at $DIR/address-of.rs:42:29: 42:30
+        StorageLive(_4);                 // scope 1 at $DIR/address-of.rs:43:9: 43:10
+        StorageLive(_5);                 // scope 1 at $DIR/address-of.rs:43:13: 43:19
+        _5 = &mut _1;                    // scope 1 at $DIR/address-of.rs:43:13: 43:19
+        _4 = &raw const (*_5);           // scope 1 at $DIR/address-of.rs:43:13: 43:19
+        FakeRead(ForLet, _4);            // scope 1 at $DIR/address-of.rs:43:9: 43:10
+        StorageDead(_5);                 // scope 1 at $DIR/address-of.rs:43:33: 43:34
+        StorageLive(_6);                 // scope 2 at $DIR/address-of.rs:44:9: 44:10
+        StorageLive(_7);                 // scope 2 at $DIR/address-of.rs:44:13: 44:19
+        _7 = &mut _1;                    // scope 2 at $DIR/address-of.rs:44:13: 44:19
+        _6 = &raw mut (*_7);             // scope 2 at $DIR/address-of.rs:44:13: 44:19
+        FakeRead(ForLet, _6);            // scope 2 at $DIR/address-of.rs:44:9: 44:10
+        StorageDead(_7);                 // scope 2 at $DIR/address-of.rs:44:31: 44:32
+        _0 = const ();                   // scope 0 at $DIR/address-of.rs:41:32: 45:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/address-of.rs:41:32: 45:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_6);                 // bb0[19]: scope 2 at $DIR/address-of.rs:45:1: 45:2
-        StorageDead(_4);                 // bb0[20]: scope 1 at $DIR/address-of.rs:45:1: 45:2
-        StorageDead(_2);                 // bb0[21]: scope 0 at $DIR/address-of.rs:45:1: 45:2
-        return;                          // bb0[22]: scope 0 at $DIR/address-of.rs:45:2: 45:2
+        StorageDead(_6);                 // scope 2 at $DIR/address-of.rs:45:1: 45:2
+        StorageDead(_4);                 // scope 1 at $DIR/address-of.rs:45:1: 45:2
+        StorageDead(_2);                 // scope 0 at $DIR/address-of.rs:45:1: 45:2
+        return;                          // scope 0 at $DIR/address-of.rs:45:2: 45:2
     }
 }
index 217d080be4fd9e6c438e8e47a2ea76c4e1163618..c42d5adce4f2b3121c7854dd9c0b59611e93b195 100644 (file)
@@ -24,8 +24,8 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
-        _1 = [const 42u32, const 43u32, const 44u32]; // bb0[1]: scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
+        StorageLive(_1);                 // scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
+        _1 = [const 42u32, const 43u32, const 44u32]; // scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x0000002a))
@@ -44,23 +44,23 @@ fn main() -> () {
                                          // mir::Constant
                                          // + span: $DIR/array-index-is-temporary.rs:13:26: 13:28
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002c)) }
-        StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
-        _2 = const 1usize;               // bb0[3]: scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
+        StorageLive(_2);                 // scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
+        _2 = const 1usize;               // scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/array-index-is-temporary.rs:14:17: 14:18
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
-        StorageLive(_3);                 // bb0[4]: scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
-        StorageLive(_4);                 // bb0[5]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
-        _4 = &mut _2;                    // bb0[6]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
-        _3 = &raw mut (*_4);             // bb0[7]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
-        StorageDead(_4);                 // bb0[8]: scope 2 at $DIR/array-index-is-temporary.rs:15:31: 15:32
-        StorageLive(_5);                 // bb0[9]: scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
-        StorageLive(_6);                 // bb0[10]: scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
-        _6 = _3;                         // bb0[11]: scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
-        _5 = const foo(move _6) -> bb1;  // bb0[12]: scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
+        StorageLive(_3);                 // scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
+        StorageLive(_4);                 // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+        _4 = &mut _2;                    // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+        _3 = &raw mut (*_4);             // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+        StorageDead(_4);                 // scope 2 at $DIR/array-index-is-temporary.rs:15:31: 15:32
+        StorageLive(_5);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
+        StorageLive(_6);                 // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
+        _6 = _3;                         // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
+        _5 = const foo(move _6) -> bb1;  // scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
                                          // ty::Const
                                          // + ty: unsafe fn(*mut usize) -> u32 {foo}
                                          // + val: Value(Scalar(<ZST>))
@@ -70,28 +70,28 @@ fn main() -> () {
     }
 
     bb1: {
-        StorageDead(_6);                 // bb1[0]: scope 4 at $DIR/array-index-is-temporary.rs:16:26: 16:27
-        StorageLive(_7);                 // bb1[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
-        _7 = _2;                         // bb1[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
-        _8 = Len(_1);                    // bb1[3]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
-        _9 = Lt(_7, _8);                 // bb1[4]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
-        assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // bb1[5]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+        StorageDead(_6);                 // scope 4 at $DIR/array-index-is-temporary.rs:16:26: 16:27
+        StorageLive(_7);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
+        _7 = _2;                         // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
+        _8 = Len(_1);                    // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+        _9 = Lt(_7, _8);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+        assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
     }
 
     bb2: {
-        _1[_7] = move _5;                // bb2[0]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
-        StorageDead(_5);                 // bb2[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
-        StorageDead(_7);                 // bb2[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
-        _0 = const ();                   // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
+        _1[_7] = move _5;                // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
+        StorageDead(_5);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
+        StorageDead(_7);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
+        _0 = const ();                   // scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/array-index-is-temporary.rs:12:11: 17:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_3);                 // bb2[4]: scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
-        StorageDead(_2);                 // bb2[5]: scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
-        StorageDead(_1);                 // bb2[6]: scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
-        return;                          // bb2[7]: scope 0 at $DIR/array-index-is-temporary.rs:17:2: 17:2
+        StorageDead(_3);                 // scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+        StorageDead(_2);                 // scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+        StorageDead(_1);                 // scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+        return;                          // scope 0 at $DIR/array-index-is-temporary.rs:17:2: 17:2
     }
 }
index c75acef2a27b0d8a33367bf4f11d8e95a58aa57a..05d9b3b9b6f777c88bdfaa3cc9de7e31caee9216 100644 (file)
@@ -24,8 +24,8 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
-        _1 = [const 42u32, const 43u32, const 44u32]; // bb0[1]: scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
+        StorageLive(_1);                 // scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
+        _1 = [const 42u32, const 43u32, const 44u32]; // scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x0000002a))
@@ -44,23 +44,23 @@ fn main() -> () {
                                          // mir::Constant
                                          // + span: $DIR/array-index-is-temporary.rs:13:26: 13:28
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002c)) }
-        StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
-        _2 = const 1usize;               // bb0[3]: scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
+        StorageLive(_2);                 // scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
+        _2 = const 1usize;               // scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000001))
                                          // mir::Constant
                                          // + span: $DIR/array-index-is-temporary.rs:14:17: 14:18
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
-        StorageLive(_3);                 // bb0[4]: scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
-        StorageLive(_4);                 // bb0[5]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
-        _4 = &mut _2;                    // bb0[6]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
-        _3 = &raw mut (*_4);             // bb0[7]: scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
-        StorageDead(_4);                 // bb0[8]: scope 2 at $DIR/array-index-is-temporary.rs:15:31: 15:32
-        StorageLive(_5);                 // bb0[9]: scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
-        StorageLive(_6);                 // bb0[10]: scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
-        _6 = _3;                         // bb0[11]: scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
-        _5 = const foo(move _6) -> bb1;  // bb0[12]: scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
+        StorageLive(_3);                 // scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
+        StorageLive(_4);                 // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+        _4 = &mut _2;                    // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+        _3 = &raw mut (*_4);             // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
+        StorageDead(_4);                 // scope 2 at $DIR/array-index-is-temporary.rs:15:31: 15:32
+        StorageLive(_5);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:12: 16:29
+        StorageLive(_6);                 // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
+        _6 = _3;                         // scope 4 at $DIR/array-index-is-temporary.rs:16:25: 16:26
+        _5 = const foo(move _6) -> bb1;  // scope 4 at $DIR/array-index-is-temporary.rs:16:21: 16:27
                                          // ty::Const
                                          // + ty: unsafe fn(*mut usize) -> u32 {foo}
                                          // + val: Value(Scalar(<ZST>))
@@ -70,28 +70,28 @@ fn main() -> () {
     }
 
     bb1: {
-        StorageDead(_6);                 // bb1[0]: scope 4 at $DIR/array-index-is-temporary.rs:16:26: 16:27
-        StorageLive(_7);                 // bb1[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
-        _7 = _2;                         // bb1[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
-        _8 = Len(_1);                    // bb1[3]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
-        _9 = Lt(_7, _8);                 // bb1[4]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
-        assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // bb1[5]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+        StorageDead(_6);                 // scope 4 at $DIR/array-index-is-temporary.rs:16:26: 16:27
+        StorageLive(_7);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
+        _7 = _2;                         // scope 3 at $DIR/array-index-is-temporary.rs:16:7: 16:8
+        _8 = Len(_1);                    // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+        _9 = Lt(_7, _8);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
+        assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:9
     }
 
     bb2: {
-        _1[_7] = move _5;                // bb2[0]: scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
-        StorageDead(_5);                 // bb2[1]: scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
-        StorageDead(_7);                 // bb2[2]: scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
-        _0 = const ();                   // bb2[3]: scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
+        _1[_7] = move _5;                // scope 3 at $DIR/array-index-is-temporary.rs:16:5: 16:29
+        StorageDead(_5);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:28: 16:29
+        StorageDead(_7);                 // scope 3 at $DIR/array-index-is-temporary.rs:16:29: 16:30
+        _0 = const ();                   // scope 0 at $DIR/array-index-is-temporary.rs:12:11: 17:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/array-index-is-temporary.rs:12:11: 17:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_3);                 // bb2[4]: scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
-        StorageDead(_2);                 // bb2[5]: scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
-        StorageDead(_1);                 // bb2[6]: scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
-        return;                          // bb2[7]: scope 0 at $DIR/array-index-is-temporary.rs:17:2: 17:2
+        StorageDead(_3);                 // scope 2 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+        StorageDead(_2);                 // scope 1 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+        StorageDead(_1);                 // scope 0 at $DIR/array-index-is-temporary.rs:17:1: 17:2
+        return;                          // scope 0 at $DIR/array-index-is-temporary.rs:17:2: 17:2
     }
 }
index 86ee1be6f7404644aabf327f18270e686c50f441..de423cd907afee058a8732b9eba7accf64663372 100644 (file)
@@ -26,71 +26,71 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
-        _1 = const false;                // bb0[1]: scope 0 at $DIR/basic_assignment.rs:11:20: 11:25
+        StorageLive(_1);                 // scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
+        _1 = const false;                // scope 0 at $DIR/basic_assignment.rs:11:20: 11:25
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/basic_assignment.rs:11:20: 11:25
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        FakeRead(ForLet, _1);            // bb0[2]: scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
-        StorageLive(_2);                 // bb0[3]: scope 1 at $DIR/basic_assignment.rs:12:9: 12:17
-        StorageLive(_3);                 // bb0[4]: scope 2 at $DIR/basic_assignment.rs:16:16: 16:24
-        _3 = _1;                         // bb0[5]: scope 2 at $DIR/basic_assignment.rs:16:16: 16:24
-        _2 = move _3;                    // bb0[6]: scope 2 at $DIR/basic_assignment.rs:16:5: 16:24
-        StorageDead(_3);                 // bb0[7]: scope 2 at $DIR/basic_assignment.rs:16:23: 16:24
-        StorageLive(_4);                 // bb0[8]: scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
-        _4 = std::option::Option::<std::boxed::Box<u32>>::None; // bb0[9]: scope 2 at $DIR/basic_assignment.rs:18:36: 18:40
-        FakeRead(ForLet, _4);            // bb0[10]: scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
-        AscribeUserType(_4, o, UserTypeProjection { base: UserType(1), projs: [] }); // bb0[11]: scope 2 at $DIR/basic_assignment.rs:18:17: 18:33
-        StorageLive(_5);                 // bb0[12]: scope 3 at $DIR/basic_assignment.rs:19:9: 19:15
-        StorageLive(_6);                 // bb0[13]: scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
-        _6 = move _4;                    // bb0[14]: scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
-        replace(_5 <- move _6) -> [return: bb2, unwind: bb5]; // bb0[15]: scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
+        FakeRead(ForLet, _1);            // scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
+        StorageLive(_2);                 // scope 1 at $DIR/basic_assignment.rs:12:9: 12:17
+        StorageLive(_3);                 // scope 2 at $DIR/basic_assignment.rs:16:16: 16:24
+        _3 = _1;                         // scope 2 at $DIR/basic_assignment.rs:16:16: 16:24
+        _2 = move _3;                    // scope 2 at $DIR/basic_assignment.rs:16:5: 16:24
+        StorageDead(_3);                 // scope 2 at $DIR/basic_assignment.rs:16:23: 16:24
+        StorageLive(_4);                 // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
+        _4 = std::option::Option::<std::boxed::Box<u32>>::None; // scope 2 at $DIR/basic_assignment.rs:18:36: 18:40
+        FakeRead(ForLet, _4);            // scope 2 at $DIR/basic_assignment.rs:18:9: 18:15
+        AscribeUserType(_4, o, UserTypeProjection { base: UserType(1), projs: [] }); // scope 2 at $DIR/basic_assignment.rs:18:17: 18:33
+        StorageLive(_5);                 // scope 3 at $DIR/basic_assignment.rs:19:9: 19:15
+        StorageLive(_6);                 // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
+        _6 = move _4;                    // scope 4 at $DIR/basic_assignment.rs:23:14: 23:20
+        replace(_5 <- move _6) -> [return: bb2, unwind: bb5]; // scope 4 at $DIR/basic_assignment.rs:23:5: 23:11
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/basic_assignment.rs:10:1: 24:2
+        resume;                          // scope 0 at $DIR/basic_assignment.rs:10:1: 24:2
     }
 
     bb2: {
-        drop(_6) -> [return: bb6, unwind: bb4]; // bb2[0]: scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
+        drop(_6) -> [return: bb6, unwind: bb4]; // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
     }
 
     bb3 (cleanup): {
-        drop(_4) -> bb1;                 // bb3[0]: scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
+        drop(_4) -> bb1;                 // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
     }
 
     bb4 (cleanup): {
-        drop(_5) -> bb3;                 // bb4[0]: scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
+        drop(_5) -> bb3;                 // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
     }
 
     bb5 (cleanup): {
-        drop(_6) -> bb4;                 // bb5[0]: scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
+        drop(_6) -> bb4;                 // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
     }
 
     bb6: {
-        StorageDead(_6);                 // bb6[0]: scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
-        _0 = const ();                   // bb6[1]: scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
+        StorageDead(_6);                 // scope 4 at $DIR/basic_assignment.rs:23:19: 23:20
+        _0 = const ();                   // scope 0 at $DIR/basic_assignment.rs:10:11: 24:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/basic_assignment.rs:10:11: 24:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        drop(_5) -> [return: bb7, unwind: bb3]; // bb6[2]: scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
+        drop(_5) -> [return: bb7, unwind: bb3]; // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
     }
 
     bb7: {
-        StorageDead(_5);                 // bb7[0]: scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
-        drop(_4) -> [return: bb8, unwind: bb1]; // bb7[1]: scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
+        StorageDead(_5);                 // scope 3 at $DIR/basic_assignment.rs:24:1: 24:2
+        drop(_4) -> [return: bb8, unwind: bb1]; // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
     }
 
     bb8: {
-        StorageDead(_4);                 // bb8[0]: scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
-        StorageDead(_2);                 // bb8[1]: scope 1 at $DIR/basic_assignment.rs:24:1: 24:2
-        StorageDead(_1);                 // bb8[2]: scope 0 at $DIR/basic_assignment.rs:24:1: 24:2
-        return;                          // bb8[3]: scope 0 at $DIR/basic_assignment.rs:24:2: 24:2
+        StorageDead(_4);                 // scope 2 at $DIR/basic_assignment.rs:24:1: 24:2
+        StorageDead(_2);                 // scope 1 at $DIR/basic_assignment.rs:24:1: 24:2
+        StorageDead(_1);                 // scope 0 at $DIR/basic_assignment.rs:24:1: 24:2
+        return;                          // scope 0 at $DIR/basic_assignment.rs:24:2: 24:2
     }
 }
index aef0da9d6f09857e5ecd02938b9fe7cf075eda46..259501c7de9515ede3c8d67f10bb532dfeb659f7 100644 (file)
@@ -11,10 +11,10 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/box_expr.rs:7:9: 7:10
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/box_expr.rs:7:13: 7:25
-        _2 = Box(S);                     // bb0[2]: scope 0 at $DIR/box_expr.rs:7:13: 7:25
-        (*_2) = const S::new() -> [return: bb2, unwind: bb3]; // bb0[3]: scope 0 at $DIR/box_expr.rs:7:17: 7:25
+        StorageLive(_1);                 // scope 0 at $DIR/box_expr.rs:7:9: 7:10
+        StorageLive(_2);                 // scope 0 at $DIR/box_expr.rs:7:13: 7:25
+        _2 = Box(S);                     // scope 0 at $DIR/box_expr.rs:7:13: 7:25
+        (*_2) = const S::new() -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/box_expr.rs:7:17: 7:25
                                          // ty::Const
                                          // + ty: fn() -> S {S::new}
                                          // + val: Value(Scalar(<ZST>))
@@ -24,24 +24,24 @@ fn main() -> () {
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/box_expr.rs:6:1: 9:2
+        resume;                          // scope 0 at $DIR/box_expr.rs:6:1: 9:2
     }
 
     bb2: {
-        _1 = move _2;                    // bb2[0]: scope 0 at $DIR/box_expr.rs:7:13: 7:25
-        drop(_2) -> bb4;                 // bb2[1]: scope 0 at $DIR/box_expr.rs:7:24: 7:25
+        _1 = move _2;                    // scope 0 at $DIR/box_expr.rs:7:13: 7:25
+        drop(_2) -> bb4;                 // scope 0 at $DIR/box_expr.rs:7:24: 7:25
     }
 
     bb3 (cleanup): {
-        drop(_2) -> bb1;                 // bb3[0]: scope 0 at $DIR/box_expr.rs:7:24: 7:25
+        drop(_2) -> bb1;                 // scope 0 at $DIR/box_expr.rs:7:24: 7:25
     }
 
     bb4: {
-        StorageDead(_2);                 // bb4[0]: scope 0 at $DIR/box_expr.rs:7:24: 7:25
-        StorageLive(_3);                 // bb4[1]: scope 1 at $DIR/box_expr.rs:8:5: 8:12
-        StorageLive(_4);                 // bb4[2]: scope 1 at $DIR/box_expr.rs:8:10: 8:11
-        _4 = move _1;                    // bb4[3]: scope 1 at $DIR/box_expr.rs:8:10: 8:11
-        _3 = const std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // bb4[4]: scope 1 at $DIR/box_expr.rs:8:5: 8:12
+        StorageDead(_2);                 // scope 0 at $DIR/box_expr.rs:7:24: 7:25
+        StorageLive(_3);                 // scope 1 at $DIR/box_expr.rs:8:5: 8:12
+        StorageLive(_4);                 // scope 1 at $DIR/box_expr.rs:8:10: 8:11
+        _4 = move _1;                    // scope 1 at $DIR/box_expr.rs:8:10: 8:11
+        _3 = const std::mem::drop::<std::boxed::Box<S>>(move _4) -> [return: bb5, unwind: bb7]; // scope 1 at $DIR/box_expr.rs:8:5: 8:12
                                          // ty::Const
                                          // + ty: fn(std::boxed::Box<S>) {std::mem::drop::<std::boxed::Box<S>>}
                                          // + val: Value(Scalar(<ZST>))
@@ -51,28 +51,28 @@ fn main() -> () {
     }
 
     bb5: {
-        StorageDead(_4);                 // bb5[0]: scope 1 at $DIR/box_expr.rs:8:11: 8:12
-        StorageDead(_3);                 // bb5[1]: scope 1 at $DIR/box_expr.rs:8:12: 8:13
-        _0 = const ();                   // bb5[2]: scope 0 at $DIR/box_expr.rs:6:11: 9:2
+        StorageDead(_4);                 // scope 1 at $DIR/box_expr.rs:8:11: 8:12
+        StorageDead(_3);                 // scope 1 at $DIR/box_expr.rs:8:12: 8:13
+        _0 = const ();                   // scope 0 at $DIR/box_expr.rs:6:11: 9:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/box_expr.rs:6:11: 9:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        drop(_1) -> bb8;                 // bb5[3]: scope 0 at $DIR/box_expr.rs:9:1: 9:2
+        drop(_1) -> bb8;                 // scope 0 at $DIR/box_expr.rs:9:1: 9:2
     }
 
     bb6 (cleanup): {
-        drop(_1) -> bb1;                 // bb6[0]: scope 0 at $DIR/box_expr.rs:9:1: 9:2
+        drop(_1) -> bb1;                 // scope 0 at $DIR/box_expr.rs:9:1: 9:2
     }
 
     bb7 (cleanup): {
-        drop(_4) -> bb6;                 // bb7[0]: scope 1 at $DIR/box_expr.rs:8:11: 8:12
+        drop(_4) -> bb6;                 // scope 1 at $DIR/box_expr.rs:8:11: 8:12
     }
 
     bb8: {
-        StorageDead(_1);                 // bb8[0]: scope 0 at $DIR/box_expr.rs:9:1: 9:2
-        return;                          // bb8[1]: scope 0 at $DIR/box_expr.rs:9:2: 9:2
+        StorageDead(_1);                 // scope 0 at $DIR/box_expr.rs:9:1: 9:2
+        return;                          // scope 0 at $DIR/box_expr.rs:9:2: 9:2
     }
 }
index 4477b8a3f0d548f29924d1680d3512ae7cc972bb..b8ecaf787fe72f4a9a4dee4ea59c0fec8621be5a 100644 (file)
@@ -12,16 +12,16 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/byte_slice.rs:5:9: 5:10
-        _1 = const b"foo";               // bb0[1]: scope 0 at $DIR/byte_slice.rs:5:13: 5:19
+        StorageLive(_1);                 // scope 0 at $DIR/byte_slice.rs:5:9: 5:10
+        _1 = const b"foo";               // scope 0 at $DIR/byte_slice.rs:5:13: 5:19
                                          // ty::Const
                                          // + ty: &[u8; 3]
                                          // + val: Value(Scalar(alloc0+0x0))
                                          // mir::Constant
                                          // + span: $DIR/byte_slice.rs:5:13: 5:19
                                          // + literal: Const { ty: &[u8; 3], val: Value(Scalar(alloc0+0x0)) }
-        StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/byte_slice.rs:6:9: 6:10
-        _2 = [const 5u8, const 120u8];   // bb0[3]: scope 1 at $DIR/byte_slice.rs:6:13: 6:24
+        StorageLive(_2);                 // scope 1 at $DIR/byte_slice.rs:6:9: 6:10
+        _2 = [const 5u8, const 120u8];   // scope 1 at $DIR/byte_slice.rs:6:13: 6:24
                                          // ty::Const
                                          // + ty: u8
                                          // + val: Value(Scalar(0x05))
@@ -34,16 +34,16 @@ fn main() -> () {
                                          // mir::Constant
                                          // + span: $DIR/byte_slice.rs:6:19: 6:23
                                          // + literal: Const { ty: u8, val: Value(Scalar(0x78)) }
-        _0 = const ();                   // bb0[4]: scope 0 at $DIR/byte_slice.rs:4:11: 7:2
+        _0 = const ();                   // scope 0 at $DIR/byte_slice.rs:4:11: 7:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/byte_slice.rs:4:11: 7:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_2);                 // bb0[5]: scope 1 at $DIR/byte_slice.rs:7:1: 7:2
-        StorageDead(_1);                 // bb0[6]: scope 0 at $DIR/byte_slice.rs:7:1: 7:2
-        return;                          // bb0[7]: scope 0 at $DIR/byte_slice.rs:7:2: 7:2
+        StorageDead(_2);                 // scope 1 at $DIR/byte_slice.rs:7:1: 7:2
+        StorageDead(_1);                 // scope 0 at $DIR/byte_slice.rs:7:1: 7:2
+        return;                          // scope 0 at $DIR/byte_slice.rs:7:2: 7:2
     }
 }
 
index 1deeee0f61239e5431d03f72d122b3be3bf4c872..e11619cf0cd0eb14da1cee8ab0fc74bce3faf5e3 100644 (file)
       }
   
       bb0: {
-          StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
-          StorageLive(_3);                 // bb0[1]: scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
-          _3 = const 0usize;               // bb0[2]: scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
+          StorageLive(_2);                 // scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
+          StorageLive(_3);                 // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
+          _3 = const 0usize;               // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/combine_array_len.rs:5:15: 5:16
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
--         _4 = Len(_1);                    // bb0[3]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-+         _4 = const 2usize;               // bb0[3]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+-         _4 = Len(_1);                    // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
++         _4 = const 2usize;               // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
 +                                          // ty::Const
 +                                          // + ty: usize
 +                                          // + val: Value(Scalar(0x00000002))
 +                                          // mir::Constant
 +                                          // + span: $DIR/combine_array_len.rs:5:13: 5:17
 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
-          _5 = Lt(_3, _4);                 // bb0[4]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-          assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[5]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+          _5 = Lt(_3, _4);                 // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+          assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
       }
   
       bb1: {
-          _2 = _1[_3];                     // bb1[0]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-          StorageDead(_3);                 // bb1[1]: scope 0 at $DIR/combine_array_len.rs:5:17: 5:18
-          StorageLive(_6);                 // bb1[2]: scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
-          StorageLive(_7);                 // bb1[3]: scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
-          _7 = const 1usize;               // bb1[4]: scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
+          _2 = _1[_3];                     // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+          StorageDead(_3);                 // scope 0 at $DIR/combine_array_len.rs:5:17: 5:18
+          StorageLive(_6);                 // scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
+          StorageLive(_7);                 // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
+          _7 = const 1usize;               // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x00000001))
                                            // mir::Constant
                                            // + span: $DIR/combine_array_len.rs:6:15: 6:16
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
--         _8 = Len(_1);                    // bb1[5]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-+         _8 = const 2usize;               // bb1[5]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+-         _8 = Len(_1);                    // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
++         _8 = const 2usize;               // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
 +                                          // ty::Const
 +                                          // + ty: usize
 +                                          // + val: Value(Scalar(0x00000002))
 +                                          // mir::Constant
 +                                          // + span: $DIR/combine_array_len.rs:6:13: 6:17
 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
-          _9 = Lt(_7, _8);                 // bb1[6]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-          assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // bb1[7]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+          _9 = Lt(_7, _8);                 // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+          assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
       }
   
       bb2: {
-          _6 = _1[_7];                     // bb2[0]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-          StorageDead(_7);                 // bb2[1]: scope 1 at $DIR/combine_array_len.rs:6:17: 6:18
-          StorageLive(_10);                // bb2[2]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
-          StorageLive(_11);                // bb2[3]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
-          _11 = _2;                        // bb2[4]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
-          StorageLive(_12);                // bb2[5]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
-          _12 = _2;                        // bb2[6]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
-          _10 = Mul(move _11, move _12);   // bb2[7]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
-          StorageDead(_12);                // bb2[8]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
-          StorageDead(_11);                // bb2[9]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
-          StorageLive(_13);                // bb2[10]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
-          StorageLive(_14);                // bb2[11]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
-          _14 = _6;                        // bb2[12]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
-          StorageLive(_15);                // bb2[13]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          _15 = _6;                        // bb2[14]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          _13 = Mul(move _14, move _15);   // bb2[15]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
-          StorageDead(_15);                // bb2[16]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          StorageDead(_14);                // bb2[17]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          _0 = Add(move _10, move _13);    // bb2[18]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:14
-          StorageDead(_13);                // bb2[19]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          StorageDead(_10);                // bb2[20]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          StorageDead(_6);                 // bb2[21]: scope 1 at $DIR/combine_array_len.rs:8:1: 8:2
-          StorageDead(_2);                 // bb2[22]: scope 0 at $DIR/combine_array_len.rs:8:1: 8:2
-          return;                          // bb2[23]: scope 0 at $DIR/combine_array_len.rs:8:2: 8:2
+          _6 = _1[_7];                     // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+          StorageDead(_7);                 // scope 1 at $DIR/combine_array_len.rs:6:17: 6:18
+          StorageLive(_10);                // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
+          StorageLive(_11);                // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
+          _11 = _2;                        // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
+          StorageLive(_12);                // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+          _12 = _2;                        // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+          _10 = Mul(move _11, move _12);   // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
+          StorageDead(_12);                // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+          StorageDead(_11);                // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+          StorageLive(_13);                // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
+          StorageLive(_14);                // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
+          _14 = _6;                        // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
+          StorageLive(_15);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          _15 = _6;                        // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          _13 = Mul(move _14, move _15);   // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
+          StorageDead(_15);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          StorageDead(_14);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          _0 = Add(move _10, move _13);    // scope 2 at $DIR/combine_array_len.rs:7:5: 7:14
+          StorageDead(_13);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          StorageDead(_10);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          StorageDead(_6);                 // scope 1 at $DIR/combine_array_len.rs:8:1: 8:2
+          StorageDead(_2);                 // scope 0 at $DIR/combine_array_len.rs:8:1: 8:2
+          return;                          // scope 0 at $DIR/combine_array_len.rs:8:2: 8:2
       }
   }
   
index 7120829e2b54a0bf0db53a307947767ed40b98e9..050cfe359a17513e3c9ff7c36353b90f3178b985 100644 (file)
       }
   
       bb0: {
-          StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
-          StorageLive(_3);                 // bb0[1]: scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
-          _3 = const 0usize;               // bb0[2]: scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
+          StorageLive(_2);                 // scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
+          StorageLive(_3);                 // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
+          _3 = const 0usize;               // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x0000000000000000))
                                            // mir::Constant
                                            // + span: $DIR/combine_array_len.rs:5:15: 5:16
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
--         _4 = Len(_1);                    // bb0[3]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-+         _4 = const 2usize;               // bb0[3]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+-         _4 = Len(_1);                    // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
++         _4 = const 2usize;               // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
 +                                          // ty::Const
 +                                          // + ty: usize
 +                                          // + val: Value(Scalar(0x0000000000000002))
 +                                          // mir::Constant
 +                                          // + span: $DIR/combine_array_len.rs:5:13: 5:17
 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
-          _5 = Lt(_3, _4);                 // bb0[4]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-          assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[5]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+          _5 = Lt(_3, _4);                 // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+          assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
       }
   
       bb1: {
-          _2 = _1[_3];                     // bb1[0]: scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-          StorageDead(_3);                 // bb1[1]: scope 0 at $DIR/combine_array_len.rs:5:17: 5:18
-          StorageLive(_6);                 // bb1[2]: scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
-          StorageLive(_7);                 // bb1[3]: scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
-          _7 = const 1usize;               // bb1[4]: scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
+          _2 = _1[_3];                     // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+          StorageDead(_3);                 // scope 0 at $DIR/combine_array_len.rs:5:17: 5:18
+          StorageLive(_6);                 // scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
+          StorageLive(_7);                 // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
+          _7 = const 1usize;               // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x0000000000000001))
                                            // mir::Constant
                                            // + span: $DIR/combine_array_len.rs:6:15: 6:16
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
--         _8 = Len(_1);                    // bb1[5]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-+         _8 = const 2usize;               // bb1[5]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+-         _8 = Len(_1);                    // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
++         _8 = const 2usize;               // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
 +                                          // ty::Const
 +                                          // + ty: usize
 +                                          // + val: Value(Scalar(0x0000000000000002))
 +                                          // mir::Constant
 +                                          // + span: $DIR/combine_array_len.rs:6:13: 6:17
 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
-          _9 = Lt(_7, _8);                 // bb1[6]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-          assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // bb1[7]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+          _9 = Lt(_7, _8);                 // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+          assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
       }
   
       bb2: {
-          _6 = _1[_7];                     // bb2[0]: scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-          StorageDead(_7);                 // bb2[1]: scope 1 at $DIR/combine_array_len.rs:6:17: 6:18
-          StorageLive(_10);                // bb2[2]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
-          StorageLive(_11);                // bb2[3]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
-          _11 = _2;                        // bb2[4]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
-          StorageLive(_12);                // bb2[5]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
-          _12 = _2;                        // bb2[6]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
-          _10 = Mul(move _11, move _12);   // bb2[7]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
-          StorageDead(_12);                // bb2[8]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
-          StorageDead(_11);                // bb2[9]: scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
-          StorageLive(_13);                // bb2[10]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
-          StorageLive(_14);                // bb2[11]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
-          _14 = _6;                        // bb2[12]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
-          StorageLive(_15);                // bb2[13]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          _15 = _6;                        // bb2[14]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          _13 = Mul(move _14, move _15);   // bb2[15]: scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
-          StorageDead(_15);                // bb2[16]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          StorageDead(_14);                // bb2[17]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          _0 = Add(move _10, move _13);    // bb2[18]: scope 2 at $DIR/combine_array_len.rs:7:5: 7:14
-          StorageDead(_13);                // bb2[19]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          StorageDead(_10);                // bb2[20]: scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
-          StorageDead(_6);                 // bb2[21]: scope 1 at $DIR/combine_array_len.rs:8:1: 8:2
-          StorageDead(_2);                 // bb2[22]: scope 0 at $DIR/combine_array_len.rs:8:1: 8:2
-          return;                          // bb2[23]: scope 0 at $DIR/combine_array_len.rs:8:2: 8:2
+          _6 = _1[_7];                     // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+          StorageDead(_7);                 // scope 1 at $DIR/combine_array_len.rs:6:17: 6:18
+          StorageLive(_10);                // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
+          StorageLive(_11);                // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
+          _11 = _2;                        // scope 2 at $DIR/combine_array_len.rs:7:5: 7:6
+          StorageLive(_12);                // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+          _12 = _2;                        // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+          _10 = Mul(move _11, move _12);   // scope 2 at $DIR/combine_array_len.rs:7:5: 7:8
+          StorageDead(_12);                // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+          StorageDead(_11);                // scope 2 at $DIR/combine_array_len.rs:7:7: 7:8
+          StorageLive(_13);                // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
+          StorageLive(_14);                // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
+          _14 = _6;                        // scope 2 at $DIR/combine_array_len.rs:7:11: 7:12
+          StorageLive(_15);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          _15 = _6;                        // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          _13 = Mul(move _14, move _15);   // scope 2 at $DIR/combine_array_len.rs:7:11: 7:14
+          StorageDead(_15);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          StorageDead(_14);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          _0 = Add(move _10, move _13);    // scope 2 at $DIR/combine_array_len.rs:7:5: 7:14
+          StorageDead(_13);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          StorageDead(_10);                // scope 2 at $DIR/combine_array_len.rs:7:13: 7:14
+          StorageDead(_6);                 // scope 1 at $DIR/combine_array_len.rs:8:1: 8:2
+          StorageDead(_2);                 // scope 0 at $DIR/combine_array_len.rs:8:1: 8:2
+          return;                          // scope 0 at $DIR/combine_array_len.rs:8:2: 8:2
       }
   }
   
index c8456dbbd6165935faf22b700b89c5ac9cd6ec8e..d202531c7ab6357f2af62f7928e41f77426d8e65 100644 (file)
@@ -7,17 +7,17 @@ promoted[0] in BAR: &[&i32; 1] = {
     let mut _3: &i32;                    // in scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
 
     bb0: {
-        _3 = const {alloc0+0x0: &i32};   // bb0[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+        _3 = const {alloc0+0x0: &i32};   // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
                                          // ty::Const
                                          // + ty: &i32
                                          // + val: Value(Scalar(alloc0+0x0))
                                          // mir::Constant
                                          // + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
                                          // + literal: Const { ty: &i32, val: Value(Scalar(alloc0+0x0)) }
-        _2 = _3;                         // bb0[1]: scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
-        _1 = [move _2];                  // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-        _0 = &_1;                        // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-        return;                          // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+        _2 = _3;                         // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
+        _1 = [move _2];                  // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+        _0 = &_1;                        // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+        return;                          // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
     }
 }
 
index dc71961d4e31813f1ebfdcf673933eaaca63ddd9..5b98830c629035fb5582cbafac10a45cb9892385 100644 (file)
 +     let mut _6: &[&i32; 1];              // in scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
--         StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
--         StorageLive(_4);                 // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
--         StorageLive(_5);                 // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
--         _5 = const {alloc0+0x0: &i32};   // bb0[5]: scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
-+         _6 = const BAR::promoted[0];     // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+          StorageLive(_1);                 // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+          StorageLive(_2);                 // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+-         StorageLive(_3);                 // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+-         StorageLive(_4);                 // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
+-         StorageLive(_5);                 // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
+-         _5 = const {alloc0+0x0: &i32};   // scope 0 at $DIR/const-promotion-extern-static.rs:9:33: 9:34
++         _6 = const BAR::promoted[0];     // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
                                            // ty::Const
 -                                          // + ty: &i32
 -                                          // + val: Value(Scalar(alloc0+0x0))
                                            // mir::Constant
 -                                          // + span: $DIR/const-promotion-extern-static.rs:9:33: 9:34
 -                                          // + literal: Const { ty: &i32, val: Value(Scalar(alloc0+0x0)) }
--         _4 = &(*_5);                     // bb0[6]: scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
--         _3 = [move _4];                  // bb0[7]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
--         _2 = &_3;                        // bb0[8]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
--         _1 = move _2 as &[&i32] (Pointer(Unsize)); // bb0[9]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
--         _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // bb0[10]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
+-         _4 = &(*_5);                     // scope 0 at $DIR/const-promotion-extern-static.rs:9:32: 9:34
+-         _3 = [move _4];                  // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+-         _2 = &_3;                        // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
 +                                          // + span: $DIR/const-promotion-extern-static.rs:9:31: 9:35
 +                                          // + literal: Const { ty: &[&i32; 1], val: Unevaluated(DefId(0:6 ~ const_promotion_extern_static[317d]::BAR[0]), [], Some(promoted[0])) }
-+         _2 = &(*_6);                     // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-+         _1 = move _2 as &[&i32] (Pointer(Unsize)); // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
-+         _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // bb0[5]: scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
++         _2 = &(*_6);                     // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+          _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:35
+          _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:9:31: 9:44
                                            // ty::Const
                                            // + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1 (cleanup): {
-          resume;                          // bb1[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
+          resume;                          // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
       }
   
       bb2: {
--         StorageDead(_5);                 // bb2[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
--         StorageDead(_3);                 // bb2[1]: scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
--         return;                          // bb2[2]: scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
-+         return;                          // bb2[0]: scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
+-         StorageDead(_5);                 // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
+-         StorageDead(_3);                 // scope 0 at $DIR/const-promotion-extern-static.rs:9:43: 9:44
+          return;                          // scope 0 at $DIR/const-promotion-extern-static.rs:9:1: 9:45
       }
 - }
 - 
index 7a1a95b448a9e2e5ba91e28968296f34abf94eb1..b49c1aaa86669b9941dced4cdbf60378ead14e20 100644 (file)
@@ -9,17 +9,17 @@ promoted[0] in FOO: &[&i32; 1] = {
     }
 
     bb0: {
-        _3 = const {alloc2+0x0: &i32};   // bb0[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+        _3 = const {alloc2+0x0: &i32};   // scope 0 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
                                          // ty::Const
                                          // + ty: &i32
                                          // + val: Value(Scalar(alloc2+0x0))
                                          // mir::Constant
                                          // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
                                          // + literal: Const { ty: &i32, val: Value(Scalar(alloc2+0x0)) }
-        _2 = _3;                         // bb0[1]: scope 0 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
-        _1 = [move _2];                  // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-        _0 = &_1;                        // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-        return;                          // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+        _2 = _3;                         // scope 0 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
+        _1 = [move _2];                  // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+        _0 = &_1;                        // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+        return;                          // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
     }
 }
 
index 18623743382f83343ecccb346c58b06dec803940..0724575b9d23b90e64953e335863903f47170c14 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
--         StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
--         StorageLive(_4);                 // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:13:32: 13:45
--         StorageLive(_5);                 // bb0[4]: scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
--         _5 = const {alloc2+0x0: &i32};   // bb0[5]: scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
-+         _6 = const FOO::promoted[0];     // bb0[2]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+          StorageLive(_1);                 // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+          StorageLive(_2);                 // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+-         StorageLive(_3);                 // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+-         StorageLive(_4);                 // scope 0 at $DIR/const-promotion-extern-static.rs:13:32: 13:45
+-         StorageLive(_5);                 // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
+-         _5 = const {alloc2+0x0: &i32};   // scope 1 at $DIR/const-promotion-extern-static.rs:13:42: 13:43
++         _6 = const FOO::promoted[0];     // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
                                            // ty::Const
 -                                          // + ty: &i32
 -                                          // + val: Value(Scalar(alloc2+0x0))
                                            // mir::Constant
 -                                          // + span: $DIR/const-promotion-extern-static.rs:13:42: 13:43
 -                                          // + literal: Const { ty: &i32, val: Value(Scalar(alloc2+0x0)) }
--         _4 = &(*_5);                     // bb0[6]: scope 1 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
--         _3 = [move _4];                  // bb0[7]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
--         _2 = &_3;                        // bb0[8]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
--         _1 = move _2 as &[&i32] (Pointer(Unsize)); // bb0[9]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
--         _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // bb0[10]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
+-         _4 = &(*_5);                     // scope 1 at $DIR/const-promotion-extern-static.rs:13:41: 13:43
+-         _3 = [move _4];                  // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+-         _2 = &_3;                        // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
 +                                          // + span: $DIR/const-promotion-extern-static.rs:13:31: 13:46
 +                                          // + literal: Const { ty: &[&i32; 1], val: Unevaluated(DefId(0:7 ~ const_promotion_extern_static[317d]::FOO[0]), [], Some(promoted[0])) }
-+         _2 = &(*_6);                     // bb0[3]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-+         _1 = move _2 as &[&i32] (Pointer(Unsize)); // bb0[4]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
-+         _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // bb0[5]: scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
++         _2 = &(*_6);                     // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+          _1 = move _2 as &[&i32] (Pointer(Unsize)); // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:46
+          _0 = const core::slice::<impl [&i32]>::as_ptr(move _1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/const-promotion-extern-static.rs:13:31: 13:55
                                            // ty::Const
                                            // + ty: for<'r> fn(&'r [&i32]) -> *const &i32 {core::slice::<impl [&i32]>::as_ptr}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1 (cleanup): {
-          resume;                          // bb1[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
+          resume;                          // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
       }
   
       bb2: {
--         StorageDead(_5);                 // bb2[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
--         StorageDead(_3);                 // bb2[1]: scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
--         return;                          // bb2[2]: scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
-+         return;                          // bb2[0]: scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
+-         StorageDead(_5);                 // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
+-         StorageDead(_3);                 // scope 0 at $DIR/const-promotion-extern-static.rs:13:54: 13:55
+          return;                          // scope 0 at $DIR/const-promotion-extern-static.rs:13:1: 13:56
       }
   }
 - 
index 5249a63a8f2f58ed253c519ddceead59189f8a21..3883bba42a3ab17c22bdea5905d030551a6c6346 100644 (file)
@@ -6,26 +6,26 @@ fn main() -> () {
     let mut _2: &&[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:8:5: 8:8
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
-        _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&str])]}; // bb0[2]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+        StorageLive(_1);                 // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+        StorageLive(_2);                 // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+        _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
                                          // ty::Const
                                          // + ty: &&[(std::option::Option<i32>, &[&str])]
                                          // + val: Value(Scalar(alloc0+0x0))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation.rs:8:5: 8:8
                                          // + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc0+0x0)) }
-        _1 = (*_2);                      // bb0[3]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
-        StorageDead(_2);                 // bb0[4]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
-        StorageDead(_1);                 // bb0[5]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
-        _0 = const ();                   // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2
+        _1 = (*_2);                      // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+        StorageDead(_2);                 // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
+        StorageDead(_1);                 // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
+        _0 = const ();                   // scope 0 at $DIR/const_allocation.rs:7:11: 9:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation.rs:7:11: 9:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb0[7]: scope 0 at $DIR/const_allocation.rs:9:2: 9:2
+        return;                          // scope 0 at $DIR/const_allocation.rs:9:2: 9:2
     }
 }
 
index 66a6c10430a12eb5b6099483bbe9bd30532e980d..54a6483f4696ee3202067c63ef0973b03eef0b03 100644 (file)
@@ -6,26 +6,26 @@ fn main() -> () {
     let mut _2: &&[(std::option::Option<i32>, &[&str])]; // in scope 0 at $DIR/const_allocation.rs:8:5: 8:8
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
-        _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&str])]}; // bb0[2]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+        StorageLive(_1);                 // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+        StorageLive(_2);                 // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+        _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&str])]}; // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
                                          // ty::Const
                                          // + ty: &&[(std::option::Option<i32>, &[&str])]
                                          // + val: Value(Scalar(alloc0+0x0))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation.rs:8:5: 8:8
                                          // + literal: Const { ty: &&[(std::option::Option<i32>, &[&str])], val: Value(Scalar(alloc0+0x0)) }
-        _1 = (*_2);                      // bb0[3]: scope 0 at $DIR/const_allocation.rs:8:5: 8:8
-        StorageDead(_2);                 // bb0[4]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
-        StorageDead(_1);                 // bb0[5]: scope 0 at $DIR/const_allocation.rs:8:8: 8:9
-        _0 = const ();                   // bb0[6]: scope 0 at $DIR/const_allocation.rs:7:11: 9:2
+        _1 = (*_2);                      // scope 0 at $DIR/const_allocation.rs:8:5: 8:8
+        StorageDead(_2);                 // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
+        StorageDead(_1);                 // scope 0 at $DIR/const_allocation.rs:8:8: 8:9
+        _0 = const ();                   // scope 0 at $DIR/const_allocation.rs:7:11: 9:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation.rs:7:11: 9:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb0[7]: scope 0 at $DIR/const_allocation.rs:9:2: 9:2
+        return;                          // scope 0 at $DIR/const_allocation.rs:9:2: 9:2
     }
 }
 
index 0db9fdcee811ae56ff5ddc9b25109672245f98c7..e11a2090c5a8ac195b9d042870a8a0b3189ed97e 100644 (file)
@@ -6,26 +6,26 @@ fn main() -> () {
     let mut _2: &&[(std::option::Option<i32>, &[&u8])]; // in scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
-        _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&u8])]}; // bb0[2]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+        StorageLive(_1);                 // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+        StorageLive(_2);                 // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+        _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
                                          // ty::Const
                                          // + ty: &&[(std::option::Option<i32>, &[&u8])]
                                          // + val: Value(Scalar(alloc0+0x0))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation2.rs:5:5: 5:8
                                          // + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc0+0x0)) }
-        _1 = (*_2);                      // bb0[3]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
-        StorageDead(_2);                 // bb0[4]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
-        StorageDead(_1);                 // bb0[5]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
-        _0 = const ();                   // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
+        _1 = (*_2);                      // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+        StorageDead(_2);                 // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
+        StorageDead(_1);                 // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
+        _0 = const ();                   // scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation2.rs:4:11: 6:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb0[7]: scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
+        return;                          // scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
     }
 }
 
index 38514fe65b99eefeb54b34223b6a0cc943f29a36..a56534a7690cedab53250e4b25d8b5761c813c1b 100644 (file)
@@ -6,26 +6,26 @@ fn main() -> () {
     let mut _2: &&[(std::option::Option<i32>, &[&u8])]; // in scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
-        _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&u8])]}; // bb0[2]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+        StorageLive(_1);                 // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+        StorageLive(_2);                 // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+        _2 = const {alloc0+0x0: &&[(std::option::Option<i32>, &[&u8])]}; // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
                                          // ty::Const
                                          // + ty: &&[(std::option::Option<i32>, &[&u8])]
                                          // + val: Value(Scalar(alloc0+0x0))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation2.rs:5:5: 5:8
                                          // + literal: Const { ty: &&[(std::option::Option<i32>, &[&u8])], val: Value(Scalar(alloc0+0x0)) }
-        _1 = (*_2);                      // bb0[3]: scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
-        StorageDead(_2);                 // bb0[4]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
-        StorageDead(_1);                 // bb0[5]: scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
-        _0 = const ();                   // bb0[6]: scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
+        _1 = (*_2);                      // scope 0 at $DIR/const_allocation2.rs:5:5: 5:8
+        StorageDead(_2);                 // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
+        StorageDead(_1);                 // scope 0 at $DIR/const_allocation2.rs:5:8: 5:9
+        _0 = const ();                   // scope 0 at $DIR/const_allocation2.rs:4:11: 6:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation2.rs:4:11: 6:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb0[7]: scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
+        return;                          // scope 0 at $DIR/const_allocation2.rs:6:2: 6:2
     }
 }
 
index b7fda5dedbfc1d78666b03bc735baa157bd6654a..e69ff17149b24ef48ddf436d687dfa850305ce6e 100644 (file)
@@ -6,26 +6,26 @@ fn main() -> () {
     let mut _2: &&Packed;                // in scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
-        _2 = const {alloc0+0x0: &&Packed}; // bb0[2]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+        StorageLive(_1);                 // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+        StorageLive(_2);                 // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+        _2 = const {alloc0+0x0: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
                                          // ty::Const
                                          // + ty: &&Packed
                                          // + val: Value(Scalar(alloc0+0x0))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation3.rs:5:5: 5:8
                                          // + literal: Const { ty: &&Packed, val: Value(Scalar(alloc0+0x0)) }
-        _1 = (*_2);                      // bb0[3]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
-        StorageDead(_2);                 // bb0[4]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
-        StorageDead(_1);                 // bb0[5]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
-        _0 = const ();                   // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
+        _1 = (*_2);                      // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+        StorageDead(_2);                 // scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
+        StorageDead(_1);                 // scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
+        _0 = const ();                   // scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation3.rs:4:11: 6:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb0[7]: scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
+        return;                          // scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
     }
 }
 
index 60caef9585a84633f63ce0ab9c214acd84a0eed1..ad669b25a79350050aa24d17ed74942fa4892436 100644 (file)
@@ -6,26 +6,26 @@ fn main() -> () {
     let mut _2: &&Packed;                // in scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
-        _2 = const {alloc0+0x0: &&Packed}; // bb0[2]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+        StorageLive(_1);                 // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+        StorageLive(_2);                 // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+        _2 = const {alloc0+0x0: &&Packed}; // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
                                          // ty::Const
                                          // + ty: &&Packed
                                          // + val: Value(Scalar(alloc0+0x0))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation3.rs:5:5: 5:8
                                          // + literal: Const { ty: &&Packed, val: Value(Scalar(alloc0+0x0)) }
-        _1 = (*_2);                      // bb0[3]: scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
-        StorageDead(_2);                 // bb0[4]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
-        StorageDead(_1);                 // bb0[5]: scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
-        _0 = const ();                   // bb0[6]: scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
+        _1 = (*_2);                      // scope 0 at $DIR/const_allocation3.rs:5:5: 5:8
+        StorageDead(_2);                 // scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
+        StorageDead(_1);                 // scope 0 at $DIR/const_allocation3.rs:5:8: 5:9
+        _0 = const ();                   // scope 0 at $DIR/const_allocation3.rs:4:11: 6:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/const_allocation3.rs:4:11: 6:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb0[7]: scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
+        return;                          // scope 0 at $DIR/const_allocation3.rs:6:2: 6:2
     }
 }
 
index 50e6cfc37eea3adf31dccaa3071aaf673a0034e9..f4b6c7db444e5a11c52c2a15cbfc5d5919f5cbb2 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/aggregate.rs:5:9: 5:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/aggregate.rs:5:13: 5:24
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/aggregate.rs:5:13: 5:22
-          _3 = (const 0i32, const 1i32, const 2i32); // bb0[3]: scope 0 at $DIR/aggregate.rs:5:13: 5:22
+          StorageLive(_1);                 // scope 0 at $DIR/aggregate.rs:5:9: 5:10
+          StorageLive(_2);                 // scope 0 at $DIR/aggregate.rs:5:13: 5:24
+          StorageLive(_3);                 // scope 0 at $DIR/aggregate.rs:5:13: 5:22
+          _3 = (const 0i32, const 1i32, const 2i32); // scope 0 at $DIR/aggregate.rs:5:13: 5:22
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000000))
@@ -33,9 +33,9 @@
                                            // mir::Constant
                                            // + span: $DIR/aggregate.rs:5:20: 5:21
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
--         _2 = (_3.1: i32);                // bb0[4]: scope 0 at $DIR/aggregate.rs:5:13: 5:24
--         _1 = Add(move _2, const 0i32);   // bb0[5]: scope 0 at $DIR/aggregate.rs:5:13: 5:28
-+         _2 = const 1i32;                 // bb0[4]: scope 0 at $DIR/aggregate.rs:5:13: 5:24
+-         _2 = (_3.1: i32);                // scope 0 at $DIR/aggregate.rs:5:13: 5:24
+-         _1 = Add(move _2, const 0i32);   // scope 0 at $DIR/aggregate.rs:5:13: 5:28
++         _2 = const 1i32;                 // scope 0 at $DIR/aggregate.rs:5:13: 5:24
                                            // ty::Const
                                            // + ty: i32
 -                                          // + val: Value(Scalar(0x00000000))
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
 +                                          // + span: $DIR/aggregate.rs:5:13: 5:24
 +                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+         _1 = const 1i32;                 // bb0[5]: scope 0 at $DIR/aggregate.rs:5:13: 5:28
++         _1 = const 1i32;                 // scope 0 at $DIR/aggregate.rs:5:13: 5:28
 +                                          // ty::Const
 +                                          // + ty: i32
 +                                          // + val: Value(Scalar(0x00000001))
 +                                          // mir::Constant
 +                                          // + span: $DIR/aggregate.rs:5:13: 5:28
 +                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-          StorageDead(_2);                 // bb0[6]: scope 0 at $DIR/aggregate.rs:5:27: 5:28
-          StorageDead(_3);                 // bb0[7]: scope 0 at $DIR/aggregate.rs:5:28: 5:29
-          _0 = const ();                   // bb0[8]: scope 0 at $DIR/aggregate.rs:4:11: 6:2
+          StorageDead(_2);                 // scope 0 at $DIR/aggregate.rs:5:27: 5:28
+          StorageDead(_3);                 // scope 0 at $DIR/aggregate.rs:5:28: 5:29
+          _0 = const ();                   // scope 0 at $DIR/aggregate.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/aggregate.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb0[9]: scope 0 at $DIR/aggregate.rs:6:1: 6:2
-          return;                          // bb0[10]: scope 0 at $DIR/aggregate.rs:6:2: 6:2
+          StorageDead(_1);                 // scope 0 at $DIR/aggregate.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/aggregate.rs:6:2: 6:2
       }
   }
   
index 474d50100b03a61a144531f08f7544a0a3920e25..e24751d39a7df8868ebfa67e56b30b6a0188f748 100644 (file)
@@ -13,9 +13,9 @@
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/array_index.rs:5:9: 5:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/array_index.rs:5:18: 5:30
-          _2 = [const 0u32, const 1u32, const 2u32, const 3u32]; // bb0[2]: scope 0 at $DIR/array_index.rs:5:18: 5:30
+          StorageLive(_1);                 // scope 0 at $DIR/array_index.rs:5:9: 5:10
+          StorageLive(_2);                 // scope 0 at $DIR/array_index.rs:5:18: 5:30
+          _2 = [const 0u32, const 1u32, const 2u32, const 3u32]; // scope 0 at $DIR/array_index.rs:5:18: 5:30
                                            // ty::Const
                                            // + ty: u32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/array_index.rs:5:28: 5:29
                                            // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-          StorageLive(_3);                 // bb0[3]: scope 0 at $DIR/array_index.rs:5:31: 5:32
-          _3 = const 2usize;               // bb0[4]: scope 0 at $DIR/array_index.rs:5:31: 5:32
+          StorageLive(_3);                 // scope 0 at $DIR/array_index.rs:5:31: 5:32
+          _3 = const 2usize;               // scope 0 at $DIR/array_index.rs:5:31: 5:32
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x00000002))
                                            // mir::Constant
                                            // + span: $DIR/array_index.rs:5:31: 5:32
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
-          _4 = const 4usize;               // bb0[5]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+          _4 = const 4usize;               // scope 0 at $DIR/array_index.rs:5:18: 5:33
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x00000004))
                                            // mir::Constant
                                            // + span: $DIR/array_index.rs:5:18: 5:33
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000004)) }
--         _5 = Lt(_3, _4);                 // bb0[6]: scope 0 at $DIR/array_index.rs:5:18: 5:33
--         assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[7]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-+         _5 = const true;                 // bb0[6]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+-         _5 = Lt(_3, _4);                 // scope 0 at $DIR/array_index.rs:5:18: 5:33
+-         assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
++         _5 = const true;                 // scope 0 at $DIR/array_index.rs:5:18: 5:33
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
 +                                          // mir::Constant
 +                                          // + span: $DIR/array_index.rs:5:18: 5:33
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+         assert(const true, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[7]: scope 0 at $DIR/array_index.rs:5:18: 5:33
++         assert(const true, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
       }
   
       bb1: {
--         _1 = _2[_3];                     // bb1[0]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-+         _1 = const 2u32;                 // bb1[0]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+-         _1 = _2[_3];                     // scope 0 at $DIR/array_index.rs:5:18: 5:33
++         _1 = const 2u32;                 // scope 0 at $DIR/array_index.rs:5:18: 5:33
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x00000002))
 +                                          // mir::Constant
 +                                          // + span: $DIR/array_index.rs:5:18: 5:33
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-          StorageDead(_3);                 // bb1[1]: scope 0 at $DIR/array_index.rs:5:33: 5:34
-          StorageDead(_2);                 // bb1[2]: scope 0 at $DIR/array_index.rs:5:33: 5:34
-          _0 = const ();                   // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2
+          StorageDead(_3);                 // scope 0 at $DIR/array_index.rs:5:33: 5:34
+          StorageDead(_2);                 // scope 0 at $DIR/array_index.rs:5:33: 5:34
+          _0 = const ();                   // scope 0 at $DIR/array_index.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/array_index.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb1[4]: scope 0 at $DIR/array_index.rs:6:1: 6:2
-          return;                          // bb1[5]: scope 0 at $DIR/array_index.rs:6:2: 6:2
+          StorageDead(_1);                 // scope 0 at $DIR/array_index.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/array_index.rs:6:2: 6:2
       }
   }
   
index b3d353bd48780f5bc674e4b4791ca6067b437eb6..ad9992bb94905d690b3043547d6e507984af5bb4 100644 (file)
@@ -13,9 +13,9 @@
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/array_index.rs:5:9: 5:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/array_index.rs:5:18: 5:30
-          _2 = [const 0u32, const 1u32, const 2u32, const 3u32]; // bb0[2]: scope 0 at $DIR/array_index.rs:5:18: 5:30
+          StorageLive(_1);                 // scope 0 at $DIR/array_index.rs:5:9: 5:10
+          StorageLive(_2);                 // scope 0 at $DIR/array_index.rs:5:18: 5:30
+          _2 = [const 0u32, const 1u32, const 2u32, const 3u32]; // scope 0 at $DIR/array_index.rs:5:18: 5:30
                                            // ty::Const
                                            // + ty: u32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/array_index.rs:5:28: 5:29
                                            // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-          StorageLive(_3);                 // bb0[3]: scope 0 at $DIR/array_index.rs:5:31: 5:32
-          _3 = const 2usize;               // bb0[4]: scope 0 at $DIR/array_index.rs:5:31: 5:32
+          StorageLive(_3);                 // scope 0 at $DIR/array_index.rs:5:31: 5:32
+          _3 = const 2usize;               // scope 0 at $DIR/array_index.rs:5:31: 5:32
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x0000000000000002))
                                            // mir::Constant
                                            // + span: $DIR/array_index.rs:5:31: 5:32
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
-          _4 = const 4usize;               // bb0[5]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+          _4 = const 4usize;               // scope 0 at $DIR/array_index.rs:5:18: 5:33
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x0000000000000004))
                                            // mir::Constant
                                            // + span: $DIR/array_index.rs:5:18: 5:33
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000004)) }
--         _5 = Lt(_3, _4);                 // bb0[6]: scope 0 at $DIR/array_index.rs:5:18: 5:33
--         assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[7]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-+         _5 = const true;                 // bb0[6]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+-         _5 = Lt(_3, _4);                 // scope 0 at $DIR/array_index.rs:5:18: 5:33
+-         assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
++         _5 = const true;                 // scope 0 at $DIR/array_index.rs:5:18: 5:33
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
 +                                          // mir::Constant
 +                                          // + span: $DIR/array_index.rs:5:18: 5:33
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+         assert(const true, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // bb0[7]: scope 0 at $DIR/array_index.rs:5:18: 5:33
++         assert(const true, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
       }
   
       bb1: {
--         _1 = _2[_3];                     // bb1[0]: scope 0 at $DIR/array_index.rs:5:18: 5:33
-+         _1 = const 2u32;                 // bb1[0]: scope 0 at $DIR/array_index.rs:5:18: 5:33
+-         _1 = _2[_3];                     // scope 0 at $DIR/array_index.rs:5:18: 5:33
++         _1 = const 2u32;                 // scope 0 at $DIR/array_index.rs:5:18: 5:33
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x00000002))
 +                                          // mir::Constant
 +                                          // + span: $DIR/array_index.rs:5:18: 5:33
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-          StorageDead(_3);                 // bb1[1]: scope 0 at $DIR/array_index.rs:5:33: 5:34
-          StorageDead(_2);                 // bb1[2]: scope 0 at $DIR/array_index.rs:5:33: 5:34
-          _0 = const ();                   // bb1[3]: scope 0 at $DIR/array_index.rs:4:11: 6:2
+          StorageDead(_3);                 // scope 0 at $DIR/array_index.rs:5:33: 5:34
+          StorageDead(_2);                 // scope 0 at $DIR/array_index.rs:5:33: 5:34
+          _0 = const ();                   // scope 0 at $DIR/array_index.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/array_index.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb1[4]: scope 0 at $DIR/array_index.rs:6:1: 6:2
-          return;                          // bb1[5]: scope 0 at $DIR/array_index.rs:6:2: 6:2
+          StorageDead(_1);                 // scope 0 at $DIR/array_index.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/array_index.rs:6:2: 6:2
       }
   }
   
diff --git a/src/test/mir-opt/const_prop/bad_op_div_by_zero.rs b/src/test/mir-opt/const_prop/bad_op_div_by_zero.rs
new file mode 100644 (file)
index 0000000..0cd1f37
--- /dev/null
@@ -0,0 +1,6 @@
+// EMIT_MIR rustc.main.ConstProp.diff
+#[allow(unconditional_panic)]
+fn main() {
+    let y = 0;
+    let _z = 1 / y;
+}
diff --git a/src/test/mir-opt/const_prop/bad_op_div_by_zero/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/bad_op_div_by_zero/rustc.main.ConstProp.diff
new file mode 100644 (file)
index 0000000..333bf0e
--- /dev/null
@@ -0,0 +1,117 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/bad_op_div_by_zero.rs:3:11: 3:11
+      let _1: i32;                         // in scope 0 at $DIR/bad_op_div_by_zero.rs:4:9: 4:10
+      let mut _3: i32;                     // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+      let mut _4: bool;                    // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+      let mut _5: bool;                    // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+      let mut _6: bool;                    // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+      let mut _7: bool;                    // in scope 0 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+      scope 1 {
+          debug y => _1;                   // in scope 1 at $DIR/bad_op_div_by_zero.rs:4:9: 4:10
+          let _2: i32;                     // in scope 1 at $DIR/bad_op_div_by_zero.rs:5:9: 5:11
+          scope 2 {
+              debug _z => _2;              // in scope 2 at $DIR/bad_op_div_by_zero.rs:5:9: 5:11
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/bad_op_div_by_zero.rs:4:9: 4:10
+          _1 = const 0i32;                 // scope 0 at $DIR/bad_op_div_by_zero.rs:4:13: 4:14
+                                           // ty::Const
+                                           // + ty: i32
+                                           // + val: Value(Scalar(0x00000000))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_div_by_zero.rs:4:13: 4:14
+                                           // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
+          StorageLive(_2);                 // scope 1 at $DIR/bad_op_div_by_zero.rs:5:9: 5:11
+          StorageLive(_3);                 // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+-         _3 = _1;                         // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+-         _4 = Eq(_3, const 0i32);         // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++         _3 = const 0i32;                 // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+                                           // ty::Const
+                                           // + ty: i32
+                                           // + val: Value(Scalar(0x00000000))
+                                           // mir::Constant
+-                                          // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++                                          // + span: $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+                                           // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
++         _4 = const true;                 // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++                                          // ty::Const
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x01))
++                                          // mir::Constant
++                                          // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+          assert(!move _4, "attempt to divide by zero") -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+      }
+  
+      bb1: {
+-         _5 = Eq(_3, const -1i32);        // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++         _5 = const false;                // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+                                           // ty::Const
+-                                          // + ty: i32
+-                                          // + val: Value(Scalar(0xffffffff))
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+-                                          // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
+-         _6 = Eq(const 1i32, const std::i32::MIN); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++         _6 = const false;                // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+                                           // ty::Const
+-                                          // + ty: i32
+-                                          // + val: Value(Scalar(0x00000001))
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
+                                           // mir::Constant
+-                                          // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:15
+-                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
++                                          // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++         _7 = const false;                // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+                                           // ty::Const
+-                                          // + ty: i32
+-                                          // + val: Value(Scalar(0x80000000))
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+-                                          // + literal: Const { ty: i32, val: Value(Scalar(0x80000000)) }
+-         _7 = BitAnd(move _5, move _6);   // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+-         assert(!move _7, "attempt to divide with overflow") -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++         assert(!const false, "attempt to divide with overflow") -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++                                          // ty::Const
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
++                                          // mir::Constant
++                                          // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+      }
+  
+      bb2: {
+          _2 = Div(const 1i32, move _3);   // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+                                           // ty::Const
+                                           // + ty: i32
+                                           // + val: Value(Scalar(0x00000001))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:15
+                                           // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
+          StorageDead(_3);                 // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+          _0 = const ();                   // scope 0 at $DIR/bad_op_div_by_zero.rs:3:11: 6:2
+                                           // ty::Const
+                                           // + ty: ()
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_div_by_zero.rs:3:11: 6:2
+                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+          StorageDead(_2);                 // scope 1 at $DIR/bad_op_div_by_zero.rs:6:1: 6:2
+          StorageDead(_1);                 // scope 0 at $DIR/bad_op_div_by_zero.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/bad_op_div_by_zero.rs:6:2: 6:2
+      }
+  }
+  
diff --git a/src/test/mir-opt/const_prop/bad_op_mod_by_zero.rs b/src/test/mir-opt/const_prop/bad_op_mod_by_zero.rs
new file mode 100644 (file)
index 0000000..26bccbb
--- /dev/null
@@ -0,0 +1,6 @@
+// EMIT_MIR rustc.main.ConstProp.diff
+#[allow(unconditional_panic)]
+fn main() {
+    let y = 0;
+    let _z = 1 % y;
+}
diff --git a/src/test/mir-opt/const_prop/bad_op_mod_by_zero/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/bad_op_mod_by_zero/rustc.main.ConstProp.diff
new file mode 100644 (file)
index 0000000..c081b46
--- /dev/null
@@ -0,0 +1,117 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/bad_op_mod_by_zero.rs:3:11: 3:11
+      let _1: i32;                         // in scope 0 at $DIR/bad_op_mod_by_zero.rs:4:9: 4:10
+      let mut _3: i32;                     // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+      let mut _4: bool;                    // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+      let mut _5: bool;                    // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+      let mut _6: bool;                    // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+      let mut _7: bool;                    // in scope 0 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+      scope 1 {
+          debug y => _1;                   // in scope 1 at $DIR/bad_op_mod_by_zero.rs:4:9: 4:10
+          let _2: i32;                     // in scope 1 at $DIR/bad_op_mod_by_zero.rs:5:9: 5:11
+          scope 2 {
+              debug _z => _2;              // in scope 2 at $DIR/bad_op_mod_by_zero.rs:5:9: 5:11
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/bad_op_mod_by_zero.rs:4:9: 4:10
+          _1 = const 0i32;                 // scope 0 at $DIR/bad_op_mod_by_zero.rs:4:13: 4:14
+                                           // ty::Const
+                                           // + ty: i32
+                                           // + val: Value(Scalar(0x00000000))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_mod_by_zero.rs:4:13: 4:14
+                                           // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
+          StorageLive(_2);                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:9: 5:11
+          StorageLive(_3);                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+-         _3 = _1;                         // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+-         _4 = Eq(_3, const 0i32);         // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++         _3 = const 0i32;                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+                                           // ty::Const
+                                           // + ty: i32
+                                           // + val: Value(Scalar(0x00000000))
+                                           // mir::Constant
+-                                          // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++                                          // + span: $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+                                           // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
++         _4 = const true;                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++                                          // ty::Const
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x01))
++                                          // mir::Constant
++                                          // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+          assert(!move _4, "attempt to calculate the remainder with a divisor of zero") -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+      }
+  
+      bb1: {
+-         _5 = Eq(_3, const -1i32);        // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++         _5 = const false;                // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+                                           // ty::Const
+-                                          // + ty: i32
+-                                          // + val: Value(Scalar(0xffffffff))
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+-                                          // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
+-         _6 = Eq(const 1i32, const std::i32::MIN); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++         _6 = const false;                // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+                                           // ty::Const
+-                                          // + ty: i32
+-                                          // + val: Value(Scalar(0x00000001))
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
+                                           // mir::Constant
+-                                          // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:15
+-                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
++                                          // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++         _7 = const false;                // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+                                           // ty::Const
+-                                          // + ty: i32
+-                                          // + val: Value(Scalar(0x80000000))
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+-                                          // + literal: Const { ty: i32, val: Value(Scalar(0x80000000)) }
+-         _7 = BitAnd(move _5, move _6);   // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+-         assert(!move _7, "attempt to calculate the remainder with overflow") -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++         assert(!const false, "attempt to calculate the remainder with overflow") -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++                                          // ty::Const
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
++                                          // mir::Constant
++                                          // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+      }
+  
+      bb2: {
+          _2 = Rem(const 1i32, move _3);   // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+                                           // ty::Const
+                                           // + ty: i32
+                                           // + val: Value(Scalar(0x00000001))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:15
+                                           // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
+          StorageDead(_3);                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+          _0 = const ();                   // scope 0 at $DIR/bad_op_mod_by_zero.rs:3:11: 6:2
+                                           // ty::Const
+                                           // + ty: ()
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_mod_by_zero.rs:3:11: 6:2
+                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+          StorageDead(_2);                 // scope 1 at $DIR/bad_op_mod_by_zero.rs:6:1: 6:2
+          StorageDead(_1);                 // scope 0 at $DIR/bad_op_mod_by_zero.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/bad_op_mod_by_zero.rs:6:2: 6:2
+      }
+  }
+  
diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices.rs
new file mode 100644 (file)
index 0000000..e517e46
--- /dev/null
@@ -0,0 +1,9 @@
+// EMIT_MIR_FOR_EACH_BIT_WIDTH
+// EMIT_MIR rustc.main.ConstProp.diff
+#[allow(unconditional_panic)]
+fn main() {
+    let a: *const [_] = &[1, 2, 3];
+    unsafe {
+        let _b = (*a)[3];
+    }
+}
diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/32bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/32bit/rustc.main.ConstProp.diff
new file mode 100644 (file)
index 0000000..8ecb777
--- /dev/null
@@ -0,0 +1,83 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:4:11: 4:11
+      let _1: *const [i32] as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+      let mut _2: *const [i32; 3];         // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+      let _3: &[i32; 3];                   // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+      let _4: [i32; 3];                    // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:26: 5:35
+      let _6: usize;                       // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+      let mut _7: usize;                   // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+      let mut _8: bool;                    // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+      let mut _9: &[i32; 3];               // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+      scope 1 {
+          debug a => _1;                   // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+          scope 2 {
+              let _5: i32;                 // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+              scope 3 {
+                  debug _b => _5;          // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+              }
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+          StorageLive(_2);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          StorageLive(_3);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          _9 = const main::promoted[0];    // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+                                           // ty::Const
+                                           // + ty: &[i32; 3]
+                                           // + val: Unevaluated(DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), [], Some(promoted[0]))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+                                           // + literal: Const { ty: &[i32; 3], val: Unevaluated(DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), [], Some(promoted[0])) }
+          _3 = _9;                         // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          _2 = &raw const (*_3);           // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          StorageDead(_2);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:34: 5:35
+          StorageDead(_3);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:35: 5:36
+          StorageLive(_5);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+          StorageLive(_6);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+          _6 = const 3usize;               // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+                                           // ty::Const
+                                           // + ty: usize
+                                           // + val: Value(Scalar(0x00000003))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+                                           // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
+-         _7 = Len((*_1));                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+-         _8 = Lt(_6, _7);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++         _7 = const 3usize;               // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++                                          // ty::Const
++                                          // + ty: usize
++                                          // + val: Value(Scalar(0x00000003))
++                                          // mir::Constant
++                                          // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
++         _8 = const false;                // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++                                          // ty::Const
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
++                                          // mir::Constant
++                                          // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+          assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+      }
+  
+      bb1: {
+          _5 = (*_1)[_6];                  // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+          StorageDead(_6);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:25: 7:26
+          _0 = const ();                   // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:6:5: 8:6
+                                           // ty::Const
+                                           // + ty: ()
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:5: 8:6
+                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+          StorageDead(_5);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:8:5: 8:6
+          StorageDead(_1);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:9:1: 9:2
+          return;                          // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:9:2: 9:2
+      }
+  }
+  
diff --git a/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/64bit/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/bad_op_unsafe_oob_for_slices/64bit/rustc.main.ConstProp.diff
new file mode 100644 (file)
index 0000000..2778ec0
--- /dev/null
@@ -0,0 +1,83 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:4:11: 4:11
+      let _1: *const [i32] as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+      let mut _2: *const [i32; 3];         // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+      let _3: &[i32; 3];                   // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+      let _4: [i32; 3];                    // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:26: 5:35
+      let _6: usize;                       // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+      let mut _7: usize;                   // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+      let mut _8: bool;                    // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+      let mut _9: &[i32; 3];               // in scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+      scope 1 {
+          debug a => _1;                   // in scope 1 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+          scope 2 {
+              let _5: i32;                 // in scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+              scope 3 {
+                  debug _b => _5;          // in scope 3 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+              }
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:9: 5:10
+          StorageLive(_2);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          StorageLive(_3);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          _9 = const main::promoted[0];    // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+                                           // ty::Const
+                                           // + ty: &[i32; 3]
+                                           // + val: Unevaluated(DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), [], Some(promoted[0]))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+                                           // + literal: Const { ty: &[i32; 3], val: Unevaluated(DefId(0:3 ~ bad_op_unsafe_oob_for_slices[317d]::main[0]), [], Some(promoted[0])) }
+          _3 = _9;                         // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          _2 = &raw const (*_3);           // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          _1 = move _2 as *const [i32] (Pointer(Unsize)); // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:25: 5:35
+          StorageDead(_2);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:34: 5:35
+          StorageDead(_3);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:5:35: 5:36
+          StorageLive(_5);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
+          StorageLive(_6);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+          _6 = const 3usize;               // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+                                           // ty::Const
+                                           // + ty: usize
+                                           // + val: Value(Scalar(0x0000000000000003))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
+                                           // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
+-         _7 = Len((*_1));                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+-         _8 = Lt(_6, _7);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++         _7 = const 3usize;               // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++                                          // ty::Const
++                                          // + ty: usize
++                                          // + val: Value(Scalar(0x0000000000000003))
++                                          // mir::Constant
++                                          // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
++         _8 = const false;                // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++                                          // ty::Const
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
++                                          // mir::Constant
++                                          // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+          assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+      }
+  
+      bb1: {
+          _5 = (*_1)[_6];                  // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+          StorageDead(_6);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:25: 7:26
+          _0 = const ();                   // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:6:5: 8:6
+                                           // ty::Const
+                                           // + ty: ()
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:6:5: 8:6
+                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+          StorageDead(_5);                 // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:8:5: 8:6
+          StorageDead(_1);                 // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:9:1: 9:2
+          return;                          // scope 0 at $DIR/bad_op_unsafe_oob_for_slices.rs:9:2: 9:2
+      }
+  }
+  
index bf5aff0cf4699749d5139571c40715e0a8fe9c98..16f937f3e7b5efd7fb33f0a787d50fadcb3bc130 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/boxes.rs:12:9: 12:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/boxes.rs:12:13: 12:22
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/boxes.rs:12:14: 12:22
-          StorageLive(_4);                 // bb0[3]: scope 0 at $DIR/boxes.rs:12:14: 12:22
-          _4 = Box(i32);                   // bb0[4]: scope 0 at $DIR/boxes.rs:12:14: 12:22
-          (*_4) = const 42i32;             // bb0[5]: scope 0 at $DIR/boxes.rs:12:19: 12:21
+          StorageLive(_1);                 // scope 0 at $DIR/boxes.rs:12:9: 12:10
+          StorageLive(_2);                 // scope 0 at $DIR/boxes.rs:12:13: 12:22
+          StorageLive(_3);                 // scope 0 at $DIR/boxes.rs:12:14: 12:22
+          StorageLive(_4);                 // scope 0 at $DIR/boxes.rs:12:14: 12:22
+          _4 = Box(i32);                   // scope 0 at $DIR/boxes.rs:12:14: 12:22
+          (*_4) = const 42i32;             // scope 0 at $DIR/boxes.rs:12:19: 12:21
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000002a))
                                            // mir::Constant
                                            // + span: $DIR/boxes.rs:12:19: 12:21
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-          _3 = move _4;                    // bb0[6]: scope 0 at $DIR/boxes.rs:12:14: 12:22
-          StorageDead(_4);                 // bb0[7]: scope 0 at $DIR/boxes.rs:12:21: 12:22
-          _2 = (*_3);                      // bb0[8]: scope 0 at $DIR/boxes.rs:12:13: 12:22
-          _1 = Add(move _2, const 0i32);   // bb0[9]: scope 0 at $DIR/boxes.rs:12:13: 12:26
+          _3 = move _4;                    // scope 0 at $DIR/boxes.rs:12:14: 12:22
+          StorageDead(_4);                 // scope 0 at $DIR/boxes.rs:12:21: 12:22
+          _2 = (*_3);                      // scope 0 at $DIR/boxes.rs:12:13: 12:22
+          _1 = Add(move _2, const 0i32);   // scope 0 at $DIR/boxes.rs:12:13: 12:26
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/boxes.rs:12:25: 12:26
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-          StorageDead(_2);                 // bb0[10]: scope 0 at $DIR/boxes.rs:12:25: 12:26
-          drop(_3) -> [return: bb2, unwind: bb1]; // bb0[11]: scope 0 at $DIR/boxes.rs:12:26: 12:27
+          StorageDead(_2);                 // scope 0 at $DIR/boxes.rs:12:25: 12:26
+          drop(_3) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
       }
   
       bb1 (cleanup): {
-          resume;                          // bb1[0]: scope 0 at $DIR/boxes.rs:11:1: 13:2
+          resume;                          // scope 0 at $DIR/boxes.rs:11:1: 13:2
       }
   
       bb2: {
-          StorageDead(_3);                 // bb2[0]: scope 0 at $DIR/boxes.rs:12:26: 12:27
-          _0 = const ();                   // bb2[1]: scope 0 at $DIR/boxes.rs:11:11: 13:2
+          StorageDead(_3);                 // scope 0 at $DIR/boxes.rs:12:26: 12:27
+          _0 = const ();                   // scope 0 at $DIR/boxes.rs:11:11: 13:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/boxes.rs:11:11: 13:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb2[2]: scope 0 at $DIR/boxes.rs:13:1: 13:2
-          return;                          // bb2[3]: scope 0 at $DIR/boxes.rs:13:2: 13:2
+          StorageDead(_1);                 // scope 0 at $DIR/boxes.rs:13:1: 13:2
+          return;                          // scope 0 at $DIR/boxes.rs:13:2: 13:2
       }
   }
   
index ca0a309b1b5df4b6b6660ad9b4a0eb2fd4627132..58c27c5a20f8cfc93b022be478420be10a546fd7 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/cast.rs:4:9: 4:10
--         _1 = const 42u8 as u32 (Misc);   // bb0[1]: scope 0 at $DIR/cast.rs:4:13: 4:24
-+         _1 = const 42u32;                // bb0[1]: scope 0 at $DIR/cast.rs:4:13: 4:24
+          StorageLive(_1);                 // scope 0 at $DIR/cast.rs:4:9: 4:10
+-         _1 = const 42u8 as u32 (Misc);   // scope 0 at $DIR/cast.rs:4:13: 4:24
++         _1 = const 42u32;                // scope 0 at $DIR/cast.rs:4:13: 4:24
                                            // ty::Const
 -                                          // + ty: u8
 -                                          // + val: Value(Scalar(0x2a))
 -                                          // mir::Constant
 -                                          // + span: $DIR/cast.rs:4:13: 4:17
 -                                          // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
--         StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/cast.rs:6:9: 6:10
--         _2 = const 42u32 as u8 (Misc);   // bb0[3]: scope 1 at $DIR/cast.rs:6:13: 6:24
+-         StorageLive(_2);                 // scope 1 at $DIR/cast.rs:6:9: 6:10
+-         _2 = const 42u32 as u8 (Misc);   // scope 1 at $DIR/cast.rs:6:13: 6:24
 -                                          // ty::Const
                                            // + ty: u32
                                            // + val: Value(Scalar(0x0000002a))
 -                                          // + span: $DIR/cast.rs:6:13: 6:18
 +                                          // + span: $DIR/cast.rs:4:13: 4:24
                                            // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-+         StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/cast.rs:6:9: 6:10
-+         _2 = const 42u8;                 // bb0[3]: scope 1 at $DIR/cast.rs:6:13: 6:24
++         StorageLive(_2);                 // scope 1 at $DIR/cast.rs:6:9: 6:10
++         _2 = const 42u8;                 // scope 1 at $DIR/cast.rs:6:13: 6:24
 +                                          // ty::Const
 +                                          // + ty: u8
 +                                          // + val: Value(Scalar(0x2a))
 +                                          // mir::Constant
 +                                          // + span: $DIR/cast.rs:6:13: 6:24
 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
-          _0 = const ();                   // bb0[4]: scope 0 at $DIR/cast.rs:3:11: 7:2
+          _0 = const ();                   // scope 0 at $DIR/cast.rs:3:11: 7:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/cast.rs:3:11: 7:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_2);                 // bb0[5]: scope 1 at $DIR/cast.rs:7:1: 7:2
-          StorageDead(_1);                 // bb0[6]: scope 0 at $DIR/cast.rs:7:1: 7:2
-          return;                          // bb0[7]: scope 0 at $DIR/cast.rs:7:2: 7:2
+          StorageDead(_2);                 // scope 1 at $DIR/cast.rs:7:1: 7:2
+          StorageDead(_1);                 // scope 0 at $DIR/cast.rs:7:1: 7:2
+          return;                          // scope 0 at $DIR/cast.rs:7:2: 7:2
       }
   }
   
index 762927575f0f3ebf8fa4e68d6d510bd7af86562e..92add8bafdc0363f92a8c2d841f32580a0e0e55f 100644 (file)
@@ -10,9 +10,9 @@
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/checked_add.rs:5:9: 5:10
--         _2 = CheckedAdd(const 1u32, const 1u32); // bb0[1]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
-+         _2 = (const 2u32, const false);  // bb0[1]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
+          StorageLive(_1);                 // scope 0 at $DIR/checked_add.rs:5:9: 5:10
+-         _2 = CheckedAdd(const 1u32, const 1u32); // scope 0 at $DIR/checked_add.rs:5:18: 5:23
++         _2 = (const 2u32, const false);  // scope 0 at $DIR/checked_add.rs:5:18: 5:23
                                            // ty::Const
                                            // + ty: u32
 -                                          // + val: Value(Scalar(0x00000001))
                                            // mir::Constant
 -                                          // + span: $DIR/checked_add.rs:5:22: 5:23
 -                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
--         assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
+-         assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23
 +                                          // + span: $DIR/checked_add.rs:5:18: 5:23
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+         assert(!const false, "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
++         assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x00))
       }
   
       bb1: {
--         _1 = move (_2.0: u32);           // bb1[0]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
-+         _1 = const 2u32;                 // bb1[0]: scope 0 at $DIR/checked_add.rs:5:18: 5:23
+-         _1 = move (_2.0: u32);           // scope 0 at $DIR/checked_add.rs:5:18: 5:23
++         _1 = const 2u32;                 // scope 0 at $DIR/checked_add.rs:5:18: 5:23
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x00000002))
 +                                          // mir::Constant
 +                                          // + span: $DIR/checked_add.rs:5:18: 5:23
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-          _0 = const ();                   // bb1[1]: scope 0 at $DIR/checked_add.rs:4:11: 6:2
+          _0 = const ();                   // scope 0 at $DIR/checked_add.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/checked_add.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb1[2]: scope 0 at $DIR/checked_add.rs:6:1: 6:2
-          return;                          // bb1[3]: scope 0 at $DIR/checked_add.rs:6:2: 6:2
+          StorageDead(_1);                 // scope 0 at $DIR/checked_add.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/checked_add.rs:6:2: 6:2
       }
   }
   
index d3a6105a8522540f8447f6fff675b5e8bafa23f0..6c5fe7454b4edbd8f2d23e45ff5fd2644bf99219 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:9: 7:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:30
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
-          _3 = const main::FOO;            // bb0[3]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
+          StorageLive(_1);                 // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:9: 7:10
+          StorageLive(_2);                 // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:30
+          StorageLive(_3);                 // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
+          _3 = const main::FOO;            // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
                                            // ty::Const
                                            // + ty: &i32
                                            // + val: Unevaluated(DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), [], None)
                                            // mir::Constant
                                            // + span: $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
                                            // + literal: Const { ty: &i32, val: Unevaluated(DefId(0:5 ~ const_prop_fails_gracefully[317d]::main[0]::FOO[0]), [], None) }
-          _2 = &raw const (*_3);           // bb0[4]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
-          _1 = move _2 as usize (Misc);    // bb0[5]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:39
-          StorageDead(_2);                 // bb0[6]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:38: 7:39
-          StorageDead(_3);                 // bb0[7]: scope 0 at $DIR/const_prop_fails_gracefully.rs:7:39: 7:40
-          StorageLive(_4);                 // bb0[8]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:5: 8:12
-          StorageLive(_5);                 // bb0[9]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
-          _5 = _1;                         // bb0[10]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
-          _4 = const read(move _5) -> bb1; // bb0[11]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:5: 8:12
+          _2 = &raw const (*_3);           // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:16
+          _1 = move _2 as usize (Misc);    // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:13: 7:39
+          StorageDead(_2);                 // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:38: 7:39
+          StorageDead(_3);                 // scope 0 at $DIR/const_prop_fails_gracefully.rs:7:39: 7:40
+          StorageLive(_4);                 // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:5: 8:12
+          StorageLive(_5);                 // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
+          _5 = _1;                         // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:10: 8:11
+          _4 = const read(move _5) -> bb1; // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:5: 8:12
                                            // ty::Const
                                            // + ty: fn(usize) {read}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
-          StorageDead(_5);                 // bb1[0]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:11: 8:12
-          StorageDead(_4);                 // bb1[1]: scope 1 at $DIR/const_prop_fails_gracefully.rs:8:12: 8:13
-          _0 = const ();                   // bb1[2]: scope 0 at $DIR/const_prop_fails_gracefully.rs:5:11: 9:2
+          StorageDead(_5);                 // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:11: 8:12
+          StorageDead(_4);                 // scope 1 at $DIR/const_prop_fails_gracefully.rs:8:12: 8:13
+          _0 = const ();                   // scope 0 at $DIR/const_prop_fails_gracefully.rs:5:11: 9:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/const_prop_fails_gracefully.rs:5:11: 9:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb1[3]: scope 0 at $DIR/const_prop_fails_gracefully.rs:9:1: 9:2
-          return;                          // bb1[4]: scope 0 at $DIR/const_prop_fails_gracefully.rs:9:2: 9:2
+          StorageDead(_1);                 // scope 0 at $DIR/const_prop_fails_gracefully.rs:9:1: 9:2
+          return;                          // scope 0 at $DIR/const_prop_fails_gracefully.rs:9:2: 9:2
       }
   }
   
index cbda5e4ef864af880615ca2339c3dcb3a60ba8e3..07a144942caa985d8fe2bd63991035fb07d39944 100644 (file)
@@ -7,9 +7,9 @@
       let mut _2: !;                       // in scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
--         _1 = const <bool as NeedsDrop>::NEEDS; // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
-+         _1 = const false;                // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
+          StorageLive(_1);                 // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
+-         _1 = const <bool as NeedsDrop>::NEEDS; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
++         _1 = const false;                // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
                                            // ty::Const
                                            // + ty: bool
 -                                          // + val: Unevaluated(DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), [bool], None)
@@ -17,9 +17,9 @@
                                            // mir::Constant
                                            // + span: $DIR/control-flow-simplification.rs:12:8: 12:21
 -                                          // + literal: Const { ty: bool, val: Unevaluated(DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), [bool], None) }
--         switchInt(_1) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+-         switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+         switchInt(const false) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
++         switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x00))
       }
   
       bb1: {
-          _0 = const ();                   // bb1[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+          _0 = const ();                   // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/control-flow-simplification.rs:12:5: 14:6
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb1[1]: scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2
-          return;                          // bb1[2]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
+          StorageDead(_1);                 // scope 0 at $DIR/control-flow-simplification.rs:15:1: 15:2
+          return;                          // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
       }
   
       bb2: {
-          StorageLive(_2);                 // bb2[0]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
-          const std::rt::begin_panic::<&str>(const "explicit panic"); // bb2[1]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
+          StorageLive(_2);                 // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
+          const std::rt::begin_panic::<&str>(const "explicit panic"); // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
                                            // ty::Const
                                            // + ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}
                                            // + val: Value(Scalar(<ZST>))
index 73922b5666905437bf5e28555ff84f2aa6350507..3569b9897f96cad1a573dd736488e9582b0bad00 100644 (file)
@@ -4,13 +4,13 @@ fn hello() -> () {
     let mut _0: ();                      // return place in scope 0 at $DIR/control-flow-simplification.rs:11:14: 11:14
 
     bb0: {
-        _0 = const ();                   // bb0[0]: scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
+        _0 = const ();                   // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/control-flow-simplification.rs:12:5: 14:6
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb0[1]: scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
+        return;                          // scope 0 at $DIR/control-flow-simplification.rs:15:2: 15:2
     }
 }
index 753c64d6c32982388dbbb00c891d898c1082fd10..9979ea9549891202df9d3e56b9f8279b497e0fdf 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/discriminant.rs:6:9: 6:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
--         _3 = std::option::Option::<bool>::Some(const true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
-+         _3 = const std::option::Option::<bool>::Some(true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
+          StorageLive(_1);                 // scope 0 at $DIR/discriminant.rs:6:9: 6:10
+          StorageLive(_2);                 // scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          StorageLive(_3);                 // scope 0 at $DIR/discriminant.rs:6:34: 6:44
+-         _3 = std::option::Option::<bool>::Some(const true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
++         _3 = const std::option::Option::<bool>::Some(true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
                                            // ty::Const
 -                                          // + ty: bool
 +                                          // + ty: std::option::Option<bool>
                                            // mir::Constant
 -                                          // + span: $DIR/discriminant.rs:6:39: 6:43
 -                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
--         _4 = discriminant(_3);           // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
--         switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
+-         _4 = discriminant(_3);           // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+-         switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
 +                                          // + span: $DIR/discriminant.rs:6:34: 6:44
 +                                          // + literal: Const { ty: std::option::Option<bool>, val: Value(Scalar(0x01)) }
-+         _4 = const 1isize;               // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
++         _4 = const 1isize;               // scope 0 at $DIR/discriminant.rs:6:21: 6:31
 +                                          // ty::Const
 +                                          // + ty: isize
 +                                          // + val: Value(Scalar(0x00000001))
 +                                          // mir::Constant
 +                                          // + span: $DIR/discriminant.rs:6:21: 6:31
 +                                          // + literal: Const { ty: isize, val: Value(Scalar(0x00000001)) }
-+         switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
++         switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
 +                                          // ty::Const
 +                                          // + ty: isize
 +                                          // + val: Value(Scalar(0x00000001))
       }
   
       bb1: {
-          _2 = const 10i32;                // bb1[0]: scope 0 at $DIR/discriminant.rs:6:59: 6:61
+          _2 = const 10i32;                // scope 0 at $DIR/discriminant.rs:6:59: 6:61
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000000a))
                                            // mir::Constant
                                            // + span: $DIR/discriminant.rs:6:59: 6:61
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
-          goto -> bb4;                     // bb1[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:6:13: 6:64
       }
   
       bb2: {
--         switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
-+         switchInt(const true) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
+-         switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
++         switchInt(const true) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
       }
   
       bb3: {
-          _2 = const 42i32;                // bb3[0]: scope 0 at $DIR/discriminant.rs:6:47: 6:49
+          _2 = const 42i32;                // scope 0 at $DIR/discriminant.rs:6:47: 6:49
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000002a))
                                            // mir::Constant
                                            // + span: $DIR/discriminant.rs:6:47: 6:49
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-          goto -> bb4;                     // bb3[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:6:13: 6:64
       }
   
       bb4: {
-          _1 = Add(move _2, const 0i32);   // bb4[0]: scope 0 at $DIR/discriminant.rs:6:13: 6:68
+          _1 = Add(move _2, const 0i32);   // scope 0 at $DIR/discriminant.rs:6:13: 6:68
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/discriminant.rs:6:67: 6:68
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-          StorageDead(_2);                 // bb4[1]: scope 0 at $DIR/discriminant.rs:6:67: 6:68
-          StorageDead(_3);                 // bb4[2]: scope 0 at $DIR/discriminant.rs:6:68: 6:69
-          _0 = const ();                   // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2
+          StorageDead(_2);                 // scope 0 at $DIR/discriminant.rs:6:67: 6:68
+          StorageDead(_3);                 // scope 0 at $DIR/discriminant.rs:6:68: 6:69
+          _0 = const ();                   // scope 0 at $DIR/discriminant.rs:5:11: 7:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/discriminant.rs:5:11: 7:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb4[4]: scope 0 at $DIR/discriminant.rs:7:1: 7:2
-          return;                          // bb4[5]: scope 0 at $DIR/discriminant.rs:7:2: 7:2
+          StorageDead(_1);                 // scope 0 at $DIR/discriminant.rs:7:1: 7:2
+          return;                          // scope 0 at $DIR/discriminant.rs:7:2: 7:2
       }
   }
   
index 1d8e945f87a6d09a211cf58928b70a32edb46d91..ec0341e3de251e9768232f65683a6a604d3ad5d4 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/discriminant.rs:6:9: 6:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
--         _3 = std::option::Option::<bool>::Some(const true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
-+         _3 = const std::option::Option::<bool>::Some(true); // bb0[3]: scope 0 at $DIR/discriminant.rs:6:34: 6:44
+          StorageLive(_1);                 // scope 0 at $DIR/discriminant.rs:6:9: 6:10
+          StorageLive(_2);                 // scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          StorageLive(_3);                 // scope 0 at $DIR/discriminant.rs:6:34: 6:44
+-         _3 = std::option::Option::<bool>::Some(const true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
++         _3 = const std::option::Option::<bool>::Some(true); // scope 0 at $DIR/discriminant.rs:6:34: 6:44
                                            // ty::Const
 -                                          // + ty: bool
 +                                          // + ty: std::option::Option<bool>
                                            // mir::Constant
 -                                          // + span: $DIR/discriminant.rs:6:39: 6:43
 -                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
--         _4 = discriminant(_3);           // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
--         switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
+-         _4 = discriminant(_3);           // scope 0 at $DIR/discriminant.rs:6:21: 6:31
+-         switchInt(move _4) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
 +                                          // + span: $DIR/discriminant.rs:6:34: 6:44
 +                                          // + literal: Const { ty: std::option::Option<bool>, val: Value(Scalar(0x01)) }
-+         _4 = const 1isize;               // bb0[4]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
++         _4 = const 1isize;               // scope 0 at $DIR/discriminant.rs:6:21: 6:31
 +                                          // ty::Const
 +                                          // + ty: isize
 +                                          // + val: Value(Scalar(0x0000000000000001))
 +                                          // mir::Constant
 +                                          // + span: $DIR/discriminant.rs:6:21: 6:31
 +                                          // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000001)) }
-+         switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // bb0[5]: scope 0 at $DIR/discriminant.rs:6:21: 6:31
++         switchInt(const 1isize) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:6:21: 6:31
 +                                          // ty::Const
 +                                          // + ty: isize
 +                                          // + val: Value(Scalar(0x0000000000000001))
       }
   
       bb1: {
-          _2 = const 10i32;                // bb1[0]: scope 0 at $DIR/discriminant.rs:6:59: 6:61
+          _2 = const 10i32;                // scope 0 at $DIR/discriminant.rs:6:59: 6:61
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000000a))
                                            // mir::Constant
                                            // + span: $DIR/discriminant.rs:6:59: 6:61
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
-          goto -> bb4;                     // bb1[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:6:13: 6:64
       }
   
       bb2: {
--         switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
-+         switchInt(const true) -> [false: bb1, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/discriminant.rs:6:26: 6:30
+-         switchInt(((_3 as Some).0: bool)) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
++         switchInt(const true) -> [false: bb1, otherwise: bb3]; // scope 0 at $DIR/discriminant.rs:6:26: 6:30
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
       }
   
       bb3: {
-          _2 = const 42i32;                // bb3[0]: scope 0 at $DIR/discriminant.rs:6:47: 6:49
+          _2 = const 42i32;                // scope 0 at $DIR/discriminant.rs:6:47: 6:49
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000002a))
                                            // mir::Constant
                                            // + span: $DIR/discriminant.rs:6:47: 6:49
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-          goto -> bb4;                     // bb3[1]: scope 0 at $DIR/discriminant.rs:6:13: 6:64
+          goto -> bb4;                     // scope 0 at $DIR/discriminant.rs:6:13: 6:64
       }
   
       bb4: {
-          _1 = Add(move _2, const 0i32);   // bb4[0]: scope 0 at $DIR/discriminant.rs:6:13: 6:68
+          _1 = Add(move _2, const 0i32);   // scope 0 at $DIR/discriminant.rs:6:13: 6:68
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/discriminant.rs:6:67: 6:68
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-          StorageDead(_2);                 // bb4[1]: scope 0 at $DIR/discriminant.rs:6:67: 6:68
-          StorageDead(_3);                 // bb4[2]: scope 0 at $DIR/discriminant.rs:6:68: 6:69
-          _0 = const ();                   // bb4[3]: scope 0 at $DIR/discriminant.rs:5:11: 7:2
+          StorageDead(_2);                 // scope 0 at $DIR/discriminant.rs:6:67: 6:68
+          StorageDead(_3);                 // scope 0 at $DIR/discriminant.rs:6:68: 6:69
+          _0 = const ();                   // scope 0 at $DIR/discriminant.rs:5:11: 7:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/discriminant.rs:5:11: 7:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb4[4]: scope 0 at $DIR/discriminant.rs:7:1: 7:2
-          return;                          // bb4[5]: scope 0 at $DIR/discriminant.rs:7:2: 7:2
+          StorageDead(_1);                 // scope 0 at $DIR/discriminant.rs:7:1: 7:2
+          return;                          // scope 0 at $DIR/discriminant.rs:7:2: 7:2
       }
   }
   
index 4c80d0d1278445a0c067b2d649c2f787e3d05cf2..941cde9172a6f5356ec4421e803685d3004ae5c9 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/indirect.rs:5:9: 5:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/indirect.rs:5:13: 5:25
--         _2 = const 2u32 as u8 (Misc);    // bb0[2]: scope 0 at $DIR/indirect.rs:5:13: 5:25
-+         _2 = const 2u8;                  // bb0[2]: scope 0 at $DIR/indirect.rs:5:13: 5:25
+          StorageLive(_1);                 // scope 0 at $DIR/indirect.rs:5:9: 5:10
+          StorageLive(_2);                 // scope 0 at $DIR/indirect.rs:5:13: 5:25
+-         _2 = const 2u32 as u8 (Misc);    // scope 0 at $DIR/indirect.rs:5:13: 5:25
++         _2 = const 2u8;                  // scope 0 at $DIR/indirect.rs:5:13: 5:25
                                            // ty::Const
 -                                          // + ty: u32
 -                                          // + val: Value(Scalar(0x00000002))
                                            // mir::Constant
 -                                          // + span: $DIR/indirect.rs:5:14: 5:18
 -                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
--         _3 = CheckedAdd(move _2, const 1u8); // bb0[3]: scope 0 at $DIR/indirect.rs:5:13: 5:29
+-         _3 = CheckedAdd(move _2, const 1u8); // scope 0 at $DIR/indirect.rs:5:13: 5:29
 +                                          // + span: $DIR/indirect.rs:5:13: 5:25
 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
-+         _3 = (const 3u8, const false);   // bb0[3]: scope 0 at $DIR/indirect.rs:5:13: 5:29
++         _3 = (const 3u8, const false);   // scope 0 at $DIR/indirect.rs:5:13: 5:29
                                            // ty::Const
                                            // + ty: u8
 -                                          // + val: Value(Scalar(0x01))
@@ -34,7 +34,7 @@
                                            // mir::Constant
 -                                          // + span: $DIR/indirect.rs:5:28: 5:29
 -                                          // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
--         assert(!move (_3.1: bool), "attempt to add with overflow") -> bb1; // bb0[4]: scope 0 at $DIR/indirect.rs:5:13: 5:29
+-         assert(!move (_3.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29
 +                                          // + span: $DIR/indirect.rs:5:13: 5:29
 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
 +                                          // ty::Const
@@ -43,7 +43,7 @@
 +                                          // mir::Constant
 +                                          // + span: $DIR/indirect.rs:5:13: 5:29
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+         assert(!const false, "attempt to add with overflow") -> bb1; // bb0[4]: scope 0 at $DIR/indirect.rs:5:13: 5:29
++         assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x00))
       }
   
       bb1: {
--         _1 = move (_3.0: u8);            // bb1[0]: scope 0 at $DIR/indirect.rs:5:13: 5:29
-+         _1 = const 3u8;                  // bb1[0]: scope 0 at $DIR/indirect.rs:5:13: 5:29
+-         _1 = move (_3.0: u8);            // scope 0 at $DIR/indirect.rs:5:13: 5:29
++         _1 = const 3u8;                  // scope 0 at $DIR/indirect.rs:5:13: 5:29
 +                                          // ty::Const
 +                                          // + ty: u8
 +                                          // + val: Value(Scalar(0x03))
 +                                          // mir::Constant
 +                                          // + span: $DIR/indirect.rs:5:13: 5:29
 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
-          StorageDead(_2);                 // bb1[1]: scope 0 at $DIR/indirect.rs:5:28: 5:29
-          _0 = const ();                   // bb1[2]: scope 0 at $DIR/indirect.rs:4:11: 6:2
+          StorageDead(_2);                 // scope 0 at $DIR/indirect.rs:5:28: 5:29
+          _0 = const ();                   // scope 0 at $DIR/indirect.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/indirect.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb1[3]: scope 0 at $DIR/indirect.rs:6:1: 6:2
-          return;                          // bb1[4]: scope 0 at $DIR/indirect.rs:6:2: 6:2
+          StorageDead(_1);                 // scope 0 at $DIR/indirect.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/indirect.rs:6:2: 6:2
       }
   }
   
index 76c6759f700adf2ab7fb1d0f81cbef1464755d6f..c26494bdc1042959b0905e47d91170cb6d85db3d 100644 (file)
@@ -8,18 +8,18 @@
       let mut _3: ();                      // in scope 0 at $DIR/issue-66971.rs:16:13: 16:15
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/issue-66971.rs:16:5: 16:23
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/issue-66971.rs:16:12: 16:22
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/issue-66971.rs:16:13: 16:15
--         _3 = ();                         // bb0[3]: scope 0 at $DIR/issue-66971.rs:16:13: 16:15
-+         _3 = const ();                   // bb0[3]: scope 0 at $DIR/issue-66971.rs:16:13: 16:15
+          StorageLive(_1);                 // scope 0 at $DIR/issue-66971.rs:16:5: 16:23
+          StorageLive(_2);                 // scope 0 at $DIR/issue-66971.rs:16:12: 16:22
+          StorageLive(_3);                 // scope 0 at $DIR/issue-66971.rs:16:13: 16:15
+-         _3 = ();                         // scope 0 at $DIR/issue-66971.rs:16:13: 16:15
++         _3 = const ();                   // scope 0 at $DIR/issue-66971.rs:16:13: 16:15
 +                                          // ty::Const
 +                                          // + ty: ()
 +                                          // + val: Value(Scalar(<ZST>))
 +                                          // mir::Constant
 +                                          // + span: $DIR/issue-66971.rs:16:13: 16:15
 +                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          _2 = (move _3, const 0u8, const 0u8); // bb0[4]: scope 0 at $DIR/issue-66971.rs:16:12: 16:22
+          _2 = (move _3, const 0u8, const 0u8); // scope 0 at $DIR/issue-66971.rs:16:12: 16:22
                                            // ty::Const
                                            // + ty: u8
                                            // + val: Value(Scalar(0x00))
@@ -32,8 +32,8 @@
                                            // mir::Constant
                                            // + span: $DIR/issue-66971.rs:16:20: 16:21
                                            // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
-          StorageDead(_3);                 // bb0[5]: scope 0 at $DIR/issue-66971.rs:16:21: 16:22
-          _1 = const encode(move _2) -> bb1; // bb0[6]: scope 0 at $DIR/issue-66971.rs:16:5: 16:23
+          StorageDead(_3);                 // scope 0 at $DIR/issue-66971.rs:16:21: 16:22
+          _1 = const encode(move _2) -> bb1; // scope 0 at $DIR/issue-66971.rs:16:5: 16:23
                                            // ty::Const
                                            // + ty: fn(((), u8, u8)) {encode}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
-          StorageDead(_2);                 // bb1[0]: scope 0 at $DIR/issue-66971.rs:16:22: 16:23
-          StorageDead(_1);                 // bb1[1]: scope 0 at $DIR/issue-66971.rs:16:23: 16:24
-          _0 = const ();                   // bb1[2]: scope 0 at $DIR/issue-66971.rs:15:11: 17:2
+          StorageDead(_2);                 // scope 0 at $DIR/issue-66971.rs:16:22: 16:23
+          StorageDead(_1);                 // scope 0 at $DIR/issue-66971.rs:16:23: 16:24
+          _0 = const ();                   // scope 0 at $DIR/issue-66971.rs:15:11: 17:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/issue-66971.rs:15:11: 17:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb1[3]: scope 0 at $DIR/issue-66971.rs:17:2: 17:2
+          return;                          // scope 0 at $DIR/issue-66971.rs:17:2: 17:2
       }
   }
   
index 05e1a615953aefa4b228b239d91e0275acf5eadd..e328febb407ae4805b9be02c3dbc09821d5183b8 100644 (file)
@@ -8,10 +8,10 @@
       let mut _3: (u8, u8);                // in scope 0 at $DIR/issue-67019.rs:11:11: 11:17
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/issue-67019.rs:11:5: 11:20
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/issue-67019.rs:11:10: 11:19
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/issue-67019.rs:11:11: 11:17
-          _3 = (const 1u8, const 2u8);     // bb0[3]: scope 0 at $DIR/issue-67019.rs:11:11: 11:17
+          StorageLive(_1);                 // scope 0 at $DIR/issue-67019.rs:11:5: 11:20
+          StorageLive(_2);                 // scope 0 at $DIR/issue-67019.rs:11:10: 11:19
+          StorageLive(_3);                 // scope 0 at $DIR/issue-67019.rs:11:11: 11:17
+          _3 = (const 1u8, const 2u8);     // scope 0 at $DIR/issue-67019.rs:11:11: 11:17
                                            // ty::Const
                                            // + ty: u8
                                            // + val: Value(Scalar(0x01))
@@ -26,9 +26,9 @@
 -                                          // + span: $DIR/issue-67019.rs:11:15: 11:16
 +                                          // + span: $DIR/issue-67019.rs:11:11: 11:17
                                            // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
-          _2 = (move _3,);                 // bb0[4]: scope 0 at $DIR/issue-67019.rs:11:10: 11:19
-          StorageDead(_3);                 // bb0[5]: scope 0 at $DIR/issue-67019.rs:11:18: 11:19
-          _1 = const test(move _2) -> bb1; // bb0[6]: scope 0 at $DIR/issue-67019.rs:11:5: 11:20
+          _2 = (move _3,);                 // scope 0 at $DIR/issue-67019.rs:11:10: 11:19
+          StorageDead(_3);                 // scope 0 at $DIR/issue-67019.rs:11:18: 11:19
+          _1 = const test(move _2) -> bb1; // scope 0 at $DIR/issue-67019.rs:11:5: 11:20
                                            // ty::Const
                                            // + ty: fn(((u8, u8),)) {test}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
-          StorageDead(_2);                 // bb1[0]: scope 0 at $DIR/issue-67019.rs:11:19: 11:20
-          StorageDead(_1);                 // bb1[1]: scope 0 at $DIR/issue-67019.rs:11:20: 11:21
-          _0 = const ();                   // bb1[2]: scope 0 at $DIR/issue-67019.rs:10:11: 12:2
+          StorageDead(_2);                 // scope 0 at $DIR/issue-67019.rs:11:19: 11:20
+          StorageDead(_1);                 // scope 0 at $DIR/issue-67019.rs:11:20: 11:21
+          _0 = const ();                   // scope 0 at $DIR/issue-67019.rs:10:11: 12:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/issue-67019.rs:10:11: 12:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb1[3]: scope 0 at $DIR/issue-67019.rs:12:2: 12:2
+          return;                          // scope 0 at $DIR/issue-67019.rs:12:2: 12:2
       }
   }
   
index 2868365e9ac8efd2a8be1e03f333259109939201..9bd9bfa9f27968d9ab1045d625ff32c8bae367d3 100644 (file)
@@ -23,9 +23,9 @@
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
--         _2 = CheckedAdd(const 2i32, const 2i32); // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+         _2 = (const 4i32, const false);  // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+          StorageLive(_1);                 // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
+-         _2 = CheckedAdd(const 2i32, const 2i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++         _2 = (const 4i32, const false);  // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
                                            // ty::Const
                                            // + ty: i32
 -                                          // + val: Value(Scalar(0x00000002))
                                            // mir::Constant
 -                                          // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
--         assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+-         assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+         assert(!const false, "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++         assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x00))
       }
   
       bb1: {
--         _1 = move (_2.0: i32);           // bb1[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+         _1 = const 4i32;                 // bb1[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+-         _1 = move (_2.0: i32);           // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++         _1 = const 4i32;                 // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // ty::Const
 +                                          // + ty: i32
 +                                          // + val: Value(Scalar(0x00000004))
 +                                          // mir::Constant
 +                                          // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-          StorageLive(_3);                 // bb1[1]: scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
-          StorageLive(_4);                 // bb1[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
-          _4 = [const 0i32, const 1i32, const 2i32, const 3i32, const 4i32, const 5i32]; // bb1[3]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
+          StorageLive(_3);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
+          StorageLive(_4);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
+          _4 = [const 0i32, const 1i32, const 2i32, const 3i32, const 4i32, const 5i32]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:13:29: 13:30
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
-          StorageLive(_5);                 // bb1[4]: scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
-          _5 = const 3usize;               // bb1[5]: scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
+          StorageLive(_5);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
+          _5 = const 3usize;               // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x00000003))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:13:32: 13:33
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
-          _6 = const 6usize;               // bb1[6]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+          _6 = const 6usize;               // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x00000006))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000006)) }
--         _7 = Lt(_5, _6);                 // bb1[7]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
--         assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // bb1[8]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+         _7 = const true;                 // bb1[7]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+-         _7 = Lt(_5, _6);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+-         assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++         _7 = const true;                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
 +                                          // mir::Constant
 +                                          // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+         assert(const true, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // bb1[8]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++         assert(const true, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
       }
   
       bb2: {
--         _3 = _4[_5];                     // bb2[0]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+         _3 = const 3i32;                 // bb2[0]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+-         _3 = _4[_5];                     // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++         _3 = const 3i32;                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // ty::Const
 +                                          // + ty: i32
 +                                          // + val: Value(Scalar(0x00000003))
 +                                          // mir::Constant
 +                                          // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-          StorageDead(_5);                 // bb2[1]: scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
-          StorageDead(_4);                 // bb2[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
-          StorageLive(_8);                 // bb2[3]: scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
-          StorageLive(_9);                 // bb2[4]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
-          _9 = Point { x: const 12u32, y: const 42u32 }; // bb2[5]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
+          StorageDead(_5);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
+          StorageDead(_4);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
+          StorageLive(_8);                 // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
+          StorageLive(_9);                 // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
+          _9 = Point { x: const 12u32, y: const 42u32 }; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
                                            // ty::Const
                                            // + ty: u32
                                            // + val: Value(Scalar(0x0000000c))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:14:32: 14:34
                                            // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
--         _8 = (_9.1: u32);                // bb2[6]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
-+         _8 = const 42u32;                // bb2[6]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+-         _8 = (_9.1: u32);                // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
++         _8 = const 42u32;                // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x0000002a))
 +                                          // mir::Constant
 +                                          // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-          StorageDead(_9);                 // bb2[7]: scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
-          _0 = const ();                   // bb2[8]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
+          StorageDead(_9);                 // scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
+          _0 = const ();                   // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:11:11: 15:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_8);                 // bb2[9]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-          StorageDead(_3);                 // bb2[10]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-          StorageDead(_1);                 // bb2[11]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-          return;                          // bb2[12]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
+          StorageDead(_8);                 // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+          StorageDead(_3);                 // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+          StorageDead(_1);                 // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+          return;                          // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
       }
   }
   
index f8aea27df6660c846f9281e1332a50cee391c35a..8ea9316c7d49b60416b2862244574e9494280e0e 100644 (file)
@@ -16,40 +16,40 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
-        _1 = const 4i32;                 // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+        StorageLive(_1);                 // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
+        _1 = const 4i32;                 // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000004))
                                          // mir::Constant
                                          // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-        StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
-        _2 = const 3i32;                 // bb0[3]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+        StorageLive(_2);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
+        _2 = const 3i32;                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
                                          // mir::Constant
                                          // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_3);                 // bb0[4]: scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
-        _3 = const 42u32;                // bb0[5]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+        StorageLive(_3);                 // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
+        _3 = const 42u32;                // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x0000002a))
                                          // mir::Constant
                                          // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-        _0 = const ();                   // bb0[6]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
+        _0 = const ();                   // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/optimizes_into_variable.rs:11:11: 15:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_3);                 // bb0[7]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-        StorageDead(_2);                 // bb0[8]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-        StorageDead(_1);                 // bb0[9]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-        return;                          // bb0[10]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
+        StorageDead(_3);                 // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+        StorageDead(_2);                 // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+        StorageDead(_1);                 // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+        return;                          // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
     }
 }
index 0097d9448c81f570140b86c16831941f731a3715..1da763ec9558aac38c46fe15c6750a8fec68e523 100644 (file)
@@ -23,9 +23,9 @@
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
--         _2 = CheckedAdd(const 2i32, const 2i32); // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+         _2 = (const 4i32, const false);  // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+          StorageLive(_1);                 // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
+-         _2 = CheckedAdd(const 2i32, const 2i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++         _2 = (const 4i32, const false);  // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
                                            // ty::Const
                                            // + ty: i32
 -                                          // + val: Value(Scalar(0x00000002))
                                            // mir::Constant
 -                                          // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
--         assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+-         assert(!move (_2.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+         assert(!const false, "attempt to add with overflow") -> bb1; // bb0[2]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++         assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x00))
       }
   
       bb1: {
--         _1 = move (_2.0: i32);           // bb1[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+         _1 = const 4i32;                 // bb1[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+-         _1 = move (_2.0: i32);           // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
++         _1 = const 4i32;                 // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // ty::Const
 +                                          // + ty: i32
 +                                          // + val: Value(Scalar(0x00000004))
 +                                          // mir::Constant
 +                                          // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
 +                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-          StorageLive(_3);                 // bb1[1]: scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
-          StorageLive(_4);                 // bb1[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
-          _4 = [const 0i32, const 1i32, const 2i32, const 3i32, const 4i32, const 5i32]; // bb1[3]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
+          StorageLive(_3);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
+          StorageLive(_4);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
+          _4 = [const 0i32, const 1i32, const 2i32, const 3i32, const 4i32, const 5i32]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:13:29: 13:30
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
-          StorageLive(_5);                 // bb1[4]: scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
-          _5 = const 3usize;               // bb1[5]: scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
+          StorageLive(_5);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
+          _5 = const 3usize;               // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x0000000000000003))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:13:32: 13:33
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
-          _6 = const 6usize;               // bb1[6]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+          _6 = const 6usize;               // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x0000000000000006))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000006)) }
--         _7 = Lt(_5, _6);                 // bb1[7]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
--         assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // bb1[8]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+         _7 = const true;                 // bb1[7]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+-         _7 = Lt(_5, _6);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+-         assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++         _7 = const true;                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
 +                                          // mir::Constant
 +                                          // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+         assert(const true, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // bb1[8]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++         assert(const true, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
       }
   
       bb2: {
--         _3 = _4[_5];                     // bb2[0]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+         _3 = const 3i32;                 // bb2[0]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+-         _3 = _4[_5];                     // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
++         _3 = const 3i32;                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // ty::Const
 +                                          // + ty: i32
 +                                          // + val: Value(Scalar(0x00000003))
 +                                          // mir::Constant
 +                                          // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
 +                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-          StorageDead(_5);                 // bb2[1]: scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
-          StorageDead(_4);                 // bb2[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
-          StorageLive(_8);                 // bb2[3]: scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
-          StorageLive(_9);                 // bb2[4]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
-          _9 = Point { x: const 12u32, y: const 42u32 }; // bb2[5]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
+          StorageDead(_5);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
+          StorageDead(_4);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
+          StorageLive(_8);                 // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
+          StorageLive(_9);                 // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
+          _9 = Point { x: const 12u32, y: const 42u32 }; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
                                            // ty::Const
                                            // + ty: u32
                                            // + val: Value(Scalar(0x0000000c))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:14:32: 14:34
                                            // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
--         _8 = (_9.1: u32);                // bb2[6]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
-+         _8 = const 42u32;                // bb2[6]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+-         _8 = (_9.1: u32);                // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
++         _8 = const 42u32;                // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x0000002a))
 +                                          // mir::Constant
 +                                          // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-          StorageDead(_9);                 // bb2[7]: scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
-          _0 = const ();                   // bb2[8]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
+          StorageDead(_9);                 // scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
+          _0 = const ();                   // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/optimizes_into_variable.rs:11:11: 15:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_8);                 // bb2[9]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-          StorageDead(_3);                 // bb2[10]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-          StorageDead(_1);                 // bb2[11]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-          return;                          // bb2[12]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
+          StorageDead(_8);                 // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+          StorageDead(_3);                 // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+          StorageDead(_1);                 // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+          return;                          // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
       }
   }
   
index f8aea27df6660c846f9281e1332a50cee391c35a..8ea9316c7d49b60416b2862244574e9494280e0e 100644 (file)
@@ -16,40 +16,40 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
-        _1 = const 4i32;                 // bb0[1]: scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+        StorageLive(_1);                 // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
+        _1 = const 4i32;                 // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000004))
                                          // mir::Constant
                                          // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-        StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
-        _2 = const 3i32;                 // bb0[3]: scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+        StorageLive(_2);                 // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
+        _2 = const 3i32;                 // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
                                          // mir::Constant
                                          // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_3);                 // bb0[4]: scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
-        _3 = const 42u32;                // bb0[5]: scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+        StorageLive(_3);                 // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
+        _3 = const 42u32;                // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x0000002a))
                                          // mir::Constant
                                          // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-        _0 = const ();                   // bb0[6]: scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
+        _0 = const ();                   // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/optimizes_into_variable.rs:11:11: 15:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_3);                 // bb0[7]: scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-        StorageDead(_2);                 // bb0[8]: scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-        StorageDead(_1);                 // bb0[9]: scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
-        return;                          // bb0[10]: scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
+        StorageDead(_3);                 // scope 2 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+        StorageDead(_2);                 // scope 1 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+        StorageDead(_1);                 // scope 0 at $DIR/optimizes_into_variable.rs:15:1: 15:2
+        return;                          // scope 0 at $DIR/optimizes_into_variable.rs:15:2: 15:2
     }
 }
index 826e3695e32b75051418c55ddcfee5749a782eea..bbe0d106011473e6d99ff3f6b18a1f9803bcb287 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/read_immutable_static.rs:7:9: 7:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
-          _3 = const {alloc0+0x0: &u8};    // bb0[3]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+          StorageLive(_1);                 // scope 0 at $DIR/read_immutable_static.rs:7:9: 7:10
+          StorageLive(_2);                 // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+          StorageLive(_3);                 // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+          _3 = const {alloc0+0x0: &u8};    // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
                                            // ty::Const
                                            // + ty: &u8
                                            // + val: Value(Scalar(alloc0+0x0))
                                            // mir::Constant
                                            // + span: $DIR/read_immutable_static.rs:7:13: 7:16
                                            // + literal: Const { ty: &u8, val: Value(Scalar(alloc0+0x0)) }
--         _2 = (*_3);                      // bb0[4]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
-+         _2 = const 2u8;                  // bb0[4]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+-         _2 = (*_3);                      // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
++         _2 = const 2u8;                  // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
 +                                          // ty::Const
 +                                          // + ty: u8
 +                                          // + val: Value(Scalar(0x02))
 +                                          // mir::Constant
 +                                          // + span: $DIR/read_immutable_static.rs:7:13: 7:16
 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
-          StorageLive(_4);                 // bb0[5]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
-          StorageLive(_5);                 // bb0[6]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
-          _5 = const {alloc0+0x0: &u8};    // bb0[7]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+          StorageLive(_4);                 // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+          StorageLive(_5);                 // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+          _5 = const {alloc0+0x0: &u8};    // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
                                            // ty::Const
                                            // + ty: &u8
                                            // + val: Value(Scalar(alloc0+0x0))
                                            // mir::Constant
                                            // + span: $DIR/read_immutable_static.rs:7:19: 7:22
                                            // + literal: Const { ty: &u8, val: Value(Scalar(alloc0+0x0)) }
--         _4 = (*_5);                      // bb0[8]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
--         _1 = Add(move _2, move _4);      // bb0[9]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
-+         _4 = const 2u8;                  // bb0[8]: scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+-         _4 = (*_5);                      // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
+-         _1 = Add(move _2, move _4);      // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
++         _4 = const 2u8;                  // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
 +                                          // ty::Const
 +                                          // + ty: u8
 +                                          // + val: Value(Scalar(0x02))
 +                                          // mir::Constant
 +                                          // + span: $DIR/read_immutable_static.rs:7:19: 7:22
 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
-+         _1 = const 4u8;                  // bb0[9]: scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
++         _1 = const 4u8;                  // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
 +                                          // ty::Const
 +                                          // + ty: u8
 +                                          // + val: Value(Scalar(0x04))
 +                                          // mir::Constant
 +                                          // + span: $DIR/read_immutable_static.rs:7:13: 7:22
 +                                          // + literal: Const { ty: u8, val: Value(Scalar(0x04)) }
-          StorageDead(_4);                 // bb0[10]: scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
-          StorageDead(_2);                 // bb0[11]: scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
-          StorageDead(_5);                 // bb0[12]: scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
-          StorageDead(_3);                 // bb0[13]: scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
-          _0 = const ();                   // bb0[14]: scope 0 at $DIR/read_immutable_static.rs:6:11: 8:2
+          StorageDead(_4);                 // scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
+          StorageDead(_2);                 // scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
+          StorageDead(_5);                 // scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
+          StorageDead(_3);                 // scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
+          _0 = const ();                   // scope 0 at $DIR/read_immutable_static.rs:6:11: 8:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/read_immutable_static.rs:6:11: 8:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb0[15]: scope 0 at $DIR/read_immutable_static.rs:8:1: 8:2
-          return;                          // bb0[16]: scope 0 at $DIR/read_immutable_static.rs:8:2: 8:2
+          StorageDead(_1);                 // scope 0 at $DIR/read_immutable_static.rs:8:1: 8:2
+          return;                          // scope 0 at $DIR/read_immutable_static.rs:8:2: 8:2
       }
   }
   
index 591fdaddfccd5b25142230355ae785ac0763d183..dcd3d4019811ee16f493bcfd9d415df8479231b3 100644 (file)
@@ -9,34 +9,34 @@
       let mut _4: &i32;                    // in scope 0 at $DIR/ref_deref.rs:5:6: 5:10
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
-          _4 = const main::promoted[0];    // bb0[2]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+          StorageLive(_1);                 // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+          StorageLive(_2);                 // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+          _4 = const main::promoted[0];    // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
                                            // ty::Const
                                            // + ty: &i32
                                            // + val: Unevaluated(DefId(0:3 ~ ref_deref[317d]::main[0]), [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/ref_deref.rs:5:6: 5:10
                                            // + literal: Const { ty: &i32, val: Unevaluated(DefId(0:3 ~ ref_deref[317d]::main[0]), [], Some(promoted[0])) }
-          _2 = _4;                         // bb0[3]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
--         _1 = (*_2);                      // bb0[4]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
-+         _1 = const 4i32;                 // bb0[4]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+          _2 = _4;                         // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+-         _1 = (*_2);                      // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
++         _1 = const 4i32;                 // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
 +                                          // ty::Const
 +                                          // + ty: i32
 +                                          // + val: Value(Scalar(0x00000004))
 +                                          // mir::Constant
 +                                          // + span: $DIR/ref_deref.rs:5:5: 5:10
 +                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-          StorageDead(_2);                 // bb0[5]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
-          StorageDead(_1);                 // bb0[6]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
-          _0 = const ();                   // bb0[7]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2
+          StorageDead(_2);                 // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+          StorageDead(_1);                 // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+          _0 = const ();                   // scope 0 at $DIR/ref_deref.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/ref_deref.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb0[8]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2
+          return;                          // scope 0 at $DIR/ref_deref.rs:6:2: 6:2
       }
   }
   
index 5cd9f43a5c684014f788e1c79f290c1cd9be9225..ef696f1ab8052a137f583829b41af9865aff10a2 100644 (file)
@@ -9,11 +9,11 @@
 +     let mut _4: &i32;                    // in scope 0 at $DIR/ref_deref.rs:5:6: 5:10
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
--         StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/ref_deref.rs:5:8: 5:9
--         _3 = const 4i32;                 // bb0[3]: scope 0 at $DIR/ref_deref.rs:5:8: 5:9
-+         _4 = const main::promoted[0];    // bb0[2]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+          StorageLive(_1);                 // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+          StorageLive(_2);                 // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+-         StorageLive(_3);                 // scope 0 at $DIR/ref_deref.rs:5:8: 5:9
+-         _3 = const 4i32;                 // scope 0 at $DIR/ref_deref.rs:5:8: 5:9
++         _4 = const main::promoted[0];    // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
                                            // ty::Const
 -                                          // + ty: i32
 -                                          // + val: Value(Scalar(0x00000004))
                                            // mir::Constant
 -                                          // + span: $DIR/ref_deref.rs:5:8: 5:9
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
--         _2 = &_3;                        // bb0[4]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
--         _1 = (*_2);                      // bb0[5]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
--         StorageDead(_3);                 // bb0[6]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
--         StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
--         StorageDead(_1);                 // bb0[8]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
--         _0 = const ();                   // bb0[9]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2
+-         _2 = &_3;                        // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
 +                                          // + span: $DIR/ref_deref.rs:5:6: 5:10
 +                                          // + literal: Const { ty: &i32, val: Unevaluated(DefId(0:3 ~ ref_deref[317d]::main[0]), [], Some(promoted[0])) }
-+         _2 = &(*_4);                     // bb0[3]: scope 0 at $DIR/ref_deref.rs:5:6: 5:10
-+         _1 = (*_2);                      // bb0[4]: scope 0 at $DIR/ref_deref.rs:5:5: 5:10
-+         StorageDead(_2);                 // bb0[5]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
-+         StorageDead(_1);                 // bb0[6]: scope 0 at $DIR/ref_deref.rs:5:10: 5:11
-+         _0 = const ();                   // bb0[7]: scope 0 at $DIR/ref_deref.rs:4:11: 6:2
++         _2 = &(*_4);                     // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+          _1 = (*_2);                      // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+-         StorageDead(_3);                 // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+          StorageDead(_2);                 // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+          StorageDead(_1);                 // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
+          _0 = const ();                   // scope 0 at $DIR/ref_deref.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/ref_deref.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         return;                          // bb0[10]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2
-+         return;                          // bb0[8]: scope 0 at $DIR/ref_deref.rs:6:2: 6:2
+          return;                          // scope 0 at $DIR/ref_deref.rs:6:2: 6:2
       }
   }
   
index 6393bad2993d55ff7d09ee170adc75fef7f12b7a..dd2f5bd90642856262166d96a0ba80792b071f13 100644 (file)
@@ -9,27 +9,27 @@
       let mut _4: &(i32, i32);             // in scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
-          _4 = const main::promoted[0];    // bb0[2]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+          StorageLive(_1);                 // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
+          StorageLive(_2);                 // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+          _4 = const main::promoted[0];    // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
                                            // ty::Const
                                            // + ty: &(i32, i32)
                                            // + val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/ref_deref_project.rs:5:6: 5:17
                                            // + literal: Const { ty: &(i32, i32), val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0])) }
-          _2 = &((*_4).1: i32);            // bb0[3]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
-          _1 = (*_2);                      // bb0[4]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
-          StorageDead(_2);                 // bb0[5]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
-          StorageDead(_1);                 // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
-          _0 = const ();                   // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
+          _2 = &((*_4).1: i32);            // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+          _1 = (*_2);                      // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
+          StorageDead(_2);                 // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+          StorageDead(_1);                 // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+          _0 = const ();                   // scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/ref_deref_project.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb0[8]: scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
+          return;                          // scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
       }
   }
   
index 020ad7278c038af50283249c87ad3446b37f560a..7f23f5ea7a69a8e456f7feafe86f056bd2e26b2a 100644 (file)
@@ -9,11 +9,11 @@
 +     let mut _4: &(i32, i32);             // in scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
--         StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
--         _3 = (const 4i32, const 5i32);   // bb0[3]: scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
-+         _4 = const main::promoted[0];    // bb0[2]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+          StorageLive(_1);                 // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
+          StorageLive(_2);                 // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+-         StorageLive(_3);                 // scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
+-         _3 = (const 4i32, const 5i32);   // scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
++         _4 = const main::promoted[0];    // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
                                            // ty::Const
 -                                          // + ty: i32
 -                                          // + val: Value(Scalar(0x00000004))
                                            // mir::Constant
 -                                          // + span: $DIR/ref_deref_project.rs:5:9: 5:10
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-+                                          // + span: $DIR/ref_deref_project.rs:5:6: 5:17
-+                                          // + literal: Const { ty: &(i32, i32), val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0])) }
-+         _2 = &((*_4).1: i32);            // bb0[3]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
-+         _1 = (*_2);                      // bb0[4]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
-+         StorageDead(_2);                 // bb0[5]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
-+         StorageDead(_1);                 // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
-+         _0 = const ();                   // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
-                                           // ty::Const
+-                                          // ty::Const
 -                                          // + ty: i32
 -                                          // + val: Value(Scalar(0x00000005))
 -                                          // mir::Constant
 -                                          // + span: $DIR/ref_deref_project.rs:5:12: 5:13
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
--         _2 = &(_3.1: i32);               // bb0[4]: scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
--         _1 = (*_2);                      // bb0[5]: scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
--         StorageDead(_3);                 // bb0[6]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
--         StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
--         StorageDead(_1);                 // bb0[8]: scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
--         _0 = const ();                   // bb0[9]: scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
--                                          // ty::Const
+-         _2 = &(_3.1: i32);               // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
++                                          // + span: $DIR/ref_deref_project.rs:5:6: 5:17
++                                          // + literal: Const { ty: &(i32, i32), val: Unevaluated(DefId(0:3 ~ ref_deref_project[317d]::main[0]), [], Some(promoted[0])) }
++         _2 = &((*_4).1: i32);            // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+          _1 = (*_2);                      // scope 0 at $DIR/ref_deref_project.rs:5:5: 5:17
+-         StorageDead(_3);                 // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+          StorageDead(_2);                 // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+          StorageDead(_1);                 // scope 0 at $DIR/ref_deref_project.rs:5:17: 5:18
+          _0 = const ();                   // scope 0 at $DIR/ref_deref_project.rs:4:11: 6:2
+                                           // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/ref_deref_project.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         return;                          // bb0[10]: scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
-+         return;                          // bb0[8]: scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
+          return;                          // scope 0 at $DIR/ref_deref_project.rs:6:2: 6:2
       }
   }
   
index 388ebe08689c2f39cdaf04b71f216c331f897302..93fe856c8e81d2c9c565368bc8f881c5a5f5956e 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
-          _3 = const main as fn() (Pointer(ReifyFnPointer)); // bb0[3]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
+          StorageLive(_1);                 // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41
+          StorageLive(_2);                 // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26
+          StorageLive(_3);                 // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
+          _3 = const main as fn() (Pointer(ReifyFnPointer)); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:17
                                            // ty::Const
                                            // + ty: fn() {main}
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/reify_fn_ptr.rs:4:13: 4:17
                                            // + literal: Const { ty: fn() {main}, val: Value(Scalar(<ZST>)) }
-          _2 = move _3 as usize (Misc);    // bb0[4]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26
-          StorageDead(_3);                 // bb0[5]: scope 0 at $DIR/reify_fn_ptr.rs:4:25: 4:26
-          _1 = move _2 as *const fn() (Misc); // bb0[6]: scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41
-          StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/reify_fn_ptr.rs:4:40: 4:41
-          StorageDead(_1);                 // bb0[8]: scope 0 at $DIR/reify_fn_ptr.rs:4:41: 4:42
-          _0 = const ();                   // bb0[9]: scope 0 at $DIR/reify_fn_ptr.rs:3:11: 5:2
+          _2 = move _3 as usize (Misc);    // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:26
+          StorageDead(_3);                 // scope 0 at $DIR/reify_fn_ptr.rs:4:25: 4:26
+          _1 = move _2 as *const fn() (Misc); // scope 0 at $DIR/reify_fn_ptr.rs:4:13: 4:41
+          StorageDead(_2);                 // scope 0 at $DIR/reify_fn_ptr.rs:4:40: 4:41
+          StorageDead(_1);                 // scope 0 at $DIR/reify_fn_ptr.rs:4:41: 4:42
+          _0 = const ();                   // scope 0 at $DIR/reify_fn_ptr.rs:3:11: 5:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/reify_fn_ptr.rs:3:11: 5:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb0[10]: scope 0 at $DIR/reify_fn_ptr.rs:5:2: 5:2
+          return;                          // scope 0 at $DIR/reify_fn_ptr.rs:5:2: 5:2
       }
   }
   
index 921de794722533b2d8784400aac3384313daf843..4ccfe1838d9cceca5f089ac72481ccc6cc7654c6 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/repeat.rs:6:9: 6:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/repeat.rs:6:18: 6:25
-          _3 = [const 42u32; 8];           // bb0[3]: scope 0 at $DIR/repeat.rs:6:18: 6:25
+          StorageLive(_1);                 // scope 0 at $DIR/repeat.rs:6:9: 6:10
+          StorageLive(_2);                 // scope 0 at $DIR/repeat.rs:6:18: 6:28
+          StorageLive(_3);                 // scope 0 at $DIR/repeat.rs:6:18: 6:25
+          _3 = [const 42u32; 8];           // scope 0 at $DIR/repeat.rs:6:18: 6:25
                                            // ty::Const
                                            // + ty: u32
                                            // + val: Value(Scalar(0x0000002a))
                                            // mir::Constant
                                            // + span: $DIR/repeat.rs:6:19: 6:21
                                            // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-          StorageLive(_4);                 // bb0[4]: scope 0 at $DIR/repeat.rs:6:26: 6:27
-          _4 = const 2usize;               // bb0[5]: scope 0 at $DIR/repeat.rs:6:26: 6:27
+          StorageLive(_4);                 // scope 0 at $DIR/repeat.rs:6:26: 6:27
+          _4 = const 2usize;               // scope 0 at $DIR/repeat.rs:6:26: 6:27
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x00000002))
                                            // mir::Constant
                                            // + span: $DIR/repeat.rs:6:26: 6:27
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
-          _5 = const 8usize;               // bb0[6]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+          _5 = const 8usize;               // scope 0 at $DIR/repeat.rs:6:18: 6:28
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x00000008))
                                            // mir::Constant
                                            // + span: $DIR/repeat.rs:6:18: 6:28
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000008)) }
--         _6 = Lt(_4, _5);                 // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28
--         assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-+         _6 = const true;                 // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+-         _6 = Lt(_4, _5);                 // scope 0 at $DIR/repeat.rs:6:18: 6:28
+-         assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
++         _6 = const true;                 // scope 0 at $DIR/repeat.rs:6:18: 6:28
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
 +                                          // mir::Constant
 +                                          // + span: $DIR/repeat.rs:6:18: 6:28
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+         assert(const true, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28
++         assert(const true, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
@@ -58,9 +58,9 @@
       }
   
       bb1: {
--         _2 = _3[_4];                     // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28
--         _1 = Add(move _2, const 0u32);   // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32
-+         _2 = const 42u32;                // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+-         _2 = _3[_4];                     // scope 0 at $DIR/repeat.rs:6:18: 6:28
+-         _1 = Add(move _2, const 0u32);   // scope 0 at $DIR/repeat.rs:6:18: 6:32
++         _2 = const 42u32;                // scope 0 at $DIR/repeat.rs:6:18: 6:28
                                            // ty::Const
                                            // + ty: u32
 -                                          // + val: Value(Scalar(0x00000000))
 -                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
 +                                          // + span: $DIR/repeat.rs:6:18: 6:28
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-+         _1 = const 42u32;                // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32
++         _1 = const 42u32;                // scope 0 at $DIR/repeat.rs:6:18: 6:32
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x0000002a))
 +                                          // mir::Constant
 +                                          // + span: $DIR/repeat.rs:6:18: 6:32
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-          StorageDead(_2);                 // bb1[2]: scope 0 at $DIR/repeat.rs:6:31: 6:32
-          StorageDead(_4);                 // bb1[3]: scope 0 at $DIR/repeat.rs:6:32: 6:33
-          StorageDead(_3);                 // bb1[4]: scope 0 at $DIR/repeat.rs:6:32: 6:33
-          _0 = const ();                   // bb1[5]: scope 0 at $DIR/repeat.rs:5:11: 7:2
+          StorageDead(_2);                 // scope 0 at $DIR/repeat.rs:6:31: 6:32
+          StorageDead(_4);                 // scope 0 at $DIR/repeat.rs:6:32: 6:33
+          StorageDead(_3);                 // scope 0 at $DIR/repeat.rs:6:32: 6:33
+          _0 = const ();                   // scope 0 at $DIR/repeat.rs:5:11: 7:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/repeat.rs:5:11: 7:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb1[6]: scope 0 at $DIR/repeat.rs:7:1: 7:2
-          return;                          // bb1[7]: scope 0 at $DIR/repeat.rs:7:2: 7:2
+          StorageDead(_1);                 // scope 0 at $DIR/repeat.rs:7:1: 7:2
+          return;                          // scope 0 at $DIR/repeat.rs:7:2: 7:2
       }
   }
   
index 361ee4933788e4603e34fb2825b5a21f7db14522..fe9d16c4ffabb91b851979226413f5c0335402f3 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/repeat.rs:6:9: 6:10
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/repeat.rs:6:18: 6:25
-          _3 = [const 42u32; 8];           // bb0[3]: scope 0 at $DIR/repeat.rs:6:18: 6:25
+          StorageLive(_1);                 // scope 0 at $DIR/repeat.rs:6:9: 6:10
+          StorageLive(_2);                 // scope 0 at $DIR/repeat.rs:6:18: 6:28
+          StorageLive(_3);                 // scope 0 at $DIR/repeat.rs:6:18: 6:25
+          _3 = [const 42u32; 8];           // scope 0 at $DIR/repeat.rs:6:18: 6:25
                                            // ty::Const
                                            // + ty: u32
                                            // + val: Value(Scalar(0x0000002a))
                                            // mir::Constant
                                            // + span: $DIR/repeat.rs:6:19: 6:21
                                            // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-          StorageLive(_4);                 // bb0[4]: scope 0 at $DIR/repeat.rs:6:26: 6:27
-          _4 = const 2usize;               // bb0[5]: scope 0 at $DIR/repeat.rs:6:26: 6:27
+          StorageLive(_4);                 // scope 0 at $DIR/repeat.rs:6:26: 6:27
+          _4 = const 2usize;               // scope 0 at $DIR/repeat.rs:6:26: 6:27
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x0000000000000002))
                                            // mir::Constant
                                            // + span: $DIR/repeat.rs:6:26: 6:27
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
-          _5 = const 8usize;               // bb0[6]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+          _5 = const 8usize;               // scope 0 at $DIR/repeat.rs:6:18: 6:28
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x0000000000000008))
                                            // mir::Constant
                                            // + span: $DIR/repeat.rs:6:18: 6:28
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000008)) }
--         _6 = Lt(_4, _5);                 // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28
--         assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28
-+         _6 = const true;                 // bb0[7]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+-         _6 = Lt(_4, _5);                 // scope 0 at $DIR/repeat.rs:6:18: 6:28
+-         assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
++         _6 = const true;                 // scope 0 at $DIR/repeat.rs:6:18: 6:28
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
 +                                          // mir::Constant
 +                                          // + span: $DIR/repeat.rs:6:18: 6:28
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+         assert(const true, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // bb0[8]: scope 0 at $DIR/repeat.rs:6:18: 6:28
++         assert(const true, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
@@ -58,9 +58,9 @@
       }
   
       bb1: {
--         _2 = _3[_4];                     // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28
--         _1 = Add(move _2, const 0u32);   // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32
-+         _2 = const 42u32;                // bb1[0]: scope 0 at $DIR/repeat.rs:6:18: 6:28
+-         _2 = _3[_4];                     // scope 0 at $DIR/repeat.rs:6:18: 6:28
+-         _1 = Add(move _2, const 0u32);   // scope 0 at $DIR/repeat.rs:6:18: 6:32
++         _2 = const 42u32;                // scope 0 at $DIR/repeat.rs:6:18: 6:28
                                            // ty::Const
                                            // + ty: u32
 -                                          // + val: Value(Scalar(0x00000000))
 -                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
 +                                          // + span: $DIR/repeat.rs:6:18: 6:28
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-+         _1 = const 42u32;                // bb1[1]: scope 0 at $DIR/repeat.rs:6:18: 6:32
++         _1 = const 42u32;                // scope 0 at $DIR/repeat.rs:6:18: 6:32
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x0000002a))
 +                                          // mir::Constant
 +                                          // + span: $DIR/repeat.rs:6:18: 6:32
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-          StorageDead(_2);                 // bb1[2]: scope 0 at $DIR/repeat.rs:6:31: 6:32
-          StorageDead(_4);                 // bb1[3]: scope 0 at $DIR/repeat.rs:6:32: 6:33
-          StorageDead(_3);                 // bb1[4]: scope 0 at $DIR/repeat.rs:6:32: 6:33
-          _0 = const ();                   // bb1[5]: scope 0 at $DIR/repeat.rs:5:11: 7:2
+          StorageDead(_2);                 // scope 0 at $DIR/repeat.rs:6:31: 6:32
+          StorageDead(_4);                 // scope 0 at $DIR/repeat.rs:6:32: 6:33
+          StorageDead(_3);                 // scope 0 at $DIR/repeat.rs:6:32: 6:33
+          _0 = const ();                   // scope 0 at $DIR/repeat.rs:5:11: 7:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/repeat.rs:5:11: 7:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb1[6]: scope 0 at $DIR/repeat.rs:7:1: 7:2
-          return;                          // bb1[7]: scope 0 at $DIR/repeat.rs:7:2: 7:2
+          StorageDead(_1);                 // scope 0 at $DIR/repeat.rs:7:1: 7:2
+          return;                          // scope 0 at $DIR/repeat.rs:7:2: 7:2
       }
   }
   
index 3453c424a368bc2e8ba2e345d447e313816690cd..fc7d028277bd9ad18a156e596668bf7512db4217 100644 (file)
@@ -6,8 +6,8 @@
       let mut _1: (u32, bool);             // in scope 0 at $DIR/return_place.rs:6:5: 6:10
   
       bb0: {
--         _1 = CheckedAdd(const 2u32, const 2u32); // bb0[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
-+         _1 = (const 4u32, const false);  // bb0[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
+-         _1 = CheckedAdd(const 2u32, const 2u32); // scope 0 at $DIR/return_place.rs:6:5: 6:10
++         _1 = (const 4u32, const false);  // scope 0 at $DIR/return_place.rs:6:5: 6:10
                                            // ty::Const
                                            // + ty: u32
 -                                          // + val: Value(Scalar(0x00000002))
                                            // mir::Constant
 -                                          // + span: $DIR/return_place.rs:6:9: 6:10
 -                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
--         assert(!move (_1.1: bool), "attempt to add with overflow") -> bb1; // bb0[1]: scope 0 at $DIR/return_place.rs:6:5: 6:10
+-         assert(!move (_1.1: bool), "attempt to add with overflow") -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10
 +                                          // + span: $DIR/return_place.rs:6:5: 6:10
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+         assert(!const false, "attempt to add with overflow") -> bb1; // bb0[1]: scope 0 at $DIR/return_place.rs:6:5: 6:10
++         assert(!const false, "attempt to add with overflow") -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x00))
       }
   
       bb1: {
--         _0 = move (_1.0: u32);           // bb1[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
-+         _0 = const 4u32;                 // bb1[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
+-         _0 = move (_1.0: u32);           // scope 0 at $DIR/return_place.rs:6:5: 6:10
++         _0 = const 4u32;                 // scope 0 at $DIR/return_place.rs:6:5: 6:10
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x00000004))
 +                                          // mir::Constant
 +                                          // + span: $DIR/return_place.rs:6:5: 6:10
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000004)) }
-          return;                          // bb1[1]: scope 0 at $DIR/return_place.rs:7:2: 7:2
+          return;                          // scope 0 at $DIR/return_place.rs:7:2: 7:2
       }
   }
   
index 9af6be771ed2b4f143bea35e157a24e8e662966c..b741c786fb394321fdeec5c09fabd698638983d6 100644 (file)
@@ -4,13 +4,13 @@ fn add() -> u32 {
     let mut _0: u32;                     // return place in scope 0 at $DIR/return_place.rs:5:13: 5:16
 
     bb0: {
-        _0 = const 4u32;                 // bb0[0]: scope 0 at $DIR/return_place.rs:6:5: 6:10
+        _0 = const 4u32;                 // scope 0 at $DIR/return_place.rs:6:5: 6:10
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000004))
                                          // mir::Constant
                                          // + span: $DIR/return_place.rs:6:5: 6:10
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000004)) }
-        return;                          // bb0[1]: scope 0 at $DIR/return_place.rs:7:2: 7:2
+        return;                          // scope 0 at $DIR/return_place.rs:7:2: 7:2
     }
 }
diff --git a/src/test/mir-opt/const_prop/scalar_literal_propagation.rs b/src/test/mir-opt/const_prop/scalar_literal_propagation.rs
new file mode 100644 (file)
index 0000000..a740e69
--- /dev/null
@@ -0,0 +1,8 @@
+// EMIT_MIR rustc.main.ConstProp.diff
+fn main() {
+    let x = 1;
+    consume(x);
+}
+
+#[inline(never)]
+fn consume(_: u32) { }
diff --git a/src/test/mir-opt/const_prop/scalar_literal_propagation/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/scalar_literal_propagation/rustc.main.ConstProp.diff
new file mode 100644 (file)
index 0000000..0183ff7
--- /dev/null
@@ -0,0 +1,55 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/scalar_literal_propagation.rs:2:11: 2:11
+      let _1: u32;                         // in scope 0 at $DIR/scalar_literal_propagation.rs:3:9: 3:10
+      let _2: ();                          // in scope 0 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
+      let mut _3: u32;                     // in scope 0 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
+      scope 1 {
+          debug x => _1;                   // in scope 1 at $DIR/scalar_literal_propagation.rs:3:9: 3:10
+      }
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/scalar_literal_propagation.rs:3:9: 3:10
+          _1 = const 1u32;                 // scope 0 at $DIR/scalar_literal_propagation.rs:3:13: 3:14
+                                           // ty::Const
+                                           // + ty: u32
+                                           // + val: Value(Scalar(0x00000001))
+                                           // mir::Constant
+                                           // + span: $DIR/scalar_literal_propagation.rs:3:13: 3:14
+                                           // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
+          StorageLive(_2);                 // scope 1 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
+          StorageLive(_3);                 // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
+-         _3 = _1;                         // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
++         _3 = const 1u32;                 // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
++                                          // ty::Const
++                                          // + ty: u32
++                                          // + val: Value(Scalar(0x00000001))
++                                          // mir::Constant
++                                          // + span: $DIR/scalar_literal_propagation.rs:4:13: 4:14
++                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
+          _2 = const consume(move _3) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
+                                           // ty::Const
+                                           // + ty: fn(u32) {consume}
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/scalar_literal_propagation.rs:4:5: 4:12
+                                           // + literal: Const { ty: fn(u32) {consume}, val: Value(Scalar(<ZST>)) }
+      }
+  
+      bb1: {
+          StorageDead(_3);                 // scope 1 at $DIR/scalar_literal_propagation.rs:4:14: 4:15
+          StorageDead(_2);                 // scope 1 at $DIR/scalar_literal_propagation.rs:4:15: 4:16
+          _0 = const ();                   // scope 0 at $DIR/scalar_literal_propagation.rs:2:11: 5:2
+                                           // ty::Const
+                                           // + ty: ()
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/scalar_literal_propagation.rs:2:11: 5:2
+                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+          StorageDead(_1);                 // scope 0 at $DIR/scalar_literal_propagation.rs:5:1: 5:2
+          return;                          // scope 0 at $DIR/scalar_literal_propagation.rs:5:2: 5:2
+      }
+  }
+  
index 018180954553dc97fc1150a97cc4a460f4258df0..9471dbef410d1624347514ec7a355a7ce9d32718 100644 (file)
       let mut _9: &[u32; 3];               // in scope 0 at $DIR/slice_len.rs:5:6: 5:19
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/slice_len.rs:5:5: 5:30
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          StorageLive(_4);                 // bb0[3]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          _9 = const main::promoted[0];    // bb0[4]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          StorageLive(_1);                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+          StorageLive(_2);                 // scope 0 at $DIR/slice_len.rs:5:5: 5:30
+          StorageLive(_3);                 // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          StorageLive(_4);                 // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          _9 = const main::promoted[0];    // scope 0 at $DIR/slice_len.rs:5:6: 5:19
                                            // ty::Const
                                            // + ty: &[u32; 3]
                                            // + val: Unevaluated(DefId(0:3 ~ slice_len[317d]::main[0]), [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/slice_len.rs:5:6: 5:19
                                            // + literal: Const { ty: &[u32; 3], val: Unevaluated(DefId(0:3 ~ slice_len[317d]::main[0]), [], Some(promoted[0])) }
-          _4 = _9;                         // bb0[5]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          _3 = _4;                         // bb0[6]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          _2 = move _3 as &[u32] (Pointer(Unsize)); // bb0[7]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          StorageDead(_3);                 // bb0[8]: scope 0 at $DIR/slice_len.rs:5:18: 5:19
-          StorageLive(_6);                 // bb0[9]: scope 0 at $DIR/slice_len.rs:5:31: 5:32
-          _6 = const 1usize;               // bb0[10]: scope 0 at $DIR/slice_len.rs:5:31: 5:32
+          _4 = _9;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          _3 = _4;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          StorageDead(_3);                 // scope 0 at $DIR/slice_len.rs:5:18: 5:19
+          StorageLive(_6);                 // scope 0 at $DIR/slice_len.rs:5:31: 5:32
+          _6 = const 1usize;               // scope 0 at $DIR/slice_len.rs:5:31: 5:32
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x00000001))
                                            // mir::Constant
                                            // + span: $DIR/slice_len.rs:5:31: 5:32
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
--         _7 = Len((*_2));                 // bb0[11]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
--         _8 = Lt(_6, _7);                 // bb0[12]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
--         assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // bb0[13]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+         _7 = const 3usize;               // bb0[11]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
+-         _7 = Len((*_2));                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+-         _8 = Lt(_6, _7);                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+-         assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
++         _7 = const 3usize;               // scope 0 at $DIR/slice_len.rs:5:5: 5:33
 +                                          // ty::Const
 +                                          // + ty: usize
 +                                          // + val: Value(Scalar(0x00000003))
 +                                          // mir::Constant
 +                                          // + span: $DIR/slice_len.rs:5:5: 5:33
 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
-+         _8 = const true;                 // bb0[12]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
++         _8 = const true;                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
 +                                          // mir::Constant
 +                                          // + span: $DIR/slice_len.rs:5:5: 5:33
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+         assert(const true, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // bb0[13]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
++         assert(const true, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
       }
   
       bb1: {
--         _1 = (*_2)[_6];                  // bb1[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+         _1 = const 2u32;                 // bb1[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
+-         _1 = (*_2)[_6];                  // scope 0 at $DIR/slice_len.rs:5:5: 5:33
++         _1 = const 2u32;                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x00000002))
 +                                          // mir::Constant
 +                                          // + span: $DIR/slice_len.rs:5:5: 5:33
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-          StorageDead(_6);                 // bb1[1]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
-          StorageDead(_4);                 // bb1[2]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
-          StorageDead(_2);                 // bb1[3]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
-          StorageDead(_1);                 // bb1[4]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
-          _0 = const ();                   // bb1[5]: scope 0 at $DIR/slice_len.rs:4:11: 6:2
+          StorageDead(_6);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+          StorageDead(_4);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+          StorageDead(_2);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+          StorageDead(_1);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+          _0 = const ();                   // scope 0 at $DIR/slice_len.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/slice_len.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb1[6]: scope 0 at $DIR/slice_len.rs:6:2: 6:2
+          return;                          // scope 0 at $DIR/slice_len.rs:6:2: 6:2
       }
   }
   
index f1379446d7ad76e84fe2c02e7d986536eba08ab5..3ae88e0d7986351d7025e7e1dd5fb9d874e4f2b6 100644 (file)
       let mut _9: &[u32; 3];               // in scope 0 at $DIR/slice_len.rs:5:6: 5:19
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/slice_len.rs:5:5: 5:30
-          StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          StorageLive(_4);                 // bb0[3]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          _9 = const main::promoted[0];    // bb0[4]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          StorageLive(_1);                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+          StorageLive(_2);                 // scope 0 at $DIR/slice_len.rs:5:5: 5:30
+          StorageLive(_3);                 // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          StorageLive(_4);                 // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          _9 = const main::promoted[0];    // scope 0 at $DIR/slice_len.rs:5:6: 5:19
                                            // ty::Const
                                            // + ty: &[u32; 3]
                                            // + val: Unevaluated(DefId(0:3 ~ slice_len[317d]::main[0]), [], Some(promoted[0]))
                                            // mir::Constant
                                            // + span: $DIR/slice_len.rs:5:6: 5:19
                                            // + literal: Const { ty: &[u32; 3], val: Unevaluated(DefId(0:3 ~ slice_len[317d]::main[0]), [], Some(promoted[0])) }
-          _4 = _9;                         // bb0[5]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          _3 = _4;                         // bb0[6]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          _2 = move _3 as &[u32] (Pointer(Unsize)); // bb0[7]: scope 0 at $DIR/slice_len.rs:5:6: 5:19
-          StorageDead(_3);                 // bb0[8]: scope 0 at $DIR/slice_len.rs:5:18: 5:19
-          StorageLive(_6);                 // bb0[9]: scope 0 at $DIR/slice_len.rs:5:31: 5:32
-          _6 = const 1usize;               // bb0[10]: scope 0 at $DIR/slice_len.rs:5:31: 5:32
+          _4 = _9;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          _3 = _4;                         // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          _2 = move _3 as &[u32] (Pointer(Unsize)); // scope 0 at $DIR/slice_len.rs:5:6: 5:19
+          StorageDead(_3);                 // scope 0 at $DIR/slice_len.rs:5:18: 5:19
+          StorageLive(_6);                 // scope 0 at $DIR/slice_len.rs:5:31: 5:32
+          _6 = const 1usize;               // scope 0 at $DIR/slice_len.rs:5:31: 5:32
                                            // ty::Const
                                            // + ty: usize
                                            // + val: Value(Scalar(0x0000000000000001))
                                            // mir::Constant
                                            // + span: $DIR/slice_len.rs:5:31: 5:32
                                            // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
--         _7 = Len((*_2));                 // bb0[11]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
--         _8 = Lt(_6, _7);                 // bb0[12]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
--         assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // bb0[13]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+         _7 = const 3usize;               // bb0[11]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
+-         _7 = Len((*_2));                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+-         _8 = Lt(_6, _7);                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+-         assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
++         _7 = const 3usize;               // scope 0 at $DIR/slice_len.rs:5:5: 5:33
 +                                          // ty::Const
 +                                          // + ty: usize
 +                                          // + val: Value(Scalar(0x0000000000000003))
 +                                          // mir::Constant
 +                                          // + span: $DIR/slice_len.rs:5:5: 5:33
 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
-+         _8 = const true;                 // bb0[12]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
++         _8 = const true;                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
 +                                          // mir::Constant
 +                                          // + span: $DIR/slice_len.rs:5:5: 5:33
 +                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+         assert(const true, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // bb0[13]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
++         assert(const true, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
 +                                          // ty::Const
 +                                          // + ty: bool
 +                                          // + val: Value(Scalar(0x01))
       }
   
       bb1: {
--         _1 = (*_2)[_6];                  // bb1[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+         _1 = const 2u32;                 // bb1[0]: scope 0 at $DIR/slice_len.rs:5:5: 5:33
+-         _1 = (*_2)[_6];                  // scope 0 at $DIR/slice_len.rs:5:5: 5:33
++         _1 = const 2u32;                 // scope 0 at $DIR/slice_len.rs:5:5: 5:33
 +                                          // ty::Const
 +                                          // + ty: u32
 +                                          // + val: Value(Scalar(0x00000002))
 +                                          // mir::Constant
 +                                          // + span: $DIR/slice_len.rs:5:5: 5:33
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-          StorageDead(_6);                 // bb1[1]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
-          StorageDead(_4);                 // bb1[2]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
-          StorageDead(_2);                 // bb1[3]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
-          StorageDead(_1);                 // bb1[4]: scope 0 at $DIR/slice_len.rs:5:33: 5:34
-          _0 = const ();                   // bb1[5]: scope 0 at $DIR/slice_len.rs:4:11: 6:2
+          StorageDead(_6);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+          StorageDead(_4);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+          StorageDead(_2);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+          StorageDead(_1);                 // scope 0 at $DIR/slice_len.rs:5:33: 5:34
+          _0 = const ();                   // scope 0 at $DIR/slice_len.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/slice_len.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb1[6]: scope 0 at $DIR/slice_len.rs:6:2: 6:2
+          return;                          // scope 0 at $DIR/slice_len.rs:6:2: 6:2
       }
   }
   
index 92b14309bf2b772e44e176276cd58c429cbbbc0e..8072424729ab043c410a0afa19962287e965612f 100644 (file)
@@ -6,16 +6,16 @@
       let mut _1: i32;                     // in scope 0 at $DIR/switch_int.rs:7:11: 7:12
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/switch_int.rs:7:11: 7:12
-          _1 = const 1i32;                 // bb0[1]: scope 0 at $DIR/switch_int.rs:7:11: 7:12
+          StorageLive(_1);                 // scope 0 at $DIR/switch_int.rs:7:11: 7:12
+          _1 = const 1i32;                 // scope 0 at $DIR/switch_int.rs:7:11: 7:12
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000001))
                                            // mir::Constant
                                            // + span: $DIR/switch_int.rs:7:11: 7:12
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
--         switchInt(_1) -> [1i32: bb2, otherwise: bb1]; // bb0[2]: scope 0 at $DIR/switch_int.rs:8:9: 8:10
-+         switchInt(const 1i32) -> [1i32: bb2, otherwise: bb1]; // bb0[2]: scope 0 at $DIR/switch_int.rs:8:9: 8:10
+-         switchInt(_1) -> [1i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
++         switchInt(const 1i32) -> [1i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
 +                                          // ty::Const
 +                                          // + ty: i32
 +                                          // + val: Value(Scalar(0x00000001))
@@ -25,7 +25,7 @@
       }
   
       bb1: {
-          _0 = const foo(const -1i32) -> bb3; // bb1[0]: scope 0 at $DIR/switch_int.rs:9:14: 9:21
+          _0 = const foo(const -1i32) -> bb3; // scope 0 at $DIR/switch_int.rs:9:14: 9:21
                                            // ty::Const
                                            // + ty: fn(i32) {foo}
                                            // + val: Value(Scalar(<ZST>))
@@ -41,7 +41,7 @@
       }
   
       bb2: {
-          _0 = const foo(const 0i32) -> bb3; // bb2[0]: scope 0 at $DIR/switch_int.rs:8:14: 8:20
+          _0 = const foo(const 0i32) -> bb3; // scope 0 at $DIR/switch_int.rs:8:14: 8:20
                                            // ty::Const
                                            // + ty: fn(i32) {foo}
                                            // + val: Value(Scalar(<ZST>))
@@ -57,8 +57,8 @@
       }
   
       bb3: {
-          StorageDead(_1);                 // bb3[0]: scope 0 at $DIR/switch_int.rs:11:1: 11:2
-          return;                          // bb3[1]: scope 0 at $DIR/switch_int.rs:11:2: 11:2
+          StorageDead(_1);                 // scope 0 at $DIR/switch_int.rs:11:1: 11:2
+          return;                          // scope 0 at $DIR/switch_int.rs:11:2: 11:2
       }
   }
   
index e1805cc57311db483724bb904f5a821adb041e8a..51f3bf20c1aea36277d07f4f97c9a3e7c11330c3 100644 (file)
@@ -6,26 +6,26 @@
       let mut _1: i32;                     // in scope 0 at $DIR/switch_int.rs:7:11: 7:12
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/switch_int.rs:7:11: 7:12
-          _1 = const 1i32;                 // bb0[1]: scope 0 at $DIR/switch_int.rs:7:11: 7:12
+          StorageLive(_1);                 // scope 0 at $DIR/switch_int.rs:7:11: 7:12
+          _1 = const 1i32;                 // scope 0 at $DIR/switch_int.rs:7:11: 7:12
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000001))
                                            // mir::Constant
                                            // + span: $DIR/switch_int.rs:7:11: 7:12
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
--         switchInt(const 1i32) -> [1i32: bb2, otherwise: bb1]; // bb0[2]: scope 0 at $DIR/switch_int.rs:8:9: 8:10
+-         switchInt(const 1i32) -> [1i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
 -                                          // ty::Const
 -                                          // + ty: i32
 -                                          // + val: Value(Scalar(0x00000001))
 -                                          // mir::Constant
 -                                          // + span: $DIR/switch_int.rs:8:9: 8:10
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+         goto -> bb2;                     // bb0[2]: scope 0 at $DIR/switch_int.rs:8:9: 8:10
++         goto -> bb2;                     // scope 0 at $DIR/switch_int.rs:8:9: 8:10
       }
   
       bb1: {
-          _0 = const foo(const -1i32) -> bb3; // bb1[0]: scope 0 at $DIR/switch_int.rs:9:14: 9:21
+          _0 = const foo(const -1i32) -> bb3; // scope 0 at $DIR/switch_int.rs:9:14: 9:21
                                            // ty::Const
                                            // + ty: fn(i32) {foo}
                                            // + val: Value(Scalar(<ZST>))
@@ -41,7 +41,7 @@
       }
   
       bb2: {
-          _0 = const foo(const 0i32) -> bb3; // bb2[0]: scope 0 at $DIR/switch_int.rs:8:14: 8:20
+          _0 = const foo(const 0i32) -> bb3; // scope 0 at $DIR/switch_int.rs:8:14: 8:20
                                            // ty::Const
                                            // + ty: fn(i32) {foo}
                                            // + val: Value(Scalar(<ZST>))
@@ -57,8 +57,8 @@
       }
   
       bb3: {
-          StorageDead(_1);                 // bb3[0]: scope 0 at $DIR/switch_int.rs:11:1: 11:2
-          return;                          // bb3[1]: scope 0 at $DIR/switch_int.rs:11:2: 11:2
+          StorageDead(_1);                 // scope 0 at $DIR/switch_int.rs:11:1: 11:2
+          return;                          // scope 0 at $DIR/switch_int.rs:11:2: 11:2
       }
   }
   
diff --git a/src/test/mir-opt/const_prop/tuple_literal_propagation.rs b/src/test/mir-opt/const_prop/tuple_literal_propagation.rs
new file mode 100644 (file)
index 0000000..015607c
--- /dev/null
@@ -0,0 +1,9 @@
+// EMIT_MIR rustc.main.ConstProp.diff
+fn main() {
+    let x = (1, 2);
+
+    consume(x);
+}
+
+#[inline(never)]
+fn consume(_: (u32, u32)) { }
diff --git a/src/test/mir-opt/const_prop/tuple_literal_propagation/rustc.main.ConstProp.diff b/src/test/mir-opt/const_prop/tuple_literal_propagation/rustc.main.ConstProp.diff
new file mode 100644 (file)
index 0000000..1511b36
--- /dev/null
@@ -0,0 +1,69 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/tuple_literal_propagation.rs:2:11: 2:11
+      let _1: (u32, u32);                  // in scope 0 at $DIR/tuple_literal_propagation.rs:3:9: 3:10
+      let _2: ();                          // in scope 0 at $DIR/tuple_literal_propagation.rs:5:5: 5:15
+      let mut _3: (u32, u32);              // in scope 0 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
+      scope 1 {
+          debug x => _1;                   // in scope 1 at $DIR/tuple_literal_propagation.rs:3:9: 3:10
+      }
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/tuple_literal_propagation.rs:3:9: 3:10
+          _1 = (const 1u32, const 2u32);   // scope 0 at $DIR/tuple_literal_propagation.rs:3:13: 3:19
+                                           // ty::Const
+                                           // + ty: u32
+                                           // + val: Value(Scalar(0x00000001))
+                                           // mir::Constant
+-                                          // + span: $DIR/tuple_literal_propagation.rs:3:14: 3:15
++                                          // + span: $DIR/tuple_literal_propagation.rs:3:13: 3:19
+                                           // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
+                                           // ty::Const
+                                           // + ty: u32
+                                           // + val: Value(Scalar(0x00000002))
+                                           // mir::Constant
+-                                          // + span: $DIR/tuple_literal_propagation.rs:3:17: 3:18
++                                          // + span: $DIR/tuple_literal_propagation.rs:3:13: 3:19
+                                           // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
+          StorageLive(_2);                 // scope 1 at $DIR/tuple_literal_propagation.rs:5:5: 5:15
+          StorageLive(_3);                 // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
+-         _3 = _1;                         // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
++         _3 = (const 1u32, const 2u32);   // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
++                                          // ty::Const
++                                          // + ty: u32
++                                          // + val: Value(Scalar(0x00000001))
++                                          // mir::Constant
++                                          // + span: $DIR/tuple_literal_propagation.rs:5:13: 5:14
++                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
++                                          // ty::Const
++                                          // + ty: u32
++                                          // + val: Value(Scalar(0x00000002))
++                                          // mir::Constant
++                                          // + span: $DIR/tuple_literal_propagation.rs:5:13: 5:14
++                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
+          _2 = const consume(move _3) -> bb1; // scope 1 at $DIR/tuple_literal_propagation.rs:5:5: 5:15
+                                           // ty::Const
+                                           // + ty: fn((u32, u32)) {consume}
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/tuple_literal_propagation.rs:5:5: 5:12
+                                           // + literal: Const { ty: fn((u32, u32)) {consume}, val: Value(Scalar(<ZST>)) }
+      }
+  
+      bb1: {
+          StorageDead(_3);                 // scope 1 at $DIR/tuple_literal_propagation.rs:5:14: 5:15
+          StorageDead(_2);                 // scope 1 at $DIR/tuple_literal_propagation.rs:5:15: 5:16
+          _0 = const ();                   // scope 0 at $DIR/tuple_literal_propagation.rs:2:11: 6:2
+                                           // ty::Const
+                                           // + ty: ()
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/tuple_literal_propagation.rs:2:11: 6:2
+                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+          StorageDead(_1);                 // scope 0 at $DIR/tuple_literal_propagation.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/tuple_literal_propagation.rs:6:2: 6:2
+      }
+  }
+  
index 4e9d4c56cd6efc85c5594162d2a0d39adeafde08..f2838638aca0e3c936f8b532402bfc1a13e30946 100644 (file)
       }
   
       bb0: {
--         StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
--         _2 = _1;                         // bb0[1]: scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
--         _0 = _2;                         // bb0[2]: scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
--         StorageDead(_2);                 // bb0[3]: scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
-+         nop;                             // bb0[0]: scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
-+         nop;                             // bb0[1]: scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
-+         _0 = _1;                         // bb0[2]: scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
-+         nop;                             // bb0[3]: scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
-          return;                          // bb0[4]: scope 0 at $DIR/copy_propagation.rs:6:2: 6:2
+-         StorageLive(_2);                 // scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
+-         _2 = _1;                         // scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
+-         _0 = _2;                         // scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
+-         StorageDead(_2);                 // scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
++         nop;                             // scope 0 at $DIR/copy_propagation.rs:4:9: 4:10
++         nop;                             // scope 0 at $DIR/copy_propagation.rs:4:13: 4:14
++         _0 = _1;                         // scope 1 at $DIR/copy_propagation.rs:5:5: 5:6
++         nop;                             // scope 0 at $DIR/copy_propagation.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/copy_propagation.rs:6:2: 6:2
       }
   }
   
index db3f588d999875176f4c8da85778245b1b1acdf7..b976449ca6d32789d2d6a4b096bade0b00e87306 100644 (file)
       }
   
       bb0: {
-          StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/copy_propagation_arg.rs:28:9: 28:10
-          _2 = _1;                         // bb0[1]: scope 0 at $DIR/copy_propagation_arg.rs:28:13: 28:14
-          _1 = const 123i32;               // bb0[2]: scope 1 at $DIR/copy_propagation_arg.rs:29:5: 29:12
+          StorageLive(_2);                 // scope 0 at $DIR/copy_propagation_arg.rs:28:9: 28:10
+          _2 = _1;                         // scope 0 at $DIR/copy_propagation_arg.rs:28:13: 28:14
+          _1 = const 123i32;               // scope 1 at $DIR/copy_propagation_arg.rs:29:5: 29:12
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000007b))
                                            // mir::Constant
                                            // + span: $DIR/copy_propagation_arg.rs:29:5: 29:12
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000007b)) }
-          _0 = _2;                         // bb0[3]: scope 1 at $DIR/copy_propagation_arg.rs:30:5: 30:6
-          StorageDead(_2);                 // bb0[4]: scope 0 at $DIR/copy_propagation_arg.rs:31:1: 31:2
-          return;                          // bb0[5]: scope 0 at $DIR/copy_propagation_arg.rs:31:2: 31:2
+          _0 = _2;                         // scope 1 at $DIR/copy_propagation_arg.rs:30:5: 30:6
+          StorageDead(_2);                 // scope 0 at $DIR/copy_propagation_arg.rs:31:1: 31:2
+          return;                          // scope 0 at $DIR/copy_propagation_arg.rs:31:2: 31:2
       }
   }
   
index 16bdb7d0a992180e587652254551c2f97f3aa2b6..26f8068f674eff492bc73415257a030508450097 100644 (file)
@@ -8,10 +8,10 @@
       let mut _3: u8;                      // in scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
   
       bb0: {
-          StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/copy_propagation_arg.rs:16:5: 16:13
-          StorageLive(_3);                 // bb0[1]: scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
-          _3 = _1;                         // bb0[2]: scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
-          _2 = const dummy(move _3) -> bb1; // bb0[3]: scope 0 at $DIR/copy_propagation_arg.rs:16:5: 16:13
+          StorageLive(_2);                 // scope 0 at $DIR/copy_propagation_arg.rs:16:5: 16:13
+          StorageLive(_3);                 // scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
+          _3 = _1;                         // scope 0 at $DIR/copy_propagation_arg.rs:16:11: 16:12
+          _2 = const dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:16:5: 16:13
                                            // ty::Const
                                            // + ty: fn(u8) -> u8 {dummy}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
-          StorageDead(_3);                 // bb1[0]: scope 0 at $DIR/copy_propagation_arg.rs:16:12: 16:13
-          StorageDead(_2);                 // bb1[1]: scope 0 at $DIR/copy_propagation_arg.rs:16:13: 16:14
-          _1 = const 5u8;                  // bb1[2]: scope 0 at $DIR/copy_propagation_arg.rs:17:5: 17:10
+          StorageDead(_3);                 // scope 0 at $DIR/copy_propagation_arg.rs:16:12: 16:13
+          StorageDead(_2);                 // scope 0 at $DIR/copy_propagation_arg.rs:16:13: 16:14
+          _1 = const 5u8;                  // scope 0 at $DIR/copy_propagation_arg.rs:17:5: 17:10
                                            // ty::Const
                                            // + ty: u8
                                            // + val: Value(Scalar(0x05))
                                            // mir::Constant
                                            // + span: $DIR/copy_propagation_arg.rs:17:5: 17:10
                                            // + literal: Const { ty: u8, val: Value(Scalar(0x05)) }
-          _0 = const ();                   // bb1[3]: scope 0 at $DIR/copy_propagation_arg.rs:15:19: 18:2
+          _0 = const ();                   // scope 0 at $DIR/copy_propagation_arg.rs:15:19: 18:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/copy_propagation_arg.rs:15:19: 18:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb1[4]: scope 0 at $DIR/copy_propagation_arg.rs:18:2: 18:2
+          return;                          // scope 0 at $DIR/copy_propagation_arg.rs:18:2: 18:2
       }
   }
   
index 7df995c990a30f6d961a919ed3d1dd207851a8cf..ee20553f7cc3fbfbda7670996acf0e033ed858de 100644 (file)
@@ -7,18 +7,18 @@
       let mut _2: i32;                     // in scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
   
       bb0: {
-          StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
-          _2 = _1;                         // bb0[1]: scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
-          _1 = move _2;                    // bb0[2]: scope 0 at $DIR/copy_propagation_arg.rs:23:5: 23:10
-          StorageDead(_2);                 // bb0[3]: scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
-          _0 = const ();                   // bb0[4]: scope 0 at $DIR/copy_propagation_arg.rs:21:20: 24:2
+          StorageLive(_2);                 // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
+          _2 = _1;                         // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
+          _1 = move _2;                    // scope 0 at $DIR/copy_propagation_arg.rs:23:5: 23:10
+          StorageDead(_2);                 // scope 0 at $DIR/copy_propagation_arg.rs:23:9: 23:10
+          _0 = const ();                   // scope 0 at $DIR/copy_propagation_arg.rs:21:20: 24:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/copy_propagation_arg.rs:21:20: 24:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb0[5]: scope 0 at $DIR/copy_propagation_arg.rs:24:2: 24:2
+          return;                          // scope 0 at $DIR/copy_propagation_arg.rs:24:2: 24:2
       }
   }
   
index 67b58c30f054ad2025826f3a500ff4af1725d25f..33aaa7486787dd4131dee22b91a88146a58cb9d5 100644 (file)
@@ -8,10 +8,10 @@
       let mut _3: u8;                      // in scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
   
       bb0: {
-          StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
-          StorageLive(_3);                 // bb0[1]: scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
-          _3 = _1;                         // bb0[2]: scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
-          _2 = const dummy(move _3) -> bb1; // bb0[3]: scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
+          StorageLive(_2);                 // scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
+          StorageLive(_3);                 // scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
+          _3 = _1;                         // scope 0 at $DIR/copy_propagation_arg.rs:11:15: 11:16
+          _2 = const dummy(move _3) -> bb1; // scope 0 at $DIR/copy_propagation_arg.rs:11:9: 11:17
                                            // ty::Const
                                            // + ty: fn(u8) -> u8 {dummy}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
-          StorageDead(_3);                 // bb1[0]: scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
-          _1 = move _2;                    // bb1[1]: scope 0 at $DIR/copy_propagation_arg.rs:11:5: 11:17
-          StorageDead(_2);                 // bb1[2]: scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
-          _0 = const ();                   // bb1[3]: scope 0 at $DIR/copy_propagation_arg.rs:9:19: 12:2
+          StorageDead(_3);                 // scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
+          _1 = move _2;                    // scope 0 at $DIR/copy_propagation_arg.rs:11:5: 11:17
+          StorageDead(_2);                 // scope 0 at $DIR/copy_propagation_arg.rs:11:16: 11:17
+          _0 = const ();                   // scope 0 at $DIR/copy_propagation_arg.rs:9:19: 12:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/copy_propagation_arg.rs:9:19: 12:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb1[4]: scope 0 at $DIR/copy_propagation_arg.rs:12:2: 12:2
+          return;                          // scope 0 at $DIR/copy_propagation_arg.rs:12:2: 12:2
       }
   }
   
index 082f05a50c10bf47b0047f0c47b6aba51f087ffa..524156e0b929d170e73dce36b6e11fca090e1322 100644 (file)
@@ -7,28 +7,26 @@
       let mut _2: usize;                   // in scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
   
       bb0: {
-          StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
-          _2 = _1;                         // bb0[1]: scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
--         _0 = Baz { x: move _2, y: const 0f32, z: const false }; // bb0[2]: scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
-+         (_0.0: usize) = move _2;         // bb0[2]: scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
-+         (_0.1: f32) = const 0f32;        // bb0[3]: scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
+          StorageLive(_2);                 // scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
+          _2 = _1;                         // scope 0 at $DIR/deaggregator_test.rs:9:14: 9:15
+-         _0 = Baz { x: move _2, y: const 0f32, z: const false }; // scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
++         (_0.0: usize) = move _2;         // scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
++         (_0.1: f32) = const 0f32;        // scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
                                            // ty::Const
                                            // + ty: f32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/deaggregator_test.rs:9:20: 9:23
                                            // + literal: Const { ty: f32, val: Value(Scalar(0x00000000)) }
-+         (_0.2: bool) = const false;      // bb0[4]: scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
++         (_0.2: bool) = const false;      // scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
                                            // ty::Const
                                            // + ty: bool
                                            // + val: Value(Scalar(0x00))
                                            // mir::Constant
                                            // + span: $DIR/deaggregator_test.rs:9:28: 9:33
                                            // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
--         StorageDead(_2);                 // bb0[3]: scope 0 at $DIR/deaggregator_test.rs:9:34: 9:35
--         return;                          // bb0[4]: scope 0 at $DIR/deaggregator_test.rs:10:2: 10:2
-+         StorageDead(_2);                 // bb0[5]: scope 0 at $DIR/deaggregator_test.rs:9:34: 9:35
-+         return;                          // bb0[6]: scope 0 at $DIR/deaggregator_test.rs:10:2: 10:2
+          StorageDead(_2);                 // scope 0 at $DIR/deaggregator_test.rs:9:34: 9:35
+          return;                          // scope 0 at $DIR/deaggregator_test.rs:10:2: 10:2
       }
   }
   
index b1839ef7e0e16cf57ed23320a17f44bfb0388a85..5af9a536693791883a2a1d7a526d060e315c4bdc 100644 (file)
@@ -7,15 +7,13 @@
       let mut _2: usize;                   // in scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
   
       bb0: {
-          StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
-          _2 = _1;                         // bb0[1]: scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
--         _0 = Baz::Foo { x: move _2 };    // bb0[2]: scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
--         StorageDead(_2);                 // bb0[3]: scope 0 at $DIR/deaggregator_test_enum.rs:8:21: 8:22
--         return;                          // bb0[4]: scope 0 at $DIR/deaggregator_test_enum.rs:9:2: 9:2
-+         ((_0 as Foo).0: usize) = move _2; // bb0[2]: scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
-+         discriminant(_0) = 1;            // bb0[3]: scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
-+         StorageDead(_2);                 // bb0[4]: scope 0 at $DIR/deaggregator_test_enum.rs:8:21: 8:22
-+         return;                          // bb0[5]: scope 0 at $DIR/deaggregator_test_enum.rs:9:2: 9:2
+          StorageLive(_2);                 // scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
+          _2 = _1;                         // scope 0 at $DIR/deaggregator_test_enum.rs:8:19: 8:20
+-         _0 = Baz::Foo { x: move _2 };    // scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
++         ((_0 as Foo).0: usize) = move _2; // scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
++         discriminant(_0) = 1;            // scope 0 at $DIR/deaggregator_test_enum.rs:8:5: 8:22
+          StorageDead(_2);                 // scope 0 at $DIR/deaggregator_test_enum.rs:8:21: 8:22
+          return;                          // scope 0 at $DIR/deaggregator_test_enum.rs:9:2: 9:2
       }
   }
   
index 3256e59e3eba9e5095b2d25941f5013fba479ce9..bf99f7efb4dd66f11898fa7aa087ea4ea85523a0 100644 (file)
       let mut _5: i32;                     // in scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
   
       bb0: {
-          StorageLive(_3);                 // bb0[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9
-          _3 = _1;                         // bb0[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9
-          switchInt(_3) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
+          StorageLive(_3);                 // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9
+          _3 = _1;                         // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:8: 10:9
+          switchInt(_3) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
       }
   
       bb1: {
-          StorageLive(_5);                 // bb1[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
-          _5 = _2;                         // bb1[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
--         _0 = Foo::B(move _5);            // bb1[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
--         StorageDead(_5);                 // bb1[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18
--         goto -> bb3;                     // bb1[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
-+         ((_0 as B).0: i32) = move _5;    // bb1[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
-+         discriminant(_0) = 1;            // bb1[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
-+         StorageDead(_5);                 // bb1[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18
-+         goto -> bb3;                     // bb1[5]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
+          StorageLive(_5);                 // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
+          _5 = _2;                         // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:16: 13:17
+-         _0 = Foo::B(move _5);            // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
++         ((_0 as B).0: i32) = move _5;    // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
++         discriminant(_0) = 1;            // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:9: 13:18
+          StorageDead(_5);                 // scope 0 at $DIR/deaggregator_test_enum_2.rs:13:17: 13:18
+          goto -> bb3;                     // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
       }
   
       bb2: {
-          StorageLive(_4);                 // bb2[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
-          _4 = _2;                         // bb2[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
--         _0 = Foo::A(move _4);            // bb2[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
--         StorageDead(_4);                 // bb2[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18
--         goto -> bb3;                     // bb2[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
-+         ((_0 as A).0: i32) = move _4;    // bb2[2]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
-+         discriminant(_0) = 0;            // bb2[3]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
-+         StorageDead(_4);                 // bb2[4]: scope 0 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18
-+         goto -> bb3;                     // bb2[5]: scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
+          StorageLive(_4);                 // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
+          _4 = _2;                         // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:16: 11:17
+-         _0 = Foo::A(move _4);            // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
++         ((_0 as A).0: i32) = move _4;    // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
++         discriminant(_0) = 0;            // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:9: 11:18
+          StorageDead(_4);                 // scope 0 at $DIR/deaggregator_test_enum_2.rs:11:17: 11:18
+          goto -> bb3;                     // scope 0 at $DIR/deaggregator_test_enum_2.rs:10:5: 14:6
       }
   
       bb3: {
-          StorageDead(_3);                 // bb3[0]: scope 0 at $DIR/deaggregator_test_enum_2.rs:15:1: 15:2
-          return;                          // bb3[1]: scope 0 at $DIR/deaggregator_test_enum_2.rs:15:2: 15:2
+          StorageDead(_3);                 // scope 0 at $DIR/deaggregator_test_enum_2.rs:15:1: 15:2
+          return;                          // scope 0 at $DIR/deaggregator_test_enum_2.rs:15:2: 15:2
       }
   }
   
index 7d3ae6a16b2a895f9b441a0d8bd2fe7c0000594c..f5d8d0607c60bc72fc3144e1f10b16a630742594 100644 (file)
       let mut _5: i32;                     // in scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
   
       bb0: {
-          StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
-          StorageLive(_3);                 // bb0[1]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
-          _3 = _1;                         // bb0[2]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
--         _2 = Foo::A(move _3);            // bb0[3]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
--         StorageDead(_3);                 // bb0[4]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:14: 10:15
--         StorageLive(_4);                 // bb0[5]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
--         StorageLive(_5);                 // bb0[6]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
--         _5 = _1;                         // bb0[7]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
--         _4 = Foo::A(move _5);            // bb0[8]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
--         StorageDead(_5);                 // bb0[9]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:25: 10:26
--         _0 = [move _2, move _4];         // bb0[10]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:5: 10:27
--         StorageDead(_4);                 // bb0[11]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
--         StorageDead(_2);                 // bb0[12]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
--         return;                          // bb0[13]: scope 0 at $DIR/deaggregator_test_multiple.rs:11:2: 11:2
-+         ((_2 as A).0: i32) = move _3;    // bb0[3]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
-+         discriminant(_2) = 0;            // bb0[4]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
-+         StorageDead(_3);                 // bb0[5]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:14: 10:15
-+         StorageLive(_4);                 // bb0[6]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
-+         StorageLive(_5);                 // bb0[7]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
-+         _5 = _1;                         // bb0[8]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
-+         ((_4 as A).0: i32) = move _5;    // bb0[9]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
-+         discriminant(_4) = 0;            // bb0[10]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
-+         StorageDead(_5);                 // bb0[11]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:25: 10:26
-+         _0 = [move _2, move _4];         // bb0[12]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:5: 10:27
-+         StorageDead(_4);                 // bb0[13]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
-+         StorageDead(_2);                 // bb0[14]: scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
-+         return;                          // bb0[15]: scope 0 at $DIR/deaggregator_test_multiple.rs:11:2: 11:2
+          StorageLive(_2);                 // scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
+          StorageLive(_3);                 // scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
+          _3 = _1;                         // scope 0 at $DIR/deaggregator_test_multiple.rs:10:13: 10:14
+-         _2 = Foo::A(move _3);            // scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
++         ((_2 as A).0: i32) = move _3;    // scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
++         discriminant(_2) = 0;            // scope 0 at $DIR/deaggregator_test_multiple.rs:10:6: 10:15
+          StorageDead(_3);                 // scope 0 at $DIR/deaggregator_test_multiple.rs:10:14: 10:15
+          StorageLive(_4);                 // scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
+          StorageLive(_5);                 // scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
+          _5 = _1;                         // scope 0 at $DIR/deaggregator_test_multiple.rs:10:24: 10:25
+-         _4 = Foo::A(move _5);            // scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
++         ((_4 as A).0: i32) = move _5;    // scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
++         discriminant(_4) = 0;            // scope 0 at $DIR/deaggregator_test_multiple.rs:10:17: 10:26
+          StorageDead(_5);                 // scope 0 at $DIR/deaggregator_test_multiple.rs:10:25: 10:26
+          _0 = [move _2, move _4];         // scope 0 at $DIR/deaggregator_test_multiple.rs:10:5: 10:27
+          StorageDead(_4);                 // scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
+          StorageDead(_2);                 // scope 0 at $DIR/deaggregator_test_multiple.rs:10:26: 10:27
+          return;                          // scope 0 at $DIR/deaggregator_test_multiple.rs:11:2: 11:2
       }
   }
   
index 192ec1bbe2187e48dfed2fe7776bccd17725043b..03d258d8f728910388adf2afc5a79a43a9649911 100644 (file)
@@ -18,96 +18,96 @@ fn match_tuple(_1: (u32, bool, std::option::Option<i32>, u32)) -> u32 {
     }
 
     bb0: {
-        FakeRead(ForMatchedPlace, _1);   // bb0[0]: scope 0 at $DIR/exponential-or.rs:7:11: 7:12
-        switchInt((_1.0: u32)) -> [1u32: bb2, 4u32: bb2, otherwise: bb1]; // bb0[1]: scope 0 at $DIR/exponential-or.rs:8:15: 8:16
+        FakeRead(ForMatchedPlace, _1);   // scope 0 at $DIR/exponential-or.rs:7:11: 7:12
+        switchInt((_1.0: u32)) -> [1u32: bb2, 4u32: bb2, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:8:15: 8:16
     }
 
     bb1: {
-        _0 = const 0u32;                 // bb1[0]: scope 0 at $DIR/exponential-or.rs:9:14: 9:15
+        _0 = const 0u32;                 // scope 0 at $DIR/exponential-or.rs:9:14: 9:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/exponential-or.rs:9:14: 9:15
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
-        goto -> bb10;                    // bb1[1]: scope 0 at $DIR/exponential-or.rs:7:5: 10:6
+        goto -> bb10;                    // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
     }
 
     bb2: {
-        _2 = discriminant((_1.2: std::option::Option<i32>)); // bb2[0]: scope 0 at $DIR/exponential-or.rs:8:37: 8:48
-        switchInt(move _2) -> [0isize: bb4, 1isize: bb3, otherwise: bb1]; // bb2[1]: scope 0 at $DIR/exponential-or.rs:8:37: 8:48
+        _2 = discriminant((_1.2: std::option::Option<i32>)); // scope 0 at $DIR/exponential-or.rs:8:37: 8:48
+        switchInt(move _2) -> [0isize: bb4, 1isize: bb3, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:8:37: 8:48
     }
 
     bb3: {
-        switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1i32: bb4, 8i32: bb4, otherwise: bb1]; // bb3[0]: scope 0 at $DIR/exponential-or.rs:8:42: 8:43
+        switchInt((((_1.2: std::option::Option<i32>) as Some).0: i32)) -> [1i32: bb4, 8i32: bb4, otherwise: bb1]; // scope 0 at $DIR/exponential-or.rs:8:42: 8:43
     }
 
     bb4: {
-        _5 = Le(const 6u32, (_1.3: u32)); // bb4[0]: scope 0 at $DIR/exponential-or.rs:8:62: 8:67
+        _5 = Le(const 6u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000006))
                                          // mir::Constant
                                          // + span: $DIR/exponential-or.rs:8:62: 8:67
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000006)) }
-        switchInt(move _5) -> [false: bb6, otherwise: bb5]; // bb4[1]: scope 0 at $DIR/exponential-or.rs:8:62: 8:67
+        switchInt(move _5) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
     }
 
     bb5: {
-        _6 = Le((_1.3: u32), const 9u32); // bb5[0]: scope 0 at $DIR/exponential-or.rs:8:62: 8:67
+        _6 = Le((_1.3: u32), const 9u32); // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000009))
                                          // mir::Constant
                                          // + span: $DIR/exponential-or.rs:8:62: 8:67
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000009)) }
-        switchInt(move _6) -> [false: bb6, otherwise: bb8]; // bb5[1]: scope 0 at $DIR/exponential-or.rs:8:62: 8:67
+        switchInt(move _6) -> [false: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
     }
 
     bb6: {
-        _3 = Le(const 13u32, (_1.3: u32)); // bb6[0]: scope 0 at $DIR/exponential-or.rs:8:70: 8:77
+        _3 = Le(const 13u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x0000000d))
                                          // mir::Constant
                                          // + span: $DIR/exponential-or.rs:8:70: 8:77
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000000d)) }
-        switchInt(move _3) -> [false: bb1, otherwise: bb7]; // bb6[1]: scope 0 at $DIR/exponential-or.rs:8:70: 8:77
+        switchInt(move _3) -> [false: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
     }
 
     bb7: {
-        _4 = Le((_1.3: u32), const 16u32); // bb7[0]: scope 0 at $DIR/exponential-or.rs:8:70: 8:77
+        _4 = Le((_1.3: u32), const 16u32); // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000010))
                                          // mir::Constant
                                          // + span: $DIR/exponential-or.rs:8:70: 8:77
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000010)) }
-        switchInt(move _4) -> [false: bb1, otherwise: bb8]; // bb7[1]: scope 0 at $DIR/exponential-or.rs:8:70: 8:77
+        switchInt(move _4) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
     }
 
     bb8: {
-        falseEdges -> [real: bb9, imaginary: bb1]; // bb8[0]: scope 0 at $DIR/exponential-or.rs:8:9: 8:79
+        falseEdges -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/exponential-or.rs:8:9: 8:79
     }
 
     bb9: {
-        StorageLive(_7);                 // bb9[0]: scope 0 at $DIR/exponential-or.rs:8:10: 8:21
-        _7 = (_1.0: u32);                // bb9[1]: scope 0 at $DIR/exponential-or.rs:8:10: 8:21
-        StorageLive(_8);                 // bb9[2]: scope 0 at $DIR/exponential-or.rs:8:57: 8:78
-        _8 = (_1.3: u32);                // bb9[3]: scope 0 at $DIR/exponential-or.rs:8:57: 8:78
-        StorageLive(_9);                 // bb9[4]: scope 1 at $DIR/exponential-or.rs:8:83: 8:84
-        _9 = _7;                         // bb9[5]: scope 1 at $DIR/exponential-or.rs:8:83: 8:84
-        StorageLive(_10);                // bb9[6]: scope 1 at $DIR/exponential-or.rs:8:87: 8:88
-        _10 = _8;                        // bb9[7]: scope 1 at $DIR/exponential-or.rs:8:87: 8:88
-        _0 = BitXor(move _9, move _10);  // bb9[8]: scope 1 at $DIR/exponential-or.rs:8:83: 8:88
-        StorageDead(_10);                // bb9[9]: scope 1 at $DIR/exponential-or.rs:8:87: 8:88
-        StorageDead(_9);                 // bb9[10]: scope 1 at $DIR/exponential-or.rs:8:87: 8:88
-        StorageDead(_8);                 // bb9[11]: scope 0 at $DIR/exponential-or.rs:8:88: 8:89
-        StorageDead(_7);                 // bb9[12]: scope 0 at $DIR/exponential-or.rs:8:88: 8:89
-        goto -> bb10;                    // bb9[13]: scope 0 at $DIR/exponential-or.rs:7:5: 10:6
+        StorageLive(_7);                 // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
+        _7 = (_1.0: u32);                // scope 0 at $DIR/exponential-or.rs:8:10: 8:21
+        StorageLive(_8);                 // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
+        _8 = (_1.3: u32);                // scope 0 at $DIR/exponential-or.rs:8:57: 8:78
+        StorageLive(_9);                 // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
+        _9 = _7;                         // scope 1 at $DIR/exponential-or.rs:8:83: 8:84
+        StorageLive(_10);                // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
+        _10 = _8;                        // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
+        _0 = BitXor(move _9, move _10);  // scope 1 at $DIR/exponential-or.rs:8:83: 8:88
+        StorageDead(_10);                // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
+        StorageDead(_9);                 // scope 1 at $DIR/exponential-or.rs:8:87: 8:88
+        StorageDead(_8);                 // scope 0 at $DIR/exponential-or.rs:8:88: 8:89
+        StorageDead(_7);                 // scope 0 at $DIR/exponential-or.rs:8:88: 8:89
+        goto -> bb10;                    // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
     }
 
     bb10: {
-        return;                          // bb10[0]: scope 0 at $DIR/exponential-or.rs:11:2: 11:2
+        return;                          // scope 0 at $DIR/exponential-or.rs:11:2: 11:2
     }
 }
index 887a4dd2cd38383869ad9828bba618c441280ef8..c88b142428a3f6851a2985a78a2c42937f9b65a4 100644 (file)
@@ -20,61 +20,61 @@ fn main::{{closure}}#0(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15:
     }
 
     bb0: {
-        _9 = discriminant((*_1));        // bb0[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
-        switchInt(move _9) -> [0u32: bb7, 3u32: bb11, otherwise: bb12]; // bb0[1]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        _9 = discriminant((*_1));        // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        switchInt(move _9) -> [0u32: bb7, 3u32: bb11, otherwise: bb12]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        resume;                          // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
     }
 
     bb2 (cleanup): {
-        nop;                             // bb2[0]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
-        goto -> bb8;                     // bb2[1]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+        nop;                             // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+        goto -> bb8;                     // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
     }
 
     bb3: {
-        StorageDead(_5);                 // bb3[0]: scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
-        StorageDead(_4);                 // bb3[1]: scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
-        drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb4, unwind: bb2]; // bb3[2]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+        StorageDead(_5);                 // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
+        StorageDead(_4);                 // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
+        drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
     }
 
     bb4: {
-        nop;                             // bb4[0]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
-        goto -> bb9;                     // bb4[1]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+        nop;                             // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+        goto -> bb9;                     // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
     }
 
     bb5: {
-        return;                          // bb5[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        return;                          // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
     }
 
     bb6: {
-        return;                          // bb6[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        return;                          // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
     }
 
     bb7: {
-        goto -> bb10;                    // bb7[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        goto -> bb10;                    // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
     }
 
     bb8 (cleanup): {
-        goto -> bb1;                     // bb8[0]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+        goto -> bb1;                     // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
     }
 
     bb9: {
-        goto -> bb5;                     // bb9[0]: scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
+        goto -> bb5;                     // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
     }
 
     bb10: {
-        goto -> bb6;                     // bb10[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        goto -> bb6;                     // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
     }
 
     bb11: {
-        StorageLive(_4);                 // bb11[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
-        StorageLive(_5);                 // bb11[1]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
-        goto -> bb3;                     // bb11[2]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        StorageLive(_4);                 // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        StorageLive(_5);                 // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        goto -> bb3;                     // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
     }
 
     bb12: {
-        return;                          // bb12[0]: scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
+        return;                          // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
     }
 }
index 5d5f9dcc61d79594e650f585795b1180b863d3d7..06645860d842dbcaab8e808ebb65929fa601097e 100644 (file)
@@ -20,39 +20,39 @@ yields ()
     }
 
     bb0: {
-        StorageLive(_3);                 // bb0[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:23:13: 23:14
-        _3 = Foo(const 5i32);            // bb0[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:23:17: 23:23
+        StorageLive(_3);                 // scope 0 at $DIR/generator-storage-dead-unwind.rs:23:13: 23:14
+        _3 = Foo(const 5i32);            // scope 0 at $DIR/generator-storage-dead-unwind.rs:23:17: 23:23
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000005))
                                          // mir::Constant
                                          // + span: $DIR/generator-storage-dead-unwind.rs:23:21: 23:22
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
-        StorageLive(_4);                 // bb0[2]: scope 1 at $DIR/generator-storage-dead-unwind.rs:24:13: 24:14
-        _4 = Bar(const 6i32);            // bb0[3]: scope 1 at $DIR/generator-storage-dead-unwind.rs:24:17: 24:23
+        StorageLive(_4);                 // scope 1 at $DIR/generator-storage-dead-unwind.rs:24:13: 24:14
+        _4 = Bar(const 6i32);            // scope 1 at $DIR/generator-storage-dead-unwind.rs:24:17: 24:23
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000006))
                                          // mir::Constant
                                          // + span: $DIR/generator-storage-dead-unwind.rs:24:21: 24:22
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000006)) }
-        StorageLive(_5);                 // bb0[4]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
-        StorageLive(_6);                 // bb0[5]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
-        _6 = ();                         // bb0[6]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
-        _5 = yield(move _6) -> [resume: bb2, drop: bb4]; // bb0[7]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
+        StorageLive(_5);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
+        StorageLive(_6);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
+        _6 = ();                         // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
+        _5 = yield(move _6) -> [resume: bb2, drop: bb4]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6
+        resume;                          // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6
     }
 
     bb2: {
-        StorageDead(_6);                 // bb2[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
-        StorageDead(_5);                 // bb2[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
-        StorageLive(_7);                 // bb2[2]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
-        StorageLive(_8);                 // bb2[3]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
-        _8 = move _3;                    // bb2[4]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
-        _7 = const take::<Foo>(move _8) -> [return: bb7, unwind: bb9]; // bb2[5]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
+        StorageDead(_6);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
+        StorageDead(_5);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
+        StorageLive(_7);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
+        StorageLive(_8);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
+        _8 = move _3;                    // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:14: 26:15
+        _7 = const take::<Foo>(move _8) -> [return: bb7, unwind: bb9]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:9: 26:16
                                          // ty::Const
                                          // + ty: fn(Foo) {take::<Foo>}
                                          // + val: Value(Scalar(<ZST>))
@@ -62,33 +62,33 @@ yields ()
     }
 
     bb3 (cleanup): {
-        StorageDead(_3);                 // bb3[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
-        drop(_1) -> bb1;                 // bb3[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        StorageDead(_3);                 // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        drop(_1) -> bb1;                 // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
     }
 
     bb4: {
-        StorageDead(_6);                 // bb4[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
-        StorageDead(_5);                 // bb4[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
-        StorageDead(_4);                 // bb4[2]: scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
-        drop(_3) -> [return: bb5, unwind: bb3]; // bb4[3]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        StorageDead(_6);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:13: 25:14
+        StorageDead(_5);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:14: 25:15
+        StorageDead(_4);                 // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        drop(_3) -> [return: bb5, unwind: bb3]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
     }
 
     bb5: {
-        StorageDead(_3);                 // bb5[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
-        drop(_1) -> [return: bb6, unwind: bb1]; // bb5[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        StorageDead(_3);                 // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        drop(_1) -> [return: bb6, unwind: bb1]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
     }
 
     bb6: {
-        generator_drop;                  // bb6[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6
+        generator_drop;                  // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:16: 28:6
     }
 
     bb7: {
-        StorageDead(_8);                 // bb7[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
-        StorageDead(_7);                 // bb7[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
-        StorageLive(_9);                 // bb7[2]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
-        StorageLive(_10);                // bb7[3]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
-        _10 = move _4;                   // bb7[4]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
-        _9 = const take::<Bar>(move _10) -> [return: bb10, unwind: bb11]; // bb7[5]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
+        StorageDead(_8);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
+        StorageDead(_7);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
+        StorageLive(_9);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
+        StorageLive(_10);                // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
+        _10 = move _4;                   // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:14: 27:15
+        _9 = const take::<Bar>(move _10) -> [return: bb10, unwind: bb11]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:9: 27:16
                                          // ty::Const
                                          // + ty: fn(Bar) {take::<Bar>}
                                          // + val: Value(Scalar(<ZST>))
@@ -98,39 +98,39 @@ yields ()
     }
 
     bb8 (cleanup): {
-        StorageDead(_4);                 // bb8[0]: scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
-        StorageDead(_3);                 // bb8[1]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
-        drop(_1) -> bb1;                 // bb8[2]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        StorageDead(_4);                 // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        StorageDead(_3);                 // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        drop(_1) -> bb1;                 // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
     }
 
     bb9 (cleanup): {
-        StorageDead(_8);                 // bb9[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
-        StorageDead(_7);                 // bb9[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
-        goto -> bb8;                     // bb9[2]: scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1
+        StorageDead(_8);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:15: 26:16
+        StorageDead(_7);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:26:16: 26:17
+        goto -> bb8;                     // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1
     }
 
     bb10: {
-        StorageDead(_10);                // bb10[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
-        StorageDead(_9);                 // bb10[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
-        _0 = const ();                   // bb10[2]: scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 28:6
+        StorageDead(_10);                // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
+        StorageDead(_9);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
+        _0 = const ();                   // scope 0 at $DIR/generator-storage-dead-unwind.rs:22:19: 28:6
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/generator-storage-dead-unwind.rs:22:19: 28:6
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_4);                 // bb10[3]: scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
-        StorageDead(_3);                 // bb10[4]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
-        drop(_1) -> [return: bb12, unwind: bb1]; // bb10[5]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        StorageDead(_4);                 // scope 1 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        StorageDead(_3);                 // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
+        drop(_1) -> [return: bb12, unwind: bb1]; // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:5: 28:6
     }
 
     bb11 (cleanup): {
-        StorageDead(_10);                // bb11[0]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
-        StorageDead(_9);                 // bb11[1]: scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
-        goto -> bb8;                     // bb11[2]: scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1
+        StorageDead(_10);                // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:15: 27:16
+        StorageDead(_9);                 // scope 2 at $DIR/generator-storage-dead-unwind.rs:27:16: 27:17
+        goto -> bb8;                     // scope 2 at $DIR/generator-storage-dead-unwind.rs:1:1: 1:1
     }
 
     bb12: {
-        return;                          // bb12[0]: scope 0 at $DIR/generator-storage-dead-unwind.rs:28:6: 28:6
+        return;                          // scope 0 at $DIR/generator-storage-dead-unwind.rs:28:6: 28:6
     }
 }
index dbab6ceffdcfff849f1a1e8511594800902c99bf..84b8af5d6b7bcad88994f0fa85e5e28226b38eb0 100644 (file)
@@ -18,32 +18,32 @@ fn main::{{closure}}#0(_1: std::pin::Pin<&mut [generator@$DIR/generator-tiny.rs:
     }
 
     bb0: {
-        _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}]))); // bb0[0]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
-        switchInt(move _11) -> [0u32: bb1, 3u32: bb5, otherwise: bb6]; // bb0[1]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+        _11 = discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}]))); // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+        switchInt(move _11) -> [0u32: bb1, 3u32: bb5, otherwise: bb6]; // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
     }
 
     bb1: {
-        _10 = move _2;                   // bb1[0]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
-        nop;                             // bb1[1]: scope 0 at $DIR/generator-tiny.rs:19:13: 19:15
-        (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}])) as variant#3).0: HasDrop) = HasDrop; // bb1[2]: scope 0 at $DIR/generator-tiny.rs:19:18: 19:25
-        StorageLive(_4);                 // bb1[3]: scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
-        goto -> bb2;                     // bb1[4]: scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
+        _10 = move _2;                   // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+        nop;                             // scope 0 at $DIR/generator-tiny.rs:19:13: 19:15
+        (((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}])) as variant#3).0: HasDrop) = HasDrop; // scope 0 at $DIR/generator-tiny.rs:19:18: 19:25
+        StorageLive(_4);                 // scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
+        goto -> bb2;                     // scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
     }
 
     bb2: {
-        StorageLive(_6);                 // bb2[0]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
-        StorageLive(_7);                 // bb2[1]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
-        _7 = ();                         // bb2[2]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
-        _0 = std::ops::GeneratorState::<(), ()>::Yielded(move _7); // bb2[3]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
-        discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}]))) = 3; // bb2[4]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
-        return;                          // bb2[5]: scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+        StorageLive(_6);                 // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+        StorageLive(_7);                 // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+        _7 = ();                         // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+        _0 = std::ops::GeneratorState::<(), ()>::Yielded(move _7); // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+        discriminant((*(_1.0: &mut [generator@$DIR/generator-tiny.rs:18:16: 24:6 {u8, HasDrop, ()}]))) = 3; // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
+        return;                          // scope 1 at $DIR/generator-tiny.rs:21:13: 21:18
     }
 
     bb3: {
-        StorageDead(_7);                 // bb3[0]: scope 1 at $DIR/generator-tiny.rs:21:17: 21:18
-        StorageDead(_6);                 // bb3[1]: scope 1 at $DIR/generator-tiny.rs:21:18: 21:19
-        StorageLive(_8);                 // bb3[2]: scope 1 at $DIR/generator-tiny.rs:22:13: 22:21
-        _8 = const callee() -> bb4;      // bb3[3]: scope 1 at $DIR/generator-tiny.rs:22:13: 22:21
+        StorageDead(_7);                 // scope 1 at $DIR/generator-tiny.rs:21:17: 21:18
+        StorageDead(_6);                 // scope 1 at $DIR/generator-tiny.rs:21:18: 21:19
+        StorageLive(_8);                 // scope 1 at $DIR/generator-tiny.rs:22:13: 22:21
+        _8 = const callee() -> bb4;      // scope 1 at $DIR/generator-tiny.rs:22:13: 22:21
                                          // ty::Const
                                          // + ty: fn() {callee}
                                          // + val: Value(Scalar(<ZST>))
@@ -53,26 +53,26 @@ fn main::{{closure}}#0(_1: std::pin::Pin<&mut [generator@$DIR/generator-tiny.rs:
     }
 
     bb4: {
-        StorageDead(_8);                 // bb4[0]: scope 1 at $DIR/generator-tiny.rs:22:21: 22:22
-        _5 = const ();                   // bb4[1]: scope 1 at $DIR/generator-tiny.rs:20:14: 23:10
+        StorageDead(_8);                 // scope 1 at $DIR/generator-tiny.rs:22:21: 22:22
+        _5 = const ();                   // scope 1 at $DIR/generator-tiny.rs:20:14: 23:10
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/generator-tiny.rs:20:14: 23:10
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        goto -> bb2;                     // bb4[2]: scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
+        goto -> bb2;                     // scope 1 at $DIR/generator-tiny.rs:20:9: 23:10
     }
 
     bb5: {
-        StorageLive(_4);                 // bb5[0]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
-        StorageLive(_6);                 // bb5[1]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
-        StorageLive(_7);                 // bb5[2]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
-        _6 = move _2;                    // bb5[3]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
-        goto -> bb3;                     // bb5[4]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+        StorageLive(_4);                 // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+        StorageLive(_6);                 // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+        StorageLive(_7);                 // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+        _6 = move _2;                    // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+        goto -> bb3;                     // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
     }
 
     bb6: {
-        unreachable;                     // bb6[0]: scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
+        unreachable;                     // scope 0 at $DIR/generator-tiny.rs:18:16: 24:6
     }
 }
index 058d9e70d260601f08a3a363a2bbf7375ee7df28..19748d52ec7e2f2e7e035a2f2b0ce8637fb220d3 100644 (file)
@@ -15,33 +15,33 @@ fn bar() -> bool {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/inline-any-operand.rs:11:9: 11:10
-        _1 = const foo;                  // bb0[1]: scope 0 at $DIR/inline-any-operand.rs:11:13: 11:16
+        StorageLive(_1);                 // scope 0 at $DIR/inline-any-operand.rs:11:9: 11:10
+        _1 = const foo;                  // scope 0 at $DIR/inline-any-operand.rs:11:13: 11:16
                                          // ty::Const
                                          // + ty: fn(i32, i32) -> bool {foo}
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/inline-any-operand.rs:11:13: 11:16
                                          // + literal: Const { ty: fn(i32, i32) -> bool {foo}, val: Value(Scalar(<ZST>)) }
-        StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
-        _2 = _1;                         // bb0[3]: scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
-        _3 = const 1i32;                 // bb0[4]: scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
+        StorageLive(_2);                 // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
+        _2 = _1;                         // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
+        _3 = const 1i32;                 // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/inline-any-operand.rs:12:7: 12:8
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        _4 = const -1i32;                // bb0[5]: scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
+        _4 = const -1i32;                // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0xffffffff))
                                          // mir::Constant
                                          // + span: $DIR/inline-any-operand.rs:12:10: 12:12
                                          // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
-        _0 = Eq(move _3, move _4);       // bb0[6]: scope 2 at $DIR/inline-any-operand.rs:17:5: 17:11
-        StorageDead(_2);                 // bb0[7]: scope 1 at $DIR/inline-any-operand.rs:12:12: 12:13
-        StorageDead(_1);                 // bb0[8]: scope 0 at $DIR/inline-any-operand.rs:13:1: 13:2
-        return;                          // bb0[9]: scope 0 at $DIR/inline-any-operand.rs:13:2: 13:2
+        _0 = Eq(move _3, move _4);       // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:11
+        StorageDead(_2);                 // scope 1 at $DIR/inline-any-operand.rs:12:12: 12:13
+        StorageDead(_1);                 // scope 0 at $DIR/inline-any-operand.rs:13:1: 13:2
+        return;                          // scope 0 at $DIR/inline-any-operand.rs:13:2: 13:2
     }
 }
index a8e846d11817e9f54c342e656de93080874da113..cea3c59a3e4794e2d9a0c98c7c2bcc726ff9db9a 100644 (file)
@@ -23,8 +23,8 @@ fn foo(_1: T, _2: &i32) -> i32 {
     }
 
     bb0: {
-        StorageLive(_3);                 // bb0[0]: scope 0 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10
-        _3 = [closure@foo::<T>::{{closure}}#0]; // bb0[1]: scope 0 at $DIR/inline-closure-borrows-arg.rs:12:13: 15:6
+        StorageLive(_3);                 // scope 0 at $DIR/inline-closure-borrows-arg.rs:12:9: 12:10
+        _3 = [closure@foo::<T>::{{closure}}#0]; // scope 0 at $DIR/inline-closure-borrows-arg.rs:12:13: 15:6
                                          // closure
                                          // + def_id: DefId(0:6 ~ inline_closure_borrows_arg[317d]::foo[0]::{{closure}}[0])
                                          // + substs: [
@@ -33,22 +33,22 @@ fn foo(_1: T, _2: &i32) -> i32 {
                                          //     for<'r, 's> extern "rust-call" fn((&'r i32, &'s i32)) -> i32,
                                          //     (),
                                          // ]
-        StorageLive(_4);                 // bb0[2]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6
-        _4 = &_3;                        // bb0[3]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6
-        StorageLive(_5);                 // bb0[4]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
-        StorageLive(_6);                 // bb0[5]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8
-        _6 = &(*_2);                     // bb0[6]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8
-        StorageLive(_7);                 // bb0[7]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11
-        _7 = &(*_2);                     // bb0[8]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11
-        _5 = (move _6, move _7);         // bb0[9]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
-        _8 = move (_5.0: &i32);          // bb0[10]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
-        _9 = move (_5.1: &i32);          // bb0[11]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
-        _0 = (*_8);                      // bb0[12]: scope 3 at $DIR/inline-closure-borrows-arg.rs:14:9: 14:18
-        StorageDead(_7);                 // bb0[13]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
-        StorageDead(_6);                 // bb0[14]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
-        StorageDead(_5);                 // bb0[15]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
-        StorageDead(_4);                 // bb0[16]: scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
-        StorageDead(_3);                 // bb0[17]: scope 0 at $DIR/inline-closure-borrows-arg.rs:17:1: 17:2
-        return;                          // bb0[18]: scope 0 at $DIR/inline-closure-borrows-arg.rs:17:2: 17:2
+        StorageLive(_4);                 // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6
+        _4 = &_3;                        // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:6
+        StorageLive(_5);                 // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
+        StorageLive(_6);                 // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8
+        _6 = &(*_2);                     // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:7: 16:8
+        StorageLive(_7);                 // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11
+        _7 = &(*_2);                     // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:10: 16:11
+        _5 = (move _6, move _7);         // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
+        _8 = move (_5.0: &i32);          // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
+        _9 = move (_5.1: &i32);          // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:5: 16:12
+        _0 = (*_8);                      // scope 3 at $DIR/inline-closure-borrows-arg.rs:14:9: 14:18
+        StorageDead(_7);                 // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
+        StorageDead(_6);                 // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
+        StorageDead(_5);                 // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
+        StorageDead(_4);                 // scope 1 at $DIR/inline-closure-borrows-arg.rs:16:11: 16:12
+        StorageDead(_3);                 // scope 0 at $DIR/inline-closure-borrows-arg.rs:17:1: 17:2
+        return;                          // scope 0 at $DIR/inline-closure-borrows-arg.rs:17:2: 17:2
     }
 }
index 8f7c5615662b301a9685ce2d421a73a9ef3c41a4..eeff914ccffb978036a300f68c5c713213c34723 100644 (file)
@@ -23,12 +23,12 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
     }
 
     bb0: {
-        StorageLive(_3);                 // bb0[0]: scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10
-        StorageLive(_4);                 // bb0[1]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
-        _4 = &_2;                        // bb0[2]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
-        StorageLive(_5);                 // bb0[3]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
-        _5 = &_1;                        // bb0[4]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
-        _3 = [closure@foo::<T>::{{closure}}#0] { q: move _4, t: move _5 }; // bb0[5]: scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+        StorageLive(_3);                 // scope 0 at $DIR/inline-closure-captures.rs:11:9: 11:10
+        StorageLive(_4);                 // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+        _4 = &_2;                        // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+        StorageLive(_5);                 // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+        _5 = &_1;                        // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
+        _3 = [closure@foo::<T>::{{closure}}#0] { q: move _4, t: move _5 }; // scope 0 at $DIR/inline-closure-captures.rs:11:13: 11:24
                                          // closure
                                          // + def_id: DefId(0:6 ~ inline_closure_captures[317d]::foo[0]::{{closure}}[0])
                                          // + substs: [
@@ -37,27 +37,27 @@ fn foo(_1: T, _2: i32) -> (i32, T) {
                                          //     extern "rust-call" fn((i32,)) -> (i32, T),
                                          //     (&i32, &T),
                                          // ]
-        StorageDead(_5);                 // bb0[6]: scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24
-        StorageDead(_4);                 // bb0[7]: scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24
-        StorageLive(_6);                 // bb0[8]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
-        _6 = &_3;                        // bb0[9]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
-        StorageLive(_7);                 // bb0[10]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
-        StorageLive(_8);                 // bb0[11]: scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8
-        _8 = _2;                         // bb0[12]: scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8
-        _7 = (move _8,);                 // bb0[13]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
-        _11 = move (_7.0: i32);          // bb0[14]: scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
-        StorageLive(_9);                 // bb0[15]: scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20
-        _9 = (*((*_6).0: &i32));         // bb0[16]: scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20
-        StorageLive(_10);                // bb0[17]: scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23
-        _10 = (*((*_6).1: &T));          // bb0[18]: scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23
-        (_0.0: i32) = move _9;           // bb0[19]: scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24
-        (_0.1: T) = move _10;            // bb0[20]: scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24
-        StorageDead(_10);                // bb0[21]: scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24
-        StorageDead(_9);                 // bb0[22]: scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24
-        StorageDead(_8);                 // bb0[23]: scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
-        StorageDead(_7);                 // bb0[24]: scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
-        StorageDead(_6);                 // bb0[25]: scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
-        StorageDead(_3);                 // bb0[26]: scope 0 at $DIR/inline-closure-captures.rs:13:1: 13:2
-        return;                          // bb0[27]: scope 0 at $DIR/inline-closure-captures.rs:13:2: 13:2
+        StorageDead(_5);                 // scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24
+        StorageDead(_4);                 // scope 0 at $DIR/inline-closure-captures.rs:11:23: 11:24
+        StorageLive(_6);                 // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
+        _6 = &_3;                        // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:6
+        StorageLive(_7);                 // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
+        StorageLive(_8);                 // scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8
+        _8 = _2;                         // scope 1 at $DIR/inline-closure-captures.rs:12:7: 12:8
+        _7 = (move _8,);                 // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
+        _11 = move (_7.0: i32);          // scope 1 at $DIR/inline-closure-captures.rs:12:5: 12:9
+        StorageLive(_9);                 // scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20
+        _9 = (*((*_6).0: &i32));         // scope 2 at $DIR/inline-closure-captures.rs:11:19: 11:20
+        StorageLive(_10);                // scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23
+        _10 = (*((*_6).1: &T));          // scope 2 at $DIR/inline-closure-captures.rs:11:22: 11:23
+        (_0.0: i32) = move _9;           // scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24
+        (_0.1: T) = move _10;            // scope 2 at $DIR/inline-closure-captures.rs:11:18: 11:24
+        StorageDead(_10);                // scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24
+        StorageDead(_9);                 // scope 2 at $DIR/inline-closure-captures.rs:11:23: 11:24
+        StorageDead(_8);                 // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
+        StorageDead(_7);                 // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
+        StorageDead(_6);                 // scope 1 at $DIR/inline-closure-captures.rs:12:8: 12:9
+        StorageDead(_3);                 // scope 0 at $DIR/inline-closure-captures.rs:13:1: 13:2
+        return;                          // scope 0 at $DIR/inline-closure-captures.rs:13:2: 13:2
     }
 }
index e31032e8c6999c478babbba81d52e5d117ecbe61..bd0ec8c7ddbd5ea96aab3f821d6e92c11b89a4ec 100644 (file)
@@ -20,8 +20,8 @@ fn foo(_1: T, _2: i32) -> i32 {
     }
 
     bb0: {
-        StorageLive(_3);                 // bb0[0]: scope 0 at $DIR/inline-closure.rs:11:9: 11:10
-        _3 = [closure@foo::<T>::{{closure}}#0]; // bb0[1]: scope 0 at $DIR/inline-closure.rs:11:13: 11:24
+        StorageLive(_3);                 // scope 0 at $DIR/inline-closure.rs:11:9: 11:10
+        _3 = [closure@foo::<T>::{{closure}}#0]; // scope 0 at $DIR/inline-closure.rs:11:13: 11:24
                                          // closure
                                          // + def_id: DefId(0:6 ~ inline_closure[317d]::foo[0]::{{closure}}[0])
                                          // + substs: [
@@ -30,22 +30,22 @@ fn foo(_1: T, _2: i32) -> i32 {
                                          //     extern "rust-call" fn((i32, i32)) -> i32,
                                          //     (),
                                          // ]
-        StorageLive(_4);                 // bb0[2]: scope 1 at $DIR/inline-closure.rs:12:5: 12:6
-        _4 = &_3;                        // bb0[3]: scope 1 at $DIR/inline-closure.rs:12:5: 12:6
-        StorageLive(_5);                 // bb0[4]: scope 1 at $DIR/inline-closure.rs:12:5: 12:12
-        StorageLive(_6);                 // bb0[5]: scope 1 at $DIR/inline-closure.rs:12:7: 12:8
-        _6 = _2;                         // bb0[6]: scope 1 at $DIR/inline-closure.rs:12:7: 12:8
-        StorageLive(_7);                 // bb0[7]: scope 1 at $DIR/inline-closure.rs:12:10: 12:11
-        _7 = _2;                         // bb0[8]: scope 1 at $DIR/inline-closure.rs:12:10: 12:11
-        _5 = (move _6, move _7);         // bb0[9]: scope 1 at $DIR/inline-closure.rs:12:5: 12:12
-        _8 = move (_5.0: i32);           // bb0[10]: scope 1 at $DIR/inline-closure.rs:12:5: 12:12
-        _9 = move (_5.1: i32);           // bb0[11]: scope 1 at $DIR/inline-closure.rs:12:5: 12:12
-        _0 = _8;                         // bb0[12]: scope 2 at $DIR/inline-closure.rs:11:22: 11:24
-        StorageDead(_7);                 // bb0[13]: scope 1 at $DIR/inline-closure.rs:12:11: 12:12
-        StorageDead(_6);                 // bb0[14]: scope 1 at $DIR/inline-closure.rs:12:11: 12:12
-        StorageDead(_5);                 // bb0[15]: scope 1 at $DIR/inline-closure.rs:12:11: 12:12
-        StorageDead(_4);                 // bb0[16]: scope 1 at $DIR/inline-closure.rs:12:11: 12:12
-        StorageDead(_3);                 // bb0[17]: scope 0 at $DIR/inline-closure.rs:13:1: 13:2
-        return;                          // bb0[18]: scope 0 at $DIR/inline-closure.rs:13:2: 13:2
+        StorageLive(_4);                 // scope 1 at $DIR/inline-closure.rs:12:5: 12:6
+        _4 = &_3;                        // scope 1 at $DIR/inline-closure.rs:12:5: 12:6
+        StorageLive(_5);                 // scope 1 at $DIR/inline-closure.rs:12:5: 12:12
+        StorageLive(_6);                 // scope 1 at $DIR/inline-closure.rs:12:7: 12:8
+        _6 = _2;                         // scope 1 at $DIR/inline-closure.rs:12:7: 12:8
+        StorageLive(_7);                 // scope 1 at $DIR/inline-closure.rs:12:10: 12:11
+        _7 = _2;                         // scope 1 at $DIR/inline-closure.rs:12:10: 12:11
+        _5 = (move _6, move _7);         // scope 1 at $DIR/inline-closure.rs:12:5: 12:12
+        _8 = move (_5.0: i32);           // scope 1 at $DIR/inline-closure.rs:12:5: 12:12
+        _9 = move (_5.1: i32);           // scope 1 at $DIR/inline-closure.rs:12:5: 12:12
+        _0 = _8;                         // scope 2 at $DIR/inline-closure.rs:11:22: 11:24
+        StorageDead(_7);                 // scope 1 at $DIR/inline-closure.rs:12:11: 12:12
+        StorageDead(_6);                 // scope 1 at $DIR/inline-closure.rs:12:11: 12:12
+        StorageDead(_5);                 // scope 1 at $DIR/inline-closure.rs:12:11: 12:12
+        StorageDead(_4);                 // scope 1 at $DIR/inline-closure.rs:12:11: 12:12
+        StorageDead(_3);                 // scope 0 at $DIR/inline-closure.rs:13:1: 13:2
+        return;                          // scope 0 at $DIR/inline-closure.rs:13:2: 13:2
     }
 }
index 7f2f7cdb176682a6b69fee9a6ac6c159d20e114d..eca7ae0f549abbf86a09c5bbc137d3fc0c4652c7 100644 (file)
 +     }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-          _2 = Box(std::vec::Vec<u32>);    // bb0[2]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
--         (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
-+         _4 = &mut (*_2);                 // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
-+         ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }; // bb0[4]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
+          StorageLive(_1);                 // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
+          StorageLive(_2);                 // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+          _2 = Box(std::vec::Vec<u32>);    // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+-         (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
++         _4 = &mut (*_2);                 // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
++         ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
                                            // ty::Const
 -                                          // + ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}
 -                                          // + val: Value(Scalar(<ZST>))
 -     }
 - 
 -     bb1 (cleanup): {
--         resume;                          // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
+-         resume;                          // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
 -     }
 - 
 -     bb2: {
--         _1 = move _2;                    // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
--         StorageDead(_2);                 // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
--         _0 = const ();                   // bb2[2]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
 +                                          // + span: $SRC_DIR/liballoc/vec.rs:LL:COL
 +                                          // + user_ty: UserType(0)
 +                                          // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
-+         ((*_4).1: usize) = const 0usize; // bb0[5]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
-                                           // ty::Const
++         ((*_4).1: usize) = const 0usize; // scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
++                                          // ty::Const
 +                                          // + ty: usize
 +                                          // + val: Value(Scalar(0x00000000))
 +                                          // mir::Constant
 +                                          // + span: $SRC_DIR/liballoc/vec.rs:LL:COL
 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
-+         _1 = move _2;                    // bb0[6]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-+         StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
-+         _0 = const ();                   // bb0[8]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
-+                                          // ty::Const
+          _1 = move _2;                    // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+          StorageDead(_2);                 // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+          _0 = const ();                   // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
+                                           // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/inline-into-box-place.rs:7:11: 9:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         drop(_1) -> [return: bb3, unwind: bb1]; // bb2[3]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-+         drop(_1) -> [return: bb2, unwind: bb1]; // bb0[9]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+-         drop(_1) -> [return: bb3, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
++         drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
       }
   
 -     bb3: {
--         StorageDead(_1);                 // bb3[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
--         return;                          // bb3[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
+-         StorageDead(_1);                 // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+-         return;                          // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
 +     bb1 (cleanup): {
-+         resume;                          // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
++         resume;                          // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
       }
   
 -     bb4 (cleanup): {
--         _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // bb4[0]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+-         _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
 -                                          // ty::Const
 -                                          // + ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}
 -                                          // + val: Value(Scalar(<ZST>))
@@ -78,8 +75,8 @@
 -                                          // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
 -                                          // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) }
 +     bb2: {
-+         StorageDead(_1);                 // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-+         return;                          // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
++         StorageDead(_1);                 // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
++         return;                          // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
       }
   }
   
index b968b33ac5274d42c7f0a90d063ab5021469f09b..a371fa214f2c31517c5c3b5950bff0b500a88752 100644 (file)
 +     }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-          _2 = Box(std::vec::Vec<u32>);    // bb0[2]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
--         (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
-+         _4 = &mut (*_2);                 // bb0[3]: scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
-+         ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }; // bb0[4]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
+          StorageLive(_1);                 // scope 0 at $DIR/inline-into-box-place.rs:8:9: 8:11
+          StorageLive(_2);                 // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+          _2 = Box(std::vec::Vec<u32>);    // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+-         (*_2) = const std::vec::Vec::<u32>::new() -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
++         _4 = &mut (*_2);                 // scope 0 at $DIR/inline-into-box-place.rs:8:33: 8:43
++         ((*_4).0: alloc::raw_vec::RawVec<u32>) = const alloc::raw_vec::RawVec::<u32> { ptr: std::ptr::Unique::<u32> { pointer: {0x4 as *const u32}, _marker: std::marker::PhantomData::<u32> }, cap: 0usize, alloc: std::alloc::Global }; // scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
                                            // ty::Const
 -                                          // + ty: fn() -> std::vec::Vec<u32> {std::vec::Vec::<u32>::new}
 -                                          // + val: Value(Scalar(<ZST>))
 -     }
 - 
 -     bb1 (cleanup): {
--         resume;                          // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
+-         resume;                          // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
 -     }
 - 
 -     bb2: {
--         _1 = move _2;                    // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
--         StorageDead(_2);                 // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
--         _0 = const ();                   // bb2[2]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
 +                                          // + span: $SRC_DIR/liballoc/vec.rs:LL:COL
 +                                          // + user_ty: UserType(0)
 +                                          // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
-+         ((*_4).1: usize) = const 0usize; // bb0[5]: scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
-                                           // ty::Const
++         ((*_4).1: usize) = const 0usize; // scope 2 at $SRC_DIR/liballoc/vec.rs:LL:COL
++                                          // ty::Const
 +                                          // + ty: usize
 +                                          // + val: Value(Scalar(0x0000000000000000))
 +                                          // mir::Constant
 +                                          // + span: $SRC_DIR/liballoc/vec.rs:LL:COL
 +                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
-+         _1 = move _2;                    // bb0[6]: scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
-+         StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
-+         _0 = const ();                   // bb0[8]: scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
-+                                          // ty::Const
+          _1 = move _2;                    // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
+          StorageDead(_2);                 // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+          _0 = const ();                   // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
+                                           // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/inline-into-box-place.rs:7:11: 9:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         drop(_1) -> [return: bb3, unwind: bb1]; // bb2[3]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-+         drop(_1) -> [return: bb2, unwind: bb1]; // bb0[9]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+-         drop(_1) -> [return: bb3, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
++         drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
       }
   
 -     bb3: {
--         StorageDead(_1);                 // bb3[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
--         return;                          // bb3[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
+-         StorageDead(_1);                 // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
+-         return;                          // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
 +     bb1 (cleanup): {
-+         resume;                          // bb1[0]: scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
++         resume;                          // scope 0 at $DIR/inline-into-box-place.rs:7:1: 9:2
       }
   
 -     bb4 (cleanup): {
--         _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // bb4[0]: scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
+-         _3 = const alloc::alloc::box_free::<std::vec::Vec<u32>>(move (_2.0: std::ptr::Unique<std::vec::Vec<u32>>)) -> bb1; // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
 -                                          // ty::Const
 -                                          // + ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}
 -                                          // + val: Value(Scalar(<ZST>))
@@ -78,8 +75,8 @@
 -                                          // + span: $DIR/inline-into-box-place.rs:8:42: 8:43
 -                                          // + literal: Const { ty: unsafe fn(std::ptr::Unique<std::vec::Vec<u32>>) {alloc::alloc::box_free::<std::vec::Vec<u32>>}, val: Value(Scalar(<ZST>)) }
 +     bb2: {
-+         StorageDead(_1);                 // bb2[0]: scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
-+         return;                          // bb2[1]: scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
++         StorageDead(_1);                 // scope 0 at $DIR/inline-into-box-place.rs:9:1: 9:2
++         return;                          // scope 0 at $DIR/inline-into-box-place.rs:9:2: 9:2
       }
   }
   
index ae2226bd183d0fa1247334696b32316d35fc373b..e83cc92eb43efceded364813b464c37d783d7bf0 100644 (file)
@@ -23,59 +23,59 @@ fn bar() -> bool {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/inline-retag.rs:11:9: 11:10
-        _1 = const foo;                  // bb0[1]: scope 0 at $DIR/inline-retag.rs:11:13: 11:16
+        StorageLive(_1);                 // scope 0 at $DIR/inline-retag.rs:11:9: 11:10
+        _1 = const foo;                  // scope 0 at $DIR/inline-retag.rs:11:13: 11:16
                                          // ty::Const
                                          // + ty: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/inline-retag.rs:11:13: 11:16
                                          // + literal: Const { ty: for<'r, 's> fn(&'r i32, &'s i32) -> bool {foo}, val: Value(Scalar(<ZST>)) }
-        StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/inline-retag.rs:12:5: 12:6
-        _2 = _1;                         // bb0[3]: scope 1 at $DIR/inline-retag.rs:12:5: 12:6
-        StorageLive(_3);                 // bb0[4]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
-        StorageLive(_4);                 // bb0[5]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
-        _10 = const bar::promoted[1];    // bb0[6]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+        StorageLive(_2);                 // scope 1 at $DIR/inline-retag.rs:12:5: 12:6
+        _2 = _1;                         // scope 1 at $DIR/inline-retag.rs:12:5: 12:6
+        StorageLive(_3);                 // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+        StorageLive(_4);                 // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+        _10 = const bar::promoted[1];    // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
                                          // ty::Const
                                          // + ty: &i32
                                          // + val: Unevaluated(DefId(0:4 ~ inline_retag[317d]::bar[0]), [], Some(promoted[1]))
                                          // mir::Constant
                                          // + span: $DIR/inline-retag.rs:12:7: 12:9
                                          // + literal: Const { ty: &i32, val: Unevaluated(DefId(0:4 ~ inline_retag[317d]::bar[0]), [], Some(promoted[1])) }
-        Retag(_10);                      // bb0[7]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
-        _4 = &(*_10);                    // bb0[8]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
-        Retag(_4);                       // bb0[9]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
-        _3 = &(*_4);                     // bb0[10]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
-        Retag(_3);                       // bb0[11]: scope 1 at $DIR/inline-retag.rs:12:7: 12:9
-        StorageLive(_6);                 // bb0[12]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
-        StorageLive(_7);                 // bb0[13]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
-        _9 = const bar::promoted[0];     // bb0[14]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+        Retag(_10);                      // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+        _4 = &(*_10);                    // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+        Retag(_4);                       // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+        _3 = &(*_4);                     // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+        Retag(_3);                       // scope 1 at $DIR/inline-retag.rs:12:7: 12:9
+        StorageLive(_6);                 // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+        StorageLive(_7);                 // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+        _9 = const bar::promoted[0];     // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
                                          // ty::Const
                                          // + ty: &i32
                                          // + val: Unevaluated(DefId(0:4 ~ inline_retag[317d]::bar[0]), [], Some(promoted[0]))
                                          // mir::Constant
                                          // + span: $DIR/inline-retag.rs:12:11: 12:14
                                          // + literal: Const { ty: &i32, val: Unevaluated(DefId(0:4 ~ inline_retag[317d]::bar[0]), [], Some(promoted[0])) }
-        Retag(_9);                       // bb0[15]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
-        _7 = &(*_9);                     // bb0[16]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
-        Retag(_7);                       // bb0[17]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
-        _6 = &(*_7);                     // bb0[18]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
-        Retag(_6);                       // bb0[19]: scope 1 at $DIR/inline-retag.rs:12:11: 12:14
-        Retag(_3);                       // bb0[20]: scope 2 at $DIR/inline-retag.rs:16:1: 18:2
-        Retag(_6);                       // bb0[21]: scope 2 at $DIR/inline-retag.rs:16:1: 18:2
-        StorageLive(_11);                // bb0[22]: scope 2 at $DIR/inline-retag.rs:17:5: 17:7
-        _11 = (*_3);                     // bb0[23]: scope 2 at $DIR/inline-retag.rs:17:5: 17:7
-        StorageLive(_12);                // bb0[24]: scope 2 at $DIR/inline-retag.rs:17:11: 17:13
-        _12 = (*_6);                     // bb0[25]: scope 2 at $DIR/inline-retag.rs:17:11: 17:13
-        _0 = Eq(move _11, move _12);     // bb0[26]: scope 2 at $DIR/inline-retag.rs:17:5: 17:13
-        StorageDead(_12);                // bb0[27]: scope 2 at $DIR/inline-retag.rs:17:12: 17:13
-        StorageDead(_11);                // bb0[28]: scope 2 at $DIR/inline-retag.rs:17:12: 17:13
-        StorageDead(_6);                 // bb0[29]: scope 1 at $DIR/inline-retag.rs:12:14: 12:15
-        StorageDead(_3);                 // bb0[30]: scope 1 at $DIR/inline-retag.rs:12:14: 12:15
-        StorageDead(_2);                 // bb0[31]: scope 1 at $DIR/inline-retag.rs:12:14: 12:15
-        StorageDead(_1);                 // bb0[32]: scope 0 at $DIR/inline-retag.rs:13:1: 13:2
-        StorageDead(_7);                 // bb0[33]: scope 0 at $DIR/inline-retag.rs:13:1: 13:2
-        StorageDead(_4);                 // bb0[34]: scope 0 at $DIR/inline-retag.rs:13:1: 13:2
-        return;                          // bb0[35]: scope 0 at $DIR/inline-retag.rs:13:2: 13:2
+        Retag(_9);                       // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+        _7 = &(*_9);                     // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+        Retag(_7);                       // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+        _6 = &(*_7);                     // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+        Retag(_6);                       // scope 1 at $DIR/inline-retag.rs:12:11: 12:14
+        Retag(_3);                       // scope 2 at $DIR/inline-retag.rs:16:1: 18:2
+        Retag(_6);                       // scope 2 at $DIR/inline-retag.rs:16:1: 18:2
+        StorageLive(_11);                // scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+        _11 = (*_3);                     // scope 2 at $DIR/inline-retag.rs:17:5: 17:7
+        StorageLive(_12);                // scope 2 at $DIR/inline-retag.rs:17:11: 17:13
+        _12 = (*_6);                     // scope 2 at $DIR/inline-retag.rs:17:11: 17:13
+        _0 = Eq(move _11, move _12);     // scope 2 at $DIR/inline-retag.rs:17:5: 17:13
+        StorageDead(_12);                // scope 2 at $DIR/inline-retag.rs:17:12: 17:13
+        StorageDead(_11);                // scope 2 at $DIR/inline-retag.rs:17:12: 17:13
+        StorageDead(_6);                 // scope 1 at $DIR/inline-retag.rs:12:14: 12:15
+        StorageDead(_3);                 // scope 1 at $DIR/inline-retag.rs:12:14: 12:15
+        StorageDead(_2);                 // scope 1 at $DIR/inline-retag.rs:12:14: 12:15
+        StorageDead(_1);                 // scope 0 at $DIR/inline-retag.rs:13:1: 13:2
+        StorageDead(_7);                 // scope 0 at $DIR/inline-retag.rs:13:1: 13:2
+        StorageDead(_4);                 // scope 0 at $DIR/inline-retag.rs:13:1: 13:2
+        return;                          // scope 0 at $DIR/inline-retag.rs:13:2: 13:2
     }
 }
index 35c400035a6ab7121e3d6f6ee028bcacf50af492..a3e0d0a57a7c3af60f6127c9708d1326d238fde7 100644 (file)
@@ -11,9 +11,9 @@
 +     }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/inline-specialization.rs:5:9: 5:10
--         _1 = const <std::vec::Vec<()> as Foo>::bar() -> bb1; // bb0[1]: scope 0 at $DIR/inline-specialization.rs:5:13: 5:38
-+         _1 = const 123u32;               // bb0[1]: scope 2 at $DIR/inline-specialization.rs:14:31: 14:34
+          StorageLive(_1);                 // scope 0 at $DIR/inline-specialization.rs:5:9: 5:10
+-         _1 = const <std::vec::Vec<()> as Foo>::bar() -> bb1; // scope 0 at $DIR/inline-specialization.rs:5:13: 5:38
++         _1 = const 123u32;               // scope 2 at $DIR/inline-specialization.rs:14:31: 14:34
                                            // ty::Const
 -                                          // + ty: fn() -> u32 {<std::vec::Vec<()> as Foo>::bar}
 -                                          // + val: Value(Scalar(<ZST>))
 -     }
 - 
 -     bb1: {
--         _0 = const ();                   // bb1[0]: scope 0 at $DIR/inline-specialization.rs:4:11: 6:2
 +                                          // + span: $DIR/inline-specialization.rs:14:31: 14:34
 +                                          // + literal: Const { ty: u32, val: Value(Scalar(0x0000007b)) }
-+         _0 = const ();                   // bb0[2]: scope 0 at $DIR/inline-specialization.rs:4:11: 6:2
+          _0 = const ();                   // scope 0 at $DIR/inline-specialization.rs:4:11: 6:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/inline-specialization.rs:4:11: 6:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         StorageDead(_1);                 // bb1[1]: scope 0 at $DIR/inline-specialization.rs:6:1: 6:2
--         return;                          // bb1[2]: scope 0 at $DIR/inline-specialization.rs:6:2: 6:2
-+         StorageDead(_1);                 // bb0[3]: scope 0 at $DIR/inline-specialization.rs:6:1: 6:2
-+         return;                          // bb0[4]: scope 0 at $DIR/inline-specialization.rs:6:2: 6:2
+          StorageDead(_1);                 // scope 0 at $DIR/inline-specialization.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/inline-specialization.rs:6:2: 6:2
       }
   }
   
index 488303e09ef64627299690f446e71b74eaf74eee..8acc5ad5c0935654ce190deb636008a01e196ee3 100644 (file)
@@ -6,9 +6,9 @@ fn test(_1: &dyn X) -> u32 {
     let mut _2: &dyn X;                  // in scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
 
     bb0: {
-        StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
-        _2 = &(*_1);                     // bb0[1]: scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
-        _0 = const <dyn X as X>::y(move _2) -> bb1; // bb0[2]: scope 0 at $DIR/inline-trait-method.rs:9:5: 9:10
+        StorageLive(_2);                 // scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
+        _2 = &(*_1);                     // scope 0 at $DIR/inline-trait-method.rs:9:5: 9:6
+        _0 = const <dyn X as X>::y(move _2) -> bb1; // scope 0 at $DIR/inline-trait-method.rs:9:5: 9:10
                                          // ty::Const
                                          // + ty: for<'r> fn(&'r dyn X) -> u32 {<dyn X as X>::y}
                                          // + val: Value(Scalar(<ZST>))
@@ -18,7 +18,7 @@ fn test(_1: &dyn X) -> u32 {
     }
 
     bb1: {
-        StorageDead(_2);                 // bb1[0]: scope 0 at $DIR/inline-trait-method.rs:9:9: 9:10
-        return;                          // bb1[1]: scope 0 at $DIR/inline-trait-method.rs:10:2: 10:2
+        StorageDead(_2);                 // scope 0 at $DIR/inline-trait-method.rs:9:9: 9:10
+        return;                          // scope 0 at $DIR/inline-trait-method.rs:10:2: 10:2
     }
 }
index aca47198aa95384fa03beaaa379dd58720d5bdab..afea1d5ebffa22b80cacec276f2734bc3b5e2a8c 100644 (file)
@@ -10,12 +10,12 @@ fn test2(_1: &dyn X) -> bool {
     }
 
     bb0: {
-        StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
-        StorageLive(_3);                 // bb0[1]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
-        _3 = &(*_1);                     // bb0[2]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
-        _2 = move _3 as &dyn X (Pointer(Unsize)); // bb0[3]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
-        StorageDead(_3);                 // bb0[4]: scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
-        _0 = const <dyn X as X>::y(move _2) -> bb1; // bb0[5]: scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
+        StorageLive(_2);                 // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+        StorageLive(_3);                 // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+        _3 = &(*_1);                     // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+        _2 = move _3 as &dyn X (Pointer(Unsize)); // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+        StorageDead(_3);                 // scope 0 at $DIR/inline-trait-method_2.rs:5:10: 5:11
+        _0 = const <dyn X as X>::y(move _2) -> bb1; // scope 1 at $DIR/inline-trait-method_2.rs:10:5: 10:10
                                          // ty::Const
                                          // + ty: for<'r> fn(&'r dyn X) -> bool {<dyn X as X>::y}
                                          // + val: Value(Scalar(<ZST>))
@@ -25,7 +25,7 @@ fn test2(_1: &dyn X) -> bool {
     }
 
     bb1: {
-        StorageDead(_2);                 // bb1[0]: scope 0 at $DIR/inline-trait-method_2.rs:5:11: 5:12
-        return;                          // bb1[1]: scope 0 at $DIR/inline-trait-method_2.rs:6:2: 6:2
+        StorageDead(_2);                 // scope 0 at $DIR/inline-trait-method_2.rs:5:11: 5:12
+        return;                          // scope 0 at $DIR/inline-trait-method_2.rs:6:2: 6:2
     }
 }
diff --git a/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut.rs b/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut.rs
new file mode 100644 (file)
index 0000000..317705f
--- /dev/null
@@ -0,0 +1,27 @@
+// EMIT_MIR rustc.a.Inline.after.mir
+pub fn a<T>(x: &mut [T]) -> &mut [T] {
+    x.as_mut()
+}
+
+// EMIT_MIR rustc.b.Inline.after.mir
+pub fn b<T>(x: &mut Box<T>) -> &mut T {
+    x.as_mut()
+}
+
+// EMIT_MIR rustc.c.Inline.after.mir
+pub fn c<T>(x: &[T]) -> &[T] {
+    x.as_ref()
+}
+
+// EMIT_MIR rustc.d.Inline.after.mir
+pub fn d<T>(x: &Box<T>) -> &T {
+    x.as_ref()
+}
+
+fn main() {
+    let mut boxed = Box::new(1);
+    println!("{:?}", a(&mut [1]));
+    println!("{:?}", b(&mut boxed));
+    println!("{:?}", c(&[1]));
+    println!("{:?}", d(&boxed));
+}
diff --git a/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.a.Inline.after.mir b/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.a.Inline.after.mir
new file mode 100644 (file)
index 0000000..d6c5220
--- /dev/null
@@ -0,0 +1,30 @@
+// MIR for `a` after Inline
+
+fn a(_1: &mut [T]) -> &mut [T] {
+    debug x => _1;                       // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:2:13: 2:14
+    let mut _0: &mut [T];                // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:2:29: 2:37
+    let mut _2: &mut [T];                // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+    let mut _3: &mut [T];                // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+    let mut _4: &mut [T];                // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6
+    scope 1 {
+        debug self => _4;                // in scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+        let mut _5: &mut [T];            // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+    }
+
+    bb0: {
+        StorageLive(_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+        StorageLive(_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+        StorageLive(_4);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6
+        _4 = &mut (*_1);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:6
+        StorageLive(_5);                 // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+        _5 = _4;                         // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+        _3 = _5;                         // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+        StorageDead(_5);                 // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+        _2 = &mut (*_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+        StorageDead(_4);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:14: 3:15
+        _0 = &mut (*_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:3:5: 3:15
+        StorageDead(_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:1: 4:2
+        StorageDead(_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:1: 4:2
+        return;                          // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:4:2: 4:2
+    }
+}
diff --git a/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.b.Inline.after.mir b/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.b.Inline.after.mir
new file mode 100644 (file)
index 0000000..2270abc
--- /dev/null
@@ -0,0 +1,34 @@
+// MIR for `b` after Inline
+
+fn b(_1: &mut std::boxed::Box<T>) -> &mut T {
+    debug x => _1;                       // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:13: 7:14
+    let mut _0: &mut T;                  // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:7:32: 7:38
+    let mut _2: &mut T;                  // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+    let mut _3: &mut T;                  // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+    let mut _4: &mut std::boxed::Box<T>; // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:6
+    scope 1 {
+        debug self => _4;                // in scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        let mut _5: &mut T;              // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+        let mut _6: &mut T;              // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+    }
+
+    bb0: {
+        StorageLive(_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+        StorageLive(_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+        StorageLive(_4);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:6
+        _4 = &mut (*_1);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:6
+        StorageLive(_5);                 // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        StorageLive(_6);                 // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        _6 = &mut (*(*_4));              // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        _5 = _6;                         // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        _3 = _5;                         // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        StorageDead(_6);                 // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        StorageDead(_5);                 // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        _2 = &mut (*_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+        StorageDead(_4);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:14: 8:15
+        _0 = &mut (*_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:8:5: 8:15
+        StorageDead(_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:9:1: 9:2
+        StorageDead(_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:9:1: 9:2
+        return;                          // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:9:2: 9:2
+    }
+}
diff --git a/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.c.Inline.after.mir b/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.c.Inline.after.mir
new file mode 100644 (file)
index 0000000..67aea63
--- /dev/null
@@ -0,0 +1,22 @@
+// MIR for `c` after Inline
+
+fn c(_1: &[T]) -> &[T] {
+    debug x => _1;                       // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:12:13: 12:14
+    let mut _0: &[T];                    // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:12:25: 12:29
+    let _2: &[T];                        // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15
+    let mut _3: &[T];                    // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:6
+    scope 1 {
+        debug self => _3;                // in scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+    }
+
+    bb0: {
+        StorageLive(_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15
+        StorageLive(_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:6
+        _3 = &(*_1);                     // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:6
+        _2 = _3;                         // scope 1 at $SRC_DIR/libcore/convert/mod.rs:LL:COL
+        _0 = &(*_2);                     // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:5: 13:15
+        StorageDead(_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:13:14: 13:15
+        StorageDead(_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:14:1: 14:2
+        return;                          // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:14:2: 14:2
+    }
+}
diff --git a/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.d.Inline.after.mir b/src/test/mir-opt/inline/issue-58867-inline-as-ref-as-mut/rustc.d.Inline.after.mir
new file mode 100644 (file)
index 0000000..a929cb1
--- /dev/null
@@ -0,0 +1,26 @@
+// MIR for `d` after Inline
+
+fn d(_1: &std::boxed::Box<T>) -> &T {
+    debug x => _1;                       // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:13: 17:14
+    let mut _0: &T;                      // return place in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:17:28: 17:30
+    let _2: &T;                          // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15
+    let mut _3: &std::boxed::Box<T>;     // in scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:6
+    scope 1 {
+        debug self => _3;                // in scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        let _4: &T;                      // in scope 1 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15
+    }
+
+    bb0: {
+        StorageLive(_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15
+        StorageLive(_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:6
+        _3 = &(*_1);                     // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:6
+        StorageLive(_4);                 // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        _4 = &(*(*_3));                  // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        _2 = _4;                         // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        StorageDead(_4);                 // scope 1 at $SRC_DIR/liballoc/boxed.rs:LL:COL
+        _0 = &(*_2);                     // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:5: 18:15
+        StorageDead(_3);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:18:14: 18:15
+        StorageDead(_2);                 // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:19:1: 19:2
+        return;                          // scope 0 at $DIR/issue-58867-inline-as-ref-as-mut.rs:19:2: 19:2
+    }
+}
index 62d2f8db7a43fdfacb40b01d54c91d930c1e2253..fa7bd2563ae44d71c1740334e9eaa3c77e922d70 100644 (file)
@@ -12,76 +12,76 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/issue-38669.rs:5:9: 5:25
-        _1 = const false;                // bb0[1]: scope 0 at $DIR/issue-38669.rs:5:28: 5:33
+        StorageLive(_1);                 // scope 0 at $DIR/issue-38669.rs:5:9: 5:25
+        _1 = const false;                // scope 0 at $DIR/issue-38669.rs:5:28: 5:33
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-38669.rs:5:28: 5:33
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        FakeRead(ForLet, _1);            // bb0[2]: scope 0 at $DIR/issue-38669.rs:5:9: 5:25
-        goto -> bb2;                     // bb0[3]: scope 1 at $DIR/issue-38669.rs:6:5: 11:6
+        FakeRead(ForLet, _1);            // scope 0 at $DIR/issue-38669.rs:5:9: 5:25
+        goto -> bb2;                     // scope 1 at $DIR/issue-38669.rs:6:5: 11:6
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/issue-38669.rs:4:1: 12:2
+        resume;                          // scope 0 at $DIR/issue-38669.rs:4:1: 12:2
     }
 
     bb2: {
-        falseUnwind -> [real: bb3, cleanup: bb1]; // bb2[0]: scope 1 at $DIR/issue-38669.rs:6:5: 11:6
+        falseUnwind -> [real: bb3, cleanup: bb1]; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6
     }
 
     bb3: {
-        StorageLive(_3);                 // bb3[0]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10
-        StorageLive(_4);                 // bb3[1]: scope 1 at $DIR/issue-38669.rs:7:12: 7:24
-        _4 = _1;                         // bb3[2]: scope 1 at $DIR/issue-38669.rs:7:12: 7:24
-        FakeRead(ForMatchedPlace, _4);   // bb3[3]: scope 1 at $DIR/issue-38669.rs:7:12: 7:24
-        switchInt(_4) -> [false: bb5, otherwise: bb4]; // bb3[4]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10
+        StorageLive(_3);                 // scope 1 at $DIR/issue-38669.rs:7:9: 9:10
+        StorageLive(_4);                 // scope 1 at $DIR/issue-38669.rs:7:12: 7:24
+        _4 = _1;                         // scope 1 at $DIR/issue-38669.rs:7:12: 7:24
+        FakeRead(ForMatchedPlace, _4);   // scope 1 at $DIR/issue-38669.rs:7:12: 7:24
+        switchInt(_4) -> [false: bb5, otherwise: bb4]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10
     }
 
     bb4: {
-        falseEdges -> [real: bb6, imaginary: bb5]; // bb4[0]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10
+        falseEdges -> [real: bb6, imaginary: bb5]; // scope 1 at $DIR/issue-38669.rs:7:9: 9:10
     }
 
     bb5: {
-        _3 = const ();                   // bb5[0]: scope 1 at $DIR/issue-38669.rs:7:9: 9:10
+        _3 = const ();                   // scope 1 at $DIR/issue-38669.rs:7:9: 9:10
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-38669.rs:7:9: 9:10
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_4);                 // bb5[1]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10
-        StorageDead(_3);                 // bb5[2]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10
-        _1 = const true;                 // bb5[3]: scope 1 at $DIR/issue-38669.rs:10:9: 10:28
+        StorageDead(_4);                 // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
+        StorageDead(_3);                 // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
+        _1 = const true;                 // scope 1 at $DIR/issue-38669.rs:10:9: 10:28
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-38669.rs:10:24: 10:28
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        _2 = const ();                   // bb5[4]: scope 1 at $DIR/issue-38669.rs:6:10: 11:6
+        _2 = const ();                   // scope 1 at $DIR/issue-38669.rs:6:10: 11:6
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-38669.rs:6:10: 11:6
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        goto -> bb2;                     // bb5[5]: scope 1 at $DIR/issue-38669.rs:6:5: 11:6
+        goto -> bb2;                     // scope 1 at $DIR/issue-38669.rs:6:5: 11:6
     }
 
     bb6: {
-        _0 = const ();                   // bb6[0]: scope 1 at $DIR/issue-38669.rs:8:13: 8:18
+        _0 = const ();                   // scope 1 at $DIR/issue-38669.rs:8:13: 8:18
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-38669.rs:8:13: 8:18
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_4);                 // bb6[1]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10
-        StorageDead(_3);                 // bb6[2]: scope 1 at $DIR/issue-38669.rs:9:9: 9:10
-        StorageDead(_1);                 // bb6[3]: scope 0 at $DIR/issue-38669.rs:12:1: 12:2
-        return;                          // bb6[4]: scope 0 at $DIR/issue-38669.rs:12:2: 12:2
+        StorageDead(_4);                 // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
+        StorageDead(_3);                 // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
+        StorageDead(_1);                 // scope 0 at $DIR/issue-38669.rs:12:1: 12:2
+        return;                          // scope 0 at $DIR/issue-38669.rs:12:2: 12:2
     }
 }
index 55849b2773290061e7d6fb711d9a540477504ad5..77763f2d3a0d1b3588ef16b6df064255201e030b 100644 (file)
@@ -12,27 +12,27 @@ fn main() -> () {
     }
 
     bb0: {
-        _5 = const false;                // bb0[0]: scope 0 at $DIR/issue-41110.rs:8:9: 8:10
+        _5 = const false;                // scope 0 at $DIR/issue-41110.rs:8:9: 8:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:8:9: 8:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        StorageLive(_1);                 // bb0[1]: scope 0 at $DIR/issue-41110.rs:8:9: 8:10
-        StorageLive(_2);                 // bb0[2]: scope 0 at $DIR/issue-41110.rs:8:13: 8:14
-        _5 = const true;                 // bb0[3]: scope 0 at $DIR/issue-41110.rs:8:13: 8:14
+        StorageLive(_1);                 // scope 0 at $DIR/issue-41110.rs:8:9: 8:10
+        StorageLive(_2);                 // scope 0 at $DIR/issue-41110.rs:8:13: 8:14
+        _5 = const true;                 // scope 0 at $DIR/issue-41110.rs:8:13: 8:14
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:8:13: 8:14
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        _2 = S;                          // bb0[4]: scope 0 at $DIR/issue-41110.rs:8:13: 8:14
-        StorageLive(_3);                 // bb0[5]: scope 0 at $DIR/issue-41110.rs:8:21: 8:27
-        StorageLive(_4);                 // bb0[6]: scope 0 at $DIR/issue-41110.rs:8:21: 8:22
-        _4 = S;                          // bb0[7]: scope 0 at $DIR/issue-41110.rs:8:21: 8:22
-        _3 = const S::id(move _4) -> [return: bb2, unwind: bb4]; // bb0[8]: scope 0 at $DIR/issue-41110.rs:8:21: 8:27
+        _2 = S;                          // scope 0 at $DIR/issue-41110.rs:8:13: 8:14
+        StorageLive(_3);                 // scope 0 at $DIR/issue-41110.rs:8:21: 8:27
+        StorageLive(_4);                 // scope 0 at $DIR/issue-41110.rs:8:21: 8:22
+        _4 = S;                          // scope 0 at $DIR/issue-41110.rs:8:21: 8:22
+        _3 = const S::id(move _4) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/issue-41110.rs:8:21: 8:27
                                          // ty::Const
                                          // + ty: fn(S) -> S {S::id}
                                          // + val: Value(Scalar(<ZST>))
@@ -42,19 +42,19 @@ fn main() -> () {
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/issue-41110.rs:7:1: 9:2
+        resume;                          // scope 0 at $DIR/issue-41110.rs:7:1: 9:2
     }
 
     bb2: {
-        StorageDead(_4);                 // bb2[0]: scope 0 at $DIR/issue-41110.rs:8:26: 8:27
-        _5 = const false;                // bb2[1]: scope 0 at $DIR/issue-41110.rs:8:13: 8:28
+        StorageDead(_4);                 // scope 0 at $DIR/issue-41110.rs:8:26: 8:27
+        _5 = const false;                // scope 0 at $DIR/issue-41110.rs:8:13: 8:28
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:8:13: 8:28
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        _1 = const S::other(move _2, move _3) -> [return: bb6, unwind: bb5]; // bb2[2]: scope 0 at $DIR/issue-41110.rs:8:13: 8:28
+        _1 = const S::other(move _2, move _3) -> [return: bb6, unwind: bb5]; // scope 0 at $DIR/issue-41110.rs:8:13: 8:28
                                          // ty::Const
                                          // + ty: fn(S, S) {S::other}
                                          // + val: Value(Scalar(<ZST>))
@@ -64,54 +64,54 @@ fn main() -> () {
     }
 
     bb3 (cleanup): {
-        goto -> bb9;                     // bb3[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+        goto -> bb9;                     // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
     }
 
     bb4 (cleanup): {
-        goto -> bb3;                     // bb4[0]: scope 0 at $DIR/issue-41110.rs:8:26: 8:27
+        goto -> bb3;                     // scope 0 at $DIR/issue-41110.rs:8:26: 8:27
     }
 
     bb5 (cleanup): {
-        goto -> bb3;                     // bb5[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+        goto -> bb3;                     // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
     }
 
     bb6: {
-        StorageDead(_3);                 // bb6[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
-        _5 = const false;                // bb6[1]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+        StorageDead(_3);                 // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+        _5 = const false;                // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:8:27: 8:28
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        StorageDead(_2);                 // bb6[2]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
-        _0 = const ();                   // bb6[3]: scope 0 at $DIR/issue-41110.rs:7:11: 9:2
+        StorageDead(_2);                 // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+        _0 = const ();                   // scope 0 at $DIR/issue-41110.rs:7:11: 9:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:7:11: 9:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_1);                 // bb6[4]: scope 0 at $DIR/issue-41110.rs:9:1: 9:2
-        return;                          // bb6[5]: scope 0 at $DIR/issue-41110.rs:9:2: 9:2
+        StorageDead(_1);                 // scope 0 at $DIR/issue-41110.rs:9:1: 9:2
+        return;                          // scope 0 at $DIR/issue-41110.rs:9:2: 9:2
     }
 
     bb7 (cleanup): {
-        drop(_2) -> bb1;                 // bb7[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+        drop(_2) -> bb1;                 // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
     }
 
     bb8 (cleanup): {
-        _5 = const false;                // bb8[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+        _5 = const false;                // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:8:27: 8:28
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        goto -> bb7;                     // bb8[1]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+        goto -> bb7;                     // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
     }
 
     bb9 (cleanup): {
-        switchInt(_5) -> [false: bb1, otherwise: bb8]; // bb9[0]: scope 0 at $DIR/issue-41110.rs:8:27: 8:28
+        switchInt(_5) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
     }
 }
index cc1a49dd24524579b7598590612c81fdda716848..a99846bd15daf4a76bd6bf385c1930b72dce4141 100644 (file)
@@ -16,28 +16,28 @@ fn test() -> () {
     }
 
     bb0: {
-        _6 = const false;                // bb0[0]: scope 0 at $DIR/issue-41110.rs:15:9: 15:10
+        _6 = const false;                // scope 0 at $DIR/issue-41110.rs:15:9: 15:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:15:9: 15:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        StorageLive(_1);                 // bb0[1]: scope 0 at $DIR/issue-41110.rs:15:9: 15:10
-        _6 = const true;                 // bb0[2]: scope 0 at $DIR/issue-41110.rs:15:13: 15:14
+        StorageLive(_1);                 // scope 0 at $DIR/issue-41110.rs:15:9: 15:10
+        _6 = const true;                 // scope 0 at $DIR/issue-41110.rs:15:13: 15:14
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:15:13: 15:14
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        _1 = S;                          // bb0[3]: scope 0 at $DIR/issue-41110.rs:15:13: 15:14
-        StorageLive(_2);                 // bb0[4]: scope 1 at $DIR/issue-41110.rs:16:9: 16:14
-        _2 = S;                          // bb0[5]: scope 1 at $DIR/issue-41110.rs:16:17: 16:18
-        StorageLive(_3);                 // bb0[6]: scope 2 at $DIR/issue-41110.rs:17:5: 17:12
-        StorageLive(_4);                 // bb0[7]: scope 2 at $DIR/issue-41110.rs:17:10: 17:11
-        _4 = move _2;                    // bb0[8]: scope 2 at $DIR/issue-41110.rs:17:10: 17:11
-        _3 = const std::mem::drop::<S>(move _4) -> [return: bb2, unwind: bb5]; // bb0[9]: scope 2 at $DIR/issue-41110.rs:17:5: 17:12
+        _1 = S;                          // scope 0 at $DIR/issue-41110.rs:15:13: 15:14
+        StorageLive(_2);                 // scope 1 at $DIR/issue-41110.rs:16:9: 16:14
+        _2 = S;                          // scope 1 at $DIR/issue-41110.rs:16:17: 16:18
+        StorageLive(_3);                 // scope 2 at $DIR/issue-41110.rs:17:5: 17:12
+        StorageLive(_4);                 // scope 2 at $DIR/issue-41110.rs:17:10: 17:11
+        _4 = move _2;                    // scope 2 at $DIR/issue-41110.rs:17:10: 17:11
+        _3 = const std::mem::drop::<S>(move _4) -> [return: bb2, unwind: bb5]; // scope 2 at $DIR/issue-41110.rs:17:5: 17:12
                                          // ty::Const
                                          // + ty: fn(S) {std::mem::drop::<S>}
                                          // + val: Value(Scalar(<ZST>))
@@ -47,99 +47,99 @@ fn test() -> () {
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/issue-41110.rs:14:1: 19:2
+        resume;                          // scope 0 at $DIR/issue-41110.rs:14:1: 19:2
     }
 
     bb2: {
-        StorageDead(_4);                 // bb2[0]: scope 2 at $DIR/issue-41110.rs:17:11: 17:12
-        StorageDead(_3);                 // bb2[1]: scope 2 at $DIR/issue-41110.rs:17:12: 17:13
-        StorageLive(_5);                 // bb2[2]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
-        _6 = const false;                // bb2[3]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+        StorageDead(_4);                 // scope 2 at $DIR/issue-41110.rs:17:11: 17:12
+        StorageDead(_3);                 // scope 2 at $DIR/issue-41110.rs:17:12: 17:13
+        StorageLive(_5);                 // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+        _6 = const false;                // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:18:9: 18:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        _5 = move _1;                    // bb2[4]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
-        goto -> bb12;                    // bb2[5]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+        _5 = move _1;                    // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+        goto -> bb12;                    // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
     }
 
     bb3 (cleanup): {
-        goto -> bb15;                    // bb3[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+        goto -> bb15;                    // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
     }
 
     bb4 (cleanup): {
-        goto -> bb3;                     // bb4[0]: scope 1 at $DIR/issue-41110.rs:19:1: 19:2
+        goto -> bb3;                     // scope 1 at $DIR/issue-41110.rs:19:1: 19:2
     }
 
     bb5 (cleanup): {
-        goto -> bb4;                     // bb5[0]: scope 2 at $DIR/issue-41110.rs:17:11: 17:12
+        goto -> bb4;                     // scope 2 at $DIR/issue-41110.rs:17:11: 17:12
     }
 
     bb6: {
-        goto -> bb8;                     // bb6[0]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+        goto -> bb8;                     // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
     }
 
     bb7 (cleanup): {
-        goto -> bb4;                     // bb7[0]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+        goto -> bb4;                     // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
     }
 
     bb8: {
-        StorageDead(_5);                 // bb8[0]: scope 2 at $DIR/issue-41110.rs:18:9: 18:10
-        _0 = const ();                   // bb8[1]: scope 0 at $DIR/issue-41110.rs:14:15: 19:2
+        StorageDead(_5);                 // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
+        _0 = const ();                   // scope 0 at $DIR/issue-41110.rs:14:15: 19:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:14:15: 19:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        drop(_2) -> [return: bb9, unwind: bb3]; // bb8[2]: scope 1 at $DIR/issue-41110.rs:19:1: 19:2
+        drop(_2) -> [return: bb9, unwind: bb3]; // scope 1 at $DIR/issue-41110.rs:19:1: 19:2
     }
 
     bb9: {
-        StorageDead(_2);                 // bb9[0]: scope 1 at $DIR/issue-41110.rs:19:1: 19:2
-        goto -> bb10;                    // bb9[1]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+        StorageDead(_2);                 // scope 1 at $DIR/issue-41110.rs:19:1: 19:2
+        goto -> bb10;                    // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
     }
 
     bb10: {
-        _6 = const false;                // bb10[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+        _6 = const false;                // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:19:1: 19:2
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        StorageDead(_1);                 // bb10[1]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
-        return;                          // bb10[2]: scope 0 at $DIR/issue-41110.rs:19:2: 19:2
+        StorageDead(_1);                 // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+        return;                          // scope 0 at $DIR/issue-41110.rs:19:2: 19:2
     }
 
     bb11 (cleanup): {
-        _2 = move _5;                    // bb11[0]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
-        goto -> bb7;                     // bb11[1]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+        _2 = move _5;                    // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+        goto -> bb7;                     // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
     }
 
     bb12: {
-        _2 = move _5;                    // bb12[0]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
-        goto -> bb6;                     // bb12[1]: scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+        _2 = move _5;                    // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
+        goto -> bb6;                     // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
     }
 
     bb13 (cleanup): {
-        drop(_1) -> bb1;                 // bb13[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+        drop(_1) -> bb1;                 // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
     }
 
     bb14 (cleanup): {
-        _6 = const false;                // bb14[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+        _6 = const false;                // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41110.rs:19:1: 19:2
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        goto -> bb13;                    // bb14[1]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+        goto -> bb13;                    // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
     }
 
     bb15 (cleanup): {
-        switchInt(_6) -> [false: bb1, otherwise: bb14]; // bb15[0]: scope 0 at $DIR/issue-41110.rs:19:1: 19:2
+        switchInt(_6) -> [false: bb1, otherwise: bb14]; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
     }
 }
index 072ca4cfe4737131732339452f87a5d44e7d84f1..d263b2515f17a5267e9b449c814378961751f389 100644 (file)
@@ -5,7 +5,7 @@
     let mut _1: (usize, bool);           // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
 
     bb0: {
-        _1 = CheckedAdd(const 1usize, const 1usize); // bb0[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        _1 = CheckedAdd(const 1usize, const 1usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/issue-41697.rs:18:21: 18:22
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
-        assert(!move (_1.1: bool), "attempt to add with overflow") -> [success: bb2, unwind: bb1]; // bb0[1]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        assert(!move (_1.1: bool), "attempt to add with overflow") -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        resume;                          // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
     }
 
     bb2: {
-        _0 = move (_1.0: usize);         // bb2[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
-        return;                          // bb2[1]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        _0 = move (_1.0: usize);         // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        return;                          // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
     }
 }
index 5a9d1570b80dc0e2ab35668981d35351ce73f80b..6c00f49fb75b1590f697e5f8aa88bffcc8d150d9 100644 (file)
@@ -5,7 +5,7 @@
     let mut _1: (usize, bool);           // in scope 0 at $DIR/issue-41697.rs:18:19: 18:22
 
     bb0: {
-        _1 = CheckedAdd(const 1usize, const 1usize); // bb0[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        _1 = CheckedAdd(const 1usize, const 1usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000001))
                                          // mir::Constant
                                          // + span: $DIR/issue-41697.rs:18:21: 18:22
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
-        assert(!move (_1.1: bool), "attempt to add with overflow") -> [success: bb2, unwind: bb1]; // bb0[1]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        assert(!move (_1.1: bool), "attempt to add with overflow") -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        resume;                          // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
     }
 
     bb2: {
-        _0 = move (_1.0: usize);         // bb2[0]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
-        return;                          // bb2[1]: scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        _0 = move (_1.0: usize);         // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
+        return;                          // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
     }
 }
index fe376f2a0486db05e019cb5915eb9940ea72e476..ce940273c3ef5e1474927133a82a06e06bd84b67 100644 (file)
@@ -21,30 +21,30 @@ fn main() -> () {
     }
 
     bb0: {
-        _9 = const false;                // bb0[0]: scope 0 at $DIR/issue-41888.rs:7:9: 7:10
+        _9 = const false;                // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:7:9: 7:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        _7 = const false;                // bb0[1]: scope 0 at $DIR/issue-41888.rs:7:9: 7:10
+        _7 = const false;                // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:7:9: 7:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        _8 = const false;                // bb0[2]: scope 0 at $DIR/issue-41888.rs:7:9: 7:10
+        _8 = const false;                // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:7:9: 7:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        StorageLive(_1);                 // bb0[3]: scope 0 at $DIR/issue-41888.rs:7:9: 7:10
-        StorageLive(_2);                 // bb0[4]: scope 1 at $DIR/issue-41888.rs:8:8: 8:14
-        _2 = const cond() -> [return: bb2, unwind: bb3]; // bb0[5]: scope 1 at $DIR/issue-41888.rs:8:8: 8:14
+        StorageLive(_1);                 // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
+        StorageLive(_2);                 // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
+        _2 = const cond() -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
                                          // ty::Const
                                          // + ty: fn() -> bool {cond}
                                          // + val: Value(Scalar(<ZST>))
@@ -54,215 +54,215 @@ fn main() -> () {
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/issue-41888.rs:6:1: 15:2
+        resume;                          // scope 0 at $DIR/issue-41888.rs:6:1: 15:2
     }
 
     bb2: {
-        switchInt(_2) -> [false: bb4, otherwise: bb5]; // bb2[0]: scope 1 at $DIR/issue-41888.rs:8:5: 14:6
+        switchInt(_2) -> [false: bb4, otherwise: bb5]; // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
     }
 
     bb3 (cleanup): {
-        goto -> bb1;                     // bb3[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        goto -> bb1;                     // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb4: {
-        _0 = const ();                   // bb4[0]: scope 1 at $DIR/issue-41888.rs:8:5: 14:6
+        _0 = const ();                   // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:8:5: 14:6
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        goto -> bb11;                    // bb4[1]: scope 1 at $DIR/issue-41888.rs:8:5: 14:6
+        goto -> bb11;                    // scope 1 at $DIR/issue-41888.rs:8:5: 14:6
     }
 
     bb5: {
-        StorageLive(_3);                 // bb5[0]: scope 1 at $DIR/issue-41888.rs:9:13: 9:20
-        StorageLive(_4);                 // bb5[1]: scope 1 at $DIR/issue-41888.rs:9:18: 9:19
-        _4 = K;                          // bb5[2]: scope 1 at $DIR/issue-41888.rs:9:18: 9:19
-        _3 = E::F(move _4);              // bb5[3]: scope 1 at $DIR/issue-41888.rs:9:13: 9:20
-        StorageDead(_4);                 // bb5[4]: scope 1 at $DIR/issue-41888.rs:9:19: 9:20
-        goto -> bb14;                    // bb5[5]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        StorageLive(_3);                 // scope 1 at $DIR/issue-41888.rs:9:13: 9:20
+        StorageLive(_4);                 // scope 1 at $DIR/issue-41888.rs:9:18: 9:19
+        _4 = K;                          // scope 1 at $DIR/issue-41888.rs:9:18: 9:19
+        _3 = E::F(move _4);              // scope 1 at $DIR/issue-41888.rs:9:13: 9:20
+        StorageDead(_4);                 // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
+        goto -> bb14;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
     }
 
     bb6: {
-        goto -> bb8;                     // bb6[0]: scope 1 at $DIR/issue-41888.rs:9:19: 9:20
+        goto -> bb8;                     // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
     }
 
     bb7 (cleanup): {
-        goto -> bb3;                     // bb7[0]: scope 1 at $DIR/issue-41888.rs:9:19: 9:20
+        goto -> bb3;                     // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
     }
 
     bb8: {
-        StorageDead(_3);                 // bb8[0]: scope 1 at $DIR/issue-41888.rs:9:19: 9:20
-        _5 = discriminant(_1);           // bb8[1]: scope 1 at $DIR/issue-41888.rs:10:16: 10:24
-        switchInt(move _5) -> [0isize: bb10, otherwise: bb9]; // bb8[2]: scope 1 at $DIR/issue-41888.rs:10:16: 10:24
+        StorageDead(_3);                 // scope 1 at $DIR/issue-41888.rs:9:19: 9:20
+        _5 = discriminant(_1);           // scope 1 at $DIR/issue-41888.rs:10:16: 10:24
+        switchInt(move _5) -> [0isize: bb10, otherwise: bb9]; // scope 1 at $DIR/issue-41888.rs:10:16: 10:24
     }
 
     bb9: {
-        _0 = const ();                   // bb9[0]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10
+        _0 = const ();                   // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:10:9: 13:10
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        goto -> bb11;                    // bb9[1]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10
+        goto -> bb11;                    // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
     }
 
     bb10: {
-        StorageLive(_6);                 // bb10[0]: scope 1 at $DIR/issue-41888.rs:10:21: 10:23
-        _9 = const false;                // bb10[1]: scope 1 at $DIR/issue-41888.rs:10:21: 10:23
+        StorageLive(_6);                 // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
+        _9 = const false;                // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:10:21: 10:23
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        _6 = move ((_1 as F).0: K);      // bb10[2]: scope 1 at $DIR/issue-41888.rs:10:21: 10:23
-        _0 = const ();                   // bb10[3]: scope 2 at $DIR/issue-41888.rs:10:29: 13:10
+        _6 = move ((_1 as F).0: K);      // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
+        _0 = const ();                   // scope 2 at $DIR/issue-41888.rs:10:29: 13:10
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:10:29: 13:10
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_6);                 // bb10[4]: scope 1 at $DIR/issue-41888.rs:13:9: 13:10
-        goto -> bb11;                    // bb10[5]: scope 1 at $DIR/issue-41888.rs:10:9: 13:10
+        StorageDead(_6);                 // scope 1 at $DIR/issue-41888.rs:13:9: 13:10
+        goto -> bb11;                    // scope 1 at $DIR/issue-41888.rs:10:9: 13:10
     }
 
     bb11: {
-        goto -> bb21;                    // bb11[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        goto -> bb21;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb12: {
-        _7 = const false;                // bb12[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        _7 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:15:1: 15:2
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        _8 = const false;                // bb12[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        _8 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:15:1: 15:2
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        _9 = const false;                // bb12[2]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        _9 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:15:1: 15:2
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        StorageDead(_1);                 // bb12[3]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
-        StorageDead(_2);                 // bb12[4]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
-        return;                          // bb12[5]: scope 0 at $DIR/issue-41888.rs:15:2: 15:2
+        StorageDead(_1);                 // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        StorageDead(_2);                 // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        return;                          // scope 0 at $DIR/issue-41888.rs:15:2: 15:2
     }
 
     bb13 (cleanup): {
-        _7 = const true;                 // bb13[0]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        _7 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:9:9: 9:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        _8 = const true;                 // bb13[1]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        _8 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:9:9: 9:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        _9 = const true;                 // bb13[2]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        _9 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:9:9: 9:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        _1 = move _3;                    // bb13[3]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
-        goto -> bb7;                     // bb13[4]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        _1 = move _3;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        goto -> bb7;                     // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
     }
 
     bb14: {
-        _7 = const true;                 // bb14[0]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        _7 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:9:9: 9:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        _8 = const true;                 // bb14[1]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        _8 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:9:9: 9:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        _9 = const true;                 // bb14[2]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        _9 = const true;                 // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:9:9: 9:10
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        _1 = move _3;                    // bb14[3]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
-        goto -> bb6;                     // bb14[4]: scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        _1 = move _3;                    // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
+        goto -> bb6;                     // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
     }
 
     bb15: {
-        _7 = const false;                // bb15[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        _7 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:15:1: 15:2
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        goto -> bb12;                    // bb15[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        goto -> bb12;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb16 (cleanup): {
-        _7 = const false;                // bb16[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        _7 = const false;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x00))
                                          // mir::Constant
                                          // + span: $DIR/issue-41888.rs:15:1: 15:2
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-        goto -> bb1;                     // bb16[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        goto -> bb1;                     // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb17 (cleanup): {
-        goto -> bb16;                    // bb17[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        goto -> bb16;                    // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb18: {
-        drop(_1) -> [return: bb15, unwind: bb16]; // bb18[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        drop(_1) -> [return: bb15, unwind: bb16]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb19 (cleanup): {
-        drop(_1) -> bb16;                // bb19[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        drop(_1) -> bb16;                // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb20: {
-        _10 = discriminant(_1);          // bb20[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
-        switchInt(move _10) -> [0isize: bb15, otherwise: bb18]; // bb20[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        _10 = discriminant(_1);          // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        switchInt(move _10) -> [0isize: bb15, otherwise: bb18]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb21: {
-        switchInt(_7) -> [false: bb15, otherwise: bb20]; // bb21[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        switchInt(_7) -> [false: bb15, otherwise: bb20]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb22 (cleanup): {
-        _11 = discriminant(_1);          // bb22[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
-        switchInt(move _11) -> [0isize: bb17, otherwise: bb19]; // bb22[1]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        _11 = discriminant(_1);          // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        switchInt(move _11) -> [0isize: bb17, otherwise: bb19]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 
     bb23 (cleanup): {
-        switchInt(_7) -> [false: bb16, otherwise: bb22]; // bb23[0]: scope 0 at $DIR/issue-41888.rs:15:1: 15:2
+        switchInt(_7) -> [false: bb16, otherwise: bb22]; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
     }
 }
index 5440d4488bb97c88cebfaa3c833354b569eaa97e..abf33cce133dd9947eadd3dc1fda6a36dfe77723 100644 (file)
@@ -13,93 +13,93 @@ fn main() -> () {
     }
 
     bb0: {
-        goto -> bb1;                     // bb0[0]: scope 0 at $DIR/issue-49232.rs:6:5: 14:6
+        goto -> bb1;                     // scope 0 at $DIR/issue-49232.rs:6:5: 14:6
     }
 
     bb1: {
-        falseUnwind -> [real: bb3, cleanup: bb4]; // bb1[0]: scope 0 at $DIR/issue-49232.rs:6:5: 14:6
+        falseUnwind -> [real: bb3, cleanup: bb4]; // scope 0 at $DIR/issue-49232.rs:6:5: 14:6
     }
 
     bb2: {
-        goto -> bb14;                    // bb2[0]: scope 0 at $DIR/issue-49232.rs:15:2: 15:2
+        goto -> bb14;                    // scope 0 at $DIR/issue-49232.rs:15:2: 15:2
     }
 
     bb3: {
-        StorageLive(_2);                 // bb3[0]: scope 0 at $DIR/issue-49232.rs:7:13: 7:19
-        StorageLive(_3);                 // bb3[1]: scope 0 at $DIR/issue-49232.rs:8:19: 8:23
-        _3 = const true;                 // bb3[2]: scope 0 at $DIR/issue-49232.rs:8:19: 8:23
+        StorageLive(_2);                 // scope 0 at $DIR/issue-49232.rs:7:13: 7:19
+        StorageLive(_3);                 // scope 0 at $DIR/issue-49232.rs:8:19: 8:23
+        _3 = const true;                 // scope 0 at $DIR/issue-49232.rs:8:19: 8:23
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/issue-49232.rs:8:19: 8:23
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        FakeRead(ForMatchedPlace, _3);   // bb3[3]: scope 0 at $DIR/issue-49232.rs:8:19: 8:23
-        switchInt(_3) -> [false: bb5, otherwise: bb6]; // bb3[4]: scope 0 at $DIR/issue-49232.rs:9:17: 9:22
+        FakeRead(ForMatchedPlace, _3);   // scope 0 at $DIR/issue-49232.rs:8:19: 8:23
+        switchInt(_3) -> [false: bb5, otherwise: bb6]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22
     }
 
     bb4 (cleanup): {
-        resume;                          // bb4[0]: scope 0 at $DIR/issue-49232.rs:5:1: 15:2
+        resume;                          // scope 0 at $DIR/issue-49232.rs:5:1: 15:2
     }
 
     bb5: {
-        falseEdges -> [real: bb7, imaginary: bb6]; // bb5[0]: scope 0 at $DIR/issue-49232.rs:9:17: 9:22
+        falseEdges -> [real: bb7, imaginary: bb6]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22
     }
 
     bb6: {
-        _0 = const ();                   // bb6[0]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+        _0 = const ();                   // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-49232.rs:10:25: 10:30
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        goto -> bb8;                     // bb6[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+        goto -> bb8;                     // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
     }
 
     bb7: {
-        _2 = const 4i32;                 // bb7[0]: scope 0 at $DIR/issue-49232.rs:9:26: 9:27
+        _2 = const 4i32;                 // scope 0 at $DIR/issue-49232.rs:9:26: 9:27
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000004))
                                          // mir::Constant
                                          // + span: $DIR/issue-49232.rs:9:26: 9:27
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-        goto -> bb12;                    // bb7[1]: scope 0 at $DIR/issue-49232.rs:8:13: 11:14
+        goto -> bb12;                    // scope 0 at $DIR/issue-49232.rs:8:13: 11:14
     }
 
     bb8: {
-        StorageDead(_3);                 // bb8[0]: scope 0 at $DIR/issue-49232.rs:12:10: 12:11
-        goto -> bb9;                     // bb8[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+        StorageDead(_3);                 // scope 0 at $DIR/issue-49232.rs:12:10: 12:11
+        goto -> bb9;                     // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
     }
 
     bb9: {
-        StorageDead(_2);                 // bb9[0]: scope 0 at $DIR/issue-49232.rs:14:5: 14:6
-        goto -> bb2;                     // bb9[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+        StorageDead(_2);                 // scope 0 at $DIR/issue-49232.rs:14:5: 14:6
+        goto -> bb2;                     // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
     }
 
     bb10: {
-        _4 = const ();                   // bb10[0]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+        _4 = const ();                   // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-49232.rs:10:25: 10:30
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        unreachable;                     // bb10[1]: scope 0 at $DIR/issue-49232.rs:10:25: 10:30
+        unreachable;                     // scope 0 at $DIR/issue-49232.rs:10:25: 10:30
     }
 
     bb11: {
-        goto -> bb12;                    // bb11[0]: scope 0 at $DIR/issue-49232.rs:8:13: 11:14
+        goto -> bb12;                    // scope 0 at $DIR/issue-49232.rs:8:13: 11:14
     }
 
     bb12: {
-        FakeRead(ForLet, _2);            // bb12[0]: scope 0 at $DIR/issue-49232.rs:7:13: 7:19
-        StorageDead(_3);                 // bb12[1]: scope 0 at $DIR/issue-49232.rs:12:10: 12:11
-        StorageLive(_5);                 // bb12[2]: scope 1 at $DIR/issue-49232.rs:13:9: 13:22
-        StorageLive(_6);                 // bb12[3]: scope 1 at $DIR/issue-49232.rs:13:14: 13:21
-        _6 = &_2;                        // bb12[4]: scope 1 at $DIR/issue-49232.rs:13:14: 13:21
-        _5 = const std::mem::drop::<&i32>(move _6) -> [return: bb13, unwind: bb4]; // bb12[5]: scope 1 at $DIR/issue-49232.rs:13:9: 13:22
+        FakeRead(ForLet, _2);            // scope 0 at $DIR/issue-49232.rs:7:13: 7:19
+        StorageDead(_3);                 // scope 0 at $DIR/issue-49232.rs:12:10: 12:11
+        StorageLive(_5);                 // scope 1 at $DIR/issue-49232.rs:13:9: 13:22
+        StorageLive(_6);                 // scope 1 at $DIR/issue-49232.rs:13:14: 13:21
+        _6 = &_2;                        // scope 1 at $DIR/issue-49232.rs:13:14: 13:21
+        _5 = const std::mem::drop::<&i32>(move _6) -> [return: bb13, unwind: bb4]; // scope 1 at $DIR/issue-49232.rs:13:9: 13:22
                                          // ty::Const
                                          // + ty: fn(&i32) {std::mem::drop::<&i32>}
                                          // + val: Value(Scalar(<ZST>))
@@ -109,20 +109,20 @@ fn main() -> () {
     }
 
     bb13: {
-        StorageDead(_6);                 // bb13[0]: scope 1 at $DIR/issue-49232.rs:13:21: 13:22
-        StorageDead(_5);                 // bb13[1]: scope 1 at $DIR/issue-49232.rs:13:22: 13:23
-        _1 = const ();                   // bb13[2]: scope 0 at $DIR/issue-49232.rs:6:10: 14:6
+        StorageDead(_6);                 // scope 1 at $DIR/issue-49232.rs:13:21: 13:22
+        StorageDead(_5);                 // scope 1 at $DIR/issue-49232.rs:13:22: 13:23
+        _1 = const ();                   // scope 0 at $DIR/issue-49232.rs:6:10: 14:6
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/issue-49232.rs:6:10: 14:6
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_2);                 // bb13[3]: scope 0 at $DIR/issue-49232.rs:14:5: 14:6
-        goto -> bb1;                     // bb13[4]: scope 0 at $DIR/issue-49232.rs:6:5: 14:6
+        StorageDead(_2);                 // scope 0 at $DIR/issue-49232.rs:14:5: 14:6
+        goto -> bb1;                     // scope 0 at $DIR/issue-49232.rs:6:5: 14:6
     }
 
     bb14: {
-        return;                          // bb14[0]: scope 0 at $DIR/issue-49232.rs:15:2: 15:2
+        return;                          // scope 0 at $DIR/issue-49232.rs:15:2: 15:2
     }
 }
index 8970cc83f2b3c49b508fde73e6b521b3f9c3d627..0b8b03961f2a013e6f5d7edd9e43f22922a079fc 100644 (file)
@@ -24,13 +24,13 @@ fn test() -> std::option::Option<std::boxed::Box<u32>> {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
-        _2 = Box(u32);                   // bb0[2]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
-        StorageLive(_3);                 // bb0[3]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
-        StorageLive(_4);                 // bb0[4]: scope 0 at $DIR/issue-62289.rs:9:15: 9:19
-        _4 = std::option::Option::<u32>::None; // bb0[5]: scope 0 at $DIR/issue-62289.rs:9:15: 9:19
-        _3 = const <std::option::Option<u32> as std::ops::Try>::into_result(move _4) -> [return: bb2, unwind: bb3]; // bb0[6]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+        StorageLive(_1);                 // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
+        StorageLive(_2);                 // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
+        _2 = Box(u32);                   // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
+        StorageLive(_3);                 // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+        StorageLive(_4);                 // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
+        _4 = std::option::Option::<u32>::None; // scope 0 at $DIR/issue-62289.rs:9:15: 9:19
+        _3 = const <std::option::Option<u32> as std::ops::Try>::into_result(move _4) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
                                          // ty::Const
                                          // + ty: fn(std::option::Option<u32>) -> std::result::Result<<std::option::Option<u32> as std::ops::Try>::Ok, <std::option::Option<u32> as std::ops::Try>::Error> {<std::option::Option<u32> as std::ops::Try>::into_result}
                                          // + val: Value(Scalar(<ZST>))
@@ -40,39 +40,39 @@ fn test() -> std::option::Option<std::boxed::Box<u32>> {
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/issue-62289.rs:8:1: 10:2
+        resume;                          // scope 0 at $DIR/issue-62289.rs:8:1: 10:2
     }
 
     bb2: {
-        StorageDead(_4);                 // bb2[0]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
-        _5 = discriminant(_3);           // bb2[1]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
-        switchInt(move _5) -> [0isize: bb4, 1isize: bb6, otherwise: bb5]; // bb2[2]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+        StorageDead(_4);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+        _5 = discriminant(_3);           // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+        switchInt(move _5) -> [0isize: bb4, 1isize: bb6, otherwise: bb5]; // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
     }
 
     bb3 (cleanup): {
-        drop(_2) -> bb1;                 // bb3[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+        drop(_2) -> bb1;                 // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
     }
 
     bb4: {
-        StorageLive(_10);                // bb4[0]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
-        _10 = ((_3 as Ok).0: u32);       // bb4[1]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
-        (*_2) = _10;                     // bb4[2]: scope 4 at $DIR/issue-62289.rs:9:15: 9:20
-        StorageDead(_10);                // bb4[3]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
-        _1 = move _2;                    // bb4[4]: scope 0 at $DIR/issue-62289.rs:9:10: 9:21
-        drop(_2) -> [return: bb12, unwind: bb11]; // bb4[5]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+        StorageLive(_10);                // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+        _10 = ((_3 as Ok).0: u32);       // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+        (*_2) = _10;                     // scope 4 at $DIR/issue-62289.rs:9:15: 9:20
+        StorageDead(_10);                // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+        _1 = move _2;                    // scope 0 at $DIR/issue-62289.rs:9:10: 9:21
+        drop(_2) -> [return: bb12, unwind: bb11]; // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
     }
 
     bb5: {
-        unreachable;                     // bb5[0]: scope 0 at $DIR/issue-62289.rs:9:15: 9:20
+        unreachable;                     // scope 0 at $DIR/issue-62289.rs:9:15: 9:20
     }
 
     bb6: {
-        StorageLive(_6);                 // bb6[0]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
-        _6 = ((_3 as Err).0: std::option::NoneError); // bb6[1]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
-        StorageLive(_8);                 // bb6[2]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
-        StorageLive(_9);                 // bb6[3]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
-        _9 = _6;                         // bb6[4]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
-        _8 = const <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb8, unwind: bb3]; // bb6[5]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+        StorageLive(_6);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+        _6 = ((_3 as Err).0: std::option::NoneError); // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+        StorageLive(_8);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+        StorageLive(_9);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+        _9 = _6;                         // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+        _8 = const <std::option::NoneError as std::convert::From<std::option::NoneError>>::from(move _9) -> [return: bb8, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
                                          // ty::Const
                                          // + ty: fn(std::option::NoneError) -> std::option::NoneError {<std::option::NoneError as std::convert::From<std::option::NoneError>>::from}
                                          // + val: Value(Scalar(<ZST>))
@@ -82,12 +82,12 @@ fn test() -> std::option::Option<std::boxed::Box<u32>> {
     }
 
     bb7: {
-        return;                          // bb7[0]: scope 0 at $DIR/issue-62289.rs:10:2: 10:2
+        return;                          // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
     }
 
     bb8: {
-        StorageDead(_9);                 // bb8[0]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
-        _0 = const <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb9, unwind: bb3]; // bb8[1]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+        StorageDead(_9);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+        _0 = const <std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error(move _8) -> [return: bb9, unwind: bb3]; // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
                                          // ty::Const
                                          // + ty: fn(<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::Error) -> std::option::Option<std::boxed::Box<u32>> {<std::option::Option<std::boxed::Box<u32>> as std::ops::Try>::from_error}
                                          // + val: Value(Scalar(<ZST>))
@@ -97,31 +97,31 @@ fn test() -> std::option::Option<std::boxed::Box<u32>> {
     }
 
     bb9: {
-        StorageDead(_8);                 // bb9[0]: scope 2 at $DIR/issue-62289.rs:9:19: 9:20
-        StorageDead(_6);                 // bb9[1]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
-        drop(_2) -> bb10;                // bb9[2]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+        StorageDead(_8);                 // scope 2 at $DIR/issue-62289.rs:9:19: 9:20
+        StorageDead(_6);                 // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+        drop(_2) -> bb10;                // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
     }
 
     bb10: {
-        StorageDead(_2);                 // bb10[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
-        StorageDead(_1);                 // bb10[1]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
-        StorageDead(_3);                 // bb10[2]: scope 0 at $DIR/issue-62289.rs:10:1: 10:2
-        goto -> bb7;                     // bb10[3]: scope 0 at $DIR/issue-62289.rs:9:19: 9:20
+        StorageDead(_2);                 // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+        StorageDead(_1);                 // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
+        StorageDead(_3);                 // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
+        goto -> bb7;                     // scope 0 at $DIR/issue-62289.rs:9:19: 9:20
     }
 
     bb11 (cleanup): {
-        drop(_1) -> bb1;                 // bb11[0]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
+        drop(_1) -> bb1;                 // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
     }
 
     bb12: {
-        StorageDead(_2);                 // bb12[0]: scope 0 at $DIR/issue-62289.rs:9:20: 9:21
-        _0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1); // bb12[1]: scope 0 at $DIR/issue-62289.rs:9:5: 9:22
-        drop(_1) -> bb13;                // bb12[2]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
+        StorageDead(_2);                 // scope 0 at $DIR/issue-62289.rs:9:20: 9:21
+        _0 = std::option::Option::<std::boxed::Box<u32>>::Some(move _1); // scope 0 at $DIR/issue-62289.rs:9:5: 9:22
+        drop(_1) -> bb13;                // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
     }
 
     bb13: {
-        StorageDead(_1);                 // bb13[0]: scope 0 at $DIR/issue-62289.rs:9:21: 9:22
-        StorageDead(_3);                 // bb13[1]: scope 0 at $DIR/issue-62289.rs:10:1: 10:2
-        goto -> bb7;                     // bb13[2]: scope 0 at $DIR/issue-62289.rs:10:2: 10:2
+        StorageDead(_1);                 // scope 0 at $DIR/issue-62289.rs:9:21: 9:22
+        StorageDead(_3);                 // scope 0 at $DIR/issue-62289.rs:10:1: 10:2
+        goto -> bb7;                     // scope 0 at $DIR/issue-62289.rs:10:2: 10:2
     }
 }
index df05dbabc770d576efb29525daff4aae4089ec09..38e04a6399fc239edc2ef7b03f0fd8a3c715e06e 100644 (file)
@@ -13,69 +13,69 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/loop_test.rs:10:5: 12:6
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/loop_test.rs:10:8: 10:12
-        _2 = const true;                 // bb0[2]: scope 0 at $DIR/loop_test.rs:10:8: 10:12
+        StorageLive(_1);                 // scope 0 at $DIR/loop_test.rs:10:5: 12:6
+        StorageLive(_2);                 // scope 0 at $DIR/loop_test.rs:10:8: 10:12
+        _2 = const true;                 // scope 0 at $DIR/loop_test.rs:10:8: 10:12
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/loop_test.rs:10:8: 10:12
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        FakeRead(ForMatchedPlace, _2);   // bb0[3]: scope 0 at $DIR/loop_test.rs:10:8: 10:12
-        switchInt(_2) -> [false: bb3, otherwise: bb2]; // bb0[4]: scope 0 at $DIR/loop_test.rs:10:5: 12:6
+        FakeRead(ForMatchedPlace, _2);   // scope 0 at $DIR/loop_test.rs:10:8: 10:12
+        switchInt(_2) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/loop_test.rs:6:1: 17:2
+        resume;                          // scope 0 at $DIR/loop_test.rs:6:1: 17:2
     }
 
     bb2: {
-        falseEdges -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 0 at $DIR/loop_test.rs:10:5: 12:6
+        falseEdges -> [real: bb4, imaginary: bb3]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6
     }
 
     bb3: {
-        _1 = const ();                   // bb3[0]: scope 0 at $DIR/loop_test.rs:10:5: 12:6
+        _1 = const ();                   // scope 0 at $DIR/loop_test.rs:10:5: 12:6
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/loop_test.rs:10:5: 12:6
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_2);                 // bb3[1]: scope 0 at $DIR/loop_test.rs:12:5: 12:6
-        StorageDead(_1);                 // bb3[2]: scope 0 at $DIR/loop_test.rs:12:5: 12:6
-        StorageLive(_4);                 // bb3[3]: scope 0 at $DIR/loop_test.rs:13:5: 16:6
-        goto -> bb5;                     // bb3[4]: scope 0 at $DIR/loop_test.rs:13:5: 16:6
+        StorageDead(_2);                 // scope 0 at $DIR/loop_test.rs:12:5: 12:6
+        StorageDead(_1);                 // scope 0 at $DIR/loop_test.rs:12:5: 12:6
+        StorageLive(_4);                 // scope 0 at $DIR/loop_test.rs:13:5: 16:6
+        goto -> bb5;                     // scope 0 at $DIR/loop_test.rs:13:5: 16:6
     }
 
     bb4: {
-        _0 = const ();                   // bb4[0]: scope 0 at $DIR/loop_test.rs:11:9: 11:15
+        _0 = const ();                   // scope 0 at $DIR/loop_test.rs:11:9: 11:15
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/loop_test.rs:11:9: 11:15
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_2);                 // bb4[1]: scope 0 at $DIR/loop_test.rs:12:5: 12:6
-        StorageDead(_1);                 // bb4[2]: scope 0 at $DIR/loop_test.rs:12:5: 12:6
-        return;                          // bb4[3]: scope 0 at $DIR/loop_test.rs:17:2: 17:2
+        StorageDead(_2);                 // scope 0 at $DIR/loop_test.rs:12:5: 12:6
+        StorageDead(_1);                 // scope 0 at $DIR/loop_test.rs:12:5: 12:6
+        return;                          // scope 0 at $DIR/loop_test.rs:17:2: 17:2
     }
 
     bb5: {
-        falseUnwind -> [real: bb6, cleanup: bb1]; // bb5[0]: scope 0 at $DIR/loop_test.rs:13:5: 16:6
+        falseUnwind -> [real: bb6, cleanup: bb1]; // scope 0 at $DIR/loop_test.rs:13:5: 16:6
     }
 
     bb6: {
-        StorageLive(_6);                 // bb6[0]: scope 0 at $DIR/loop_test.rs:14:13: 14:14
-        _6 = const 1i32;                 // bb6[1]: scope 0 at $DIR/loop_test.rs:14:17: 14:18
+        StorageLive(_6);                 // scope 0 at $DIR/loop_test.rs:14:13: 14:14
+        _6 = const 1i32;                 // scope 0 at $DIR/loop_test.rs:14:17: 14:18
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/loop_test.rs:14:17: 14:18
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        FakeRead(ForLet, _6);            // bb6[2]: scope 0 at $DIR/loop_test.rs:14:13: 14:14
-        StorageDead(_6);                 // bb6[3]: scope 0 at $DIR/loop_test.rs:16:5: 16:6
-        goto -> bb5;                     // bb6[4]: scope 0 at $DIR/loop_test.rs:15:9: 15:17
+        FakeRead(ForLet, _6);            // scope 0 at $DIR/loop_test.rs:14:13: 14:14
+        StorageDead(_6);                 // scope 0 at $DIR/loop_test.rs:16:5: 16:6
+        goto -> bb5;                     // scope 0 at $DIR/loop_test.rs:15:9: 15:17
     }
 }
index 0b60f4f3321b6024fd125e2c979ef9ec0db44f8e..856248e90d495dac63e2b23d4e4823657cf76fc8 100644 (file)
@@ -30,206 +30,206 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb0: {
-        switchInt((_2.0: bool)) -> [false: bb6, otherwise: bb2]; // bb0[0]: scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:15
+        switchInt((_2.0: bool)) -> [false: bb6, otherwise: bb2]; // scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:15
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/match-arm-scopes.rs:14:1: 19:2
+        resume;                          // scope 0 at $DIR/match-arm-scopes.rs:14:1: 19:2
     }
 
     bb2: {
-        switchInt((_2.1: bool)) -> [false: bb14, otherwise: bb3]; // bb2[0]: scope 0 at $DIR/match-arm-scopes.rs:16:29: 16:34
+        switchInt((_2.1: bool)) -> [false: bb14, otherwise: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:16:29: 16:34
     }
 
     bb3: {
-        switchInt((_2.0: bool)) -> [false: bb4, otherwise: bb21]; // bb3[0]: scope 0 at $DIR/match-arm-scopes.rs:17:10: 17:14
+        switchInt((_2.0: bool)) -> [false: bb4, otherwise: bb21]; // scope 0 at $DIR/match-arm-scopes.rs:17:10: 17:14
     }
 
     bb4: {
-        StorageLive(_15);                // bb4[0]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
-        _15 = (_2.1: bool);              // bb4[1]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
-        StorageLive(_16);                // bb4[2]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
-        _16 = move (_2.2: std::string::String); // bb4[3]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
-        goto -> bb20;                    // bb4[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageLive(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
+        _15 = (_2.1: bool);              // scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
+        StorageLive(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
+        _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
+        goto -> bb20;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb5: {
-        _0 = const 1i32;                 // bb5[0]: scope 1 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        _0 = const 1i32;                 // scope 1 at $DIR/match-arm-scopes.rs:16:77: 16:78
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:16:77: 16:78
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        drop(_7) -> [return: bb19, unwind: bb10]; // bb5[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        drop(_7) -> [return: bb19, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
     }
 
     bb6: {
-        StorageLive(_6);                 // bb6[0]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
-        _6 = &(_2.1: bool);              // bb6[1]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
-        StorageLive(_8);                 // bb6[2]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
-        _8 = &(_2.2: std::string::String); // bb6[3]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
-        StorageLive(_9);                 // bb6[4]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
-        StorageLive(_10);                // bb6[5]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        _10 = _1;                        // bb6[6]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        switchInt(_10) -> [false: bb7, otherwise: bb8]; // bb6[7]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageLive(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+        _6 = &(_2.1: bool);              // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+        StorageLive(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+        _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+        StorageLive(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageLive(_10);                // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        _10 = _1;                        // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        switchInt(_10) -> [false: bb7, otherwise: bb8]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb7: {
-        _9 = (*_6);                      // bb7[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
-        StorageDead(_10);                // bb7[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        switchInt(move _9) -> [false: bb13, otherwise: bb12]; // bb7[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        _9 = (*_6);                      // scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
+        StorageDead(_10);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        switchInt(move _9) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb8: {
-        _0 = const 3i32;                 // bb8[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
+        _0 = const 3i32;                 // scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        StorageDead(_10);                // bb8[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageDead(_9);                 // bb8[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb8[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb8[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        goto -> bb11;                    // bb8[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
+        StorageDead(_10);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        goto -> bb11;                    // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
     }
 
     bb9: {
-        return;                          // bb9[0]: scope 0 at $DIR/match-arm-scopes.rs:19:2: 19:2
+        return;                          // scope 0 at $DIR/match-arm-scopes.rs:19:2: 19:2
     }
 
     bb10 (cleanup): {
-        goto -> bb25;                    // bb10[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        goto -> bb25;                    // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb11: {
-        drop(_2) -> [return: bb9, unwind: bb1]; // bb11[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        drop(_2) -> [return: bb9, unwind: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb12: {
-        StorageDead(_9);                 // bb12[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageLive(_5);                 // bb12[1]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
-        _5 = (_2.1: bool);               // bb12[2]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
-        StorageLive(_7);                 // bb12[3]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
-        _7 = move (_2.2: std::string::String); // bb12[4]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
-        goto -> bb5;                     // bb12[5]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageLive(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+        _5 = (_2.1: bool);               // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+        StorageLive(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+        _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+        goto -> bb5;                     // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb13: {
-        StorageDead(_9);                 // bb13[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb13[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb13[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        goto -> bb2;                     // bb13[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        goto -> bb2;                     // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb14: {
-        StorageLive(_6);                 // bb14[0]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
-        _6 = &(_2.0: bool);              // bb14[1]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
-        StorageLive(_8);                 // bb14[2]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
-        _8 = &(_2.2: std::string::String); // bb14[3]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
-        StorageLive(_12);                // bb14[4]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
-        StorageLive(_13);                // bb14[5]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        _13 = _1;                        // bb14[6]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        switchInt(_13) -> [false: bb15, otherwise: bb16]; // bb14[7]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageLive(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+        _6 = &(_2.0: bool);              // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+        StorageLive(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+        _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+        StorageLive(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageLive(_13);                // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        _13 = _1;                        // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        switchInt(_13) -> [false: bb15, otherwise: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb15: {
-        _12 = (*_6);                     // bb15[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
-        StorageDead(_13);                // bb15[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        switchInt(move _12) -> [false: bb18, otherwise: bb17]; // bb15[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        _12 = (*_6);                     // scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
+        StorageDead(_13);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        switchInt(move _12) -> [false: bb18, otherwise: bb17]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb16: {
-        _0 = const 3i32;                 // bb16[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
+        _0 = const 3i32;                 // scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        StorageDead(_13);                // bb16[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageDead(_12);                // bb16[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb16[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb16[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        goto -> bb11;                    // bb16[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
+        StorageDead(_13);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        goto -> bb11;                    // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
     }
 
     bb17: {
-        StorageDead(_12);                // bb17[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageLive(_5);                 // bb17[1]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
-        _5 = (_2.0: bool);               // bb17[2]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
-        StorageLive(_7);                 // bb17[3]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
-        _7 = move (_2.2: std::string::String); // bb17[4]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
-        goto -> bb5;                     // bb17[5]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageLive(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+        _5 = (_2.0: bool);               // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+        StorageLive(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+        _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+        goto -> bb5;                     // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb18: {
-        StorageDead(_12);                // bb18[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb18[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb18[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        goto -> bb3;                     // bb18[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        goto -> bb3;                     // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb19: {
-        StorageDead(_7);                 // bb19[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_5);                 // bb19[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb19[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb19[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        goto -> bb23;                    // bb19[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageDead(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        goto -> bb23;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb20: {
-        _0 = const 2i32;                 // bb20[0]: scope 2 at $DIR/match-arm-scopes.rs:17:41: 17:42
+        _0 = const 2i32;                 // scope 2 at $DIR/match-arm-scopes.rs:17:41: 17:42
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:17:41: 17:42
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        drop(_16) -> [return: bb22, unwind: bb10]; // bb20[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        drop(_16) -> [return: bb22, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
     }
 
     bb21: {
-        StorageLive(_15);                // bb21[0]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
-        _15 = (_2.1: bool);              // bb21[1]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
-        StorageLive(_16);                // bb21[2]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
-        _16 = move (_2.2: std::string::String); // bb21[3]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
-        goto -> bb20;                    // bb21[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageLive(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
+        _15 = (_2.1: bool);              // scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
+        StorageLive(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
+        _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
+        goto -> bb20;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb22: {
-        StorageDead(_16);                // bb22[0]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
-        StorageDead(_15);                // bb22[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
-        goto -> bb23;                    // bb22[2]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageDead(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        StorageDead(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        goto -> bb23;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb23: {
-        goto -> bb29;                    // bb23[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        goto -> bb29;                    // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb24 (cleanup): {
-        goto -> bb1;                     // bb24[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        goto -> bb1;                     // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb25 (cleanup): {
-        goto -> bb24;                    // bb25[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        goto -> bb24;                    // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb26: {
-        goto -> bb9;                     // bb26[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        goto -> bb9;                     // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb27 (cleanup): {
-        goto -> bb1;                     // bb27[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        goto -> bb1;                     // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb28 (cleanup): {
-        goto -> bb27;                    // bb28[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        goto -> bb27;                    // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb29: {
-        goto -> bb26;                    // bb29[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        goto -> bb26;                    // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 }
index 80ce94a7f3c61955d87c89c106e1bcab41953bb2..63974bda26038f97c8072734c6c2846a798f7992 100644 (file)
@@ -30,217 +30,217 @@ fn complicated_match(_1: bool, _2: (bool, bool, std::string::String)) -> i32 {
     }
 
     bb0: {
-        FakeRead(ForMatchedPlace, _2);   // bb0[0]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
-        switchInt((_2.0: bool)) -> [false: bb2, otherwise: bb3]; // bb0[1]: scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:15
+        FakeRead(ForMatchedPlace, _2);   // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+        switchInt((_2.0: bool)) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/match-arm-scopes.rs:16:10: 16:15
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/match-arm-scopes.rs:14:1: 19:2
+        resume;                          // scope 0 at $DIR/match-arm-scopes.rs:14:1: 19:2
     }
 
     bb2: {
-        falseEdges -> [real: bb9, imaginary: bb4]; // bb2[0]: scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:22
+        falseEdges -> [real: bb9, imaginary: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:16:9: 16:22
     }
 
     bb3: {
-        switchInt((_2.1: bool)) -> [false: bb4, otherwise: bb5]; // bb3[0]: scope 0 at $DIR/match-arm-scopes.rs:16:29: 16:34
+        switchInt((_2.1: bool)) -> [false: bb4, otherwise: bb5]; // scope 0 at $DIR/match-arm-scopes.rs:16:29: 16:34
     }
 
     bb4: {
-        falseEdges -> [real: bb18, imaginary: bb6]; // bb4[0]: scope 0 at $DIR/match-arm-scopes.rs:16:25: 16:38
+        falseEdges -> [real: bb18, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:25: 16:38
     }
 
     bb5: {
-        switchInt((_2.0: bool)) -> [false: bb7, otherwise: bb6]; // bb5[0]: scope 0 at $DIR/match-arm-scopes.rs:17:10: 17:14
+        switchInt((_2.0: bool)) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:17:10: 17:14
     }
 
     bb6: {
-        falseEdges -> [real: bb26, imaginary: bb7]; // bb6[0]: scope 0 at $DIR/match-arm-scopes.rs:17:9: 17:21
+        falseEdges -> [real: bb26, imaginary: bb7]; // scope 0 at $DIR/match-arm-scopes.rs:17:9: 17:21
     }
 
     bb7: {
-        StorageLive(_15);                // bb7[0]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
-        _15 = (_2.1: bool);              // bb7[1]: scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
-        StorageLive(_16);                // bb7[2]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
-        _16 = move (_2.2: std::string::String); // bb7[3]: scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
-        goto -> bb25;                    // bb7[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageLive(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
+        _15 = (_2.1: bool);              // scope 0 at $DIR/match-arm-scopes.rs:17:32: 17:33
+        StorageLive(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
+        _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:17:35: 17:36
+        goto -> bb25;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb8: {
-        _0 = const 1i32;                 // bb8[0]: scope 1 at $DIR/match-arm-scopes.rs:16:77: 16:78
+        _0 = const 1i32;                 // scope 1 at $DIR/match-arm-scopes.rs:16:77: 16:78
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:16:77: 16:78
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        drop(_7) -> [return: bb24, unwind: bb14]; // bb8[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        drop(_7) -> [return: bb24, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
     }
 
     bb9: {
-        StorageLive(_6);                 // bb9[0]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
-        _6 = &(_2.1: bool);              // bb9[1]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
-        StorageLive(_8);                 // bb9[2]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
-        _8 = &(_2.2: std::string::String); // bb9[3]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
-        _3 = &shallow (_2.0: bool);      // bb9[4]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
-        _4 = &shallow (_2.1: bool);      // bb9[5]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
-        StorageLive(_9);                 // bb9[6]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
-        StorageLive(_10);                // bb9[7]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        _10 = _1;                        // bb9[8]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        FakeRead(ForMatchedPlace, _10);  // bb9[9]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        switchInt(_10) -> [false: bb11, otherwise: bb10]; // bb9[10]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageLive(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+        _6 = &(_2.1: bool);              // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+        StorageLive(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+        _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+        _3 = &shallow (_2.0: bool);      // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+        _4 = &shallow (_2.1: bool);      // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+        StorageLive(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageLive(_10);                // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        _10 = _1;                        // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        FakeRead(ForMatchedPlace, _10);  // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        switchInt(_10) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb10: {
-        falseEdges -> [real: bb12, imaginary: bb11]; // bb10[0]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        falseEdges -> [real: bb12, imaginary: bb11]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb11: {
-        _9 = (*_6);                      // bb11[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
-        StorageDead(_10);                // bb11[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        switchInt(move _9) -> [false: bb17, otherwise: bb16]; // bb11[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        _9 = (*_6);                      // scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
+        StorageDead(_10);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        switchInt(move _9) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb12: {
-        _0 = const 3i32;                 // bb12[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
+        _0 = const 3i32;                 // scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        StorageDead(_10);                // bb12[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageDead(_9);                 // bb12[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb12[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb12[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        goto -> bb15;                    // bb12[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
+        StorageDead(_10);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        goto -> bb15;                    // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
     }
 
     bb13: {
-        return;                          // bb13[0]: scope 0 at $DIR/match-arm-scopes.rs:19:2: 19:2
+        return;                          // scope 0 at $DIR/match-arm-scopes.rs:19:2: 19:2
     }
 
     bb14 (cleanup): {
-        drop(_2) -> bb1;                 // bb14[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        drop(_2) -> bb1;                 // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb15: {
-        drop(_2) -> [return: bb13, unwind: bb1]; // bb15[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        drop(_2) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 
     bb16: {
-        StorageDead(_9);                 // bb16[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        FakeRead(ForMatchGuard, _3);     // bb16[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        FakeRead(ForMatchGuard, _4);     // bb16[2]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        FakeRead(ForGuardBinding, _6);   // bb16[3]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        FakeRead(ForGuardBinding, _8);   // bb16[4]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageLive(_5);                 // bb16[5]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
-        _5 = (_2.1: bool);               // bb16[6]: scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
-        StorageLive(_7);                 // bb16[7]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
-        _7 = move (_2.2: std::string::String); // bb16[8]: scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
-        goto -> bb8;                     // bb16[9]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        FakeRead(ForMatchGuard, _3);     // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        FakeRead(ForGuardBinding, _8);   // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        StorageLive(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+        _5 = (_2.1: bool);               // scope 0 at $DIR/match-arm-scopes.rs:16:17: 16:18
+        StorageLive(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+        _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:20: 16:21
+        goto -> bb8;                     // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb17: {
-        StorageDead(_9);                 // bb17[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb17[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb17[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        falseEdges -> [real: bb3, imaginary: bb4]; // bb17[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageDead(_9);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        falseEdges -> [real: bb3, imaginary: bb4]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb18: {
-        StorageLive(_6);                 // bb18[0]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
-        _6 = &(_2.0: bool);              // bb18[1]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
-        StorageLive(_8);                 // bb18[2]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
-        _8 = &(_2.2: std::string::String); // bb18[3]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
-        _3 = &shallow (_2.0: bool);      // bb18[4]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
-        _4 = &shallow (_2.1: bool);      // bb18[5]: scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
-        StorageLive(_12);                // bb18[6]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
-        StorageLive(_13);                // bb18[7]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        _13 = _1;                        // bb18[8]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        FakeRead(ForMatchedPlace, _13);  // bb18[9]: scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
-        switchInt(_13) -> [false: bb20, otherwise: bb19]; // bb18[10]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageLive(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+        _6 = &(_2.0: bool);              // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+        StorageLive(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+        _8 = &(_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+        _3 = &shallow (_2.0: bool);      // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+        _4 = &shallow (_2.1: bool);      // scope 0 at $DIR/match-arm-scopes.rs:15:11: 15:16
+        StorageLive(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageLive(_13);                // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        _13 = _1;                        // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        FakeRead(ForMatchedPlace, _13);  // scope 0 at $DIR/match-arm-scopes.rs:16:45: 16:49
+        switchInt(_13) -> [false: bb20, otherwise: bb19]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb19: {
-        falseEdges -> [real: bb21, imaginary: bb20]; // bb19[0]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        falseEdges -> [real: bb21, imaginary: bb20]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb20: {
-        _12 = (*_6);                     // bb20[0]: scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
-        StorageDead(_13);                // bb20[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        switchInt(move _12) -> [false: bb23, otherwise: bb22]; // bb20[2]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        _12 = (*_6);                     // scope 0 at $DIR/match-arm-scopes.rs:16:70: 16:71
+        StorageDead(_13);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        switchInt(move _12) -> [false: bb23, otherwise: bb22]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb21: {
-        _0 = const 3i32;                 // bb21[0]: scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
+        _0 = const 3i32;                 // scope 0 at $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:16:59: 16:60
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        StorageDead(_13);                // bb21[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageDead(_12);                // bb21[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb21[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb21[4]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        goto -> bb15;                    // bb21[5]: scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
+        StorageDead(_13);                // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        goto -> bb15;                    // scope 0 at $DIR/match-arm-scopes.rs:16:52: 16:60
     }
 
     bb22: {
-        StorageDead(_12);                // bb22[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        FakeRead(ForMatchGuard, _3);     // bb22[1]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        FakeRead(ForMatchGuard, _4);     // bb22[2]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        FakeRead(ForGuardBinding, _6);   // bb22[3]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        FakeRead(ForGuardBinding, _8);   // bb22[4]: scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
-        StorageLive(_5);                 // bb22[5]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
-        _5 = (_2.0: bool);               // bb22[6]: scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
-        StorageLive(_7);                 // bb22[7]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
-        _7 = move (_2.2: std::string::String); // bb22[8]: scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
-        goto -> bb8;                     // bb22[9]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        FakeRead(ForMatchGuard, _3);     // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        FakeRead(ForGuardBinding, _8);   // scope 0 at $DIR/match-arm-scopes.rs:16:72: 16:73
+        StorageLive(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+        _5 = (_2.0: bool);               // scope 0 at $DIR/match-arm-scopes.rs:16:26: 16:27
+        StorageLive(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+        _7 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:16:36: 16:37
+        goto -> bb8;                     // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb23: {
-        StorageDead(_12);                // bb23[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb23[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb23[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        falseEdges -> [real: bb5, imaginary: bb6]; // bb23[3]: scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
+        StorageDead(_12);                // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        falseEdges -> [real: bb5, imaginary: bb6]; // scope 0 at $DIR/match-arm-scopes.rs:16:42: 16:73
     }
 
     bb24: {
-        StorageDead(_7);                 // bb24[0]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_5);                 // bb24[1]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_8);                 // bb24[2]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        StorageDead(_6);                 // bb24[3]: scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
-        goto -> bb28;                    // bb24[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageDead(_7);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_5);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_8);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        StorageDead(_6);                 // scope 0 at $DIR/match-arm-scopes.rs:16:78: 16:79
+        goto -> bb28;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb25: {
-        _0 = const 2i32;                 // bb25[0]: scope 2 at $DIR/match-arm-scopes.rs:17:41: 17:42
+        _0 = const 2i32;                 // scope 2 at $DIR/match-arm-scopes.rs:17:41: 17:42
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/match-arm-scopes.rs:17:41: 17:42
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        drop(_16) -> [return: bb27, unwind: bb14]; // bb25[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        drop(_16) -> [return: bb27, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
     }
 
     bb26: {
-        StorageLive(_15);                // bb26[0]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
-        _15 = (_2.1: bool);              // bb26[1]: scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
-        StorageLive(_16);                // bb26[2]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
-        _16 = move (_2.2: std::string::String); // bb26[3]: scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
-        goto -> bb25;                    // bb26[4]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageLive(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
+        _15 = (_2.1: bool);              // scope 0 at $DIR/match-arm-scopes.rs:17:16: 17:17
+        StorageLive(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
+        _16 = move (_2.2: std::string::String); // scope 0 at $DIR/match-arm-scopes.rs:17:19: 17:20
+        goto -> bb25;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb27: {
-        StorageDead(_16);                // bb27[0]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
-        StorageDead(_15);                // bb27[1]: scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
-        goto -> bb28;                    // bb27[2]: scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
+        StorageDead(_16);                // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        StorageDead(_15);                // scope 0 at $DIR/match-arm-scopes.rs:17:42: 17:43
+        goto -> bb28;                    // scope 0 at $DIR/match-arm-scopes.rs:15:5: 18:6
     }
 
     bb28: {
-        drop(_2) -> [return: bb13, unwind: bb1]; // bb28[0]: scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
+        drop(_2) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/match-arm-scopes.rs:19:1: 19:2
     }
 }
index 0f8b6cc9c841baedadfff40776bda7c7b6aa1705..db888bc4b87b2fecc4aee5a37eff341a0e8acec7 100644 (file)
@@ -24,26 +24,26 @@ fn full_tested_match() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-        _2 = std::option::Option::<i32>::Some(const 42i32); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+        StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
+        StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+        _2 = std::option::Option::<i32>::Some(const 42i32); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x0000002a))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:15:24: 15:26
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-        FakeRead(ForMatchedPlace, _2);   // bb0[3]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-        _3 = discriminant(_2);           // bb0[4]: scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
-        switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb5]; // bb0[5]: scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
+        FakeRead(ForMatchedPlace, _2);   // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+        _3 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
+        switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/match_false_edges.rs:14:1: 20:2
+        resume;                          // scope 0 at $DIR/match_false_edges.rs:14:1: 20:2
     }
 
     bb2: {
-        _1 = (const 3i32, const 3i32);   // bb2[0]: scope 0 at $DIR/match_false_edges.rs:18:17: 18:23
+        _1 = (const 3i32, const 3i32);   // scope 0 at $DIR/match_false_edges.rs:18:17: 18:23
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
@@ -56,34 +56,34 @@ fn full_tested_match() -> () {
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:18:21: 18:22
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        goto -> bb11;                    // bb2[1]: scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
+        goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
     }
 
     bb3: {
-        falseEdges -> [real: bb6, imaginary: bb4]; // bb3[0]: scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
+        falseEdges -> [real: bb6, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
     }
 
     bb4: {
-        falseEdges -> [real: bb10, imaginary: bb2]; // bb4[0]: scope 0 at $DIR/match_false_edges.rs:17:9: 17:16
+        falseEdges -> [real: bb10, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:17:9: 17:16
     }
 
     bb5: {
-        unreachable;                     // bb5[0]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+        unreachable;                     // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
     }
 
     bb6: {
-        StorageLive(_6);                 // bb6[0]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-        _11 = const full_tested_match::promoted[0]; // bb6[1]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+        StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+        _11 = const full_tested_match::promoted[0]; // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
                                          // ty::Const
                                          // + ty: &std::option::Option<i32>
                                          // + val: Unevaluated(DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), [], Some(promoted[0]))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:16:14: 16:15
                                          // + literal: Const { ty: &std::option::Option<i32>, val: Unevaluated(DefId(0:5 ~ match_false_edges[317d]::full_tested_match[0]), [], Some(promoted[0])) }
-        _6 = &(((*_11) as Some).0: i32); // bb6[2]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-        _4 = &shallow _2;                // bb6[3]: scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
-        StorageLive(_7);                 // bb6[4]: scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
-        _7 = const guard() -> [return: bb7, unwind: bb1]; // bb6[5]: scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+        _6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+        _4 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
+        StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+        _7 = const guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
                                          // ty::Const
                                          // + ty: fn() -> bool {guard}
                                          // + val: Value(Scalar(<ZST>))
@@ -93,63 +93,63 @@ fn full_tested_match() -> () {
     }
 
     bb7: {
-        switchInt(move _7) -> [false: bb9, otherwise: bb8]; // bb7[0]: scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+        switchInt(move _7) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
     }
 
     bb8: {
-        StorageDead(_7);                 // bb8[0]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
-        FakeRead(ForMatchGuard, _4);     // bb8[1]: scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
-        FakeRead(ForGuardBinding, _6);   // bb8[2]: scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
-        StorageLive(_5);                 // bb8[3]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-        _5 = ((_2 as Some).0: i32);      // bb8[4]: scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
-        StorageLive(_8);                 // bb8[5]: scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
-        _8 = _5;                         // bb8[6]: scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
-        _1 = (const 1i32, move _8);      // bb8[7]: scope 2 at $DIR/match_false_edges.rs:16:31: 16:37
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+        FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
+        FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match_false_edges.rs:16:26: 16:27
+        StorageLive(_5);                 // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+        _5 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:16:14: 16:15
+        StorageLive(_8);                 // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
+        _8 = _5;                         // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
+        _1 = (const 1i32, move _8);      // scope 2 at $DIR/match_false_edges.rs:16:31: 16:37
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:16:32: 16:33
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        StorageDead(_8);                 // bb8[8]: scope 2 at $DIR/match_false_edges.rs:16:36: 16:37
-        StorageDead(_5);                 // bb8[9]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
-        StorageDead(_6);                 // bb8[10]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
-        goto -> bb11;                    // bb8[11]: scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
+        StorageDead(_8);                 // scope 2 at $DIR/match_false_edges.rs:16:36: 16:37
+        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+        goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
     }
 
     bb9: {
-        StorageDead(_7);                 // bb9[0]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
-        StorageDead(_6);                 // bb9[1]: scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
-        goto -> bb4;                     // bb9[2]: scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:16:37: 16:38
+        goto -> bb4;                     // scope 0 at $DIR/match_false_edges.rs:16:20: 16:27
     }
 
     bb10: {
-        StorageLive(_9);                 // bb10[0]: scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
-        _9 = ((_2 as Some).0: i32);      // bb10[1]: scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
-        StorageLive(_10);                // bb10[2]: scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
-        _10 = _9;                        // bb10[3]: scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
-        _1 = (const 2i32, move _10);     // bb10[4]: scope 3 at $DIR/match_false_edges.rs:17:20: 17:26
+        StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
+        _9 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:17:14: 17:15
+        StorageLive(_10);                // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
+        _10 = _9;                        // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
+        _1 = (const 2i32, move _10);     // scope 3 at $DIR/match_false_edges.rs:17:20: 17:26
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:17:21: 17:22
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        StorageDead(_10);                // bb10[5]: scope 3 at $DIR/match_false_edges.rs:17:25: 17:26
-        StorageDead(_9);                 // bb10[6]: scope 0 at $DIR/match_false_edges.rs:17:26: 17:27
-        goto -> bb11;                    // bb10[7]: scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
+        StorageDead(_10);                // scope 3 at $DIR/match_false_edges.rs:17:25: 17:26
+        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:17:26: 17:27
+        goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
     }
 
     bb11: {
-        StorageDead(_2);                 // bb11[0]: scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
-        StorageDead(_1);                 // bb11[1]: scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
-        _0 = const ();                   // bb11[2]: scope 0 at $DIR/match_false_edges.rs:14:28: 20:2
+        StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
+        StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:19:6: 19:7
+        _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:14:28: 20:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:14:28: 20:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb11[3]: scope 0 at $DIR/match_false_edges.rs:20:2: 20:2
+        return;                          // scope 0 at $DIR/match_false_edges.rs:20:2: 20:2
     }
 }
index 2cf6c97ae22653ba772530ceb54082f359634101..96aa9e828d7842d6f1e87b09dc76ace575e99080 100644 (file)
@@ -23,59 +23,59 @@ fn full_tested_match2() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-        _2 = std::option::Option::<i32>::Some(const 42i32); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+        StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
+        StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+        _2 = std::option::Option::<i32>::Some(const 42i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x0000002a))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:26:24: 26:26
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-        FakeRead(ForMatchedPlace, _2);   // bb0[3]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-        _3 = discriminant(_2);           // bb0[4]: scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
-        switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb5]; // bb0[5]: scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
+        FakeRead(ForMatchedPlace, _2);   // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+        _3 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
+        switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/match_false_edges.rs:25:1: 31:2
+        resume;                          // scope 0 at $DIR/match_false_edges.rs:25:1: 31:2
     }
 
     bb2: {
-        falseEdges -> [real: bb10, imaginary: bb4]; // bb2[0]: scope 0 at $DIR/match_false_edges.rs:28:9: 28:13
+        falseEdges -> [real: bb10, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:28:9: 28:13
     }
 
     bb3: {
-        falseEdges -> [real: bb6, imaginary: bb2]; // bb3[0]: scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
+        falseEdges -> [real: bb6, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
     }
 
     bb4: {
-        StorageLive(_9);                 // bb4[0]: scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
-        _9 = ((_2 as Some).0: i32);      // bb4[1]: scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
-        StorageLive(_10);                // bb4[2]: scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
-        _10 = _9;                        // bb4[3]: scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
-        _1 = (const 2i32, move _10);     // bb4[4]: scope 3 at $DIR/match_false_edges.rs:29:20: 29:26
+        StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
+        _9 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:29:14: 29:15
+        StorageLive(_10);                // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
+        _10 = _9;                        // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
+        _1 = (const 2i32, move _10);     // scope 3 at $DIR/match_false_edges.rs:29:20: 29:26
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:29:21: 29:22
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        StorageDead(_10);                // bb4[5]: scope 3 at $DIR/match_false_edges.rs:29:25: 29:26
-        StorageDead(_9);                 // bb4[6]: scope 0 at $DIR/match_false_edges.rs:29:26: 29:27
-        goto -> bb11;                    // bb4[7]: scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
+        StorageDead(_10);                // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26
+        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:29:26: 29:27
+        goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
     }
 
     bb5: {
-        unreachable;                     // bb5[0]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+        unreachable;                     // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
     }
 
     bb6: {
-        StorageLive(_6);                 // bb6[0]: scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-        _6 = &((_2 as Some).0: i32);     // bb6[1]: scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-        _4 = &shallow _2;                // bb6[2]: scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
-        StorageLive(_7);                 // bb6[3]: scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
-        _7 = const guard() -> [return: bb7, unwind: bb1]; // bb6[4]: scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+        StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+        _6 = &((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+        _4 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
+        StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+        _7 = const guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
                                          // ty::Const
                                          // + ty: fn() -> bool {guard}
                                          // + val: Value(Scalar(<ZST>))
@@ -85,38 +85,38 @@ fn full_tested_match2() -> () {
     }
 
     bb7: {
-        switchInt(move _7) -> [false: bb9, otherwise: bb8]; // bb7[0]: scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+        switchInt(move _7) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
     }
 
     bb8: {
-        StorageDead(_7);                 // bb8[0]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
-        FakeRead(ForMatchGuard, _4);     // bb8[1]: scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
-        FakeRead(ForGuardBinding, _6);   // bb8[2]: scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
-        StorageLive(_5);                 // bb8[3]: scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-        _5 = ((_2 as Some).0: i32);      // bb8[4]: scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
-        StorageLive(_8);                 // bb8[5]: scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
-        _8 = _5;                         // bb8[6]: scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
-        _1 = (const 1i32, move _8);      // bb8[7]: scope 2 at $DIR/match_false_edges.rs:27:31: 27:37
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+        FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
+        FakeRead(ForGuardBinding, _6);   // scope 0 at $DIR/match_false_edges.rs:27:26: 27:27
+        StorageLive(_5);                 // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+        _5 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:27:14: 27:15
+        StorageLive(_8);                 // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
+        _8 = _5;                         // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
+        _1 = (const 1i32, move _8);      // scope 2 at $DIR/match_false_edges.rs:27:31: 27:37
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:27:32: 27:33
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        StorageDead(_8);                 // bb8[8]: scope 2 at $DIR/match_false_edges.rs:27:36: 27:37
-        StorageDead(_5);                 // bb8[9]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
-        StorageDead(_6);                 // bb8[10]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
-        goto -> bb11;                    // bb8[11]: scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
+        StorageDead(_8);                 // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37
+        StorageDead(_5);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+        goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
     }
 
     bb9: {
-        StorageDead(_7);                 // bb9[0]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
-        StorageDead(_6);                 // bb9[1]: scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
-        falseEdges -> [real: bb4, imaginary: bb2]; // bb9[2]: scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:27:37: 27:38
+        falseEdges -> [real: bb4, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:27:20: 27:27
     }
 
     bb10: {
-        _1 = (const 3i32, const 3i32);   // bb10[0]: scope 0 at $DIR/match_false_edges.rs:28:17: 28:23
+        _1 = (const 3i32, const 3i32);   // scope 0 at $DIR/match_false_edges.rs:28:17: 28:23
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
@@ -129,19 +129,19 @@ fn full_tested_match2() -> () {
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:28:21: 28:22
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        goto -> bb11;                    // bb10[1]: scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
+        goto -> bb11;                    // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
     }
 
     bb11: {
-        StorageDead(_2);                 // bb11[0]: scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
-        StorageDead(_1);                 // bb11[1]: scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
-        _0 = const ();                   // bb11[2]: scope 0 at $DIR/match_false_edges.rs:25:29: 31:2
+        StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
+        StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:30:6: 30:7
+        _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:25:29: 31:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:25:29: 31:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb11[3]: scope 0 at $DIR/match_false_edges.rs:31:2: 31:2
+        return;                          // scope 0 at $DIR/match_false_edges.rs:31:2: 31:2
     }
 }
index 7bba0b20d8ebcaa854a2cf81ffadb69a726c9fab..63a7c4bc43d7ad57e4183959570e37b6b686b20d 100644 (file)
@@ -34,56 +34,56 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        _2 = std::option::Option::<i32>::Some(const 1i32); // bb0[2]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+        StorageLive(_1);                 // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+        StorageLive(_2);                 // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+        _2 = std::option::Option::<i32>::Some(const 1i32); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:35:24: 35:25
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        FakeRead(ForMatchedPlace, _2);   // bb0[3]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        _4 = discriminant(_2);           // bb0[4]: scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
-        switchInt(move _4) -> [1isize: bb3, otherwise: bb2]; // bb0[5]: scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
+        FakeRead(ForMatchedPlace, _2);   // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+        _4 = discriminant(_2);           // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
+        switchInt(move _4) -> [1isize: bb3, otherwise: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/match_false_edges.rs:34:1: 41:2
+        resume;                          // scope 0 at $DIR/match_false_edges.rs:34:1: 41:2
     }
 
     bb2: {
-        falseEdges -> [real: bb10, imaginary: bb5]; // bb2[0]: scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
+        falseEdges -> [real: bb10, imaginary: bb5]; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
     }
 
     bb3: {
-        falseEdges -> [real: bb6, imaginary: bb2]; // bb3[0]: scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
+        falseEdges -> [real: bb6, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
     }
 
     bb4: {
-        StorageLive(_14);                // bb4[0]: scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
-        _14 = _2;                        // bb4[1]: scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
-        _1 = const 4i32;                 // bb4[2]: scope 5 at $DIR/match_false_edges.rs:39:15: 39:16
+        StorageLive(_14);                // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
+        _14 = _2;                        // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
+        _1 = const 4i32;                 // scope 5 at $DIR/match_false_edges.rs:39:15: 39:16
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000004))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:39:15: 39:16
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-        StorageDead(_14);                // bb4[3]: scope 0 at $DIR/match_false_edges.rs:39:16: 39:17
-        goto -> bb15;                    // bb4[4]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+        StorageDead(_14);                // scope 0 at $DIR/match_false_edges.rs:39:16: 39:17
+        goto -> bb15;                    // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
     }
 
     bb5: {
-        falseEdges -> [real: bb11, imaginary: bb4]; // bb5[0]: scope 0 at $DIR/match_false_edges.rs:38:9: 38:16
+        falseEdges -> [real: bb11, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:38:9: 38:16
     }
 
     bb6: {
-        StorageLive(_7);                 // bb6[0]: scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-        _7 = &((_2 as Some).0: i32);     // bb6[1]: scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-        _5 = &shallow _2;                // bb6[2]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        StorageLive(_8);                 // bb6[3]: scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
-        _8 = const guard() -> [return: bb7, unwind: bb1]; // bb6[4]: scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+        StorageLive(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
+        _7 = &((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
+        _5 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+        StorageLive(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+        _8 = const guard() -> [return: bb7, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
                                          // ty::Const
                                          // + ty: fn() -> bool {guard}
                                          // + val: Value(Scalar(<ZST>))
@@ -93,55 +93,55 @@ fn main() -> () {
     }
 
     bb7: {
-        switchInt(move _8) -> [false: bb9, otherwise: bb8]; // bb7[0]: scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+        switchInt(move _8) -> [false: bb9, otherwise: bb8]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
     }
 
     bb8: {
-        StorageDead(_8);                 // bb8[0]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
-        FakeRead(ForMatchGuard, _5);     // bb8[1]: scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
-        FakeRead(ForGuardBinding, _7);   // bb8[2]: scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
-        StorageLive(_6);                 // bb8[3]: scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-        _6 = ((_2 as Some).0: i32);      // bb8[4]: scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
-        _1 = const 1i32;                 // bb8[5]: scope 2 at $DIR/match_false_edges.rs:36:32: 36:33
+        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
+        FakeRead(ForGuardBinding, _7);   // scope 0 at $DIR/match_false_edges.rs:36:27: 36:28
+        StorageLive(_6);                 // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
+        _6 = ((_2 as Some).0: i32);      // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
+        _1 = const 1i32;                 // scope 2 at $DIR/match_false_edges.rs:36:32: 36:33
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:36:32: 36:33
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        StorageDead(_6);                 // bb8[6]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
-        StorageDead(_7);                 // bb8[7]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
-        goto -> bb15;                    // bb8[8]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+        StorageDead(_6);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        goto -> bb15;                    // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
     }
 
     bb9: {
-        StorageDead(_8);                 // bb9[0]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
-        StorageDead(_7);                 // bb9[1]: scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
-        falseEdges -> [real: bb2, imaginary: bb2]; // bb9[2]: scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
+        StorageDead(_8);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        StorageDead(_7);                 // scope 0 at $DIR/match_false_edges.rs:36:33: 36:34
+        falseEdges -> [real: bb2, imaginary: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:21: 36:28
     }
 
     bb10: {
-        StorageLive(_9);                 // bb10[0]: scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
-        _9 = _2;                         // bb10[1]: scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
-        _1 = const 2i32;                 // bb10[2]: scope 3 at $DIR/match_false_edges.rs:37:15: 37:16
+        StorageLive(_9);                 // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
+        _9 = _2;                         // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
+        _1 = const 2i32;                 // scope 3 at $DIR/match_false_edges.rs:37:15: 37:16
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:37:15: 37:16
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        StorageDead(_9);                 // bb10[3]: scope 0 at $DIR/match_false_edges.rs:37:16: 37:17
-        goto -> bb15;                    // bb10[4]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+        StorageDead(_9);                 // scope 0 at $DIR/match_false_edges.rs:37:16: 37:17
+        goto -> bb15;                    // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
     }
 
     bb11: {
-        StorageLive(_11);                // bb11[0]: scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-        _11 = &((_2 as Some).0: i32);    // bb11[1]: scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-        _5 = &shallow _2;                // bb11[2]: scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
-        StorageLive(_12);                // bb11[3]: scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
-        StorageLive(_13);                // bb11[4]: scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
-        _13 = (*_11);                    // bb11[5]: scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
-        _12 = const guard2(move _13) -> [return: bb12, unwind: bb1]; // bb11[6]: scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+        StorageLive(_11);                // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
+        _11 = &((_2 as Some).0: i32);    // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
+        _5 = &shallow _2;                // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
+        StorageLive(_12);                // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+        StorageLive(_13);                // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
+        _13 = (*_11);                    // scope 0 at $DIR/match_false_edges.rs:38:27: 38:28
+        _12 = const guard2(move _13) -> [return: bb12, unwind: bb1]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
                                          // ty::Const
                                          // + ty: fn(i32) -> bool {guard2}
                                          // + val: Value(Scalar(<ZST>))
@@ -151,44 +151,44 @@ fn main() -> () {
     }
 
     bb12: {
-        StorageDead(_13);                // bb12[0]: scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
-        switchInt(move _12) -> [false: bb14, otherwise: bb13]; // bb12[1]: scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+        StorageDead(_13);                // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
+        switchInt(move _12) -> [false: bb14, otherwise: bb13]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
     }
 
     bb13: {
-        StorageDead(_12);                // bb13[0]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
-        FakeRead(ForMatchGuard, _5);     // bb13[1]: scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
-        FakeRead(ForGuardBinding, _11);  // bb13[2]: scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
-        StorageLive(_10);                // bb13[3]: scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-        _10 = ((_2 as Some).0: i32);     // bb13[4]: scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
-        _1 = const 3i32;                 // bb13[5]: scope 4 at $DIR/match_false_edges.rs:38:33: 38:34
+        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+        FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
+        FakeRead(ForGuardBinding, _11);  // scope 0 at $DIR/match_false_edges.rs:38:28: 38:29
+        StorageLive(_10);                // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
+        _10 = ((_2 as Some).0: i32);     // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
+        _1 = const 3i32;                 // scope 4 at $DIR/match_false_edges.rs:38:33: 38:34
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:38:33: 38:34
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        StorageDead(_10);                // bb13[6]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
-        StorageDead(_11);                // bb13[7]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
-        goto -> bb15;                    // bb13[8]: scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
+        StorageDead(_10);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+        goto -> bb15;                    // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
     }
 
     bb14: {
-        StorageDead(_12);                // bb14[0]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
-        StorageDead(_11);                // bb14[1]: scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
-        falseEdges -> [real: bb4, imaginary: bb4]; // bb14[2]: scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
+        StorageDead(_12);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+        StorageDead(_11);                // scope 0 at $DIR/match_false_edges.rs:38:34: 38:35
+        falseEdges -> [real: bb4, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:38:20: 38:29
     }
 
     bb15: {
-        StorageDead(_2);                 // bb15[0]: scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
-        StorageDead(_1);                 // bb15[1]: scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
-        _0 = const ();                   // bb15[2]: scope 0 at $DIR/match_false_edges.rs:34:11: 41:2
+        StorageDead(_2);                 // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
+        StorageDead(_1);                 // scope 0 at $DIR/match_false_edges.rs:40:6: 40:7
+        _0 = const ();                   // scope 0 at $DIR/match_false_edges.rs:34:11: 41:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/match_false_edges.rs:34:11: 41:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb15[3]: scope 0 at $DIR/match_false_edges.rs:41:2: 41:2
+        return;                          // scope 0 at $DIR/match_false_edges.rs:41:2: 41:2
     }
 }
index 3236b3bcc738f8560f5c38be983c8563842b2a45..9408248b25dd39253c79f0d3116536f49a0da390 100644 (file)
@@ -19,154 +19,154 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/match_test.rs:7:9: 7:10
-        _1 = const 3i32;                 // bb0[1]: scope 0 at $DIR/match_test.rs:7:13: 7:14
+        StorageLive(_1);                 // scope 0 at $DIR/match_test.rs:7:9: 7:10
+        _1 = const 3i32;                 // scope 0 at $DIR/match_test.rs:7:13: 7:14
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:7:13: 7:14
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        FakeRead(ForLet, _1);            // bb0[2]: scope 0 at $DIR/match_test.rs:7:9: 7:10
-        StorageLive(_2);                 // bb0[3]: scope 1 at $DIR/match_test.rs:8:9: 8:10
-        _2 = const true;                 // bb0[4]: scope 1 at $DIR/match_test.rs:8:13: 8:17
+        FakeRead(ForLet, _1);            // scope 0 at $DIR/match_test.rs:7:9: 7:10
+        StorageLive(_2);                 // scope 1 at $DIR/match_test.rs:8:9: 8:10
+        _2 = const true;                 // scope 1 at $DIR/match_test.rs:8:13: 8:17
                                          // ty::Const
                                          // + ty: bool
                                          // + val: Value(Scalar(0x01))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:8:13: 8:17
                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-        FakeRead(ForLet, _2);            // bb0[5]: scope 1 at $DIR/match_test.rs:8:9: 8:10
-        StorageLive(_3);                 // bb0[6]: scope 2 at $DIR/match_test.rs:12:5: 17:6
-        FakeRead(ForMatchedPlace, _1);   // bb0[7]: scope 2 at $DIR/match_test.rs:12:11: 12:12
-        _6 = Le(const 0i32, _1);         // bb0[8]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+        FakeRead(ForLet, _2);            // scope 1 at $DIR/match_test.rs:8:9: 8:10
+        StorageLive(_3);                 // scope 2 at $DIR/match_test.rs:12:5: 17:6
+        FakeRead(ForMatchedPlace, _1);   // scope 2 at $DIR/match_test.rs:12:11: 12:12
+        _6 = Le(const 0i32, _1);         // scope 2 at $DIR/match_test.rs:13:9: 13:14
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:13:9: 13:14
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-        switchInt(move _6) -> [false: bb4, otherwise: bb1]; // bb0[9]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+        switchInt(move _6) -> [false: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
     }
 
     bb1: {
-        _7 = Lt(_1, const 10i32);        // bb1[0]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+        _7 = Lt(_1, const 10i32);        // scope 2 at $DIR/match_test.rs:13:9: 13:14
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x0000000a))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:13:9: 13:14
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
-        switchInt(move _7) -> [false: bb4, otherwise: bb2]; // bb1[1]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+        switchInt(move _7) -> [false: bb4, otherwise: bb2]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
     }
 
     bb2: {
-        falseEdges -> [real: bb9, imaginary: bb6]; // bb2[0]: scope 2 at $DIR/match_test.rs:13:9: 13:14
+        falseEdges -> [real: bb9, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
     }
 
     bb3: {
-        _3 = const 3i32;                 // bb3[0]: scope 2 at $DIR/match_test.rs:16:14: 16:15
+        _3 = const 3i32;                 // scope 2 at $DIR/match_test.rs:16:14: 16:15
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000003))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:16:14: 16:15
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
-        goto -> bb14;                    // bb3[1]: scope 2 at $DIR/match_test.rs:12:5: 17:6
+        goto -> bb14;                    // scope 2 at $DIR/match_test.rs:12:5: 17:6
     }
 
     bb4: {
-        _4 = Le(const 10i32, _1);        // bb4[0]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+        _4 = Le(const 10i32, _1);        // scope 2 at $DIR/match_test.rs:14:9: 14:16
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x0000000a))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:14:9: 14:16
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
-        switchInt(move _4) -> [false: bb7, otherwise: bb5]; // bb4[1]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+        switchInt(move _4) -> [false: bb7, otherwise: bb5]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
     }
 
     bb5: {
-        _5 = Le(_1, const 20i32);        // bb5[0]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+        _5 = Le(_1, const 20i32);        // scope 2 at $DIR/match_test.rs:14:9: 14:16
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000014))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:14:9: 14:16
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000014)) }
-        switchInt(move _5) -> [false: bb7, otherwise: bb6]; // bb5[1]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+        switchInt(move _5) -> [false: bb7, otherwise: bb6]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
     }
 
     bb6: {
-        falseEdges -> [real: bb12, imaginary: bb8]; // bb6[0]: scope 2 at $DIR/match_test.rs:14:9: 14:16
+        falseEdges -> [real: bb12, imaginary: bb8]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
     }
 
     bb7: {
-        switchInt(_1) -> [-1i32: bb8, otherwise: bb3]; // bb7[0]: scope 2 at $DIR/match_test.rs:15:9: 15:11
+        switchInt(_1) -> [-1i32: bb8, otherwise: bb3]; // scope 2 at $DIR/match_test.rs:15:9: 15:11
     }
 
     bb8: {
-        falseEdges -> [real: bb13, imaginary: bb3]; // bb8[0]: scope 2 at $DIR/match_test.rs:15:9: 15:11
+        falseEdges -> [real: bb13, imaginary: bb3]; // scope 2 at $DIR/match_test.rs:15:9: 15:11
     }
 
     bb9: {
-        _8 = &shallow _1;                // bb9[0]: scope 2 at $DIR/match_test.rs:12:11: 12:12
-        StorageLive(_9);                 // bb9[1]: scope 2 at $DIR/match_test.rs:13:18: 13:19
-        _9 = _2;                         // bb9[2]: scope 2 at $DIR/match_test.rs:13:18: 13:19
-        switchInt(move _9) -> [false: bb11, otherwise: bb10]; // bb9[3]: scope 2 at $DIR/match_test.rs:13:18: 13:19
+        _8 = &shallow _1;                // scope 2 at $DIR/match_test.rs:12:11: 12:12
+        StorageLive(_9);                 // scope 2 at $DIR/match_test.rs:13:18: 13:19
+        _9 = _2;                         // scope 2 at $DIR/match_test.rs:13:18: 13:19
+        switchInt(move _9) -> [false: bb11, otherwise: bb10]; // scope 2 at $DIR/match_test.rs:13:18: 13:19
     }
 
     bb10: {
-        StorageDead(_9);                 // bb10[0]: scope 2 at $DIR/match_test.rs:13:24: 13:25
-        FakeRead(ForMatchGuard, _8);     // bb10[1]: scope 2 at $DIR/match_test.rs:13:18: 13:19
-        _3 = const 0i32;                 // bb10[2]: scope 2 at $DIR/match_test.rs:13:23: 13:24
+        StorageDead(_9);                 // scope 2 at $DIR/match_test.rs:13:24: 13:25
+        FakeRead(ForMatchGuard, _8);     // scope 2 at $DIR/match_test.rs:13:18: 13:19
+        _3 = const 0i32;                 // scope 2 at $DIR/match_test.rs:13:23: 13:24
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:13:23: 13:24
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-        goto -> bb14;                    // bb10[3]: scope 2 at $DIR/match_test.rs:12:5: 17:6
+        goto -> bb14;                    // scope 2 at $DIR/match_test.rs:12:5: 17:6
     }
 
     bb11: {
-        StorageDead(_9);                 // bb11[0]: scope 2 at $DIR/match_test.rs:13:24: 13:25
-        falseEdges -> [real: bb3, imaginary: bb6]; // bb11[1]: scope 2 at $DIR/match_test.rs:13:18: 13:19
+        StorageDead(_9);                 // scope 2 at $DIR/match_test.rs:13:24: 13:25
+        falseEdges -> [real: bb3, imaginary: bb6]; // scope 2 at $DIR/match_test.rs:13:18: 13:19
     }
 
     bb12: {
-        _3 = const 1i32;                 // bb12[0]: scope 2 at $DIR/match_test.rs:14:20: 14:21
+        _3 = const 1i32;                 // scope 2 at $DIR/match_test.rs:14:20: 14:21
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:14:20: 14:21
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        goto -> bb14;                    // bb12[1]: scope 2 at $DIR/match_test.rs:12:5: 17:6
+        goto -> bb14;                    // scope 2 at $DIR/match_test.rs:12:5: 17:6
     }
 
     bb13: {
-        _3 = const 2i32;                 // bb13[0]: scope 2 at $DIR/match_test.rs:15:15: 15:16
+        _3 = const 2i32;                 // scope 2 at $DIR/match_test.rs:15:15: 15:16
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:15:15: 15:16
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        goto -> bb14;                    // bb13[1]: scope 2 at $DIR/match_test.rs:12:5: 17:6
+        goto -> bb14;                    // scope 2 at $DIR/match_test.rs:12:5: 17:6
     }
 
     bb14: {
-        StorageDead(_3);                 // bb14[0]: scope 2 at $DIR/match_test.rs:17:6: 17:7
-        _0 = const ();                   // bb14[1]: scope 0 at $DIR/match_test.rs:6:11: 18:2
+        StorageDead(_3);                 // scope 2 at $DIR/match_test.rs:17:6: 17:7
+        _0 = const ();                   // scope 0 at $DIR/match_test.rs:6:11: 18:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/match_test.rs:6:11: 18:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_2);                 // bb14[2]: scope 1 at $DIR/match_test.rs:18:1: 18:2
-        StorageDead(_1);                 // bb14[3]: scope 0 at $DIR/match_test.rs:18:1: 18:2
-        return;                          // bb14[4]: scope 0 at $DIR/match_test.rs:18:2: 18:2
+        StorageDead(_2);                 // scope 1 at $DIR/match_test.rs:18:1: 18:2
+        StorageDead(_1);                 // scope 0 at $DIR/match_test.rs:18:1: 18:2
+        return;                          // scope 0 at $DIR/match_test.rs:18:2: 18:2
     }
 }
index 383024113366dfbfd70b05a95d23efd96fa8b02f..a20a3c0e603e94d3c5b8b0988fda70a481f34f6e 100644 (file)
@@ -13,17 +13,17 @@ fn unwrap(_1: std::option::Option<T>) -> T {
     }
 
     bb0: {
-        _2 = discriminant(_1);           // bb0[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
-        switchInt(move _2) -> [0isize: bb2, 1isize: bb4, otherwise: bb3]; // bb0[1]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
+        _2 = discriminant(_1);           // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
+        switchInt(move _2) -> [0isize: bb2, 1isize: bb4, otherwise: bb3]; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:9: 9:16
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:1: 12:2
+        resume;                          // scope 0 at $DIR/no-drop-for-inactive-variant.rs:7:1: 12:2
     }
 
     bb2: {
-        StorageLive(_4);                 // bb2[0]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
-        const std::rt::begin_panic::<&str>(const "explicit panic") -> bb5; // bb2[1]: scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
+        StorageLive(_4);                 // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
+        const std::rt::begin_panic::<&str>(const "explicit panic") -> bb5; // scope 0 at $SRC_DIR/libstd/macros.rs:LL:COL
                                          // ty::Const
                                          // + ty: fn(&str) -> ! {std::rt::begin_panic::<&str>}
                                          // + val: Value(Scalar(<ZST>))
@@ -39,19 +39,19 @@ fn unwrap(_1: std::option::Option<T>) -> T {
     }
 
     bb3: {
-        unreachable;                     // bb3[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:8:11: 8:14
+        unreachable;                     // scope 0 at $DIR/no-drop-for-inactive-variant.rs:8:11: 8:14
     }
 
     bb4: {
-        StorageLive(_3);                 // bb4[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
-        _3 = move ((_1 as Some).0: T);   // bb4[1]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
-        _0 = move _3;                    // bb4[2]: scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21
-        StorageDead(_3);                 // bb4[3]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:21: 9:22
-        _5 = discriminant(_1);           // bb4[4]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
-        return;                          // bb4[5]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2
+        StorageLive(_3);                 // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
+        _3 = move ((_1 as Some).0: T);   // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:14: 9:15
+        _0 = move _3;                    // scope 1 at $DIR/no-drop-for-inactive-variant.rs:9:20: 9:21
+        StorageDead(_3);                 // scope 0 at $DIR/no-drop-for-inactive-variant.rs:9:21: 9:22
+        _5 = discriminant(_1);           // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
+        return;                          // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:2: 12:2
     }
 
     bb5 (cleanup): {
-        drop(_1) -> bb1;                 // bb5[0]: scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
+        drop(_1) -> bb1;                 // scope 0 at $DIR/no-drop-for-inactive-variant.rs:12:1: 12:2
     }
 }
index e43e37feba743515e83933b393dff9acbf917b3e..e1ab6cc0b942309e8fea29c9921f66679868d8d7 100644 (file)
@@ -8,19 +8,19 @@ fn main() -> () {
     let _4: &str;                        // in scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
-        StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
-        StorageLive(_4);                 // bb0[3]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
-        _4 = const "";                   // bb0[4]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
+        StorageLive(_1);                 // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
+        StorageLive(_2);                 // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
+        StorageLive(_3);                 // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
+        StorageLive(_4);                 // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
+        _4 = const "";                   // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
                                          // ty::Const
                                          // + ty: &str
                                          // + val: Value(Slice { data: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [], len: Size { raw: 0 } }, size: Size { raw: 0 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 0 })
                                          // mir::Constant
                                          // + span: $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
                                          // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [], len: Size { raw: 0 } }, size: Size { raw: 0 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 0 }) }
-        _3 = &(*_4);                     // bb0[5]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
-        _2 = const <str as std::string::ToString>::to_string(move _3) -> bb2; // bb0[6]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
+        _3 = &(*_4);                     // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:22
+        _2 = const <str as std::string::ToString>::to_string(move _3) -> bb2; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:20: 9:34
                                          // ty::Const
                                          // + ty: for<'r> fn(&'r str) -> std::string::String {<str as std::string::ToString>::to_string}
                                          // + val: Value(Scalar(<ZST>))
@@ -30,12 +30,12 @@ fn main() -> () {
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:8:1: 10:2
+        resume;                          // scope 0 at $DIR/no-spurious-drop-after-call.rs:8:1: 10:2
     }
 
     bb2: {
-        StorageDead(_3);                 // bb2[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:33: 9:34
-        _1 = const std::mem::drop::<std::string::String>(move _2) -> [return: bb3, unwind: bb4]; // bb2[1]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
+        StorageDead(_3);                 // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:33: 9:34
+        _1 = const std::mem::drop::<std::string::String>(move _2) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:5: 9:35
                                          // ty::Const
                                          // + ty: fn(std::string::String) {std::mem::drop::<std::string::String>}
                                          // + val: Value(Scalar(<ZST>))
@@ -45,20 +45,20 @@ fn main() -> () {
     }
 
     bb3: {
-        StorageDead(_2);                 // bb3[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35
-        StorageDead(_4);                 // bb3[1]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36
-        StorageDead(_1);                 // bb3[2]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36
-        _0 = const ();                   // bb3[3]: scope 0 at $DIR/no-spurious-drop-after-call.rs:8:11: 10:2
+        StorageDead(_2);                 // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35
+        StorageDead(_4);                 // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36
+        StorageDead(_1);                 // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:35: 9:36
+        _0 = const ();                   // scope 0 at $DIR/no-spurious-drop-after-call.rs:8:11: 10:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/no-spurious-drop-after-call.rs:8:11: 10:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb3[4]: scope 0 at $DIR/no-spurious-drop-after-call.rs:10:2: 10:2
+        return;                          // scope 0 at $DIR/no-spurious-drop-after-call.rs:10:2: 10:2
     }
 
     bb4 (cleanup): {
-        drop(_2) -> bb1;                 // bb4[0]: scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35
+        drop(_2) -> bb1;                 // scope 0 at $DIR/no-spurious-drop-after-call.rs:9:34: 9:35
     }
 }
index cf423d06efb5f01e5793bfd751d3b160825a5667..21dab9ab923946c9a7110c7e65e23796d052ee54 100644 (file)
@@ -13,61 +13,61 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
-        StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
-        _3 = Droppy(const 0usize);       // bb0[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+        StorageLive(_1);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
+        StorageLive(_2);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+        StorageLive(_3);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+        _3 = Droppy(const 0usize);       // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:6:39: 6:40
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
-        _2 = Aligned(move _3);           // bb0[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
-        StorageDead(_3);                 // bb0[5]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
-        _1 = Packed(move _2);            // bb0[6]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
-        StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
-        StorageLive(_4);                 // bb0[8]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
-        StorageLive(_5);                 // bb0[9]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
-        _5 = Droppy(const 0usize);       // bb0[10]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+        _2 = Aligned(move _3);           // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+        StorageDead(_3);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
+        _1 = Packed(move _2);            // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
+        StorageDead(_2);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
+        StorageLive(_4);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+        StorageLive(_5);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+        _5 = Droppy(const 0usize);       // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:7:26: 7:27
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
-        _4 = Aligned(move _5);           // bb0[11]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
-        StorageDead(_5);                 // bb0[12]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
-        StorageLive(_6);                 // bb0[13]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        _6 = move (_1.0: Aligned);       // bb0[14]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        drop(_6) -> [return: bb4, unwind: bb3]; // bb0[15]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        _4 = Aligned(move _5);           // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+        StorageDead(_5);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
+        StorageLive(_6);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        _6 = move (_1.0: Aligned);       // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        drop(_6) -> [return: bb4, unwind: bb3]; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2
+        resume;                          // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2
     }
 
     bb2: {
-        StorageDead(_1);                 // bb2[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
-        return;                          // bb2[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2
+        StorageDead(_1);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+        return;                          // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2
     }
 
     bb3 (cleanup): {
-        (_1.0: Aligned) = move _4;       // bb3[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        drop(_1) -> bb1;                 // bb3[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+        (_1.0: Aligned) = move _4;       // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        drop(_1) -> bb1;                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
     }
 
     bb4: {
-        StorageDead(_6);                 // bb4[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        (_1.0: Aligned) = move _4;       // bb4[1]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        StorageDead(_4);                 // bb4[2]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
-        _0 = const ();                   // bb4[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
+        StorageDead(_6);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        (_1.0: Aligned) = move _4;       // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        StorageDead(_4);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
+        _0 = const ();                   // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        drop(_1) -> [return: bb2, unwind: bb1]; // bb4[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+        drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
     }
 }
index 09b398e960420232574ecd7df7bddd76963ce4ff..cf46f74c16df35b2d999f0cc99c151dc63cc4bac 100644 (file)
@@ -13,61 +13,61 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
-        StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
-        _3 = Droppy(const 0usize);       // bb0[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+        StorageLive(_1);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:9: 6:14
+        StorageLive(_2);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+        StorageLive(_3);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
+        _3 = Droppy(const 0usize);       // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000000))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:6:39: 6:40
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
-        _2 = Aligned(move _3);           // bb0[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
-        StorageDead(_3);                 // bb0[5]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
-        _1 = Packed(move _2);            // bb0[6]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
-        StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
-        StorageLive(_4);                 // bb0[8]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
-        StorageLive(_5);                 // bb0[9]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
-        _5 = Droppy(const 0usize);       // bb0[10]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+        _2 = Aligned(move _3);           // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
+        StorageDead(_3);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
+        _1 = Packed(move _2);            // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
+        StorageDead(_2);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:42: 6:43
+        StorageLive(_4);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+        StorageLive(_5);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
+        _5 = Droppy(const 0usize);       // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000000))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:7:26: 7:27
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
-        _4 = Aligned(move _5);           // bb0[11]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
-        StorageDead(_5);                 // bb0[12]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
-        StorageLive(_6);                 // bb0[13]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        _6 = move (_1.0: Aligned);       // bb0[14]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        drop(_6) -> [return: bb4, unwind: bb3]; // bb0[15]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        _4 = Aligned(move _5);           // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
+        StorageDead(_5);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
+        StorageLive(_6);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        _6 = move (_1.0: Aligned);       // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        drop(_6) -> [return: bb4, unwind: bb3]; // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2
+        resume;                          // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:1: 8:2
     }
 
     bb2: {
-        StorageDead(_1);                 // bb2[0]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
-        return;                          // bb2[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2
+        StorageDead(_1);                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+        return;                          // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:2: 8:2
     }
 
     bb3 (cleanup): {
-        (_1.0: Aligned) = move _4;       // bb3[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        drop(_1) -> bb1;                 // bb3[1]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+        (_1.0: Aligned) = move _4;       // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        drop(_1) -> bb1;                 // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
     }
 
     bb4: {
-        StorageDead(_6);                 // bb4[0]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        (_1.0: Aligned) = move _4;       // bb4[1]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
-        StorageDead(_4);                 // bb4[2]: scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
-        _0 = const ();                   // bb4[3]: scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
+        StorageDead(_6);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        (_1.0: Aligned) = move _4;       // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
+        StorageDead(_4);                 // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
+        _0 = const ();                   // scope 0 at $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/packed-struct-drop-aligned.rs:5:11: 8:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        drop(_1) -> [return: bb2, unwind: bb1]; // bb4[4]: scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
+        drop(_1) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/packed-struct-drop-aligned.rs:8:1: 8:2
     }
 }
index 1cc2138f19e37736ae2ba883d651fe34a1ec7cfc..6f4a024d20f93b9cc73079edc01c100d054b3913 100644 (file)
@@ -6,6 +6,6 @@ fn no_codegen() -> () {
     }
 
     bb0: {
-        unreachable;                     // bb0[0]: scope 0 at $DIR/remove-never-const.rs:20:13: 20:33
+        unreachable;                     // scope 0 at $DIR/remove-never-const.rs:20:13: 20:33
     }
 }
index c915554a127be37d39c3e9ba3c38c6bf87b76074..4e626b1384afc1702da4163730603edcaabd3aa4 100644 (file)
       let mut _8: bool;                    // in scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
   
       bb0: {
--         FakeRead(ForMatchedPlace, _1);   // bb0[0]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+         nop;                             // bb0[0]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-          _3 = discriminant(_1);           // bb0[1]: scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
-          switchInt(move _3) -> [1isize: bb2, otherwise: bb1]; // bb0[2]: scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
+-         FakeRead(ForMatchedPlace, _1);   // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++         nop;                             // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+          _3 = discriminant(_1);           // scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
+          switchInt(move _3) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
       }
   
       bb1: {
-          _0 = const 1i32;                 // bb1[0]: scope 0 at $DIR/remove_fake_borrows.rs:9:14: 9:15
+          _0 = const 1i32;                 // scope 0 at $DIR/remove_fake_borrows.rs:9:14: 9:15
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000001))
                                            // mir::Constant
                                            // + span: $DIR/remove_fake_borrows.rs:9:14: 9:15
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-          goto -> bb7;                     // bb1[1]: scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
+          goto -> bb7;                     // scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
       }
   
       bb2: {
-          switchInt((*(*((_1 as Some).0: &&i32)))) -> [0i32: bb3, otherwise: bb1]; // bb2[0]: scope 0 at $DIR/remove_fake_borrows.rs:8:14: 8:15
+          switchInt((*(*((_1 as Some).0: &&i32)))) -> [0i32: bb3, otherwise: bb1]; // scope 0 at $DIR/remove_fake_borrows.rs:8:14: 8:15
       }
   
       bb3: {
-          goto -> bb4;                     // bb3[0]: scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
+          goto -> bb4;                     // scope 0 at $DIR/remove_fake_borrows.rs:8:9: 8:16
       }
   
       bb4: {
--         _4 = &shallow _1;                // bb4[0]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
--         _5 = &shallow ((_1 as Some).0: &&i32); // bb4[1]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
--         _6 = &shallow (*((_1 as Some).0: &&i32)); // bb4[2]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
--         _7 = &shallow (*(*((_1 as Some).0: &&i32))); // bb4[3]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+         nop;                             // bb4[0]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+         nop;                             // bb4[1]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+         nop;                             // bb4[2]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-+         nop;                             // bb4[3]: scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
-          StorageLive(_8);                 // bb4[4]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-          _8 = _2;                         // bb4[5]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-          switchInt(move _8) -> [false: bb6, otherwise: bb5]; // bb4[6]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+-         _4 = &shallow _1;                // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+-         _5 = &shallow ((_1 as Some).0: &&i32); // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+-         _6 = &shallow (*((_1 as Some).0: &&i32)); // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+-         _7 = &shallow (*(*((_1 as Some).0: &&i32))); // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++         nop;                             // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++         nop;                             // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++         nop;                             // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
++         nop;                             // scope 0 at $DIR/remove_fake_borrows.rs:7:11: 7:12
+          StorageLive(_8);                 // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+          _8 = _2;                         // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+          switchInt(move _8) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
       }
   
       bb5: {
-          StorageDead(_8);                 // bb5[0]: scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
--         FakeRead(ForMatchGuard, _4);     // bb5[1]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
--         FakeRead(ForMatchGuard, _5);     // bb5[2]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
--         FakeRead(ForMatchGuard, _6);     // bb5[3]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
--         FakeRead(ForMatchGuard, _7);     // bb5[4]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-+         nop;                             // bb5[1]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-+         nop;                             // bb5[2]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-+         nop;                             // bb5[3]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-+         nop;                             // bb5[4]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
-          _0 = const 0i32;                 // bb5[5]: scope 0 at $DIR/remove_fake_borrows.rs:8:25: 8:26
+          StorageDead(_8);                 // scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
+-         FakeRead(ForMatchGuard, _4);     // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+-         FakeRead(ForMatchGuard, _5);     // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+-         FakeRead(ForMatchGuard, _6);     // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+-         FakeRead(ForMatchGuard, _7);     // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
++         nop;                             // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
++         nop;                             // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
++         nop;                             // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
++         nop;                             // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+          _0 = const 0i32;                 // scope 0 at $DIR/remove_fake_borrows.rs:8:25: 8:26
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000000))
                                            // mir::Constant
                                            // + span: $DIR/remove_fake_borrows.rs:8:25: 8:26
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-          goto -> bb7;                     // bb5[6]: scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
+          goto -> bb7;                     // scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
       }
   
       bb6: {
-          StorageDead(_8);                 // bb6[0]: scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
-          goto -> bb1;                     // bb6[1]: scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+          StorageDead(_8);                 // scope 0 at $DIR/remove_fake_borrows.rs:8:26: 8:27
+          goto -> bb1;                     // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
       }
   
       bb7: {
-          return;                          // bb7[0]: scope 0 at $DIR/remove_fake_borrows.rs:11:2: 11:2
+          return;                          // scope 0 at $DIR/remove_fake_borrows.rs:11:2: 11:2
       }
   
       bb8 (cleanup): {
-          resume;                          // bb8[0]: scope 0 at $DIR/remove_fake_borrows.rs:6:1: 11:2
+          resume;                          // scope 0 at $DIR/remove_fake_borrows.rs:6:1: 11:2
       }
   }
   
index 5aa2510f3449e0a46c848f46648cf7604aa52f60..01f5fbb7d236c52e561be67bb8511ca0c4011b3d 100644 (file)
@@ -9,14 +9,14 @@ fn main::{{closure}}#0(_1: &[closure@main::{{closure}}#0], _2: &i32) -> &i32 {
     }
 
     bb0: {
-        Retag([fn entry] _1);            // bb0[0]: scope 0 at $DIR/retag.rs:40:31: 43:6
-        Retag([fn entry] _2);            // bb0[1]: scope 0 at $DIR/retag.rs:40:31: 43:6
-        StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/retag.rs:41:13: 41:15
-        _3 = _2;                         // bb0[3]: scope 0 at $DIR/retag.rs:41:18: 41:19
-        Retag(_3);                       // bb0[4]: scope 0 at $DIR/retag.rs:41:18: 41:19
-        _0 = _2;                         // bb0[5]: scope 1 at $DIR/retag.rs:42:9: 42:10
-        Retag(_0);                       // bb0[6]: scope 1 at $DIR/retag.rs:42:9: 42:10
-        StorageDead(_3);                 // bb0[7]: scope 0 at $DIR/retag.rs:43:5: 43:6
-        return;                          // bb0[8]: scope 0 at $DIR/retag.rs:43:6: 43:6
+        Retag([fn entry] _1);            // scope 0 at $DIR/retag.rs:40:31: 43:6
+        Retag([fn entry] _2);            // scope 0 at $DIR/retag.rs:40:31: 43:6
+        StorageLive(_3);                 // scope 0 at $DIR/retag.rs:41:13: 41:15
+        _3 = _2;                         // scope 0 at $DIR/retag.rs:41:18: 41:19
+        Retag(_3);                       // scope 0 at $DIR/retag.rs:41:18: 41:19
+        _0 = _2;                         // scope 1 at $DIR/retag.rs:42:9: 42:10
+        Retag(_0);                       // scope 1 at $DIR/retag.rs:42:9: 42:10
+        StorageDead(_3);                 // scope 0 at $DIR/retag.rs:43:5: 43:6
+        return;                          // scope 0 at $DIR/retag.rs:43:6: 43:6
     }
 }
index 125f69b0bc2883bab5a05756f249fff5369938b3..7484d209d1b6f40acbcd3a2c8f728450fedbe767 100644 (file)
@@ -55,34 +55,34 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/retag.rs:30:9: 30:14
-        _1 = const 0i32;                 // bb0[1]: scope 0 at $DIR/retag.rs:30:17: 30:18
+        StorageLive(_1);                 // scope 0 at $DIR/retag.rs:30:9: 30:14
+        _1 = const 0i32;                 // scope 0 at $DIR/retag.rs:30:17: 30:18
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/retag.rs:30:17: 30:18
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-        StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/retag.rs:31:5: 37:6
-        StorageLive(_3);                 // bb0[3]: scope 1 at $DIR/retag.rs:32:13: 32:14
-        StorageLive(_4);                 // bb0[4]: scope 1 at $DIR/retag.rs:32:17: 32:24
-        StorageLive(_5);                 // bb0[5]: scope 1 at $DIR/retag.rs:32:17: 32:24
-        _5 = Test(const 0i32);           // bb0[6]: scope 1 at $DIR/retag.rs:32:17: 32:24
+        StorageLive(_2);                 // scope 1 at $DIR/retag.rs:31:5: 37:6
+        StorageLive(_3);                 // scope 1 at $DIR/retag.rs:32:13: 32:14
+        StorageLive(_4);                 // scope 1 at $DIR/retag.rs:32:17: 32:24
+        StorageLive(_5);                 // scope 1 at $DIR/retag.rs:32:17: 32:24
+        _5 = Test(const 0i32);           // scope 1 at $DIR/retag.rs:32:17: 32:24
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/retag.rs:32:22: 32:23
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-        _4 = &_5;                        // bb0[7]: scope 1 at $DIR/retag.rs:32:17: 32:24
-        Retag(_4);                       // bb0[8]: scope 1 at $DIR/retag.rs:32:17: 32:24
-        StorageLive(_6);                 // bb0[9]: scope 1 at $DIR/retag.rs:32:29: 32:35
-        StorageLive(_7);                 // bb0[10]: scope 1 at $DIR/retag.rs:32:29: 32:35
-        _7 = &mut _1;                    // bb0[11]: scope 1 at $DIR/retag.rs:32:29: 32:35
-        Retag(_7);                       // bb0[12]: scope 1 at $DIR/retag.rs:32:29: 32:35
-        _6 = &mut (*_7);                 // bb0[13]: scope 1 at $DIR/retag.rs:32:29: 32:35
-        Retag([2phase] _6);              // bb0[14]: scope 1 at $DIR/retag.rs:32:29: 32:35
-        _3 = const Test::foo(move _4, move _6) -> [return: bb2, unwind: bb3]; // bb0[15]: scope 1 at $DIR/retag.rs:32:17: 32:36
+        _4 = &_5;                        // scope 1 at $DIR/retag.rs:32:17: 32:24
+        Retag(_4);                       // scope 1 at $DIR/retag.rs:32:17: 32:24
+        StorageLive(_6);                 // scope 1 at $DIR/retag.rs:32:29: 32:35
+        StorageLive(_7);                 // scope 1 at $DIR/retag.rs:32:29: 32:35
+        _7 = &mut _1;                    // scope 1 at $DIR/retag.rs:32:29: 32:35
+        Retag(_7);                       // scope 1 at $DIR/retag.rs:32:29: 32:35
+        _6 = &mut (*_7);                 // scope 1 at $DIR/retag.rs:32:29: 32:35
+        Retag([2phase] _6);              // scope 1 at $DIR/retag.rs:32:29: 32:35
+        _3 = const Test::foo(move _4, move _6) -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/retag.rs:32:17: 32:36
                                          // ty::Const
                                          // + ty: for<'r, 'x> fn(&'r Test, &'x mut i32) -> &'x mut i32 {Test::foo}
                                          // + val: Value(Scalar(<ZST>))
@@ -92,54 +92,54 @@ fn main() -> () {
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/retag.rs:29:1: 51:2
+        resume;                          // scope 0 at $DIR/retag.rs:29:1: 51:2
     }
 
     bb2: {
-        Retag(_3);                       // bb2[0]: scope 1 at $DIR/retag.rs:32:17: 32:36
-        StorageDead(_6);                 // bb2[1]: scope 1 at $DIR/retag.rs:32:35: 32:36
-        StorageDead(_4);                 // bb2[2]: scope 1 at $DIR/retag.rs:32:35: 32:36
-        StorageDead(_7);                 // bb2[3]: scope 1 at $DIR/retag.rs:32:36: 32:37
-        drop(_5) -> [return: bb4, unwind: bb1]; // bb2[4]: scope 1 at $DIR/retag.rs:32:36: 32:37
+        Retag(_3);                       // scope 1 at $DIR/retag.rs:32:17: 32:36
+        StorageDead(_6);                 // scope 1 at $DIR/retag.rs:32:35: 32:36
+        StorageDead(_4);                 // scope 1 at $DIR/retag.rs:32:35: 32:36
+        StorageDead(_7);                 // scope 1 at $DIR/retag.rs:32:36: 32:37
+        drop(_5) -> [return: bb4, unwind: bb1]; // scope 1 at $DIR/retag.rs:32:36: 32:37
     }
 
     bb3 (cleanup): {
-        drop(_5) -> bb1;                 // bb3[0]: scope 1 at $DIR/retag.rs:32:36: 32:37
+        drop(_5) -> bb1;                 // scope 1 at $DIR/retag.rs:32:36: 32:37
     }
 
     bb4: {
-        StorageDead(_5);                 // bb4[0]: scope 1 at $DIR/retag.rs:32:36: 32:37
-        StorageLive(_8);                 // bb4[1]: scope 2 at $DIR/retag.rs:33:13: 33:14
-        StorageLive(_9);                 // bb4[2]: scope 2 at $DIR/retag.rs:33:19: 33:20
-        _9 = move _3;                    // bb4[3]: scope 2 at $DIR/retag.rs:33:19: 33:20
-        Retag(_9);                       // bb4[4]: scope 2 at $DIR/retag.rs:33:19: 33:20
-        _8 = &mut (*_9);                 // bb4[5]: scope 2 at $DIR/retag.rs:33:19: 33:20
-        Retag(_8);                       // bb4[6]: scope 2 at $DIR/retag.rs:33:19: 33:20
-        StorageDead(_9);                 // bb4[7]: scope 2 at $DIR/retag.rs:33:22: 33:23
-        StorageLive(_10);                // bb4[8]: scope 3 at $DIR/retag.rs:34:13: 34:14
-        _10 = move _8;                   // bb4[9]: scope 3 at $DIR/retag.rs:34:17: 34:18
-        Retag(_10);                      // bb4[10]: scope 3 at $DIR/retag.rs:34:17: 34:18
-        StorageLive(_11);                // bb4[11]: scope 4 at $DIR/retag.rs:36:13: 36:15
-        StorageLive(_12);                // bb4[12]: scope 4 at $DIR/retag.rs:36:18: 36:29
-        _12 = &raw mut (*_10);           // bb4[13]: scope 4 at $DIR/retag.rs:36:18: 36:19
-        Retag([raw] _12);                // bb4[14]: scope 4 at $DIR/retag.rs:36:18: 36:19
-        _11 = _12;                       // bb4[15]: scope 4 at $DIR/retag.rs:36:18: 36:29
-        StorageDead(_12);                // bb4[16]: scope 4 at $DIR/retag.rs:36:29: 36:30
-        _2 = const ();                   // bb4[17]: scope 1 at $DIR/retag.rs:31:5: 37:6
+        StorageDead(_5);                 // scope 1 at $DIR/retag.rs:32:36: 32:37
+        StorageLive(_8);                 // scope 2 at $DIR/retag.rs:33:13: 33:14
+        StorageLive(_9);                 // scope 2 at $DIR/retag.rs:33:19: 33:20
+        _9 = move _3;                    // scope 2 at $DIR/retag.rs:33:19: 33:20
+        Retag(_9);                       // scope 2 at $DIR/retag.rs:33:19: 33:20
+        _8 = &mut (*_9);                 // scope 2 at $DIR/retag.rs:33:19: 33:20
+        Retag(_8);                       // scope 2 at $DIR/retag.rs:33:19: 33:20
+        StorageDead(_9);                 // scope 2 at $DIR/retag.rs:33:22: 33:23
+        StorageLive(_10);                // scope 3 at $DIR/retag.rs:34:13: 34:14
+        _10 = move _8;                   // scope 3 at $DIR/retag.rs:34:17: 34:18
+        Retag(_10);                      // scope 3 at $DIR/retag.rs:34:17: 34:18
+        StorageLive(_11);                // scope 4 at $DIR/retag.rs:36:13: 36:15
+        StorageLive(_12);                // scope 4 at $DIR/retag.rs:36:18: 36:29
+        _12 = &raw mut (*_10);           // scope 4 at $DIR/retag.rs:36:18: 36:19
+        Retag([raw] _12);                // scope 4 at $DIR/retag.rs:36:18: 36:19
+        _11 = _12;                       // scope 4 at $DIR/retag.rs:36:18: 36:29
+        StorageDead(_12);                // scope 4 at $DIR/retag.rs:36:29: 36:30
+        _2 = const ();                   // scope 1 at $DIR/retag.rs:31:5: 37:6
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/retag.rs:31:5: 37:6
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_11);                // bb4[18]: scope 4 at $DIR/retag.rs:37:5: 37:6
-        StorageDead(_10);                // bb4[19]: scope 3 at $DIR/retag.rs:37:5: 37:6
-        StorageDead(_8);                 // bb4[20]: scope 2 at $DIR/retag.rs:37:5: 37:6
-        StorageDead(_3);                 // bb4[21]: scope 1 at $DIR/retag.rs:37:5: 37:6
-        StorageDead(_2);                 // bb4[22]: scope 1 at $DIR/retag.rs:37:5: 37:6
-        StorageLive(_13);                // bb4[23]: scope 1 at $DIR/retag.rs:40:9: 40:10
-        StorageLive(_14);                // bb4[24]: scope 1 at $DIR/retag.rs:40:31: 43:6
-        _14 = [closure@main::{{closure}}#0]; // bb4[25]: scope 1 at $DIR/retag.rs:40:31: 43:6
+        StorageDead(_11);                // scope 4 at $DIR/retag.rs:37:5: 37:6
+        StorageDead(_10);                // scope 3 at $DIR/retag.rs:37:5: 37:6
+        StorageDead(_8);                 // scope 2 at $DIR/retag.rs:37:5: 37:6
+        StorageDead(_3);                 // scope 1 at $DIR/retag.rs:37:5: 37:6
+        StorageDead(_2);                 // scope 1 at $DIR/retag.rs:37:5: 37:6
+        StorageLive(_13);                // scope 1 at $DIR/retag.rs:40:9: 40:10
+        StorageLive(_14);                // scope 1 at $DIR/retag.rs:40:31: 43:6
+        _14 = [closure@main::{{closure}}#0]; // scope 1 at $DIR/retag.rs:40:31: 43:6
                                          // closure
                                          // + def_id: DefId(0:14 ~ retag[317d]::main[0]::{{closure}}[0])
                                          // + substs: [
@@ -147,53 +147,53 @@ fn main() -> () {
                                          //     for<'r> extern "rust-call" fn((&'r i32,)) -> &'r i32,
                                          //     (),
                                          // ]
-        Retag(_14);                      // bb4[26]: scope 1 at $DIR/retag.rs:40:31: 43:6
-        _13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // bb4[27]: scope 1 at $DIR/retag.rs:40:31: 43:6
-        StorageDead(_14);                // bb4[28]: scope 1 at $DIR/retag.rs:43:5: 43:6
-        StorageLive(_15);                // bb4[29]: scope 6 at $DIR/retag.rs:44:9: 44:11
-        StorageLive(_16);                // bb4[30]: scope 6 at $DIR/retag.rs:44:14: 44:15
-        _16 = _13;                       // bb4[31]: scope 6 at $DIR/retag.rs:44:14: 44:15
-        StorageLive(_17);                // bb4[32]: scope 6 at $DIR/retag.rs:44:16: 44:18
-        StorageLive(_18);                // bb4[33]: scope 6 at $DIR/retag.rs:44:16: 44:18
-        _18 = &_1;                       // bb4[34]: scope 6 at $DIR/retag.rs:44:16: 44:18
-        Retag(_18);                      // bb4[35]: scope 6 at $DIR/retag.rs:44:16: 44:18
-        _17 = &(*_18);                   // bb4[36]: scope 6 at $DIR/retag.rs:44:16: 44:18
-        Retag(_17);                      // bb4[37]: scope 6 at $DIR/retag.rs:44:16: 44:18
-        _15 = move _16(move _17) -> bb5; // bb4[38]: scope 6 at $DIR/retag.rs:44:14: 44:19
+        Retag(_14);                      // scope 1 at $DIR/retag.rs:40:31: 43:6
+        _13 = move _14 as for<'r> fn(&'r i32) -> &'r i32 (Pointer(ClosureFnPointer(Normal))); // scope 1 at $DIR/retag.rs:40:31: 43:6
+        StorageDead(_14);                // scope 1 at $DIR/retag.rs:43:5: 43:6
+        StorageLive(_15);                // scope 6 at $DIR/retag.rs:44:9: 44:11
+        StorageLive(_16);                // scope 6 at $DIR/retag.rs:44:14: 44:15
+        _16 = _13;                       // scope 6 at $DIR/retag.rs:44:14: 44:15
+        StorageLive(_17);                // scope 6 at $DIR/retag.rs:44:16: 44:18
+        StorageLive(_18);                // scope 6 at $DIR/retag.rs:44:16: 44:18
+        _18 = &_1;                       // scope 6 at $DIR/retag.rs:44:16: 44:18
+        Retag(_18);                      // scope 6 at $DIR/retag.rs:44:16: 44:18
+        _17 = &(*_18);                   // scope 6 at $DIR/retag.rs:44:16: 44:18
+        Retag(_17);                      // scope 6 at $DIR/retag.rs:44:16: 44:18
+        _15 = move _16(move _17) -> bb5; // scope 6 at $DIR/retag.rs:44:14: 44:19
     }
 
     bb5: {
-        Retag(_15);                      // bb5[0]: scope 6 at $DIR/retag.rs:44:14: 44:19
-        StorageDead(_17);                // bb5[1]: scope 6 at $DIR/retag.rs:44:18: 44:19
-        StorageDead(_16);                // bb5[2]: scope 6 at $DIR/retag.rs:44:18: 44:19
-        StorageDead(_18);                // bb5[3]: scope 6 at $DIR/retag.rs:44:19: 44:20
-        StorageLive(_19);                // bb5[4]: scope 7 at $DIR/retag.rs:47:5: 47:24
-        StorageLive(_20);                // bb5[5]: scope 7 at $DIR/retag.rs:47:5: 47:12
-        StorageLive(_21);                // bb5[6]: scope 7 at $DIR/retag.rs:47:5: 47:12
-        _21 = Test(const 0i32);          // bb5[7]: scope 7 at $DIR/retag.rs:47:5: 47:12
+        Retag(_15);                      // scope 6 at $DIR/retag.rs:44:14: 44:19
+        StorageDead(_17);                // scope 6 at $DIR/retag.rs:44:18: 44:19
+        StorageDead(_16);                // scope 6 at $DIR/retag.rs:44:18: 44:19
+        StorageDead(_18);                // scope 6 at $DIR/retag.rs:44:19: 44:20
+        StorageLive(_19);                // scope 7 at $DIR/retag.rs:47:5: 47:24
+        StorageLive(_20);                // scope 7 at $DIR/retag.rs:47:5: 47:12
+        StorageLive(_21);                // scope 7 at $DIR/retag.rs:47:5: 47:12
+        _21 = Test(const 0i32);          // scope 7 at $DIR/retag.rs:47:5: 47:12
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/retag.rs:47:10: 47:11
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-        _20 = &_21;                      // bb5[8]: scope 7 at $DIR/retag.rs:47:5: 47:12
-        Retag(_20);                      // bb5[9]: scope 7 at $DIR/retag.rs:47:5: 47:12
-        StorageLive(_22);                // bb5[10]: scope 7 at $DIR/retag.rs:47:21: 47:23
-        StorageLive(_23);                // bb5[11]: scope 7 at $DIR/retag.rs:47:21: 47:23
-        _27 = const main::promoted[0];   // bb5[12]: scope 7 at $DIR/retag.rs:47:21: 47:23
+        _20 = &_21;                      // scope 7 at $DIR/retag.rs:47:5: 47:12
+        Retag(_20);                      // scope 7 at $DIR/retag.rs:47:5: 47:12
+        StorageLive(_22);                // scope 7 at $DIR/retag.rs:47:21: 47:23
+        StorageLive(_23);                // scope 7 at $DIR/retag.rs:47:21: 47:23
+        _27 = const main::promoted[0];   // scope 7 at $DIR/retag.rs:47:21: 47:23
                                          // ty::Const
                                          // + ty: &i32
                                          // + val: Unevaluated(DefId(0:13 ~ retag[317d]::main[0]), [], Some(promoted[0]))
                                          // mir::Constant
                                          // + span: $DIR/retag.rs:47:21: 47:23
                                          // + literal: Const { ty: &i32, val: Unevaluated(DefId(0:13 ~ retag[317d]::main[0]), [], Some(promoted[0])) }
-        Retag(_27);                      // bb5[13]: scope 7 at $DIR/retag.rs:47:21: 47:23
-        _23 = &(*_27);                   // bb5[14]: scope 7 at $DIR/retag.rs:47:21: 47:23
-        Retag(_23);                      // bb5[15]: scope 7 at $DIR/retag.rs:47:21: 47:23
-        _22 = &(*_23);                   // bb5[16]: scope 7 at $DIR/retag.rs:47:21: 47:23
-        Retag(_22);                      // bb5[17]: scope 7 at $DIR/retag.rs:47:21: 47:23
-        _19 = const Test::foo_shr(move _20, move _22) -> [return: bb6, unwind: bb7]; // bb5[18]: scope 7 at $DIR/retag.rs:47:5: 47:24
+        Retag(_27);                      // scope 7 at $DIR/retag.rs:47:21: 47:23
+        _23 = &(*_27);                   // scope 7 at $DIR/retag.rs:47:21: 47:23
+        Retag(_23);                      // scope 7 at $DIR/retag.rs:47:21: 47:23
+        _22 = &(*_23);                   // scope 7 at $DIR/retag.rs:47:21: 47:23
+        Retag(_22);                      // scope 7 at $DIR/retag.rs:47:21: 47:23
+        _19 = const Test::foo_shr(move _20, move _22) -> [return: bb6, unwind: bb7]; // scope 7 at $DIR/retag.rs:47:5: 47:24
                                          // ty::Const
                                          // + ty: for<'r, 'x> fn(&'r Test, &'x i32) -> &'x i32 {Test::foo_shr}
                                          // + val: Value(Scalar(<ZST>))
@@ -203,37 +203,37 @@ fn main() -> () {
     }
 
     bb6: {
-        Retag(_19);                      // bb6[0]: scope 7 at $DIR/retag.rs:47:5: 47:24
-        StorageDead(_22);                // bb6[1]: scope 7 at $DIR/retag.rs:47:23: 47:24
-        StorageDead(_20);                // bb6[2]: scope 7 at $DIR/retag.rs:47:23: 47:24
-        StorageDead(_23);                // bb6[3]: scope 7 at $DIR/retag.rs:47:24: 47:25
-        drop(_21) -> [return: bb8, unwind: bb1]; // bb6[4]: scope 7 at $DIR/retag.rs:47:24: 47:25
+        Retag(_19);                      // scope 7 at $DIR/retag.rs:47:5: 47:24
+        StorageDead(_22);                // scope 7 at $DIR/retag.rs:47:23: 47:24
+        StorageDead(_20);                // scope 7 at $DIR/retag.rs:47:23: 47:24
+        StorageDead(_23);                // scope 7 at $DIR/retag.rs:47:24: 47:25
+        drop(_21) -> [return: bb8, unwind: bb1]; // scope 7 at $DIR/retag.rs:47:24: 47:25
     }
 
     bb7 (cleanup): {
-        drop(_21) -> bb1;                // bb7[0]: scope 7 at $DIR/retag.rs:47:24: 47:25
+        drop(_21) -> bb1;                // scope 7 at $DIR/retag.rs:47:24: 47:25
     }
 
     bb8: {
-        StorageDead(_21);                // bb8[0]: scope 7 at $DIR/retag.rs:47:24: 47:25
-        StorageDead(_19);                // bb8[1]: scope 7 at $DIR/retag.rs:47:24: 47:25
-        StorageLive(_25);                // bb8[2]: scope 7 at $DIR/retag.rs:50:9: 50:11
-        StorageLive(_26);                // bb8[3]: scope 7 at $DIR/retag.rs:50:14: 50:28
-        _26 = &raw const (*_15);         // bb8[4]: scope 7 at $DIR/retag.rs:50:14: 50:16
-        Retag([raw] _26);                // bb8[5]: scope 7 at $DIR/retag.rs:50:14: 50:16
-        _25 = _26;                       // bb8[6]: scope 7 at $DIR/retag.rs:50:14: 50:28
-        StorageDead(_26);                // bb8[7]: scope 7 at $DIR/retag.rs:50:28: 50:29
-        _0 = const ();                   // bb8[8]: scope 0 at $DIR/retag.rs:29:11: 51:2
+        StorageDead(_21);                // scope 7 at $DIR/retag.rs:47:24: 47:25
+        StorageDead(_19);                // scope 7 at $DIR/retag.rs:47:24: 47:25
+        StorageLive(_25);                // scope 7 at $DIR/retag.rs:50:9: 50:11
+        StorageLive(_26);                // scope 7 at $DIR/retag.rs:50:14: 50:28
+        _26 = &raw const (*_15);         // scope 7 at $DIR/retag.rs:50:14: 50:16
+        Retag([raw] _26);                // scope 7 at $DIR/retag.rs:50:14: 50:16
+        _25 = _26;                       // scope 7 at $DIR/retag.rs:50:14: 50:28
+        StorageDead(_26);                // scope 7 at $DIR/retag.rs:50:28: 50:29
+        _0 = const ();                   // scope 0 at $DIR/retag.rs:29:11: 51:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/retag.rs:29:11: 51:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_25);                // bb8[9]: scope 7 at $DIR/retag.rs:51:1: 51:2
-        StorageDead(_15);                // bb8[10]: scope 6 at $DIR/retag.rs:51:1: 51:2
-        StorageDead(_13);                // bb8[11]: scope 1 at $DIR/retag.rs:51:1: 51:2
-        StorageDead(_1);                 // bb8[12]: scope 0 at $DIR/retag.rs:51:1: 51:2
-        return;                          // bb8[13]: scope 0 at $DIR/retag.rs:51:2: 51:2
+        StorageDead(_25);                // scope 7 at $DIR/retag.rs:51:1: 51:2
+        StorageDead(_15);                // scope 6 at $DIR/retag.rs:51:1: 51:2
+        StorageDead(_13);                // scope 1 at $DIR/retag.rs:51:1: 51:2
+        StorageDead(_1);                 // scope 0 at $DIR/retag.rs:51:1: 51:2
+        return;                          // scope 0 at $DIR/retag.rs:51:2: 51:2
     }
 }
index 306d30587d61b955f779515d4b128b528d3c0b39..995c8c141c66f3c8849cf06af27f42057986bd11 100644 (file)
@@ -6,9 +6,9 @@ fn std::intrinsics::drop_in_place(_1: *mut Test) -> () {
     let mut _3: ();                      // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
 
     bb0: {
-        Retag([raw] _1);                 // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _2 = &mut (*_1);                 // bb0[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _3 = const <Test as std::ops::Drop>::drop(move _2) -> bb1; // bb0[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        Retag([raw] _1);                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _2 = &mut (*_1);                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _3 = const <Test as std::ops::Drop>::drop(move _2) -> bb1; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: for<'r> fn(&'r mut Test) {<Test as std::ops::Drop>::drop}
                                          // + val: Value(Scalar(<ZST>))
@@ -18,6 +18,6 @@ fn std::intrinsics::drop_in_place(_1: *mut Test) -> () {
     }
 
     bb1: {
-        return;                          // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        return;                          // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 }
index 265a4bdd8224321f5c6158b8588403d68e02ecb6..f9ed3932d33356399aecaff84c1c2ee7a9d6f251 100644 (file)
@@ -7,14 +7,14 @@ fn <impl at $DIR/retag.rs:11:1: 19:2>::foo(_1: &Test, _2: &mut i32) -> &mut i32
     let mut _3: &mut i32;                // in scope 0 at $DIR/retag.rs:14:9: 14:10
 
     bb0: {
-        Retag([fn entry] _1);            // bb0[0]: scope 0 at $DIR/retag.rs:13:5: 15:6
-        Retag([fn entry] _2);            // bb0[1]: scope 0 at $DIR/retag.rs:13:5: 15:6
-        StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/retag.rs:14:9: 14:10
-        _3 = &mut (*_2);                 // bb0[3]: scope 0 at $DIR/retag.rs:14:9: 14:10
-        Retag(_3);                       // bb0[4]: scope 0 at $DIR/retag.rs:14:9: 14:10
-        _0 = &mut (*_3);                 // bb0[5]: scope 0 at $DIR/retag.rs:14:9: 14:10
-        Retag(_0);                       // bb0[6]: scope 0 at $DIR/retag.rs:14:9: 14:10
-        StorageDead(_3);                 // bb0[7]: scope 0 at $DIR/retag.rs:15:5: 15:6
-        return;                          // bb0[8]: scope 0 at $DIR/retag.rs:15:6: 15:6
+        Retag([fn entry] _1);            // scope 0 at $DIR/retag.rs:13:5: 15:6
+        Retag([fn entry] _2);            // scope 0 at $DIR/retag.rs:13:5: 15:6
+        StorageLive(_3);                 // scope 0 at $DIR/retag.rs:14:9: 14:10
+        _3 = &mut (*_2);                 // scope 0 at $DIR/retag.rs:14:9: 14:10
+        Retag(_3);                       // scope 0 at $DIR/retag.rs:14:9: 14:10
+        _0 = &mut (*_3);                 // scope 0 at $DIR/retag.rs:14:9: 14:10
+        Retag(_0);                       // scope 0 at $DIR/retag.rs:14:9: 14:10
+        StorageDead(_3);                 // scope 0 at $DIR/retag.rs:15:5: 15:6
+        return;                          // scope 0 at $DIR/retag.rs:15:6: 15:6
     }
 }
index edf1058e4574ee6b6cb2a8b64e272d72c488fa04..87a8603a931da0ea4892abe8e876aa3ff9ff620b 100644 (file)
@@ -6,10 +6,10 @@ fn <impl at $DIR/retag.rs:11:1: 19:2>::foo_shr(_1: &Test, _2: &i32) -> &i32 {
     let mut _0: &i32;                    // return place in scope 0 at $DIR/retag.rs:16:42: 16:49
 
     bb0: {
-        Retag([fn entry] _1);            // bb0[0]: scope 0 at $DIR/retag.rs:16:5: 18:6
-        Retag([fn entry] _2);            // bb0[1]: scope 0 at $DIR/retag.rs:16:5: 18:6
-        _0 = _2;                         // bb0[2]: scope 0 at $DIR/retag.rs:17:9: 17:10
-        Retag(_0);                       // bb0[3]: scope 0 at $DIR/retag.rs:17:9: 17:10
-        return;                          // bb0[4]: scope 0 at $DIR/retag.rs:18:6: 18:6
+        Retag([fn entry] _1);            // scope 0 at $DIR/retag.rs:16:5: 18:6
+        Retag([fn entry] _2);            // scope 0 at $DIR/retag.rs:16:5: 18:6
+        _0 = _2;                         // scope 0 at $DIR/retag.rs:17:9: 17:10
+        Retag(_0);                       // scope 0 at $DIR/retag.rs:17:9: 17:10
+        return;                          // scope 0 at $DIR/retag.rs:18:6: 18:6
     }
 }
index b720255893a20dd5dd54126f10e0398474641c65..3a7d6a7ca3c6159c541bc234ecd9e5034914398c 100644 (file)
@@ -5,45 +5,45 @@ fn match_bool(_1: bool) -> usize {
     let mut _0: usize;                   // return place in scope 0 at $DIR/simple-match.rs:5:27: 5:32
 
     bb0: {
-        FakeRead(ForMatchedPlace, _1);   // bb0[0]: scope 0 at $DIR/simple-match.rs:6:11: 6:12
-        switchInt(_1) -> [false: bb3, otherwise: bb2]; // bb0[1]: scope 0 at $DIR/simple-match.rs:7:9: 7:13
+        FakeRead(ForMatchedPlace, _1);   // scope 0 at $DIR/simple-match.rs:6:11: 6:12
+        switchInt(_1) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/simple-match.rs:5:1: 10:2
+        resume;                          // scope 0 at $DIR/simple-match.rs:5:1: 10:2
     }
 
     bb2: {
-        falseEdges -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 0 at $DIR/simple-match.rs:7:9: 7:13
+        falseEdges -> [real: bb4, imaginary: bb3]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13
     }
 
     bb3: {
-        _0 = const 20usize;              // bb3[0]: scope 0 at $DIR/simple-match.rs:8:14: 8:16
+        _0 = const 20usize;              // scope 0 at $DIR/simple-match.rs:8:14: 8:16
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000014))
                                          // mir::Constant
                                          // + span: $DIR/simple-match.rs:8:14: 8:16
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000014)) }
-        goto -> bb5;                     // bb3[1]: scope 0 at $DIR/simple-match.rs:6:5: 9:6
+        goto -> bb5;                     // scope 0 at $DIR/simple-match.rs:6:5: 9:6
     }
 
     bb4: {
-        _0 = const 10usize;              // bb4[0]: scope 0 at $DIR/simple-match.rs:7:17: 7:19
+        _0 = const 10usize;              // scope 0 at $DIR/simple-match.rs:7:17: 7:19
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000a))
                                          // mir::Constant
                                          // + span: $DIR/simple-match.rs:7:17: 7:19
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000a)) }
-        goto -> bb5;                     // bb4[1]: scope 0 at $DIR/simple-match.rs:6:5: 9:6
+        goto -> bb5;                     // scope 0 at $DIR/simple-match.rs:6:5: 9:6
     }
 
     bb5: {
-        goto -> bb6;                     // bb5[0]: scope 0 at $DIR/simple-match.rs:10:2: 10:2
+        goto -> bb6;                     // scope 0 at $DIR/simple-match.rs:10:2: 10:2
     }
 
     bb6: {
-        return;                          // bb6[0]: scope 0 at $DIR/simple-match.rs:10:2: 10:2
+        return;                          // scope 0 at $DIR/simple-match.rs:10:2: 10:2
     }
 }
index f2fe72d0c118c4c610404bc46c8befbd1e4cd231..170181177b26adf812afc274d4876e1d36d9c6e8 100644 (file)
@@ -5,45 +5,45 @@ fn match_bool(_1: bool) -> usize {
     let mut _0: usize;                   // return place in scope 0 at $DIR/simple-match.rs:5:27: 5:32
 
     bb0: {
-        FakeRead(ForMatchedPlace, _1);   // bb0[0]: scope 0 at $DIR/simple-match.rs:6:11: 6:12
-        switchInt(_1) -> [false: bb3, otherwise: bb2]; // bb0[1]: scope 0 at $DIR/simple-match.rs:7:9: 7:13
+        FakeRead(ForMatchedPlace, _1);   // scope 0 at $DIR/simple-match.rs:6:11: 6:12
+        switchInt(_1) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/simple-match.rs:5:1: 10:2
+        resume;                          // scope 0 at $DIR/simple-match.rs:5:1: 10:2
     }
 
     bb2: {
-        falseEdges -> [real: bb4, imaginary: bb3]; // bb2[0]: scope 0 at $DIR/simple-match.rs:7:9: 7:13
+        falseEdges -> [real: bb4, imaginary: bb3]; // scope 0 at $DIR/simple-match.rs:7:9: 7:13
     }
 
     bb3: {
-        _0 = const 20usize;              // bb3[0]: scope 0 at $DIR/simple-match.rs:8:14: 8:16
+        _0 = const 20usize;              // scope 0 at $DIR/simple-match.rs:8:14: 8:16
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000014))
                                          // mir::Constant
                                          // + span: $DIR/simple-match.rs:8:14: 8:16
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000014)) }
-        goto -> bb5;                     // bb3[1]: scope 0 at $DIR/simple-match.rs:6:5: 9:6
+        goto -> bb5;                     // scope 0 at $DIR/simple-match.rs:6:5: 9:6
     }
 
     bb4: {
-        _0 = const 10usize;              // bb4[0]: scope 0 at $DIR/simple-match.rs:7:17: 7:19
+        _0 = const 10usize;              // scope 0 at $DIR/simple-match.rs:7:17: 7:19
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x000000000000000a))
                                          // mir::Constant
                                          // + span: $DIR/simple-match.rs:7:17: 7:19
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x000000000000000a)) }
-        goto -> bb5;                     // bb4[1]: scope 0 at $DIR/simple-match.rs:6:5: 9:6
+        goto -> bb5;                     // scope 0 at $DIR/simple-match.rs:6:5: 9:6
     }
 
     bb5: {
-        goto -> bb6;                     // bb5[0]: scope 0 at $DIR/simple-match.rs:10:2: 10:2
+        goto -> bb6;                     // scope 0 at $DIR/simple-match.rs:10:2: 10:2
     }
 
     bb6: {
-        return;                          // bb6[0]: scope 0 at $DIR/simple-match.rs:10:2: 10:2
+        return;                          // scope 0 at $DIR/simple-match.rs:10:2: 10:2
     }
 }
index cc6aab7523f009e8064518ecbd79ca142e00bf33..24e91b3ff611c484c3ad91596c6f663296486d75 100644 (file)
@@ -2,6 +2,7 @@
 // Regression test for issue #66856.
 //
 // compile-flags: -Zmir-opt-level=2
+// EMIT_MIR_FOR_EACH_BIT_WIDTH
 
 enum Src {
     Foo(u8),
diff --git a/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm-identity/32bit/rustc.main.SimplifyArmIdentity.diff
new file mode 100644 (file)
index 0000000..bf24bfb
--- /dev/null
@@ -0,0 +1,53 @@
+- // MIR for `main` before SimplifyArmIdentity
++ // MIR for `main` after SimplifyArmIdentity
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/simplify-arm-identity.rs:17:11: 17:11
+      let _1: Src as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+      let mut _2: Dst;                     // in scope 0 at $DIR/simplify-arm-identity.rs:19:18: 22:6
+      let mut _3: isize;                   // in scope 0 at $DIR/simplify-arm-identity.rs:20:9: 20:20
+      let mut _5: u8;                      // in scope 0 at $DIR/simplify-arm-identity.rs:20:33: 20:34
+      scope 1 {
+          debug e => _1;                   // in scope 1 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+          let _4: u8;                      // in scope 1 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+          scope 2 {
+          }
+          scope 3 {
+              debug x => _4;               // in scope 3 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+          ((_1 as Foo).0: u8) = const 0u8; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
+                                           // ty::Const
+                                           // + ty: u8
+                                           // + val: Value(Scalar(0x00))
+                                           // mir::Constant
+                                           // + span: $DIR/simplify-arm-identity.rs:18:27: 18:28
+                                           // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
+          discriminant(_1) = 0;            // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
+          StorageLive(_2);                 // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
+          _3 = const 0isize;               // scope 1 at $DIR/simplify-arm-identity.rs:20:9: 20:20
+                                           // ty::Const
+                                           // + ty: isize
+                                           // + val: Value(Scalar(0x00000000))
+                                           // mir::Constant
+                                           // + span: $DIR/simplify-arm-identity.rs:20:9: 20:20
+                                           // + literal: Const { ty: isize, val: Value(Scalar(0x00000000)) }
+          _4 = ((_1 as Foo).0: u8);        // scope 1 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+          ((_2 as Foo).0: u8) = move _4;   // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
+          discriminant(_2) = 0;            // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
+          StorageDead(_2);                 // scope 1 at $DIR/simplify-arm-identity.rs:22:6: 22:7
+          _0 = const ();                   // scope 0 at $DIR/simplify-arm-identity.rs:17:11: 23:2
+                                           // ty::Const
+                                           // + ty: ()
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/simplify-arm-identity.rs:17:11: 23:2
+                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+          StorageDead(_1);                 // scope 0 at $DIR/simplify-arm-identity.rs:23:1: 23:2
+          return;                          // scope 0 at $DIR/simplify-arm-identity.rs:23:2: 23:2
+      }
+  }
+  
diff --git a/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff b/src/test/mir-opt/simplify-arm-identity/64bit/rustc.main.SimplifyArmIdentity.diff
new file mode 100644 (file)
index 0000000..ff7183e
--- /dev/null
@@ -0,0 +1,53 @@
+- // MIR for `main` before SimplifyArmIdentity
++ // MIR for `main` after SimplifyArmIdentity
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/simplify-arm-identity.rs:17:11: 17:11
+      let _1: Src as UserTypeProjection { base: UserType(0), projs: [] }; // in scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+      let mut _2: Dst;                     // in scope 0 at $DIR/simplify-arm-identity.rs:19:18: 22:6
+      let mut _3: isize;                   // in scope 0 at $DIR/simplify-arm-identity.rs:20:9: 20:20
+      let mut _5: u8;                      // in scope 0 at $DIR/simplify-arm-identity.rs:20:33: 20:34
+      scope 1 {
+          debug e => _1;                   // in scope 1 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+          let _4: u8;                      // in scope 1 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+          scope 2 {
+          }
+          scope 3 {
+              debug x => _4;               // in scope 3 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+          }
+      }
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
+          ((_1 as Foo).0: u8) = const 0u8; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
+                                           // ty::Const
+                                           // + ty: u8
+                                           // + val: Value(Scalar(0x00))
+                                           // mir::Constant
+                                           // + span: $DIR/simplify-arm-identity.rs:18:27: 18:28
+                                           // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
+          discriminant(_1) = 0;            // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
+          StorageLive(_2);                 // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
+          _3 = const 0isize;               // scope 1 at $DIR/simplify-arm-identity.rs:20:9: 20:20
+                                           // ty::Const
+                                           // + ty: isize
+                                           // + val: Value(Scalar(0x0000000000000000))
+                                           // mir::Constant
+                                           // + span: $DIR/simplify-arm-identity.rs:20:9: 20:20
+                                           // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000000)) }
+          _4 = ((_1 as Foo).0: u8);        // scope 1 at $DIR/simplify-arm-identity.rs:20:18: 20:19
+          ((_2 as Foo).0: u8) = move _4;   // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
+          discriminant(_2) = 0;            // scope 3 at $DIR/simplify-arm-identity.rs:20:24: 20:35
+          StorageDead(_2);                 // scope 1 at $DIR/simplify-arm-identity.rs:22:6: 22:7
+          _0 = const ();                   // scope 0 at $DIR/simplify-arm-identity.rs:17:11: 23:2
+                                           // ty::Const
+                                           // + ty: ()
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/simplify-arm-identity.rs:17:11: 23:2
+                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+          StorageDead(_1);                 // scope 0 at $DIR/simplify-arm-identity.rs:23:1: 23:2
+          return;                          // scope 0 at $DIR/simplify-arm-identity.rs:23:2: 23:2
+      }
+  }
+  
index 2caa6235d54c00de85278cc4631b84dee33ca61d..b2517cb7012b488869e7f3404f87fd9046292f57 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/simplify-arm-identity.rs:17:9: 17:10
-          ((_1 as Foo).0: u8) = const 0u8; // bb0[1]: scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29
+          StorageLive(_1);                 // scope 0 at $DIR/simplify-arm-identity.rs:17:9: 17:10
+          ((_1 as Foo).0: u8) = const 0u8; // scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29
                                            // ty::Const
                                            // + ty: u8
                                            // + val: Value(Scalar(0x00))
                                            // mir::Constant
                                            // + span: $DIR/simplify-arm-identity.rs:17:27: 17:28
                                            // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
-          discriminant(_1) = 0;            // bb0[2]: scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29
-          StorageLive(_2);                 // bb0[3]: scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
-          _3 = discriminant(_1);           // bb0[4]: scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20
-          switchInt(move _3) -> [0isize: bb3, 1isize: bb1, otherwise: bb2]; // bb0[5]: scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20
+          discriminant(_1) = 0;            // scope 0 at $DIR/simplify-arm-identity.rs:17:18: 17:29
+          StorageLive(_2);                 // scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
+          _3 = discriminant(_1);           // scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20
+          switchInt(move _3) -> [0isize: bb3, 1isize: bb1, otherwise: bb2]; // scope 1 at $DIR/simplify-arm-identity.rs:19:9: 19:20
       }
   
       bb1: {
-          ((_2 as Foo).0: u8) = const 0u8; // bb1[0]: scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32
+          ((_2 as Foo).0: u8) = const 0u8; // scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32
                                            // ty::Const
                                            // + ty: u8
                                            // + val: Value(Scalar(0x00))
                                            // mir::Constant
                                            // + span: $DIR/simplify-arm-identity.rs:20:30: 20:31
                                            // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
-          discriminant(_2) = 0;            // bb1[1]: scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32
-          goto -> bb4;                     // bb1[2]: scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
+          discriminant(_2) = 0;            // scope 1 at $DIR/simplify-arm-identity.rs:20:21: 20:32
+          goto -> bb4;                     // scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
       }
   
       bb2: {
-          unreachable;                     // bb2[0]: scope 1 at $DIR/simplify-arm-identity.rs:18:24: 18:25
+          unreachable;                     // scope 1 at $DIR/simplify-arm-identity.rs:18:24: 18:25
       }
   
       bb3: {
-          _4 = ((_1 as Foo).0: u8);        // bb3[0]: scope 1 at $DIR/simplify-arm-identity.rs:19:18: 19:19
-          ((_2 as Foo).0: u8) = move _4;   // bb3[1]: scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35
-          discriminant(_2) = 0;            // bb3[2]: scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35
-          goto -> bb4;                     // bb3[3]: scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
+          _4 = ((_1 as Foo).0: u8);        // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 19:19
+          ((_2 as Foo).0: u8) = move _4;   // scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35
+          discriminant(_2) = 0;            // scope 3 at $DIR/simplify-arm-identity.rs:19:24: 19:35
+          goto -> bb4;                     // scope 1 at $DIR/simplify-arm-identity.rs:18:18: 21:6
       }
   
       bb4: {
-          StorageDead(_2);                 // bb4[0]: scope 1 at $DIR/simplify-arm-identity.rs:21:6: 21:7
-          _0 = const ();                   // bb4[1]: scope 0 at $DIR/simplify-arm-identity.rs:16:11: 22:2
+          StorageDead(_2);                 // scope 1 at $DIR/simplify-arm-identity.rs:21:6: 21:7
+          _0 = const ();                   // scope 0 at $DIR/simplify-arm-identity.rs:16:11: 22:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify-arm-identity.rs:16:11: 22:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb4[2]: scope 0 at $DIR/simplify-arm-identity.rs:22:1: 22:2
-          return;                          // bb4[3]: scope 0 at $DIR/simplify-arm-identity.rs:22:2: 22:2
+          StorageDead(_1);                 // scope 0 at $DIR/simplify-arm-identity.rs:22:1: 22:2
+          return;                          // scope 0 at $DIR/simplify-arm-identity.rs:22:2: 22:2
       }
   }
   
index bc59be48eee0fb565108da5d360f250b285cd854..f7db14e716526924401a40794ae4a1281e428434 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
-          discriminant(_2) = 0;            // bb0[2]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
-          StorageLive(_3);                 // bb0[3]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
-          discriminant(_3) = 0;            // bb0[4]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
-          (_1.0: std::option::Option<u8>) = move _2; // bb0[5]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
-          (_1.1: std::option::Option<T>) = move _3; // bb0[6]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
-          StorageDead(_3);                 // bb0[7]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
-          StorageDead(_2);                 // bb0[8]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
-          _5 = discriminant((_1.0: std::option::Option<u8>)); // bb0[9]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:13: 4:20
-          switchInt(move _5) -> [1isize: bb2, otherwise: bb1]; // bb0[10]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:13: 4:20
+          StorageLive(_1);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+          StorageLive(_2);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
+          discriminant(_2) = 0;            // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:31: 4:49
+          StorageLive(_3);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
+          discriminant(_3) = 0;            // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:51: 4:68
+          (_1.0: std::option::Option<u8>) = move _2; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+          (_1.1: std::option::Option<T>) = move _3; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:30: 4:69
+          StorageDead(_3);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
+          StorageDead(_2);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:68: 4:69
+          _5 = discriminant((_1.0: std::option::Option<u8>)); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:13: 4:20
+          switchInt(move _5) -> [1isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:13: 4:20
       }
   
       bb1: {
-          _0 = const ();                   // bb1[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
+          _0 = const ();                   // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          goto -> bb7;                     // bb1[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
+          goto -> bb7;                     // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
       }
   
       bb2: {
-          _4 = discriminant((_1.1: std::option::Option<T>)); // bb2[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:22: 4:26
-          switchInt(move _4) -> [0isize: bb3, otherwise: bb1]; // bb2[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:22: 4:26
+          _4 = discriminant((_1.1: std::option::Option<T>)); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:22: 4:26
+          switchInt(move _4) -> [0isize: bb3, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:22: 4:26
       }
   
       bb3: {
-          StorageLive(_6);                 // bb3[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
-          _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); // bb3[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
-          StorageLive(_7);                 // bb3[2]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
-          StorageLive(_8);                 // bb3[3]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
-          _8 = _6;                         // bb3[4]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
-          _7 = Gt(move _8, const 42u8);    // bb3[5]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
+          StorageLive(_6);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
+          _6 = (((_1.0: std::option::Option<u8>) as Some).0: u8); // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:18: 4:19
+          StorageLive(_7);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
+          StorageLive(_8);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
+          _8 = _6;                         // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
+          _7 = Gt(move _8, const 42u8);    // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
                                            // ty::Const
                                            // + ty: u8
                                            // + val: Value(Scalar(0x2a))
                                            // mir::Constant
                                            // + span: $DIR/simplify-locals-fixedpoint.rs:5:16: 5:20
                                            // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
-          StorageDead(_8);                 // bb3[6]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20
-          switchInt(_7) -> [false: bb4, otherwise: bb5]; // bb3[7]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
+          StorageDead(_8);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20
+          switchInt(_7) -> [false: bb4, otherwise: bb5]; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
       }
   
       bb4: {
-          _0 = const ();                   // bb4[0]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
+          _0 = const ();                   // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          goto -> bb6;                     // bb4[1]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
+          goto -> bb6;                     // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
       }
   
       bb5: {
-          _0 = const ();                   // bb5[0]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10
+          _0 = const ();                   // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify-locals-fixedpoint.rs:5:21: 7:10
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          goto -> bb6;                     // bb5[1]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
+          goto -> bb6;                     // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
       }
   
       bb6: {
-          StorageDead(_7);                 // bb6[0]: scope 1 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
-          StorageDead(_6);                 // bb6[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
-          goto -> bb7;                     // bb6[2]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
+          StorageDead(_7);                 // scope 1 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
+          StorageDead(_6);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:8:5: 8:6
+          goto -> bb7;                     // scope 0 at $DIR/simplify-locals-fixedpoint.rs:4:5: 8:6
       }
   
       bb7: {
-          drop(_1) -> bb8;                 // bb7[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:1: 9:2
+          drop(_1) -> bb8;                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:1: 9:2
       }
   
       bb8: {
-          StorageDead(_1);                 // bb8[0]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:1: 9:2
-          return;                          // bb8[1]: scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:2: 9:2
+          StorageDead(_1);                 // scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:1: 9:2
+          return;                          // scope 0 at $DIR/simplify-locals-fixedpoint.rs:9:2: 9:2
       }
   }
   
index 855ead7ea0554cb45c30faecbbcefdf7f7a1012b..0742f655730c51aa277365ba9fc8d29534dba540 100644 (file)
       }
   
       bb0: {
--         StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
--         StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
--         _2 = const ();                   // bb0[2]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
-+         StorageLive(_1);                 // bb0[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
-+         _1 = const use_zst(const ((), ())) -> bb1; // bb0[1]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
+-         StorageLive(_1);                 // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
+-         StorageLive(_2);                 // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
+-         _2 = const ();                   // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
++         StorageLive(_1);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
++         _1 = const use_zst(const ((), ())) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
                                            // ty::Const
 -                                          // + ty: ()
 -                                          // + val: Value(Scalar(<ZST>))
 -                                          // mir::Constant
 -                                          // + span: $DIR/simplify-locals-removes-unused-consts.rs:13:21: 13:23
 -                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         StorageLive(_3);                 // bb0[3]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
--         _3 = const ();                   // bb0[4]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
+-         StorageLive(_3);                 // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
+-         _3 = const ();                   // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
 -                                          // ty::Const
 -                                          // + ty: ()
 -                                          // + val: Value(Scalar(<ZST>))
 -                                          // mir::Constant
 -                                          // + span: $DIR/simplify-locals-removes-unused-consts.rs:13:25: 13:27
 -                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         _1 = const ((), ());             // bb0[5]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
+-         _1 = const ((), ());             // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
 -                                          // ty::Const
 -                                          // + ty: ((), ())
 -                                          // + val: Value(Scalar(<ZST>))
 -                                          // mir::Constant
 -                                          // + span: $DIR/simplify-locals-removes-unused-consts.rs:13:20: 13:28
 -                                          // + literal: Const { ty: ((), ()), val: Value(Scalar(<ZST>)) }
--         StorageDead(_3);                 // bb0[6]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:27: 13:28
--         StorageDead(_2);                 // bb0[7]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:27: 13:28
--         StorageDead(_1);                 // bb0[8]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:28: 13:29
--         StorageLive(_4);                 // bb0[9]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
--         StorageLive(_6);                 // bb0[10]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
--         _6 = const ();                   // bb0[11]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
+-         StorageDead(_3);                 // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:27: 13:28
+-         StorageDead(_2);                 // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:27: 13:28
+-         StorageDead(_1);                 // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:13:28: 13:29
+-         StorageLive(_4);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
+-         StorageLive(_6);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
+-         _6 = const ();                   // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
 -                                          // ty::Const
 -                                          // + ty: ()
 -                                          // + val: Value(Scalar(<ZST>))
 -                                          // mir::Constant
 -                                          // + span: $DIR/simplify-locals-removes-unused-consts.rs:14:14: 14:16
 -                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         StorageLive(_7);                 // bb0[12]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
--         _7 = const ();                   // bb0[13]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
+-         StorageLive(_7);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
+-         _7 = const ();                   // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
 -                                          // ty::Const
 -                                          // + ty: ()
 -                                          // + val: Value(Scalar(<ZST>))
 -                                          // mir::Constant
 -                                          // + span: $DIR/simplify-locals-removes-unused-consts.rs:14:18: 14:20
 -                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         StorageDead(_7);                 // bb0[14]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:20: 14:21
--         StorageDead(_6);                 // bb0[15]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:20: 14:21
--         _4 = const use_zst(const ((), ())) -> bb1; // bb0[16]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
+-         StorageDead(_7);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:20: 14:21
+-         StorageDead(_6);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:20: 14:21
+-         _4 = const use_zst(const ((), ())) -> bb1; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:5: 14:22
 -                                          // ty::Const
                                            // + ty: fn(((), ())) {use_zst}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
--         StorageDead(_4);                 // bb1[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
--         StorageLive(_8);                 // bb1[1]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
--         StorageLive(_10);                // bb1[2]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
--         StorageLive(_11);                // bb1[3]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
--         _11 = const Temp { x: 40u8 };    // bb1[4]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
-+         StorageDead(_1);                 // bb1[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
-+         StorageLive(_2);                 // bb1[1]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
-+         _2 = const use_u8(const 42u8) -> bb2; // bb1[2]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
+-         StorageDead(_4);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
+-         StorageLive(_8);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
+-         StorageLive(_10);                // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
+-         StorageLive(_11);                // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
+-         _11 = const Temp { x: 40u8 };    // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
++         StorageDead(_1);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
++         StorageLive(_2);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
++         _2 = const use_u8(const 42u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
                                            // ty::Const
 -                                          // + ty: Temp
 -                                          // + val: Value(Scalar(0x28))
 -                                          // mir::Constant
 -                                          // + span: $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
 -                                          // + literal: Const { ty: Temp, val: Value(Scalar(0x28)) }
--         _10 = const 40u8;                // bb1[5]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
+-         _10 = const 40u8;                // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
 -                                          // ty::Const
 -                                          // + ty: u8
 -                                          // + val: Value(Scalar(0x28))
 -                                          // mir::Constant
 -                                          // + span: $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
 -                                          // + literal: Const { ty: u8, val: Value(Scalar(0x28)) }
--         StorageDead(_10);                // bb1[6]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:33: 16:34
--         _8 = const use_u8(const 42u8) -> bb2; // bb1[7]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
+-         StorageDead(_10);                // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:33: 16:34
+-         _8 = const use_u8(const 42u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
 -                                          // ty::Const
                                            // + ty: fn(u8) {use_u8}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb2: {
--         StorageDead(_11);                // bb2[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
--         StorageDead(_8);                 // bb2[1]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
--         _0 = const ();                   // bb2[2]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2
-+         StorageDead(_2);                 // bb2[0]: scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
-+         _0 = const ();                   // bb2[1]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2
+-         StorageDead(_11);                // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
+-         StorageDead(_8);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
++         StorageDead(_2);                 // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:35: 16:36
+          _0 = const ();                   // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify-locals-removes-unused-consts.rs:12:11: 17:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         return;                          // bb2[3]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2
-+         return;                          // bb2[2]: scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2
+          return;                          // scope 0 at $DIR/simplify-locals-removes-unused-consts.rs:17:2: 17:2
       }
   }
   
index bba8bc82fe7d9b06de710a32313dd056f76875f6..0ca54af85e3b6c5d9eaeaf5fe48ab96f7d8ab83a 100644 (file)
       }
   
       bb0: {
-          _2 = discriminant(_1);           // bb0[0]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
-          switchInt(move _2) -> [0isize: bb2, otherwise: bb1]; // bb0[1]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
+          _2 = discriminant(_1);           // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
+          switchInt(move _2) -> [0isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
       }
   
       bb1: {
-          _0 = move _1;                    // bb1[0]: scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
-          goto -> bb3;                     // bb1[1]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
+          _0 = move _1;                    // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
+          goto -> bb3;                     // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
       }
   
       bb2: {
-          discriminant(_0) = 0;            // bb2[0]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:17: 3:21
-          goto -> bb3;                     // bb2[1]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
+          discriminant(_0) = 0;            // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:17: 3:21
+          goto -> bb3;                     // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
       }
   
       bb3: {
--         _5 = discriminant(_1);           // bb3[0]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
--         return;                          // bb3[1]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
-+         return;                          // bb3[0]: scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
+-         _5 = discriminant(_1);           // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
+          return;                          // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
       }
   }
   
index ecac835fb87ef01869091e55f2f6c6e3ebc4a3a5..3b472ed3a0376a99d99cc469e216345578337a99 100644 (file)
@@ -8,14 +8,13 @@
       let mut _3: !;                       // in scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10
   
       bb0: {
--         goto -> bb1;                     // bb0[0]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+-         goto -> bb1;                     // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
 -     }
 - 
 -     bb1: {
--         StorageLive(_2);                 // bb1[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
--         _2 = const bar() -> bb3;         // bb1[1]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+         StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+         _2 = const bar() -> bb1;         // bb0[1]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+          StorageLive(_2);                 // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+-         _2 = const bar() -> bb3;         // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
++         _2 = const bar() -> bb1;         // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
                                            // ty::Const
                                            // + ty: fn() -> bool {bar}
                                            // + val: Value(Scalar(<ZST>))
       }
   
 -     bb2 (cleanup): {
--         resume;                          // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
+-         resume;                          // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
 +     bb1: {
-+         switchInt(_2) -> [false: bb2, otherwise: bb3]; // bb1[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
++         switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
       }
   
 -     bb3: {
--         nop;                             // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
--         switchInt(_2) -> [false: bb5, otherwise: bb4]; // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+-         nop;                             // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+-         switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
 -     }
 - 
 -     bb4: {
--         goto -> bb6;                     // bb4[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+-         goto -> bb6;                     // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
 -     }
 - 
 -     bb5: {
--         _1 = const ();                   // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
 +     bb2: {
-+         _1 = const ();                   // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+          _1 = const ();                   // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify_cfg.rs:7:9: 9:10
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         StorageDead(_2);                 // bb5[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
--         goto -> bb0;                     // bb5[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
-+         StorageDead(_2);                 // bb2[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-+         goto -> bb0;                     // bb2[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+          StorageDead(_2);                 // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
+          goto -> bb0;                     // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
       }
   
 -     bb6: {
--         _0 = const ();                   // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
 +     bb3: {
-+         _0 = const ();                   // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+          _0 = const ();                   // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify_cfg.rs:8:13: 8:18
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         StorageDead(_2);                 // bb6[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
--         return;                          // bb6[2]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
-+         StorageDead(_2);                 // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-+         return;                          // bb3[2]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
+          StorageDead(_2);                 // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
+          return;                          // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
       }
   }
   
index 7c8bdde5418c2c1f18dccb99af6489282c33c3b7..0cc2258f46364dcdb4fd3b0ddf7c2c0a9f8e0b4e 100644 (file)
@@ -8,23 +8,22 @@
       let mut _3: !;                       // in scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10
   
       bb0: {
--         goto -> bb1;                     // bb0[0]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
-+         falseUnwind -> [real: bb1, cleanup: bb2]; // bb0[0]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+-         goto -> bb1;                     // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
++         falseUnwind -> [real: bb1, cleanup: bb2]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
       }
   
       bb1: {
--         falseUnwind -> [real: bb3, cleanup: bb4]; // bb1[0]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+-         falseUnwind -> [real: bb3, cleanup: bb4]; // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
 -     }
 - 
 -     bb2: {
--         goto -> bb13;                    // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
+-         goto -> bb13;                    // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
 -     }
 - 
 -     bb3: {
--         StorageLive(_2);                 // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
--         _2 = const bar() -> [return: bb5, unwind: bb4]; // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+         StorageLive(_2);                 // bb1[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+         _2 = const bar() -> [return: bb3, unwind: bb2]; // bb1[1]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+          StorageLive(_2);                 // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+-         _2 = const bar() -> [return: bb5, unwind: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
++         _2 = const bar() -> [return: bb3, unwind: bb2]; // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
                                            // ty::Const
                                            // + ty: fn() -> bool {bar}
                                            // + val: Value(Scalar(<ZST>))
       }
   
 -     bb4 (cleanup): {
--         resume;                          // bb4[0]: scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
 +     bb2 (cleanup): {
-+         resume;                          // bb2[0]: scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
+          resume;                          // scope 0 at $DIR/simplify_cfg.rs:5:1: 11:2
       }
   
 -     bb5: {
--         FakeRead(ForMatchedPlace, _2);   // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
--         switchInt(_2) -> [false: bb7, otherwise: bb6]; // bb5[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
 +     bb3: {
-+         FakeRead(ForMatchedPlace, _2);   // bb3[0]: scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
-+         switchInt(_2) -> [false: bb5, otherwise: bb4]; // bb3[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+          FakeRead(ForMatchedPlace, _2);   // scope 0 at $DIR/simplify_cfg.rs:7:12: 7:17
+-         switchInt(_2) -> [false: bb7, otherwise: bb6]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
++         switchInt(_2) -> [false: bb5, otherwise: bb4]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
       }
   
 -     bb6: {
--         falseEdges -> [real: bb8, imaginary: bb7]; // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+-         falseEdges -> [real: bb8, imaginary: bb7]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
 +     bb4: {
-+         falseEdges -> [real: bb6, imaginary: bb5]; // bb4[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
++         falseEdges -> [real: bb6, imaginary: bb5]; // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
       }
   
 -     bb7: {
--         _1 = const ();                   // bb7[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
 +     bb5: {
-+         _1 = const ();                   // bb5[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+          _1 = const ();                   // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify_cfg.rs:7:9: 9:10
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         goto -> bb12;                    // bb7[1]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
-+         StorageDead(_2);                 // bb5[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-+         goto -> bb0;                     // bb5[2]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+-         goto -> bb12;                    // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
++         StorageDead(_2);                 // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
++         goto -> bb0;                     // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
       }
   
 -     bb8: {
--         _0 = const ();                   // bb8[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
 +     bb6: {
-+         _0 = const ();                   // bb6[0]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+          _0 = const ();                   // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify_cfg.rs:8:13: 8:18
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         goto -> bb9;                     // bb8[1]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+-         goto -> bb9;                     // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
 -     }
 - 
 -     bb9: {
--         StorageDead(_2);                 // bb9[0]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
--         goto -> bb2;                     // bb9[1]: scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
+          StorageDead(_2);                 // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
+-         goto -> bb2;                     // scope 0 at $DIR/simplify_cfg.rs:8:13: 8:18
 -     }
 - 
 -     bb10: {
--         unreachable;                     // bb10[0]: scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10
+-         unreachable;                     // scope 0 at $DIR/simplify_cfg.rs:7:18: 9:10
 -     }
 - 
 -     bb11: {
--         goto -> bb12;                    // bb11[0]: scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
+-         goto -> bb12;                    // scope 0 at $DIR/simplify_cfg.rs:7:9: 9:10
 -     }
 - 
 -     bb12: {
--         StorageDead(_2);                 // bb12[0]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
--         goto -> bb1;                     // bb12[1]: scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
+-         StorageDead(_2);                 // scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
+-         goto -> bb1;                     // scope 0 at $DIR/simplify_cfg.rs:6:5: 10:6
 -     }
 - 
 -     bb13: {
--         return;                          // bb13[0]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
-+         StorageDead(_2);                 // bb6[1]: scope 0 at $DIR/simplify_cfg.rs:10:5: 10:6
-+         return;                          // bb6[2]: scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
+          return;                          // scope 0 at $DIR/simplify_cfg.rs:11:2: 11:2
       }
   }
   
index 2946eb1cc44e162b5d2e24fc1ad98f4ab208423e..e94e49bf0cb4fca56b5c7750e0d7ab57a36caa2b 100644 (file)
@@ -7,38 +7,38 @@
       let _2: ();                          // in scope 0 at $DIR/simplify_if.rs:7:9: 7:15
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/simplify_if.rs:6:8: 6:13
-          _1 = const false;                // bb0[1]: scope 0 at $DIR/simplify_if.rs:6:8: 6:13
+          StorageLive(_1);                 // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
+          _1 = const false;                // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
                                            // ty::Const
                                            // + ty: bool
                                            // + val: Value(Scalar(0x00))
                                            // mir::Constant
                                            // + span: $DIR/simplify_if.rs:6:8: 6:13
                                            // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
--         switchInt(const false) -> [false: bb1, otherwise: bb2]; // bb0[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
+-         switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
 -                                          // ty::Const
 -                                          // + ty: bool
 -                                          // + val: Value(Scalar(0x00))
 -                                          // mir::Constant
 -                                          // + span: $DIR/simplify_if.rs:6:5: 8:6
 -                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+         goto -> bb1;                     // bb0[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
++         goto -> bb1;                     // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
       }
   
       bb1: {
-          _0 = const ();                   // bb1[0]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
+          _0 = const ();                   // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify_if.rs:6:5: 8:6
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          goto -> bb4;                     // bb1[1]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
+          goto -> bb4;                     // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
       }
   
       bb2: {
-          StorageLive(_2);                 // bb2[0]: scope 0 at $DIR/simplify_if.rs:7:9: 7:15
-          _2 = const noop() -> bb3;        // bb2[1]: scope 0 at $DIR/simplify_if.rs:7:9: 7:15
+          StorageLive(_2);                 // scope 0 at $DIR/simplify_if.rs:7:9: 7:15
+          _2 = const noop() -> bb3;        // scope 0 at $DIR/simplify_if.rs:7:9: 7:15
                                            // ty::Const
                                            // + ty: fn() {noop}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb3: {
-          StorageDead(_2);                 // bb3[0]: scope 0 at $DIR/simplify_if.rs:7:15: 7:16
-          _0 = const ();                   // bb3[1]: scope 0 at $DIR/simplify_if.rs:6:14: 8:6
+          StorageDead(_2);                 // scope 0 at $DIR/simplify_if.rs:7:15: 7:16
+          _0 = const ();                   // scope 0 at $DIR/simplify_if.rs:6:14: 8:6
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/simplify_if.rs:6:14: 8:6
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          goto -> bb4;                     // bb3[2]: scope 0 at $DIR/simplify_if.rs:6:5: 8:6
+          goto -> bb4;                     // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
       }
   
       bb4: {
-          StorageDead(_1);                 // bb4[0]: scope 0 at $DIR/simplify_if.rs:9:1: 9:2
-          return;                          // bb4[1]: scope 0 at $DIR/simplify_if.rs:9:2: 9:2
+          StorageDead(_1);                 // scope 0 at $DIR/simplify_if.rs:9:1: 9:2
+          return;                          // scope 0 at $DIR/simplify_if.rs:9:2: 9:2
       }
   }
   
index 233f9ff4c400bb5662a12285b1f72a649d77640e..b8e1ea6f981faa1b4ae181b396c0f3cc1118324d 100644 (file)
@@ -1,7 +1,7 @@
 #[inline(never)]
 fn noop() {}
 
-// EMIT_MIR rustc.main.SimplifyBranches-after-copy-prop.diff
+// EMIT_MIR rustc.main.ConstProp.diff
 fn main() {
     match { let x = false; x } {
         true => noop(),
diff --git a/src/test/mir-opt/simplify_match/rustc.main.ConstProp.diff b/src/test/mir-opt/simplify_match/rustc.main.ConstProp.diff
new file mode 100644 (file)
index 0000000..8003112
--- /dev/null
@@ -0,0 +1,67 @@
+- // MIR for `main` before ConstProp
++ // MIR for `main` after ConstProp
+  
+  fn main() -> () {
+      let mut _0: ();                      // return place in scope 0 at $DIR/simplify_match.rs:5:11: 5:11
+      let mut _1: bool;                    // in scope 0 at $DIR/simplify_match.rs:6:11: 6:31
+      let _2: bool;                        // in scope 0 at $DIR/simplify_match.rs:6:17: 6:18
+      scope 1 {
+          debug x => _2;                   // in scope 1 at $DIR/simplify_match.rs:6:17: 6:18
+      }
+  
+      bb0: {
+          StorageLive(_1);                 // scope 0 at $DIR/simplify_match.rs:6:11: 6:31
+          StorageLive(_2);                 // scope 0 at $DIR/simplify_match.rs:6:17: 6:18
+          _2 = const false;                // scope 0 at $DIR/simplify_match.rs:6:21: 6:26
+                                           // ty::Const
+                                           // + ty: bool
+                                           // + val: Value(Scalar(0x00))
+                                           // mir::Constant
+                                           // + span: $DIR/simplify_match.rs:6:21: 6:26
+                                           // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+-         _1 = _2;                         // scope 1 at $DIR/simplify_match.rs:6:28: 6:29
++         _1 = const false;                // scope 1 at $DIR/simplify_match.rs:6:28: 6:29
++                                          // ty::Const
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
++                                          // mir::Constant
++                                          // + span: $DIR/simplify_match.rs:6:28: 6:29
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+          StorageDead(_2);                 // scope 0 at $DIR/simplify_match.rs:6:30: 6:31
+-         switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:7:9: 7:13
++         switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:7:9: 7:13
++                                          // ty::Const
++                                          // + ty: bool
++                                          // + val: Value(Scalar(0x00))
++                                          // mir::Constant
++                                          // + span: $DIR/simplify_match.rs:7:9: 7:13
++                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+      }
+  
+      bb1: {
+          _0 = const ();                   // scope 0 at $DIR/simplify_match.rs:8:18: 8:20
+                                           // ty::Const
+                                           // + ty: ()
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/simplify_match.rs:8:18: 8:20
+                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
+          goto -> bb3;                     // scope 0 at $DIR/simplify_match.rs:6:5: 9:6
+      }
+  
+      bb2: {
+          _0 = const noop() -> bb3;        // scope 0 at $DIR/simplify_match.rs:7:17: 7:23
+                                           // ty::Const
+                                           // + ty: fn() {noop}
+                                           // + val: Value(Scalar(<ZST>))
+                                           // mir::Constant
+                                           // + span: $DIR/simplify_match.rs:7:17: 7:21
+                                           // + literal: Const { ty: fn() {noop}, val: Value(Scalar(<ZST>)) }
+      }
+  
+      bb3: {
+          StorageDead(_1);                 // scope 0 at $DIR/simplify_match.rs:10:1: 10:2
+          return;                          // scope 0 at $DIR/simplify_match.rs:10:2: 10:2
+      }
+  }
+  
diff --git a/src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff b/src/test/mir-opt/simplify_match/rustc.main.SimplifyBranches-after-copy-prop.diff
deleted file mode 100644 (file)
index 1c83bb1..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-- // MIR for `main` before SimplifyBranches-after-copy-prop
-+ // MIR for `main` after SimplifyBranches-after-copy-prop
-  
-  fn main() -> () {
-      let mut _0: ();                      // return place in scope 0 at $DIR/simplify_match.rs:5:11: 5:11
-      let mut _1: bool;                    // in scope 0 at $DIR/simplify_match.rs:6:11: 6:31
-      let _2: bool;                        // in scope 0 at $DIR/simplify_match.rs:6:17: 6:18
-      scope 1 {
-          debug x => _2;                   // in scope 1 at $DIR/simplify_match.rs:6:17: 6:18
-      }
-  
-      bb0: {
-          nop;                             // bb0[0]: scope 0 at $DIR/simplify_match.rs:6:11: 6:31
-          nop;                             // bb0[1]: scope 0 at $DIR/simplify_match.rs:6:17: 6:18
-          nop;                             // bb0[2]: scope 0 at $DIR/simplify_match.rs:6:21: 6:26
-          nop;                             // bb0[3]: scope 1 at $DIR/simplify_match.rs:6:28: 6:29
-          nop;                             // bb0[4]: scope 0 at $DIR/simplify_match.rs:6:30: 6:31
--         switchInt(const false) -> [false: bb1, otherwise: bb2]; // bb0[5]: scope 0 at $DIR/simplify_match.rs:7:9: 7:13
--                                          // ty::Const
--                                          // + ty: bool
--                                          // + val: Value(Scalar(0x00))
--                                          // mir::Constant
--                                          // + span: $DIR/simplify_match.rs:6:21: 6:26
--                                          // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+         goto -> bb1;                     // bb0[5]: scope 0 at $DIR/simplify_match.rs:7:9: 7:13
-      }
-  
-      bb1: {
-          _0 = const ();                   // bb1[0]: scope 0 at $DIR/simplify_match.rs:8:18: 8:20
-                                           // ty::Const
-                                           // + ty: ()
-                                           // + val: Value(Scalar(<ZST>))
-                                           // mir::Constant
-                                           // + span: $DIR/simplify_match.rs:8:18: 8:20
-                                           // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          goto -> bb3;                     // bb1[1]: scope 0 at $DIR/simplify_match.rs:6:5: 9:6
-      }
-  
-      bb2: {
-          _0 = const noop() -> bb3;        // bb2[0]: scope 0 at $DIR/simplify_match.rs:7:17: 7:23
-                                           // ty::Const
-                                           // + ty: fn() {noop}
-                                           // + val: Value(Scalar(<ZST>))
-                                           // mir::Constant
-                                           // + span: $DIR/simplify_match.rs:7:17: 7:21
-                                           // + literal: Const { ty: fn() {noop}, val: Value(Scalar(<ZST>)) }
-      }
-  
-      bb3: {
-          nop;                             // bb3[0]: scope 0 at $DIR/simplify_match.rs:10:1: 10:2
-          return;                          // bb3[1]: scope 0 at $DIR/simplify_match.rs:10:2: 10:2
-      }
-  }
-  
index a4cc6b817eac8ee0808fc511464e7c4b93b2b52c..20520f7db368e569b9a1ca423e53c9bd5d9af307 100644 (file)
       }
   
       bb0: {
-          _5 = discriminant(_1);           // bb0[0]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
-          switchInt(move _5) -> [0isize: bb1, otherwise: bb2]; // bb0[1]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+          _5 = discriminant(_1);           // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+          switchInt(move _5) -> [0isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
       }
   
       bb1: {
--         _10 = ((_1 as Ok).0: u32);       // bb1[0]: scope 0 at $DIR/simplify_try.rs:6:13: 6:15
--         ((_0 as Ok).0: u32) = move _10;  // bb1[1]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
--         discriminant(_0) = 0;            // bb1[2]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-+         _0 = move _1;                    // bb1[0]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-+         nop;                             // bb1[1]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-+         nop;                             // bb1[2]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-          goto -> bb3;                     // bb1[3]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+-         _10 = ((_1 as Ok).0: u32);       // scope 0 at $DIR/simplify_try.rs:6:13: 6:15
+-         ((_0 as Ok).0: u32) = move _10;  // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+-         discriminant(_0) = 0;            // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
++         _0 = move _1;                    // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
++         nop;                             // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
++         nop;                             // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+          goto -> bb3;                     // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
       }
   
       bb2: {
--         _6 = ((_1 as Err).0: i32);       // bb2[0]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
--         ((_0 as Err).0: i32) = move _6;  // bb2[1]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
--         discriminant(_0) = 1;            // bb2[2]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
-+         _0 = move _1;                    // bb2[0]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
-+         nop;                             // bb2[1]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
-+         nop;                             // bb2[2]: scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
-          goto -> bb3;                     // bb2[3]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+-         _6 = ((_1 as Err).0: i32);       // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+-         ((_0 as Err).0: i32) = move _6;  // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
+-         discriminant(_0) = 1;            // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
++         _0 = move _1;                    // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
++         nop;                             // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
++         nop;                             // scope 8 at $SRC_DIR/libcore/result.rs:LL:COL
+          goto -> bb3;                     // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
       }
   
       bb3: {
-          return;                          // bb3[0]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+          return;                          // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
       }
   }
   
index a18fb641f94b334ea076df3f86623cdb173759f5..e5661a47201d908ecc515cbf60d9ba1204ad2cb6 100644 (file)
@@ -38,18 +38,18 @@ fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i
     }
 
     bb0: {
-        _5 = discriminant(_1);           // bb0[0]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
-        goto -> bb1;                     // bb0[1]: scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+        _5 = discriminant(_1);           // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
+        goto -> bb1;                     // scope 0 at $DIR/simplify_try.rs:6:14: 6:15
     }
 
     bb1: {
-        _0 = move _1;                    // bb1[0]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-        nop;                             // bb1[1]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-        nop;                             // bb1[2]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-        goto -> bb2;                     // bb1[3]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+        _0 = move _1;                    // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+        nop;                             // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+        nop;                             // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+        goto -> bb2;                     // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
     }
 
     bb2: {
-        return;                          // bb2[0]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+        return;                          // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
     }
 }
index b7ed760f6d65634197deb6c0da3cb6f97dfd152a..989931ed0eaf755b9b94375c9df5ef8328625bde 100644 (file)
@@ -29,7 +29,7 @@ fn try_identity(_1: std::result::Result<u32, i32>) -> std::result::Result<u32, i
     }
 
     bb0: {
-        _0 = move _1;                    // bb0[0]: scope 1 at $DIR/simplify_try.rs:7:5: 7:10
-        return;                          // bb0[1]: scope 0 at $DIR/simplify_try.rs:8:2: 8:2
+        _0 = move _1;                    // scope 1 at $DIR/simplify_try.rs:7:5: 7:10
+        return;                          // scope 0 at $DIR/simplify_try.rs:8:2: 8:2
     }
 }
index e397adcc2ccef341c3a1afc709fd2f5af7ae79d3..e79dcba13b00b78424963297f8043abf0557854f 100644 (file)
@@ -18,114 +18,114 @@ fn std::intrinsics::drop_in_place(_1: *mut [std::string::String]) -> () {
     let mut _15: *mut [std::string::String]; // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
 
     bb0: {
-        goto -> bb15;                    // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb15;                    // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb1: {
-        return;                          // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        return;                          // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb2 (cleanup): {
-        resume;                          // bb2[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        resume;                          // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb3 (cleanup): {
-        _5 = &raw mut (*_1)[_4];         // bb3[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _4 = Add(move _4, const 1usize); // bb3[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _5 = &raw mut (*_1)[_4];         // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _4 = Add(move _4, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
-        drop((*_5)) -> bb4;              // bb3[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop((*_5)) -> bb4;              // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb4 (cleanup): {
-        _6 = Eq(_4, _3);                 // bb4[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _6) -> [false: bb3, otherwise: bb2]; // bb4[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _6 = Eq(_4, _3);                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _6) -> [false: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb5: {
-        _7 = &raw mut (*_1)[_4];         // bb5[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _4 = Add(move _4, const 1usize); // bb5[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _7 = &raw mut (*_1)[_4];         // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _4 = Add(move _4, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
-        drop((*_7)) -> [return: bb6, unwind: bb4]; // bb5[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop((*_7)) -> [return: bb6, unwind: bb4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb6: {
-        _8 = Eq(_4, _3);                 // bb6[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _8) -> [false: bb5, otherwise: bb1]; // bb6[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _8 = Eq(_4, _3);                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _8) -> [false: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb7: {
-        _4 = const 0usize;               // bb7[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _4 = const 0usize;               // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
-        goto -> bb6;                     // bb7[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb6;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb8: {
-        goto -> bb7;                     // bb8[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb7;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb9 (cleanup): {
-        _11 = _9;                        // bb9[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _9 = Offset(move _9, const 1usize); // bb9[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _11 = _9;                        // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _9 = Offset(move _9, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
-        drop((*_11)) -> bb10;            // bb9[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop((*_11)) -> bb10;            // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb10 (cleanup): {
-        _12 = Eq(_9, _10);               // bb10[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _12) -> [false: bb9, otherwise: bb2]; // bb10[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _12 = Eq(_9, _10);               // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _12) -> [false: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb11: {
-        _13 = _9;                        // bb11[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _9 = Offset(move _9, const 1usize); // bb11[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _13 = _9;                        // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _9 = Offset(move _9, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
-        drop((*_13)) -> [return: bb12, unwind: bb10]; // bb11[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop((*_13)) -> [return: bb12, unwind: bb10]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb12: {
-        _14 = Eq(_9, _10);               // bb12[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _14) -> [false: bb11, otherwise: bb1]; // bb12[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _14 = Eq(_9, _10);               // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _14) -> [false: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb13: {
-        _15 = &raw mut (*_1);            // bb13[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _9 = move _15 as *mut std::string::String (Misc); // bb13[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _10 = Offset(_9, move _3);       // bb13[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        goto -> bb12;                    // bb13[3]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _15 = &raw mut (*_1);            // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _9 = move _15 as *mut std::string::String (Misc); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _10 = Offset(_9, move _3);       // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb12;                    // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb14: {
-        goto -> bb13;                    // bb14[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb13;                    // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb15: {
-        _2 = SizeOf(std::string::String); // bb15[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _3 = Len((*_1));                 // bb15[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _2) -> [0usize: bb8, otherwise: bb14]; // bb15[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _2 = SizeOf(std::string::String); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _3 = Len((*_1));                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _2) -> [0usize: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 }
index fd2bfe46c5aba69ebde6b6edf68b4bca6d2f9fb5..604a0228f63cf0e5ffe7fa37afae3014a6f35027 100644 (file)
@@ -18,114 +18,114 @@ fn std::intrinsics::drop_in_place(_1: *mut [std::string::String]) -> () {
     let mut _15: *mut [std::string::String]; // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
 
     bb0: {
-        goto -> bb15;                    // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb15;                    // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb1: {
-        return;                          // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        return;                          // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb2 (cleanup): {
-        resume;                          // bb2[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        resume;                          // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb3 (cleanup): {
-        _5 = &raw mut (*_1)[_4];         // bb3[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _4 = Add(move _4, const 1usize); // bb3[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _5 = &raw mut (*_1)[_4];         // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _4 = Add(move _4, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000001))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
-        drop((*_5)) -> bb4;              // bb3[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop((*_5)) -> bb4;              // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb4 (cleanup): {
-        _6 = Eq(_4, _3);                 // bb4[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _6) -> [false: bb3, otherwise: bb2]; // bb4[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _6 = Eq(_4, _3);                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _6) -> [false: bb3, otherwise: bb2]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb5: {
-        _7 = &raw mut (*_1)[_4];         // bb5[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _4 = Add(move _4, const 1usize); // bb5[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _7 = &raw mut (*_1)[_4];         // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _4 = Add(move _4, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000001))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
-        drop((*_7)) -> [return: bb6, unwind: bb4]; // bb5[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop((*_7)) -> [return: bb6, unwind: bb4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb6: {
-        _8 = Eq(_4, _3);                 // bb6[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _8) -> [false: bb5, otherwise: bb1]; // bb6[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _8 = Eq(_4, _3);                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _8) -> [false: bb5, otherwise: bb1]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb7: {
-        _4 = const 0usize;               // bb7[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _4 = const 0usize;               // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000000))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
-        goto -> bb6;                     // bb7[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb6;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb8: {
-        goto -> bb7;                     // bb8[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb7;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb9 (cleanup): {
-        _11 = _9;                        // bb9[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _9 = Offset(move _9, const 1usize); // bb9[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _11 = _9;                        // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _9 = Offset(move _9, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000001))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
-        drop((*_11)) -> bb10;            // bb9[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop((*_11)) -> bb10;            // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb10 (cleanup): {
-        _12 = Eq(_9, _10);               // bb10[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _12) -> [false: bb9, otherwise: bb2]; // bb10[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _12 = Eq(_9, _10);               // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _12) -> [false: bb9, otherwise: bb2]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb11: {
-        _13 = _9;                        // bb11[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _9 = Offset(move _9, const 1usize); // bb11[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _13 = _9;                        // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _9 = Offset(move _9, const 1usize); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: usize
                                          // + val: Value(Scalar(0x0000000000000001))
                                          // mir::Constant
                                          // + span: $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
-        drop((*_13)) -> [return: bb12, unwind: bb10]; // bb11[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop((*_13)) -> [return: bb12, unwind: bb10]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb12: {
-        _14 = Eq(_9, _10);               // bb12[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _14) -> [false: bb11, otherwise: bb1]; // bb12[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _14 = Eq(_9, _10);               // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _14) -> [false: bb11, otherwise: bb1]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb13: {
-        _15 = &raw mut (*_1);            // bb13[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _9 = move _15 as *mut std::string::String (Misc); // bb13[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _10 = Offset(_9, move _3);       // bb13[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        goto -> bb12;                    // bb13[3]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _15 = &raw mut (*_1);            // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _9 = move _15 as *mut std::string::String (Misc); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _10 = Offset(_9, move _3);       // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb12;                    // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb14: {
-        goto -> bb13;                    // bb14[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb13;                    // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb15: {
-        _2 = SizeOf(std::string::String); // bb15[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _3 = Len((*_1));                 // bb15[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        switchInt(move _2) -> [0usize: bb8, otherwise: bb14]; // bb15[2]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _2 = SizeOf(std::string::String); // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _3 = Len((*_1));                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        switchInt(move _2) -> [0usize: bb8, otherwise: bb14]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 }
index 5ea1e431d192b987f8472cce45638e386b3824d5..e7815da73aa151dd2151ae867532aa0c10d351ac 100644 (file)
@@ -52,14 +52,14 @@ static XXX: &Foo = {
     let mut _48: (u32, u32);             // in scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:29: 23:2
-        StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
-        StorageLive(_4);                 // bb0[3]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
-        StorageLive(_5);                 // bb0[4]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
-        StorageLive(_6);                 // bb0[5]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
-        StorageLive(_7);                 // bb0[6]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
-        _7 = (const 0u32, const 1u32);   // bb0[7]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
+        StorageLive(_1);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
+        StorageLive(_2);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:29: 23:2
+        StorageLive(_3);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+        StorageLive(_4);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+        StorageLive(_5);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+        StorageLive(_6);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
+        StorageLive(_7);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
+        _7 = (const 0u32, const 1u32);   // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -72,8 +72,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:8:13: 8:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_8);                 // bb0[8]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
-        _8 = (const 0u32, const 2u32);   // bb0[9]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
+        StorageLive(_8);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
+        _8 = (const 0u32, const 2u32);   // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -86,8 +86,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:8:21: 8:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_9);                 // bb0[10]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
-        _9 = (const 0u32, const 3u32);   // bb0[11]: scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
+        StorageLive(_9);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
+        _9 = (const 0u32, const 3u32);   // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -100,8 +100,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:8:29: 8:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_10);                // bb0[12]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
-        _10 = (const 0u32, const 1u32);  // bb0[13]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
+        StorageLive(_10);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
+        _10 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -114,8 +114,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:9:13: 9:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_11);                // bb0[14]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
-        _11 = (const 0u32, const 2u32);  // bb0[15]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
+        StorageLive(_11);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
+        _11 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -128,8 +128,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:9:21: 9:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_12);                // bb0[16]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
-        _12 = (const 0u32, const 3u32);  // bb0[17]: scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
+        StorageLive(_12);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
+        _12 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -142,8 +142,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:9:29: 9:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_13);                // bb0[18]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
-        _13 = (const 0u32, const 1u32);  // bb0[19]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
+        StorageLive(_13);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
+        _13 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -156,8 +156,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:10:13: 10:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_14);                // bb0[20]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
-        _14 = (const 0u32, const 2u32);  // bb0[21]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
+        StorageLive(_14);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
+        _14 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -170,8 +170,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:10:21: 10:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_15);                // bb0[22]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
-        _15 = (const 0u32, const 3u32);  // bb0[23]: scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
+        StorageLive(_15);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
+        _15 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -184,8 +184,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:10:29: 10:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_16);                // bb0[24]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
-        _16 = (const 0u32, const 1u32);  // bb0[25]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
+        StorageLive(_16);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
+        _16 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -198,8 +198,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:11:13: 11:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_17);                // bb0[26]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
-        _17 = (const 0u32, const 2u32);  // bb0[27]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
+        StorageLive(_17);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
+        _17 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -212,8 +212,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:11:21: 11:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_18);                // bb0[28]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
-        _18 = (const 0u32, const 3u32);  // bb0[29]: scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
+        StorageLive(_18);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
+        _18 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -226,8 +226,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:11:29: 11:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_19);                // bb0[30]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
-        _19 = (const 0u32, const 1u32);  // bb0[31]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
+        StorageLive(_19);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
+        _19 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -240,8 +240,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:12:13: 12:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_20);                // bb0[32]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
-        _20 = (const 0u32, const 2u32);  // bb0[33]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
+        StorageLive(_20);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
+        _20 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -254,8 +254,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:12:21: 12:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_21);                // bb0[34]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
-        _21 = (const 0u32, const 3u32);  // bb0[35]: scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
+        StorageLive(_21);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
+        _21 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -268,8 +268,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:12:29: 12:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_22);                // bb0[36]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
-        _22 = (const 0u32, const 1u32);  // bb0[37]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
+        StorageLive(_22);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
+        _22 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -282,8 +282,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:13:13: 13:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_23);                // bb0[38]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
-        _23 = (const 0u32, const 2u32);  // bb0[39]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
+        StorageLive(_23);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
+        _23 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -296,8 +296,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:13:21: 13:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_24);                // bb0[40]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
-        _24 = (const 0u32, const 3u32);  // bb0[41]: scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
+        StorageLive(_24);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
+        _24 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -310,8 +310,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:13:29: 13:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_25);                // bb0[42]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
-        _25 = (const 0u32, const 1u32);  // bb0[43]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
+        StorageLive(_25);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
+        _25 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -324,8 +324,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:14:13: 14:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_26);                // bb0[44]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
-        _26 = (const 0u32, const 2u32);  // bb0[45]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
+        StorageLive(_26);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
+        _26 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -338,8 +338,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:14:21: 14:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_27);                // bb0[46]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
-        _27 = (const 0u32, const 3u32);  // bb0[47]: scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
+        StorageLive(_27);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
+        _27 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -352,8 +352,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:14:29: 14:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_28);                // bb0[48]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
-        _28 = (const 0u32, const 1u32);  // bb0[49]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
+        StorageLive(_28);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
+        _28 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -366,8 +366,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:15:13: 15:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_29);                // bb0[50]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
-        _29 = (const 0u32, const 2u32);  // bb0[51]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
+        StorageLive(_29);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
+        _29 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -380,8 +380,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:15:21: 15:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_30);                // bb0[52]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
-        _30 = (const 0u32, const 3u32);  // bb0[53]: scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
+        StorageLive(_30);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
+        _30 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -394,8 +394,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:15:29: 15:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_31);                // bb0[54]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
-        _31 = (const 0u32, const 1u32);  // bb0[55]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
+        StorageLive(_31);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
+        _31 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -408,8 +408,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:16:13: 16:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_32);                // bb0[56]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
-        _32 = (const 0u32, const 2u32);  // bb0[57]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
+        StorageLive(_32);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
+        _32 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -422,8 +422,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:16:21: 16:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_33);                // bb0[58]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
-        _33 = (const 0u32, const 3u32);  // bb0[59]: scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
+        StorageLive(_33);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
+        _33 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -436,8 +436,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:16:29: 16:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_34);                // bb0[60]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
-        _34 = (const 0u32, const 1u32);  // bb0[61]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
+        StorageLive(_34);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
+        _34 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -450,8 +450,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:17:13: 17:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_35);                // bb0[62]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
-        _35 = (const 0u32, const 2u32);  // bb0[63]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
+        StorageLive(_35);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
+        _35 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -464,8 +464,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:17:21: 17:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_36);                // bb0[64]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
-        _36 = (const 0u32, const 3u32);  // bb0[65]: scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
+        StorageLive(_36);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
+        _36 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -478,8 +478,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:17:29: 17:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_37);                // bb0[66]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
-        _37 = (const 0u32, const 1u32);  // bb0[67]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
+        StorageLive(_37);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
+        _37 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -492,8 +492,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:18:13: 18:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_38);                // bb0[68]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
-        _38 = (const 0u32, const 2u32);  // bb0[69]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
+        StorageLive(_38);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
+        _38 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -506,8 +506,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:18:21: 18:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_39);                // bb0[70]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
-        _39 = (const 0u32, const 3u32);  // bb0[71]: scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
+        StorageLive(_39);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
+        _39 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -520,8 +520,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:18:29: 18:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_40);                // bb0[72]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
-        _40 = (const 0u32, const 1u32);  // bb0[73]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
+        StorageLive(_40);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
+        _40 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -534,8 +534,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:19:13: 19:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_41);                // bb0[74]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
-        _41 = (const 0u32, const 2u32);  // bb0[75]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
+        StorageLive(_41);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
+        _41 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -548,8 +548,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:19:21: 19:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_42);                // bb0[76]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
-        _42 = (const 0u32, const 3u32);  // bb0[77]: scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
+        StorageLive(_42);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
+        _42 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -562,8 +562,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:19:29: 19:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_43);                // bb0[78]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
-        _43 = (const 0u32, const 1u32);  // bb0[79]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
+        StorageLive(_43);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
+        _43 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -576,8 +576,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:20:13: 20:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_44);                // bb0[80]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
-        _44 = (const 0u32, const 2u32);  // bb0[81]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
+        StorageLive(_44);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
+        _44 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -590,8 +590,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:20:21: 20:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_45);                // bb0[82]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
-        _45 = (const 0u32, const 3u32);  // bb0[83]: scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
+        StorageLive(_45);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
+        _45 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -604,8 +604,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:20:29: 20:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        StorageLive(_46);                // bb0[84]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
-        _46 = (const 0u32, const 1u32);  // bb0[85]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
+        StorageLive(_46);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
+        _46 = (const 0u32, const 1u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -618,8 +618,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:21:13: 21:14
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-        StorageLive(_47);                // bb0[86]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
-        _47 = (const 0u32, const 2u32);  // bb0[87]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
+        StorageLive(_47);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
+        _47 = (const 0u32, const 2u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -632,8 +632,8 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:21:21: 21:22
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-        StorageLive(_48);                // bb0[88]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
-        _48 = (const 0u32, const 3u32);  // bb0[89]: scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
+        StorageLive(_48);                // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
+        _48 = (const 0u32, const 3u32);  // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
                                          // ty::Const
                                          // + ty: u32
                                          // + val: Value(Scalar(0x00000000))
@@ -646,25 +646,25 @@ static XXX: &Foo = {
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:21:29: 21:30
                                          // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
-        _6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48]; // bb0[90]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
-        _5 = &_6;                        // bb0[91]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
-        _4 = &(*_5);                     // bb0[92]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
-        _3 = move _4 as &[(u32, u32)] (Pointer(Unsize)); // bb0[93]: scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
-        _2 = Foo { tup: const "hi", data: move _3 }; // bb0[94]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:29: 23:2
+        _6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48]; // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
+        _5 = &_6;                        // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+        _4 = &(*_5);                     // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+        _3 = move _4 as &[(u32, u32)] (Pointer(Unsize)); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
+        _2 = Foo { tup: const "hi", data: move _3 }; // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:29: 23:2
                                          // ty::Const
                                          // + ty: &str
                                          // + val: Value(Slice { data: Allocation { bytes: [104, 105], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [3], len: Size { raw: 2 } }, size: Size { raw: 2 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 2 })
                                          // mir::Constant
                                          // + span: $DIR/storage_live_dead_in_statics.rs:6:10: 6:14
                                          // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [104, 105], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [3], len: Size { raw: 2 } }, size: Size { raw: 2 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 2 }) }
-        _1 = &_2;                        // bb0[95]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
-        _0 = &(*_1);                     // bb0[96]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
-        StorageDead(_5);                 // bb0[97]: scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
-        StorageDead(_1);                 // bb0[98]: scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
-        return;                          // bb0[99]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
+        _1 = &_2;                        // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
+        _0 = &(*_1);                     // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:28: 23:2
+        StorageDead(_5);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
+        StorageDead(_1);                 // scope 0 at $DIR/storage_live_dead_in_statics.rs:23:1: 23:2
+        return;                          // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
+        resume;                          // scope 0 at $DIR/storage_live_dead_in_statics.rs:5:1: 23:3
     }
 }
index 799521b09a6fe7d0073b5fae389c559df781e1db..5ffc83158ead2949e9d808c34e9f4a9af18c16ea 100644 (file)
@@ -36,52 +36,52 @@ fn main() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
-        _1 = const 0i32;                 // bb0[1]: scope 0 at $DIR/storage_ranges.rs:4:13: 4:14
+        StorageLive(_1);                 // scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
+        _1 = const 0i32;                 // scope 0 at $DIR/storage_ranges.rs:4:13: 4:14
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000000))
                                          // mir::Constant
                                          // + span: $DIR/storage_ranges.rs:4:13: 4:14
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-        FakeRead(ForLet, _1);            // bb0[2]: scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
-        StorageLive(_2);                 // bb0[3]: scope 1 at $DIR/storage_ranges.rs:5:5: 7:6
-        StorageLive(_3);                 // bb0[4]: scope 1 at $DIR/storage_ranges.rs:6:13: 6:14
-        StorageLive(_4);                 // bb0[5]: scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
-        StorageLive(_5);                 // bb0[6]: scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
-        _5 = _1;                         // bb0[7]: scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
-        _4 = std::option::Option::<i32>::Some(move _5); // bb0[8]: scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
-        StorageDead(_5);                 // bb0[9]: scope 1 at $DIR/storage_ranges.rs:6:24: 6:25
-        _3 = &_4;                        // bb0[10]: scope 1 at $DIR/storage_ranges.rs:6:17: 6:25
-        FakeRead(ForLet, _3);            // bb0[11]: scope 1 at $DIR/storage_ranges.rs:6:13: 6:14
-        _2 = const ();                   // bb0[12]: scope 1 at $DIR/storage_ranges.rs:5:5: 7:6
+        FakeRead(ForLet, _1);            // scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
+        StorageLive(_2);                 // scope 1 at $DIR/storage_ranges.rs:5:5: 7:6
+        StorageLive(_3);                 // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14
+        StorageLive(_4);                 // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
+        StorageLive(_5);                 // scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
+        _5 = _1;                         // scope 1 at $DIR/storage_ranges.rs:6:23: 6:24
+        _4 = std::option::Option::<i32>::Some(move _5); // scope 1 at $DIR/storage_ranges.rs:6:18: 6:25
+        StorageDead(_5);                 // scope 1 at $DIR/storage_ranges.rs:6:24: 6:25
+        _3 = &_4;                        // scope 1 at $DIR/storage_ranges.rs:6:17: 6:25
+        FakeRead(ForLet, _3);            // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14
+        _2 = const ();                   // scope 1 at $DIR/storage_ranges.rs:5:5: 7:6
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/storage_ranges.rs:5:5: 7:6
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_4);                 // bb0[13]: scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
-        StorageDead(_3);                 // bb0[14]: scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
-        StorageDead(_2);                 // bb0[15]: scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
-        StorageLive(_6);                 // bb0[16]: scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
-        _6 = const 1i32;                 // bb0[17]: scope 1 at $DIR/storage_ranges.rs:8:13: 8:14
+        StorageDead(_4);                 // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
+        StorageDead(_3);                 // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
+        StorageDead(_2);                 // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
+        StorageLive(_6);                 // scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
+        _6 = const 1i32;                 // scope 1 at $DIR/storage_ranges.rs:8:13: 8:14
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/storage_ranges.rs:8:13: 8:14
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        FakeRead(ForLet, _6);            // bb0[18]: scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
-        _0 = const ();                   // bb0[19]: scope 0 at $DIR/storage_ranges.rs:3:11: 9:2
+        FakeRead(ForLet, _6);            // scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
+        _0 = const ();                   // scope 0 at $DIR/storage_ranges.rs:3:11: 9:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/storage_ranges.rs:3:11: 9:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_6);                 // bb0[20]: scope 1 at $DIR/storage_ranges.rs:9:1: 9:2
-        StorageDead(_1);                 // bb0[21]: scope 0 at $DIR/storage_ranges.rs:9:1: 9:2
-        return;                          // bb0[22]: scope 0 at $DIR/storage_ranges.rs:9:2: 9:2
+        StorageDead(_6);                 // scope 1 at $DIR/storage_ranges.rs:9:1: 9:2
+        StorageDead(_1);                 // scope 0 at $DIR/storage_ranges.rs:9:1: 9:2
+        return;                          // scope 0 at $DIR/storage_ranges.rs:9:2: 9:2
     }
 }
index b46adadf1016ad16ebc9229a4097b44b1693c469..de29cd61019f11f6929287f5217f2eddc82cd3dc 100644 (file)
@@ -16,102 +16,102 @@ fn move_out_by_subslice() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
-        StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
-        _3 = Box(i32);                   // bb0[3]: scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
-        (*_3) = const 1i32;              // bb0[4]: scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
+        StorageLive(_1);                 // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
+        StorageLive(_2);                 // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
+        StorageLive(_3);                 // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
+        _3 = Box(i32);                   // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
+        (*_3) = const 1i32;              // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/uniform_array_move_out.rs:11:18: 11:19
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        _2 = move _3;                    // bb0[5]: scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
-        drop(_3) -> [return: bb4, unwind: bb2]; // bb0[6]: scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
+        _2 = move _3;                    // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
+        drop(_3) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/uniform_array_move_out.rs:10:1: 13:2
+        resume;                          // scope 0 at $DIR/uniform_array_move_out.rs:10:1: 13:2
     }
 
     bb2 (cleanup): {
-        drop(_2) -> bb1;                 // bb2[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+        drop(_2) -> bb1;                 // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
     }
 
     bb3 (cleanup): {
-        drop(_3) -> bb2;                 // bb3[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
+        drop(_3) -> bb2;                 // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
     }
 
     bb4: {
-        StorageDead(_3);                 // bb4[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
-        StorageLive(_4);                 // bb4[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
-        StorageLive(_5);                 // bb4[2]: scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
-        _5 = Box(i32);                   // bb4[3]: scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
-        (*_5) = const 2i32;              // bb4[4]: scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
+        StorageDead(_3);                 // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
+        StorageLive(_4);                 // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
+        StorageLive(_5);                 // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
+        _5 = Box(i32);                   // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
+        (*_5) = const 2i32;              // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/uniform_array_move_out.rs:11:25: 11:26
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        _4 = move _5;                    // bb4[5]: scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
-        drop(_5) -> [return: bb7, unwind: bb5]; // bb4[6]: scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
+        _4 = move _5;                    // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
+        drop(_5) -> [return: bb7, unwind: bb5]; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
     }
 
     bb5 (cleanup): {
-        drop(_4) -> bb2;                 // bb5[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+        drop(_4) -> bb2;                 // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
     }
 
     bb6 (cleanup): {
-        drop(_5) -> bb5;                 // bb6[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
+        drop(_5) -> bb5;                 // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
     }
 
     bb7: {
-        StorageDead(_5);                 // bb7[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
-        _1 = [move _2, move _4];         // bb7[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:13: 11:27
-        drop(_4) -> [return: bb8, unwind: bb2]; // bb7[2]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+        StorageDead(_5);                 // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
+        _1 = [move _2, move _4];         // scope 0 at $DIR/uniform_array_move_out.rs:11:13: 11:27
+        drop(_4) -> [return: bb8, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
     }
 
     bb8: {
-        StorageDead(_4);                 // bb8[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
-        drop(_2) -> [return: bb9, unwind: bb1]; // bb8[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+        StorageDead(_4);                 // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+        drop(_2) -> [return: bb9, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
     }
 
     bb9: {
-        StorageDead(_2);                 // bb9[0]: scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
-        FakeRead(ForLet, _1);            // bb9[1]: scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
-        StorageLive(_6);                 // bb9[2]: scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
-        _6 = move _1[0..2];              // bb9[3]: scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
-        _0 = const ();                   // bb9[4]: scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2
+        StorageDead(_2);                 // scope 0 at $DIR/uniform_array_move_out.rs:11:26: 11:27
+        FakeRead(ForLet, _1);            // scope 0 at $DIR/uniform_array_move_out.rs:11:9: 11:10
+        StorageLive(_6);                 // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
+        _6 = move _1[0..2];              // scope 1 at $DIR/uniform_array_move_out.rs:12:10: 12:17
+        _0 = const ();                   // scope 0 at $DIR/uniform_array_move_out.rs:10:27: 13:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/uniform_array_move_out.rs:10:27: 13:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        drop(_6) -> [return: bb12, unwind: bb10]; // bb9[5]: scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+        drop(_6) -> [return: bb12, unwind: bb10]; // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
     }
 
     bb10 (cleanup): {
-        drop(_1) -> bb1;                 // bb10[0]: scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+        drop(_1) -> bb1;                 // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
     }
 
     bb11 (cleanup): {
-        drop(_6) -> bb10;                // bb11[0]: scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+        drop(_6) -> bb10;                // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
     }
 
     bb12: {
-        StorageDead(_6);                 // bb12[0]: scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
-        drop(_1) -> [return: bb13, unwind: bb1]; // bb12[1]: scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+        StorageDead(_6);                 // scope 1 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+        drop(_1) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
     }
 
     bb13: {
-        StorageDead(_1);                 // bb13[0]: scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
-        goto -> bb14;                    // bb13[1]: scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
+        StorageDead(_1);                 // scope 0 at $DIR/uniform_array_move_out.rs:13:1: 13:2
+        goto -> bb14;                    // scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
     }
 
     bb14: {
-        return;                          // bb14[0]: scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
+        return;                          // scope 0 at $DIR/uniform_array_move_out.rs:13:2: 13:2
     }
 }
index 851107efe11f258f6c694752d47b33625ac99d98..aeab0e892ae8b8725c6bfa59dcb782fdc0d5f5b4 100644 (file)
@@ -16,102 +16,102 @@ fn move_out_from_end() -> () {
     }
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
-        StorageLive(_3);                 // bb0[2]: scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
-        _3 = Box(i32);                   // bb0[3]: scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
-        (*_3) = const 1i32;              // bb0[4]: scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
+        StorageLive(_1);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
+        StorageLive(_2);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
+        StorageLive(_3);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
+        _3 = Box(i32);                   // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
+        (*_3) = const 1i32;              // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000001))
                                          // mir::Constant
                                          // + span: $DIR/uniform_array_move_out.rs:5:18: 5:19
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-        _2 = move _3;                    // bb0[5]: scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
-        drop(_3) -> [return: bb4, unwind: bb2]; // bb0[6]: scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
+        _2 = move _3;                    // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
+        drop(_3) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/uniform_array_move_out.rs:4:1: 7:2
+        resume;                          // scope 0 at $DIR/uniform_array_move_out.rs:4:1: 7:2
     }
 
     bb2 (cleanup): {
-        drop(_2) -> bb1;                 // bb2[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+        drop(_2) -> bb1;                 // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
     }
 
     bb3 (cleanup): {
-        drop(_3) -> bb2;                 // bb3[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
+        drop(_3) -> bb2;                 // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
     }
 
     bb4: {
-        StorageDead(_3);                 // bb4[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
-        StorageLive(_4);                 // bb4[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
-        StorageLive(_5);                 // bb4[2]: scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
-        _5 = Box(i32);                   // bb4[3]: scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
-        (*_5) = const 2i32;              // bb4[4]: scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
+        StorageDead(_3);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
+        StorageLive(_4);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
+        StorageLive(_5);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
+        _5 = Box(i32);                   // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
+        (*_5) = const 2i32;              // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/uniform_array_move_out.rs:5:25: 5:26
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        _4 = move _5;                    // bb4[5]: scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
-        drop(_5) -> [return: bb7, unwind: bb5]; // bb4[6]: scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
+        _4 = move _5;                    // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
+        drop(_5) -> [return: bb7, unwind: bb5]; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
     }
 
     bb5 (cleanup): {
-        drop(_4) -> bb2;                 // bb5[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+        drop(_4) -> bb2;                 // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
     }
 
     bb6 (cleanup): {
-        drop(_5) -> bb5;                 // bb6[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
+        drop(_5) -> bb5;                 // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
     }
 
     bb7: {
-        StorageDead(_5);                 // bb7[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
-        _1 = [move _2, move _4];         // bb7[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:13: 5:27
-        drop(_4) -> [return: bb8, unwind: bb2]; // bb7[2]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+        StorageDead(_5);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
+        _1 = [move _2, move _4];         // scope 0 at $DIR/uniform_array_move_out.rs:5:13: 5:27
+        drop(_4) -> [return: bb8, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
     }
 
     bb8: {
-        StorageDead(_4);                 // bb8[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
-        drop(_2) -> [return: bb9, unwind: bb1]; // bb8[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+        StorageDead(_4);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+        drop(_2) -> [return: bb9, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
     }
 
     bb9: {
-        StorageDead(_2);                 // bb9[0]: scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
-        FakeRead(ForLet, _1);            // bb9[1]: scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
-        StorageLive(_6);                 // bb9[2]: scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
-        _6 = move _1[1 of 2];            // bb9[3]: scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
-        _0 = const ();                   // bb9[4]: scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2
+        StorageDead(_2);                 // scope 0 at $DIR/uniform_array_move_out.rs:5:26: 5:27
+        FakeRead(ForLet, _1);            // scope 0 at $DIR/uniform_array_move_out.rs:5:9: 5:10
+        StorageLive(_6);                 // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
+        _6 = move _1[1 of 2];            // scope 1 at $DIR/uniform_array_move_out.rs:6:14: 6:16
+        _0 = const ();                   // scope 0 at $DIR/uniform_array_move_out.rs:4:24: 7:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/uniform_array_move_out.rs:4:24: 7:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        drop(_6) -> [return: bb12, unwind: bb10]; // bb9[5]: scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+        drop(_6) -> [return: bb12, unwind: bb10]; // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
     }
 
     bb10 (cleanup): {
-        drop(_1) -> bb1;                 // bb10[0]: scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+        drop(_1) -> bb1;                 // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
     }
 
     bb11 (cleanup): {
-        drop(_6) -> bb10;                // bb11[0]: scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+        drop(_6) -> bb10;                // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
     }
 
     bb12: {
-        StorageDead(_6);                 // bb12[0]: scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
-        drop(_1) -> [return: bb13, unwind: bb1]; // bb12[1]: scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+        StorageDead(_6);                 // scope 1 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+        drop(_1) -> [return: bb13, unwind: bb1]; // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
     }
 
     bb13: {
-        StorageDead(_1);                 // bb13[0]: scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
-        goto -> bb14;                    // bb13[1]: scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
+        StorageDead(_1);                 // scope 0 at $DIR/uniform_array_move_out.rs:7:1: 7:2
+        goto -> bb14;                    // scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
     }
 
     bb14: {
-        return;                          // bb14[0]: scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
+        return;                          // scope 0 at $DIR/uniform_array_move_out.rs:7:2: 7:2
     }
 }
index f2c87336608739275f03a247411f6951d1052622..c17fe3bb757575195e4880e2312a579449ce294a 100644 (file)
@@ -11,9 +11,9 @@ fn process_never(_1: *const !) -> () {
     }
 
     bb0: {
-        StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/uninhabited-enum.rs:8:8: 8:14
-        _2 = &(*_1);                     // bb0[1]: scope 2 at $DIR/uninhabited-enum.rs:8:26: 8:33
-        StorageDead(_2);                 // bb0[2]: scope 0 at $DIR/uninhabited-enum.rs:9:1: 9:2
-        unreachable;                     // bb0[3]: scope 0 at $DIR/uninhabited-enum.rs:7:39: 9:2
+        StorageLive(_2);                 // scope 0 at $DIR/uninhabited-enum.rs:8:8: 8:14
+        _2 = &(*_1);                     // scope 2 at $DIR/uninhabited-enum.rs:8:26: 8:33
+        StorageDead(_2);                 // scope 0 at $DIR/uninhabited-enum.rs:9:1: 9:2
+        unreachable;                     // scope 0 at $DIR/uninhabited-enum.rs:7:39: 9:2
     }
 }
index 1ee2297daaca43302eab9c6cf592f833ad14b430..8cfcd64a70f7d0f3053d6b8c0f703f7d1293d5ef 100644 (file)
@@ -11,16 +11,16 @@ fn process_void(_1: *const Void) -> () {
     }
 
     bb0: {
-        StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/uninhabited-enum.rs:14:8: 14:14
-        _2 = &(*_1);                     // bb0[1]: scope 2 at $DIR/uninhabited-enum.rs:14:26: 14:33
-        _0 = const ();                   // bb0[2]: scope 0 at $DIR/uninhabited-enum.rs:13:41: 17:2
+        StorageLive(_2);                 // scope 0 at $DIR/uninhabited-enum.rs:14:8: 14:14
+        _2 = &(*_1);                     // scope 2 at $DIR/uninhabited-enum.rs:14:26: 14:33
+        _0 = const ();                   // scope 0 at $DIR/uninhabited-enum.rs:13:41: 17:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/uninhabited-enum.rs:13:41: 17:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_2);                 // bb0[3]: scope 0 at $DIR/uninhabited-enum.rs:17:1: 17:2
-        return;                          // bb0[4]: scope 0 at $DIR/uninhabited-enum.rs:17:2: 17:2
+        StorageDead(_2);                 // scope 0 at $DIR/uninhabited-enum.rs:17:1: 17:2
+        return;                          // scope 0 at $DIR/uninhabited-enum.rs:17:2: 17:2
     }
 }
index fba77dfe239efcf1a6e4d0b8ac9a2a545cce27cf..4d65f8d10471df1dbd409e32f1895fbc85cd0589 100644 (file)
@@ -13,64 +13,64 @@ fn main() -> () {
     let _9: &str;                        // in scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
 
     bb0: {
-        StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
-        StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
-        _2 = Test1::C;                   // bb0[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
-        _3 = discriminant(_2);           // bb0[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
-        StorageLive(_5);                 // bb0[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
-        _5 = const "C";                  // bb0[5]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+        StorageLive(_1);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+        StorageLive(_2);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
+        _2 = Test1::C;                   // scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
+        _3 = discriminant(_2);           // scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
+        StorageLive(_5);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+        _5 = const "C";                  // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
                                          // ty::Const
                                          // + ty: &str
                                          // + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
                                          // mir::Constant
                                          // + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24
                                          // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
-        _1 = &(*_5);                     // bb0[6]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
-        StorageDead(_5);                 // bb0[7]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:23: 23:24
-        StorageDead(_2);                 // bb0[8]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
-        StorageDead(_1);                 // bb0[9]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
-        StorageLive(_6);                 // bb0[10]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
-        StorageLive(_7);                 // bb0[11]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
-        _7 = Test2::D;                   // bb0[12]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
-        _8 = discriminant(_7);           // bb0[13]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
-        switchInt(move _8) -> [4isize: bb2, otherwise: bb1]; // bb0[14]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
+        _1 = &(*_5);                     // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+        StorageDead(_5);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:23:23: 23:24
+        StorageDead(_2);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
+        StorageDead(_1);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
+        StorageLive(_6);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+        StorageLive(_7);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
+        _7 = Test2::D;                   // scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
+        _8 = discriminant(_7);           // scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
+        switchInt(move _8) -> [4isize: bb2, otherwise: bb1]; // scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
     }
 
     bb1: {
-        StorageLive(_9);                 // bb1[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
-        _9 = const "E";                  // bb1[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+        StorageLive(_9);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+        _9 = const "E";                  // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
                                          // ty::Const
                                          // + ty: &str
                                          // + val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
                                          // mir::Constant
                                          // + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24
                                          // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
-        _6 = &(*_9);                     // bb1[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
-        StorageDead(_9);                 // bb1[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:23: 28:24
-        goto -> bb3;                     // bb1[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+        _6 = &(*_9);                     // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+        StorageDead(_9);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:28:23: 28:24
+        goto -> bb3;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
     }
 
     bb2: {
-        _6 = const "D";                  // bb2[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
+        _6 = const "D";                  // scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
                                          // ty::Const
                                          // + ty: &str
                                          // + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
                                          // mir::Constant
                                          // + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24
                                          // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
-        goto -> bb3;                     // bb2[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+        goto -> bb3;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
     }
 
     bb3: {
-        StorageDead(_7);                 // bb3[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
-        StorageDead(_6);                 // bb3[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
-        _0 = const ();                   // bb3[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2
+        StorageDead(_7);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
+        StorageDead(_6);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
+        _0 = const ();                   // scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/uninhabited_enum_branching.rs:19:11: 30:2
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        return;                          // bb3[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2
+        return;                          // scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2
     }
 }
index 35842fdaa4e7e9c6145635b7e7dfbb8455f9f808..da9dd8b0963117f6db6ca8ca98738fa8c1dd9316 100644 (file)
       let _9: &str;                        // in scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
-          StorageLive(_2);                 // bb0[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
-          _2 = Test1::C;                   // bb0[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
-          _3 = discriminant(_2);           // bb0[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
--         switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb1]; // bb0[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
-+         switchInt(move _3) -> bb1;       // bb0[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
+          StorageLive(_1);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+          StorageLive(_2);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
+          _2 = Test1::C;                   // scope 0 at $DIR/uninhabited_enum_branching.rs:20:11: 20:19
+          _3 = discriminant(_2);           // scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
+-         switchInt(move _3) -> [0isize: bb2, 1isize: bb3, otherwise: bb1]; // scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
++         switchInt(move _3) -> bb1;       // scope 0 at $DIR/uninhabited_enum_branching.rs:21:9: 21:20
       }
   
       bb1: {
-          StorageLive(_5);                 // bb1[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
-          _5 = const "C";                  // bb1[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+          StorageLive(_5);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+          _5 = const "C";                  // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
                                            // ty::Const
                                            // + ty: &str
                                            // + val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
                                            // mir::Constant
                                            // + span: $DIR/uninhabited_enum_branching.rs:23:21: 23:24
                                            // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [67], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
-          _1 = &(*_5);                     // bb1[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
-          StorageDead(_5);                 // bb1[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:23:23: 23:24
-          goto -> bb4;                     // bb1[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+          _1 = &(*_5);                     // scope 0 at $DIR/uninhabited_enum_branching.rs:23:21: 23:24
+          StorageDead(_5);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:23:23: 23:24
+          goto -> bb4;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
       }
   
       bb2: {
-          _1 = const "A(Empty)";           // bb2[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:21:24: 21:34
+          _1 = const "A(Empty)";           // scope 0 at $DIR/uninhabited_enum_branching.rs:21:24: 21:34
                                            // ty::Const
                                            // + ty: &str
                                            // + val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
                                            // mir::Constant
                                            // + span: $DIR/uninhabited_enum_branching.rs:21:24: 21:34
                                            // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [65, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
-          goto -> bb4;                     // bb2[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+          goto -> bb4;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
       }
   
       bb3: {
-          StorageLive(_4);                 // bb3[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
-          _4 = const "B(Empty)";           // bb3[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
+          StorageLive(_4);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
+          _4 = const "B(Empty)";           // scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
                                            // ty::Const
                                            // + ty: &str
                                            // + val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 })
                                            // mir::Constant
                                            // + span: $DIR/uninhabited_enum_branching.rs:22:24: 22:34
                                            // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [66, 40, 69, 109, 112, 116, 121, 41], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 8 }) }
-          _1 = &(*_4);                     // bb3[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
-          StorageDead(_4);                 // bb3[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:22:33: 22:34
-          goto -> bb4;                     // bb3[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
+          _1 = &(*_4);                     // scope 0 at $DIR/uninhabited_enum_branching.rs:22:24: 22:34
+          StorageDead(_4);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:22:33: 22:34
+          goto -> bb4;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:20:5: 24:6
       }
   
       bb4: {
-          StorageDead(_2);                 // bb4[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
-          StorageDead(_1);                 // bb4[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
-          StorageLive(_6);                 // bb4[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
-          StorageLive(_7);                 // bb4[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
-          _7 = Test2::D;                   // bb4[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
-          _8 = discriminant(_7);           // bb4[5]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
-          switchInt(move _8) -> [4isize: bb6, otherwise: bb5]; // bb4[6]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
+          StorageDead(_2);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
+          StorageDead(_1);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:24:6: 24:7
+          StorageLive(_6);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+          StorageLive(_7);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
+          _7 = Test2::D;                   // scope 0 at $DIR/uninhabited_enum_branching.rs:26:11: 26:19
+          _8 = discriminant(_7);           // scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
+          switchInt(move _8) -> [4isize: bb6, otherwise: bb5]; // scope 0 at $DIR/uninhabited_enum_branching.rs:27:9: 27:17
       }
   
       bb5: {
-          StorageLive(_9);                 // bb5[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
-          _9 = const "E";                  // bb5[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+          StorageLive(_9);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+          _9 = const "E";                  // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
                                            // ty::Const
                                            // + ty: &str
                                            // + val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
                                            // mir::Constant
                                            // + span: $DIR/uninhabited_enum_branching.rs:28:21: 28:24
                                            // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [69], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
-          _6 = &(*_9);                     // bb5[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
-          StorageDead(_9);                 // bb5[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:28:23: 28:24
-          goto -> bb7;                     // bb5[4]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+          _6 = &(*_9);                     // scope 0 at $DIR/uninhabited_enum_branching.rs:28:21: 28:24
+          StorageDead(_9);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:28:23: 28:24
+          goto -> bb7;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
       }
   
       bb6: {
-          _6 = const "D";                  // bb6[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
+          _6 = const "D";                  // scope 0 at $DIR/uninhabited_enum_branching.rs:27:21: 27:24
                                            // ty::Const
                                            // + ty: &str
                                            // + val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 })
                                            // mir::Constant
                                            // + span: $DIR/uninhabited_enum_branching.rs:27:21: 27:24
                                            // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [68], relocations: Relocations(SortedMap { data: [] }), undef_mask: UndefMask { blocks: [1], len: Size { raw: 1 } }, size: Size { raw: 1 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 1 }) }
-          goto -> bb7;                     // bb6[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
+          goto -> bb7;                     // scope 0 at $DIR/uninhabited_enum_branching.rs:26:5: 29:6
       }
   
       bb7: {
-          StorageDead(_7);                 // bb7[0]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
-          StorageDead(_6);                 // bb7[1]: scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
-          _0 = const ();                   // bb7[2]: scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2
+          StorageDead(_7);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
+          StorageDead(_6);                 // scope 0 at $DIR/uninhabited_enum_branching.rs:29:6: 29:7
+          _0 = const ();                   // scope 0 at $DIR/uninhabited_enum_branching.rs:19:11: 30:2
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/uninhabited_enum_branching.rs:19:11: 30:2
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          return;                          // bb7[3]: scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2
+          return;                          // scope 0 at $DIR/uninhabited_enum_branching.rs:30:2: 30:2
       }
   }
   
index d530a9994098347347056013dad9e6f6ea7ba04a..ccd9612caddd45f60d0f76b261a8afa1991ca279 100644 (file)
@@ -18,8 +18,8 @@
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/unreachable.rs:9:23: 9:30
-          _1 = const empty() -> bb1;       // bb0[1]: scope 0 at $DIR/unreachable.rs:9:23: 9:30
+          StorageLive(_1);                 // scope 0 at $DIR/unreachable.rs:9:23: 9:30
+          _1 = const empty() -> bb1;       // scope 0 at $DIR/unreachable.rs:9:23: 9:30
                                            // ty::Const
                                            // + ty: fn() -> std::option::Option<Empty> {empty}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
-          _2 = discriminant(_1);           // bb1[0]: scope 0 at $DIR/unreachable.rs:9:12: 9:20
--         switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // bb1[1]: scope 0 at $DIR/unreachable.rs:9:12: 9:20
-+         goto -> bb2;                     // bb1[1]: scope 0 at $DIR/unreachable.rs:9:12: 9:20
+          _2 = discriminant(_1);           // scope 0 at $DIR/unreachable.rs:9:12: 9:20
+-         switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // scope 0 at $DIR/unreachable.rs:9:12: 9:20
++         goto -> bb2;                     // scope 0 at $DIR/unreachable.rs:9:12: 9:20
       }
   
       bb2: {
-          _0 = const ();                   // bb2[0]: scope 0 at $DIR/unreachable.rs:9:5: 19:6
+          _0 = const ();                   // scope 0 at $DIR/unreachable.rs:9:5: 19:6
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable.rs:9:5: 19:6
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb2[1]: scope 0 at $DIR/unreachable.rs:20:1: 20:2
-          return;                          // bb2[2]: scope 0 at $DIR/unreachable.rs:20:2: 20:2
+          StorageDead(_1);                 // scope 0 at $DIR/unreachable.rs:20:1: 20:2
+          return;                          // scope 0 at $DIR/unreachable.rs:20:2: 20:2
 -     }
 - 
 -     bb3: {
--         StorageLive(_3);                 // bb3[0]: scope 0 at $DIR/unreachable.rs:9:17: 9:19
--         _3 = move ((_1 as Some).0: Empty); // bb3[1]: scope 0 at $DIR/unreachable.rs:9:17: 9:19
--         StorageLive(_4);                 // bb3[2]: scope 1 at $DIR/unreachable.rs:10:13: 10:19
--         StorageLive(_5);                 // bb3[3]: scope 2 at $DIR/unreachable.rs:12:9: 16:10
--         StorageLive(_6);                 // bb3[4]: scope 2 at $DIR/unreachable.rs:12:12: 12:16
--         _6 = const true;                 // bb3[5]: scope 2 at $DIR/unreachable.rs:12:12: 12:16
+-         StorageLive(_3);                 // scope 0 at $DIR/unreachable.rs:9:17: 9:19
+-         _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable.rs:9:17: 9:19
+-         StorageLive(_4);                 // scope 1 at $DIR/unreachable.rs:10:13: 10:19
+-         StorageLive(_5);                 // scope 2 at $DIR/unreachable.rs:12:9: 16:10
+-         StorageLive(_6);                 // scope 2 at $DIR/unreachable.rs:12:12: 12:16
+-         _6 = const true;                 // scope 2 at $DIR/unreachable.rs:12:12: 12:16
 -                                          // ty::Const
 -                                          // + ty: bool
 -                                          // + val: Value(Scalar(0x01))
 -                                          // mir::Constant
 -                                          // + span: $DIR/unreachable.rs:12:12: 12:16
 -                                          // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
--         switchInt(_6) -> [false: bb4, otherwise: bb5]; // bb3[6]: scope 2 at $DIR/unreachable.rs:12:9: 16:10
+-         switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable.rs:12:9: 16:10
 -     }
 - 
 -     bb4: {
--         _4 = const 42i32;                // bb4[0]: scope 2 at $DIR/unreachable.rs:15:13: 15:20
+-         _4 = const 42i32;                // scope 2 at $DIR/unreachable.rs:15:13: 15:20
 -                                          // ty::Const
 -                                          // + ty: i32
 -                                          // + val: Value(Scalar(0x0000002a))
 -                                          // mir::Constant
 -                                          // + span: $DIR/unreachable.rs:15:18: 15:20
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
--         _5 = const ();                   // bb4[1]: scope 2 at $DIR/unreachable.rs:14:16: 16:10
+-         _5 = const ();                   // scope 2 at $DIR/unreachable.rs:14:16: 16:10
 -                                          // ty::Const
 -                                          // + ty: ()
 -                                          // + val: Value(Scalar(<ZST>))
 -                                          // mir::Constant
 -                                          // + span: $DIR/unreachable.rs:14:16: 16:10
 -                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         goto -> bb6;                     // bb4[2]: scope 2 at $DIR/unreachable.rs:12:9: 16:10
+-         goto -> bb6;                     // scope 2 at $DIR/unreachable.rs:12:9: 16:10
 -     }
 - 
 -     bb5: {
--         _4 = const 21i32;                // bb5[0]: scope 2 at $DIR/unreachable.rs:13:13: 13:20
+-         _4 = const 21i32;                // scope 2 at $DIR/unreachable.rs:13:13: 13:20
 -                                          // ty::Const
 -                                          // + ty: i32
 -                                          // + val: Value(Scalar(0x00000015))
 -                                          // mir::Constant
 -                                          // + span: $DIR/unreachable.rs:13:18: 13:20
 -                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) }
--         _5 = const ();                   // bb5[1]: scope 2 at $DIR/unreachable.rs:12:17: 14:10
+-         _5 = const ();                   // scope 2 at $DIR/unreachable.rs:12:17: 14:10
 -                                          // ty::Const
 -                                          // + ty: ()
 -                                          // + val: Value(Scalar(<ZST>))
 -                                          // mir::Constant
 -                                          // + span: $DIR/unreachable.rs:12:17: 14:10
 -                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         goto -> bb6;                     // bb5[2]: scope 2 at $DIR/unreachable.rs:12:9: 16:10
+-         goto -> bb6;                     // scope 2 at $DIR/unreachable.rs:12:9: 16:10
 -     }
 - 
 -     bb6: {
--         StorageDead(_6);                 // bb6[0]: scope 2 at $DIR/unreachable.rs:16:9: 16:10
--         StorageDead(_5);                 // bb6[1]: scope 2 at $DIR/unreachable.rs:16:9: 16:10
--         StorageLive(_7);                 // bb6[2]: scope 2 at $DIR/unreachable.rs:18:9: 18:21
--         unreachable;                     // bb6[3]: scope 2 at $DIR/unreachable.rs:18:15: 18:17
+-         StorageDead(_6);                 // scope 2 at $DIR/unreachable.rs:16:9: 16:10
+-         StorageDead(_5);                 // scope 2 at $DIR/unreachable.rs:16:9: 16:10
+-         StorageLive(_7);                 // scope 2 at $DIR/unreachable.rs:18:9: 18:21
+-         unreachable;                     // scope 2 at $DIR/unreachable.rs:18:15: 18:17
       }
   }
   
index 2b3ab80fa0f812af59fb0a454aad6c7ce568fe62..449bea06207d9a43497fccd310099aa7340fc8df 100644 (file)
@@ -21,8 +21,8 @@
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
-          _1 = const empty() -> bb1;       // bb0[1]: scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
+          StorageLive(_1);                 // scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
+          _1 = const empty() -> bb1;       // scope 0 at $DIR/unreachable_asm.rs:11:23: 11:30
                                            // ty::Const
                                            // + ty: fn() -> std::option::Option<Empty> {empty}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
-          _2 = discriminant(_1);           // bb1[0]: scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
-          switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // bb1[1]: scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
+          _2 = discriminant(_1);           // scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
+          switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // scope 0 at $DIR/unreachable_asm.rs:11:12: 11:20
       }
   
       bb2: {
-          _0 = const ();                   // bb2[0]: scope 0 at $DIR/unreachable_asm.rs:11:5: 23:6
+          _0 = const ();                   // scope 0 at $DIR/unreachable_asm.rs:11:5: 23:6
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm.rs:11:5: 23:6
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb2[1]: scope 0 at $DIR/unreachable_asm.rs:24:1: 24:2
-          return;                          // bb2[2]: scope 0 at $DIR/unreachable_asm.rs:24:2: 24:2
+          StorageDead(_1);                 // scope 0 at $DIR/unreachable_asm.rs:24:1: 24:2
+          return;                          // scope 0 at $DIR/unreachable_asm.rs:24:2: 24:2
       }
   
       bb3: {
-          StorageLive(_3);                 // bb3[0]: scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
-          _3 = move ((_1 as Some).0: Empty); // bb3[1]: scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
-          StorageLive(_4);                 // bb3[2]: scope 1 at $DIR/unreachable_asm.rs:12:13: 12:19
-          StorageLive(_5);                 // bb3[3]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
-          StorageLive(_6);                 // bb3[4]: scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
-          _6 = const true;                 // bb3[5]: scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
+          StorageLive(_3);                 // scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
+          _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable_asm.rs:11:17: 11:19
+          StorageLive(_4);                 // scope 1 at $DIR/unreachable_asm.rs:12:13: 12:19
+          StorageLive(_5);                 // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
+          StorageLive(_6);                 // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
+          _6 = const true;                 // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
                                            // ty::Const
                                            // + ty: bool
                                            // + val: Value(Scalar(0x01))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm.rs:14:12: 14:16
                                            // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-          switchInt(_6) -> [false: bb4, otherwise: bb5]; // bb3[6]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
+          switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
       }
   
       bb4: {
-          _4 = const 42i32;                // bb4[0]: scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20
+          _4 = const 42i32;                // scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000002a))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm.rs:17:18: 17:20
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-          _5 = const ();                   // bb4[1]: scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10
+          _5 = const ();                   // scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm.rs:16:16: 18:10
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          goto -> bb6;                     // bb4[2]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
+          goto -> bb6;                     // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
       }
   
       bb5: {
-          _4 = const 21i32;                // bb5[0]: scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20
+          _4 = const 21i32;                // scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000015))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm.rs:15:18: 15:20
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) }
-          _5 = const ();                   // bb5[1]: scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10
+          _5 = const ();                   // scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm.rs:14:17: 16:10
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          goto -> bb6;                     // bb5[2]: scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
+          goto -> bb6;                     // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
       }
   
       bb6: {
-          StorageDead(_6);                 // bb6[0]: scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
-          StorageDead(_5);                 // bb6[1]: scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
-          StorageLive(_7);                 // bb6[2]: scope 2 at $DIR/unreachable_asm.rs:21:9: 21:37
-          llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // bb6[3]: scope 3 at $DIR/unreachable_asm.rs:21:18: 21:35
-          _7 = const ();                   // bb6[4]: scope 3 at $DIR/unreachable_asm.rs:21:9: 21:37
+          StorageDead(_6);                 // scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
+          StorageDead(_5);                 // scope 2 at $DIR/unreachable_asm.rs:18:9: 18:10
+          StorageLive(_7);                 // scope 2 at $DIR/unreachable_asm.rs:21:9: 21:37
+          llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 3 at $DIR/unreachable_asm.rs:21:18: 21:35
+          _7 = const ();                   // scope 3 at $DIR/unreachable_asm.rs:21:9: 21:37
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm.rs:21:9: 21:37
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_7);                 // bb6[5]: scope 2 at $DIR/unreachable_asm.rs:21:36: 21:37
-          StorageLive(_8);                 // bb6[6]: scope 2 at $DIR/unreachable_asm.rs:22:9: 22:21
-          unreachable;                     // bb6[7]: scope 2 at $DIR/unreachable_asm.rs:22:15: 22:17
+          StorageDead(_7);                 // scope 2 at $DIR/unreachable_asm.rs:21:36: 21:37
+          StorageLive(_8);                 // scope 2 at $DIR/unreachable_asm.rs:22:9: 22:21
+          unreachable;                     // scope 2 at $DIR/unreachable_asm.rs:22:15: 22:17
       }
   }
   
index c3760f6a7fccf55533817ef80dfbe72de9954353..a152e1dbe892fc18d66007afd11daf7ade3cbb7a 100644 (file)
@@ -24,8 +24,8 @@
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
-          _1 = const empty() -> bb1;       // bb0[1]: scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
+          StorageLive(_1);                 // scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
+          _1 = const empty() -> bb1;       // scope 0 at $DIR/unreachable_asm_2.rs:11:23: 11:30
                                            // ty::Const
                                            // + ty: fn() -> std::option::Option<Empty> {empty}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
-          _2 = discriminant(_1);           // bb1[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
-          switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // bb1[1]: scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
+          _2 = discriminant(_1);           // scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
+          switchInt(move _2) -> [1isize: bb3, otherwise: bb2]; // scope 0 at $DIR/unreachable_asm_2.rs:11:12: 11:20
       }
   
       bb2: {
-          _0 = const ();                   // bb2[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:5: 25:6
+          _0 = const ();                   // scope 0 at $DIR/unreachable_asm_2.rs:11:5: 25:6
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm_2.rs:11:5: 25:6
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb2[1]: scope 0 at $DIR/unreachable_asm_2.rs:26:1: 26:2
-          return;                          // bb2[2]: scope 0 at $DIR/unreachable_asm_2.rs:26:2: 26:2
+          StorageDead(_1);                 // scope 0 at $DIR/unreachable_asm_2.rs:26:1: 26:2
+          return;                          // scope 0 at $DIR/unreachable_asm_2.rs:26:2: 26:2
       }
   
       bb3: {
-          StorageLive(_3);                 // bb3[0]: scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
-          _3 = move ((_1 as Some).0: Empty); // bb3[1]: scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
-          StorageLive(_4);                 // bb3[2]: scope 1 at $DIR/unreachable_asm_2.rs:12:13: 12:19
-          StorageLive(_5);                 // bb3[3]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
-          StorageLive(_6);                 // bb3[4]: scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
-          _6 = const true;                 // bb3[5]: scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
+          StorageLive(_3);                 // scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
+          _3 = move ((_1 as Some).0: Empty); // scope 0 at $DIR/unreachable_asm_2.rs:11:17: 11:19
+          StorageLive(_4);                 // scope 1 at $DIR/unreachable_asm_2.rs:12:13: 12:19
+          StorageLive(_5);                 // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+          StorageLive(_6);                 // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
+          _6 = const true;                 // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
                                            // ty::Const
                                            // + ty: bool
                                            // + val: Value(Scalar(0x01))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm_2.rs:14:12: 14:16
                                            // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-          switchInt(_6) -> [false: bb4, otherwise: bb5]; // bb3[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+          switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
       }
   
       bb4: {
-          StorageLive(_8);                 // bb4[0]: scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41
-          llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // bb4[1]: scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:39
-          _8 = const ();                   // bb4[2]: scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41
+          StorageLive(_8);                 // scope 2 at $DIR/unreachable_asm_2.rs:20:13: 20:41
+          llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 4 at $DIR/unreachable_asm_2.rs:20:22: 20:39
+          _8 = const ();                   // scope 4 at $DIR/unreachable_asm_2.rs:20:13: 20:41
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm_2.rs:20:13: 20:41
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_8);                 // bb4[3]: scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41
-          _4 = const 42i32;                // bb4[4]: scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20
+          StorageDead(_8);                 // scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41
+          _4 = const 42i32;                // scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x0000002a))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm_2.rs:21:18: 21:20
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-          _5 = const ();                   // bb4[5]: scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10
+          _5 = const ();                   // scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm_2.rs:18:16: 22:10
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         goto -> bb6;                     // bb4[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
-+         unreachable;                     // bb4[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+-         goto -> bb6;                     // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
++         unreachable;                     // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
       }
   
       bb5: {
-          StorageLive(_7);                 // bb5[0]: scope 2 at $DIR/unreachable_asm_2.rs:16:13: 16:41
-          llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // bb5[1]: scope 3 at $DIR/unreachable_asm_2.rs:16:22: 16:39
-          _7 = const ();                   // bb5[2]: scope 3 at $DIR/unreachable_asm_2.rs:16:13: 16:41
+          StorageLive(_7);                 // scope 2 at $DIR/unreachable_asm_2.rs:16:13: 16:41
+          llvm_asm!(LlvmInlineAsmInner { asm: "NOP", asm_str_style: Cooked, outputs: [], inputs: [], clobbers: [], volatile: true, alignstack: false, dialect: Att } : [] : []); // scope 3 at $DIR/unreachable_asm_2.rs:16:22: 16:39
+          _7 = const ();                   // scope 3 at $DIR/unreachable_asm_2.rs:16:13: 16:41
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm_2.rs:16:13: 16:41
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_7);                 // bb5[3]: scope 2 at $DIR/unreachable_asm_2.rs:16:40: 16:41
-          _4 = const 21i32;                // bb5[4]: scope 2 at $DIR/unreachable_asm_2.rs:17:13: 17:20
+          StorageDead(_7);                 // scope 2 at $DIR/unreachable_asm_2.rs:16:40: 16:41
+          _4 = const 21i32;                // scope 2 at $DIR/unreachable_asm_2.rs:17:13: 17:20
                                            // ty::Const
                                            // + ty: i32
                                            // + val: Value(Scalar(0x00000015))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm_2.rs:17:18: 17:20
                                            // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) }
-          _5 = const ();                   // bb5[5]: scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10
+          _5 = const ();                   // scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_asm_2.rs:14:17: 18:10
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         goto -> bb6;                     // bb5[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+-         goto -> bb6;                     // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
 -     }
 - 
 -     bb6: {
--         StorageDead(_6);                 // bb6[0]: scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
--         StorageDead(_5);                 // bb6[1]: scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
--         StorageLive(_9);                 // bb6[2]: scope 2 at $DIR/unreachable_asm_2.rs:24:9: 24:21
--         unreachable;                     // bb6[3]: scope 2 at $DIR/unreachable_asm_2.rs:24:15: 24:17
-+         unreachable;                     // bb5[6]: scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
+-         StorageDead(_6);                 // scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
+-         StorageDead(_5);                 // scope 2 at $DIR/unreachable_asm_2.rs:22:9: 22:10
+-         StorageLive(_9);                 // scope 2 at $DIR/unreachable_asm_2.rs:24:9: 24:21
+-         unreachable;                     // scope 2 at $DIR/unreachable_asm_2.rs:24:15: 24:17
++         unreachable;                     // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
       }
   }
   
index 2fe0c8dc1e7856ba7608a329a16a6eb509abeb8b..ff23baf0b4e9ff70cd5057b772aa2f5b26a434de 100644 (file)
       }
   
       bb0: {
-          StorageLive(_1);                 // bb0[0]: scope 0 at $DIR/unreachable_diverging.rs:13:9: 13:10
-          _1 = const true;                 // bb0[1]: scope 0 at $DIR/unreachable_diverging.rs:13:13: 13:17
+          StorageLive(_1);                 // scope 0 at $DIR/unreachable_diverging.rs:13:9: 13:10
+          _1 = const true;                 // scope 0 at $DIR/unreachable_diverging.rs:13:13: 13:17
                                            // ty::Const
                                            // + ty: bool
                                            // + val: Value(Scalar(0x01))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_diverging.rs:13:13: 13:17
                                            // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-          StorageLive(_2);                 // bb0[2]: scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
-          _2 = const empty() -> bb1;       // bb0[3]: scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
+          StorageLive(_2);                 // scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
+          _2 = const empty() -> bb1;       // scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
                                            // ty::Const
                                            // + ty: fn() -> std::option::Option<Empty> {empty}
                                            // + val: Value(Scalar(<ZST>))
       }
   
       bb1: {
-          _3 = discriminant(_2);           // bb1[0]: scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
-          switchInt(move _3) -> [1isize: bb3, otherwise: bb2]; // bb1[1]: scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
+          _3 = discriminant(_2);           // scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
+          switchInt(move _3) -> [1isize: bb3, otherwise: bb2]; // scope 1 at $DIR/unreachable_diverging.rs:14:12: 14:22
       }
   
       bb2: {
-          _0 = const ();                   // bb2[0]: scope 1 at $DIR/unreachable_diverging.rs:14:5: 19:6
+          _0 = const ();                   // scope 1 at $DIR/unreachable_diverging.rs:14:5: 19:6
                                            // ty::Const
                                            // + ty: ()
                                            // + val: Value(Scalar(<ZST>))
                                            // mir::Constant
                                            // + span: $DIR/unreachable_diverging.rs:14:5: 19:6
                                            // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-          StorageDead(_1);                 // bb2[1]: scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
-          StorageDead(_2);                 // bb2[2]: scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
-          return;                          // bb2[3]: scope 0 at $DIR/unreachable_diverging.rs:20:2: 20:2
+          StorageDead(_1);                 // scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
+          StorageDead(_2);                 // scope 0 at $DIR/unreachable_diverging.rs:20:1: 20:2
+          return;                          // scope 0 at $DIR/unreachable_diverging.rs:20:2: 20:2
       }
   
       bb3: {
-          StorageLive(_4);                 // bb3[0]: scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
-          _4 = move ((_2 as Some).0: Empty); // bb3[1]: scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
-          StorageLive(_5);                 // bb3[2]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
-          StorageLive(_6);                 // bb3[3]: scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
-          _6 = _1;                         // bb3[4]: scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
--         switchInt(_6) -> [false: bb4, otherwise: bb5]; // bb3[5]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
-+         goto -> bb4;                     // bb3[5]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
+          StorageLive(_4);                 // scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
+          _4 = move ((_2 as Some).0: Empty); // scope 1 at $DIR/unreachable_diverging.rs:14:17: 14:21
+          StorageLive(_5);                 // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
+          StorageLive(_6);                 // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
+          _6 = _1;                         // scope 2 at $DIR/unreachable_diverging.rs:15:12: 15:13
+-         switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
++         goto -> bb4;                     // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
       }
   
       bb4: {
--         _5 = const ();                   // bb4[0]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
-+         _5 = const loop_forever() -> bb5; // bb4[0]: scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
+-         _5 = const ();                   // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
++         _5 = const loop_forever() -> bb5; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
                                            // ty::Const
 -                                          // + ty: ()
 -                                          // + val: Value(Scalar(<ZST>))
 -                                          // mir::Constant
 -                                          // + span: $DIR/unreachable_diverging.rs:15:9: 17:10
 -                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
--         goto -> bb6;                     // bb4[1]: scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
+-         goto -> bb6;                     // scope 2 at $DIR/unreachable_diverging.rs:15:9: 17:10
 -     }
 - 
 -     bb5: {
--         _5 = const loop_forever() -> bb6; // bb5[0]: scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
+-         _5 = const loop_forever() -> bb6; // scope 2 at $DIR/unreachable_diverging.rs:16:13: 16:27
 -                                          // ty::Const
                                            // + ty: fn() {loop_forever}
                                            // + val: Value(Scalar(<ZST>))
       }
   
 -     bb6: {
--         StorageDead(_6);                 // bb6[0]: scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
--         StorageDead(_5);                 // bb6[1]: scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
--         StorageLive(_7);                 // bb6[2]: scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22
--         unreachable;                     // bb6[3]: scope 2 at $DIR/unreachable_diverging.rs:18:15: 18:19
 +     bb5: {
-+         StorageDead(_6);                 // bb5[0]: scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
-+         StorageDead(_5);                 // bb5[1]: scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
-+         StorageLive(_7);                 // bb5[2]: scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22
-+         unreachable;                     // bb5[3]: scope 2 at $DIR/unreachable_diverging.rs:18:15: 18:19
+          StorageDead(_6);                 // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
+          StorageDead(_5);                 // scope 2 at $DIR/unreachable_diverging.rs:17:9: 17:10
+          StorageLive(_7);                 // scope 2 at $DIR/unreachable_diverging.rs:18:9: 18:22
+          unreachable;                     // scope 2 at $DIR/unreachable_diverging.rs:18:15: 18:19
       }
   }
   
index 3dc8cea1fe8e16427942b6f8651d10bb71380429..c800ccb1ae51f698db8d7a5fcd773be2dfca4672 100644 (file)
@@ -4,17 +4,17 @@ E::V::{{constant}}#0: isize = {
     let mut _0: isize;                   // return place in scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
 
     bb0: {
-        _0 = const 5isize;               // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+        _0 = const 5isize;               // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
                                          // ty::Const
                                          // + ty: isize
                                          // + val: Value(Scalar(0x00000005))
                                          // mir::Constant
                                          // + span: $DIR/unusual-item-types.rs:22:9: 22:10
                                          // + literal: Const { ty: isize, val: Value(Scalar(0x00000005)) }
-        return;                          // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+        return;                          // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+        resume;                          // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
     }
 }
index d6ce06246a16d20695b8f05c8f42bba28be09e53..832f18e14c25d288b14c6690804824d44a97b84a 100644 (file)
@@ -4,8 +4,8 @@ fn Test::X(_1: usize) -> Test {
     let mut _0: Test;                    // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
 
     bb0: {
-        ((_0 as X).0: usize) = move _1;  // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
-        discriminant(_0) = 0;            // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
-        return;                          // bb0[2]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+        ((_0 as X).0: usize) = move _1;  // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+        discriminant(_0) = 0;            // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+        return;                          // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
     }
 }
index b78480e774c650295a19a5922295f98a07e5376e..28f14399a630995e51e5338bf3e09b9897d216c2 100644 (file)
@@ -6,36 +6,36 @@ fn std::intrinsics::drop_in_place(_1: *mut std::vec::Vec<i32>) -> () {
     let mut _3: ();                      // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
 
     bb0: {
-        goto -> bb7;                     // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb7;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb1: {
-        return;                          // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        return;                          // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb2 (cleanup): {
-        resume;                          // bb2[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        resume;                          // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb3: {
-        goto -> bb1;                     // bb3[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb1;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb4 (cleanup): {
-        goto -> bb2;                     // bb4[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb2;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb5 (cleanup): {
-        drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // bb5[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb6: {
-        drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // bb6[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb7: {
-        _2 = &mut (*_1);                 // bb7[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _3 = const <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // bb7[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _2 = &mut (*_1);                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _3 = const <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}
                                          // + val: Value(Scalar(<ZST>))
index 9f65819bcf8d34960dc54c1b08fed24ed47c4eb1..f4a5cc0b3279a5136106ae8df95aa0dd0939fc0d 100644 (file)
@@ -4,17 +4,17 @@ const <impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT: i32 =
     let mut _0: i32;                     // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35
 
     bb0: {
-        _0 = const 2i32;                 // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
+        _0 = const 2i32;                 // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/unusual-item-types.rs:10:38: 10:39
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        return;                          // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+        return;                          // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+        resume;                          // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
     }
 }
index 8434ff47f1c6421156513dd7adfed326f58fa47d..e635cd2b01bbd79fb97d6e08f40e69e95fafa81d 100644 (file)
@@ -4,17 +4,17 @@ E::V::{{constant}}#0: isize = {
     let mut _0: isize;                   // return place in scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
 
     bb0: {
-        _0 = const 5isize;               // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+        _0 = const 5isize;               // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
                                          // ty::Const
                                          // + ty: isize
                                          // + val: Value(Scalar(0x0000000000000005))
                                          // mir::Constant
                                          // + span: $DIR/unusual-item-types.rs:22:9: 22:10
                                          // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000005)) }
-        return;                          // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+        return;                          // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
+        resume;                          // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
     }
 }
index d6ce06246a16d20695b8f05c8f42bba28be09e53..832f18e14c25d288b14c6690804824d44a97b84a 100644 (file)
@@ -4,8 +4,8 @@ fn Test::X(_1: usize) -> Test {
     let mut _0: Test;                    // return place in scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
 
     bb0: {
-        ((_0 as X).0: usize) = move _1;  // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
-        discriminant(_0) = 0;            // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
-        return;                          // bb0[2]: scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+        ((_0 as X).0: usize) = move _1;  // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+        discriminant(_0) = 0;            // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
+        return;                          // scope 0 at $DIR/unusual-item-types.rs:16:5: 16:13
     }
 }
index b78480e774c650295a19a5922295f98a07e5376e..28f14399a630995e51e5338bf3e09b9897d216c2 100644 (file)
@@ -6,36 +6,36 @@ fn std::intrinsics::drop_in_place(_1: *mut std::vec::Vec<i32>) -> () {
     let mut _3: ();                      // in scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
 
     bb0: {
-        goto -> bb7;                     // bb0[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb7;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb1: {
-        return;                          // bb1[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        return;                          // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb2 (cleanup): {
-        resume;                          // bb2[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        resume;                          // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb3: {
-        goto -> bb1;                     // bb3[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb1;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb4 (cleanup): {
-        goto -> bb2;                     // bb4[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        goto -> bb2;                     // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb5 (cleanup): {
-        drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // bb5[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> bb4; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb6: {
-        drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // bb6[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        drop(((*_1).0: alloc::raw_vec::RawVec<i32>)) -> [return: bb3, unwind: bb4]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
     }
 
     bb7: {
-        _2 = &mut (*_1);                 // bb7[0]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
-        _3 = const <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // bb7[1]: scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _2 = &mut (*_1);                 // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
+        _3 = const <std::vec::Vec<i32> as std::ops::Drop>::drop(move _2) -> [return: bb6, unwind: bb5]; // scope 0 at $SRC_DIR/libcore/ptr/mod.rs:LL:COL
                                          // ty::Const
                                          // + ty: for<'r> fn(&'r mut std::vec::Vec<i32>) {<std::vec::Vec<i32> as std::ops::Drop>::drop}
                                          // + val: Value(Scalar(<ZST>))
index 9f65819bcf8d34960dc54c1b08fed24ed47c4eb1..f4a5cc0b3279a5136106ae8df95aa0dd0939fc0d 100644 (file)
@@ -4,17 +4,17 @@ const <impl at $DIR/unusual-item-types.rs:9:1: 11:2>::ASSOCIATED_CONSTANT: i32 =
     let mut _0: i32;                     // return place in scope 0 at $DIR/unusual-item-types.rs:10:32: 10:35
 
     bb0: {
-        _0 = const 2i32;                 // bb0[0]: scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
+        _0 = const 2i32;                 // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
                                          // ty::Const
                                          // + ty: i32
                                          // + val: Value(Scalar(0x00000002))
                                          // mir::Constant
                                          // + span: $DIR/unusual-item-types.rs:10:38: 10:39
                                          // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-        return;                          // bb0[1]: scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+        return;                          // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
     }
 
     bb1 (cleanup): {
-        resume;                          // bb1[0]: scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
+        resume;                          // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
     }
 }
index 5d9c1f6b230d9006c54a5e97c148761b14459682..3ddf82c2fb2c9d6384c6a7317d3130d09a4ba6d7 100644 (file)
@@ -9,10 +9,10 @@ fn while_loop(_1: bool) -> () {
     let mut _5: bool;                    // in scope 0 at $DIR/while-storage.rs:11:21: 11:22
 
     bb0: {
-        StorageLive(_2);                 // bb0[0]: scope 0 at $DIR/while-storage.rs:10:11: 10:22
-        StorageLive(_3);                 // bb0[1]: scope 0 at $DIR/while-storage.rs:10:20: 10:21
-        _3 = _1;                         // bb0[2]: scope 0 at $DIR/while-storage.rs:10:20: 10:21
-        _2 = const get_bool(move _3) -> bb1; // bb0[3]: scope 0 at $DIR/while-storage.rs:10:11: 10:22
+        StorageLive(_2);                 // scope 0 at $DIR/while-storage.rs:10:11: 10:22
+        StorageLive(_3);                 // scope 0 at $DIR/while-storage.rs:10:20: 10:21
+        _3 = _1;                         // scope 0 at $DIR/while-storage.rs:10:20: 10:21
+        _2 = const get_bool(move _3) -> bb1; // scope 0 at $DIR/while-storage.rs:10:11: 10:22
                                          // ty::Const
                                          // + ty: fn(bool) -> bool {get_bool}
                                          // + val: Value(Scalar(<ZST>))
@@ -22,26 +22,26 @@ fn while_loop(_1: bool) -> () {
     }
 
     bb1: {
-        StorageDead(_3);                 // bb1[0]: scope 0 at $DIR/while-storage.rs:10:21: 10:22
-        switchInt(_2) -> [false: bb2, otherwise: bb3]; // bb1[1]: scope 0 at $DIR/while-storage.rs:10:5: 14:6
+        StorageDead(_3);                 // scope 0 at $DIR/while-storage.rs:10:21: 10:22
+        switchInt(_2) -> [false: bb2, otherwise: bb3]; // scope 0 at $DIR/while-storage.rs:10:5: 14:6
     }
 
     bb2: {
-        _0 = const ();                   // bb2[0]: scope 0 at $DIR/while-storage.rs:10:5: 14:6
+        _0 = const ();                   // scope 0 at $DIR/while-storage.rs:10:5: 14:6
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/while-storage.rs:10:5: 14:6
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        goto -> bb7;                     // bb2[1]: scope 0 at $DIR/while-storage.rs:10:5: 14:6
+        goto -> bb7;                     // scope 0 at $DIR/while-storage.rs:10:5: 14:6
     }
 
     bb3: {
-        StorageLive(_4);                 // bb3[0]: scope 0 at $DIR/while-storage.rs:11:12: 11:23
-        StorageLive(_5);                 // bb3[1]: scope 0 at $DIR/while-storage.rs:11:21: 11:22
-        _5 = _1;                         // bb3[2]: scope 0 at $DIR/while-storage.rs:11:21: 11:22
-        _4 = const get_bool(move _5) -> bb4; // bb3[3]: scope 0 at $DIR/while-storage.rs:11:12: 11:23
+        StorageLive(_4);                 // scope 0 at $DIR/while-storage.rs:11:12: 11:23
+        StorageLive(_5);                 // scope 0 at $DIR/while-storage.rs:11:21: 11:22
+        _5 = _1;                         // scope 0 at $DIR/while-storage.rs:11:21: 11:22
+        _4 = const get_bool(move _5) -> bb4; // scope 0 at $DIR/while-storage.rs:11:12: 11:23
                                          // ty::Const
                                          // + ty: fn(bool) -> bool {get_bool}
                                          // + val: Value(Scalar(<ZST>))
@@ -51,30 +51,30 @@ fn while_loop(_1: bool) -> () {
     }
 
     bb4: {
-        StorageDead(_5);                 // bb4[0]: scope 0 at $DIR/while-storage.rs:11:22: 11:23
-        switchInt(_4) -> [false: bb5, otherwise: bb6]; // bb4[1]: scope 0 at $DIR/while-storage.rs:11:9: 13:10
+        StorageDead(_5);                 // scope 0 at $DIR/while-storage.rs:11:22: 11:23
+        switchInt(_4) -> [false: bb5, otherwise: bb6]; // scope 0 at $DIR/while-storage.rs:11:9: 13:10
     }
 
     bb5: {
-        StorageDead(_4);                 // bb5[0]: scope 0 at $DIR/while-storage.rs:14:5: 14:6
-        StorageDead(_2);                 // bb5[1]: scope 0 at $DIR/while-storage.rs:14:5: 14:6
-        goto -> bb0;                     // bb5[2]: scope 0 at $DIR/while-storage.rs:10:5: 14:6
+        StorageDead(_4);                 // scope 0 at $DIR/while-storage.rs:14:5: 14:6
+        StorageDead(_2);                 // scope 0 at $DIR/while-storage.rs:14:5: 14:6
+        goto -> bb0;                     // scope 0 at $DIR/while-storage.rs:10:5: 14:6
     }
 
     bb6: {
-        _0 = const ();                   // bb6[0]: scope 0 at $DIR/while-storage.rs:12:13: 12:18
+        _0 = const ();                   // scope 0 at $DIR/while-storage.rs:12:13: 12:18
                                          // ty::Const
                                          // + ty: ()
                                          // + val: Value(Scalar(<ZST>))
                                          // mir::Constant
                                          // + span: $DIR/while-storage.rs:12:13: 12:18
                                          // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
-        StorageDead(_4);                 // bb6[1]: scope 0 at $DIR/while-storage.rs:14:5: 14:6
-        goto -> bb7;                     // bb6[2]: scope 0 at $DIR/while-storage.rs:12:13: 12:18
+        StorageDead(_4);                 // scope 0 at $DIR/while-storage.rs:14:5: 14:6
+        goto -> bb7;                     // scope 0 at $DIR/while-storage.rs:12:13: 12:18
     }
 
     bb7: {
-        StorageDead(_2);                 // bb7[0]: scope 0 at $DIR/while-storage.rs:14:5: 14:6
-        return;                          // bb7[1]: scope 0 at $DIR/while-storage.rs:15:2: 15:2
+        StorageDead(_2);                 // scope 0 at $DIR/while-storage.rs:14:5: 14:6
+        return;                          // scope 0 at $DIR/while-storage.rs:15:2: 15:2
     }
 }
index fdb3f4842e50af9574f23aa9280f4dae5bb65d70..ba93563154a3b3958189e8d5fd82cadb58dfad3f 100644 (file)
@@ -1,5 +1,5 @@
 // error-pattern:attempt to divide by zero
-
+#[allow(unconditional_panic)]
 fn main() {
     let y = 0;
     let _z = 1 / y;
index 561b1fb42ed0634cf07a7b2c57b9cf2670b92cc9..2575de7cc58336fbd85028a9be61dd0cb1c060c8 100644 (file)
@@ -1,6 +1,6 @@
 // Test bounds checking for DST raw slices
 // error-pattern:index out of bounds
-
+#[allow(unconditional_panic)]
 fn main() {
     let a: *const [_] = &[1, 2, 3];
     unsafe {
index ac2959fcd38535964a29fabd42a7fb1f426df5ef..f70b3ac920c6116258ae0ccd79ece1d8171b1171 100644 (file)
@@ -1,5 +1,5 @@
 // error-pattern:attempt to calculate the remainder with a divisor of zero
-
+#[allow(unconditional_panic)]
 fn main() {
     let y = 0;
     let _z = 1 % y;
index a9d28d1bebeb7b758a5810dd5c880b2042c79623..c1de6477585851296f8d535f682d61f24d75b1b5 100644 (file)
@@ -8,7 +8,7 @@
 pub fn main() {
     unsafe {
         let path = Path::new("libdylib.so");
-        let a = DynamicLibrary::open(Some(&path)).unwrap();
+        let a = DynamicLibrary::open(&path).unwrap();
         assert!(a.symbol::<isize>("fun1").is_ok());
         assert!(a.symbol::<isize>("fun2").is_ok());
         assert!(a.symbol::<isize>("fun3").is_ok());
index 35317dca1e824b5a3b8cf3575991d0618d6cea78..5d46be87eac6b2e3da1763e98461a606610ab412 100644 (file)
@@ -11,10 +11,7 @@ LOG := $(TMPDIR)/log.txt
 # are compiled with address sanitizer, and we assert that a fault in the cdylib
 # is correctly detected.
 
-# See comment in sanitizer-address/Makefile for why this is here
-EXTRA_RUSTFLAG=-C relocation-model=dynamic-no-pic
-
 all:
-       $(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) $(EXTRA_RUSTFLAG) library.rs
-       $(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) $(EXTRA_RUSTFLAG) -llibrary program.rs
+       $(RUSTC) -g -Z sanitizer=address --crate-type cdylib --target $(TARGET) library.rs
+       $(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) -llibrary program.rs
        LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
index 24d2ebd8f48aa00dbe89de9109909822620f04db..f62c3a6654ed414d36b74a7128b03555e0bca91a 100644 (file)
@@ -11,10 +11,7 @@ LOG := $(TMPDIR)/log.txt
 # are compiled with address sanitizer, and we assert that a fault in the dylib
 # is correctly detected.
 
-# See comment in sanitizer-address/Makefile for why this is here
-EXTRA_RUSTFLAG=-C relocation-model=dynamic-no-pic
-
 all:
-       $(RUSTC) -g -Z sanitizer=address --crate-type dylib --target $(TARGET) $(EXTRA_RUSTFLAG) library.rs
-       $(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) $(EXTRA_RUSTFLAG) -llibrary program.rs
+       $(RUSTC) -g -Z sanitizer=address --crate-type dylib --target $(TARGET) library.rs
+       $(RUSTC) -g -Z sanitizer=address --crate-type bin --target $(TARGET) -llibrary program.rs
        LD_LIBRARY_PATH=$(TMPDIR) $(TMPDIR)/program 2>&1 | $(CGREP) stack-buffer-overflow
index 9b3bcef2faf327ca9b25acdf4274634daf553466..57cac76aec2a5384243aa2d6fed45add8a19c416 100644 (file)
@@ -3,3 +3,5 @@
 all:
        $(RUSTC) err.rs -Z treat-err-as-bug 2>&1 \
            | $(CGREP) "panicked at 'aborting due to \`-Z treat-err-as-bug=1\`'"
+       $(RUSTC) delay_span_bug.rs -Z treat-err-as-bug 2>&1 \
+           | $(CGREP) "panicked at 'aborting due to \`-Z treat-err-as-bug=1\`'"
diff --git a/src/test/run-make-fulldeps/treat-err-as-bug/delay_span_bug.rs b/src/test/run-make-fulldeps/treat-err-as-bug/delay_span_bug.rs
new file mode 100644 (file)
index 0000000..dad33e4
--- /dev/null
@@ -0,0 +1,4 @@
+#![feature(rustc_attrs)]
+
+#[rustc_error(delay_span_bug_from_inside_query)]
+fn main() {}
diff --git a/src/test/ui-fulldeps/auxiliary/linkage-visibility.rs b/src/test/ui-fulldeps/auxiliary/linkage-visibility.rs
deleted file mode 100644 (file)
index 837ed1f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-// ignore-musl - dlsym doesn't see symbols without "-C link-arg=-Wl,--export-dynamic"
-
-#![feature(rustc_private)]
-
-extern crate rustc_metadata;
-
-use rustc_metadata::dynamic_lib::DynamicLibrary;
-
-#[no_mangle]
-pub fn foo() {
-    bar();
-}
-
-pub fn foo2<T>() {
-    fn bar2() {
-        bar();
-    }
-    bar2();
-}
-
-#[no_mangle]
-fn bar() {}
-
-#[allow(dead_code)]
-#[no_mangle]
-fn baz() {}
-
-pub fn test() {
-    let lib = DynamicLibrary::open(None).unwrap();
-    unsafe {
-        assert!(lib.symbol::<isize>("foo").is_ok());
-        assert!(lib.symbol::<isize>("baz").is_ok());
-        assert!(lib.symbol::<isize>("bar").is_ok());
-    }
-}
diff --git a/src/test/ui-fulldeps/linkage-visibility.rs b/src/test/ui-fulldeps/linkage-visibility.rs
deleted file mode 100644 (file)
index ae46fbc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// run-pass
-// aux-build:linkage-visibility.rs
-// ignore-android: FIXME(#10356)
-// ignore-windows: std::dynamic_lib does not work on Windows well
-// ignore-emscripten no dynamic linking
-
-extern crate linkage_visibility as foo;
-
-pub fn main() {
-    foo::test();
-    foo::foo2::<isize>();
-    foo::foo();
-}
index fe42113eb2ee9df6af0041c1183f4846bb8e096c..d288bba5957a282e169f541ad948623680730c33 100644 (file)
@@ -1,7 +1,7 @@
 #![warn(anonymous_parameters)]
 // Test for the anonymous_parameters deprecation lint (RFC 1685)
 
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // edition:2015
 // run-rustfix
 
index dc0357721ec73bf6ba559da92b3b0c7c9cea5ca8..d677e0c32b04a4ee9e1e2040fb39eeb162e009f6 100644 (file)
@@ -1,7 +1,7 @@
 #![warn(anonymous_parameters)]
 // Test for the anonymous_parameters deprecation lint (RFC 1685)
 
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // edition:2015
 // run-rustfix
 
diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.rs
new file mode 100644 (file)
index 0000000..be8162c
--- /dev/null
@@ -0,0 +1,15 @@
+// Check for recursion involving references to impl-associated const.
+
+trait Foo {
+    const BAR: u32;
+}
+
+const IMPL_REF_BAR: u32 = GlobalImplRef::BAR; //~ ERROR E0391
+
+struct GlobalImplRef;
+
+impl GlobalImplRef {
+    const BAR: u32 = IMPL_REF_BAR;
+}
+
+fn main() {}
diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.stderr
new file mode 100644 (file)
index 0000000..01a34d3
--- /dev/null
@@ -0,0 +1,44 @@
+error[E0391]: cycle detected when const-evaluating + checking `IMPL_REF_BAR`
+  --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
+   |
+LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: ...which requires const-evaluating + checking `IMPL_REF_BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
+   |
+LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `IMPL_REF_BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:7:1
+   |
+LL | const IMPL_REF_BAR: u32 = GlobalImplRef::BAR;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: ...which requires normalizing `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
+   |
+LL |     const BAR: u32 = IMPL_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
+   |
+LL |     const BAR: u32 = IMPL_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
+   |
+LL |     const BAR: u32 = IMPL_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 13:2>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-impl.rs:12:5
+   |
+LL |     const BAR: u32 = IMPL_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: ...which requires normalizing `IMPL_REF_BAR`...
+   = note: ...which again requires const-evaluating + checking `IMPL_REF_BAR`, completing the cycle
+   = note: cycle used when running analysis passes on this crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.rs b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.rs
new file mode 100644 (file)
index 0000000..cec75ae
--- /dev/null
@@ -0,0 +1,17 @@
+// Check for recursion involving references to trait-associated const default.
+
+trait Foo {
+    const BAR: u32;
+}
+
+trait FooDefault {
+    const BAR: u32 = DEFAULT_REF_BAR;
+}
+
+const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR; //~ ERROR E0391
+
+struct GlobalDefaultRef;
+
+impl FooDefault for GlobalDefaultRef {}
+
+fn main() {}
diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait-default.stderr
new file mode 100644 (file)
index 0000000..cad60cb
--- /dev/null
@@ -0,0 +1,44 @@
+error[E0391]: cycle detected when const-evaluating + checking `DEFAULT_REF_BAR`
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
+   |
+LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: ...which requires const-evaluating + checking `DEFAULT_REF_BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
+   |
+LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `DEFAULT_REF_BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:11:1
+   |
+LL | const DEFAULT_REF_BAR: u32 = <GlobalDefaultRef>::BAR;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: ...which requires normalizing `<GlobalDefaultRef as FooDefault>::BAR`...
+note: ...which requires const-evaluating + checking `FooDefault::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
+   |
+LL |     const BAR: u32 = DEFAULT_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating + checking `FooDefault::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
+   |
+LL |     const BAR: u32 = DEFAULT_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `FooDefault::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
+   |
+LL |     const BAR: u32 = DEFAULT_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing `FooDefault::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait-default.rs:8:5
+   |
+LL |     const BAR: u32 = DEFAULT_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: ...which requires normalizing `DEFAULT_REF_BAR`...
+   = note: ...which again requires const-evaluating + checking `DEFAULT_REF_BAR`, completing the cycle
+   = note: cycle used when running analysis passes on this crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.rs
new file mode 100644 (file)
index 0000000..62af853
--- /dev/null
@@ -0,0 +1,15 @@
+// Check for recursion involving references to trait-associated const.
+
+trait Foo {
+    const BAR: u32;
+}
+
+const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR; //~ ERROR E0391
+
+struct GlobalTraitRef;
+
+impl Foo for GlobalTraitRef {
+    const BAR: u32 = TRAIT_REF_BAR;
+}
+
+fn main() {}
diff --git a/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr b/src/test/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr
new file mode 100644 (file)
index 0000000..f415980
--- /dev/null
@@ -0,0 +1,44 @@
+error[E0391]: cycle detected when const-evaluating + checking `TRAIT_REF_BAR`
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
+   |
+LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: ...which requires const-evaluating + checking `TRAIT_REF_BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
+   |
+LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `TRAIT_REF_BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:7:1
+   |
+LL | const TRAIT_REF_BAR: u32 = <GlobalTraitRef>::BAR;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: ...which requires normalizing `<GlobalTraitRef as Foo>::BAR`...
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
+   |
+LL |     const BAR: u32 = TRAIT_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating + checking `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
+   |
+LL |     const BAR: u32 = TRAIT_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires const-evaluating `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
+   |
+LL |     const BAR: u32 = TRAIT_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+note: ...which requires processing `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 13:2>::BAR`...
+  --> $DIR/issue-24949-assoc-const-static-recursion-trait.rs:12:5
+   |
+LL |     const BAR: u32 = TRAIT_REF_BAR;
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = note: ...which requires normalizing `TRAIT_REF_BAR`...
+   = note: ...which again requires const-evaluating + checking `TRAIT_REF_BAR`, completing the cycle
+   = note: cycle used when running analysis passes on this crate
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
index 1dc7315e88c111b5fd480b796cba4e1e40731f45..0207752afe09892a3eb73c1b1afd2df3f619db94 100644 (file)
@@ -1,5 +1,8 @@
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 #![allow(unused)]
 
 // edition:2018
index 9a24bd8c9543953251f5bf54c02cab1e9bda9fcd..12d66b19e07d44cb9467d88a6dc9238c6e751ed8 100644 (file)
@@ -1,5 +1,8 @@
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 // edition:2018
 // aux-build:arc_wake.rs
 
index 00072786a50a7524997dc8d5cd8f5e16d2e1af8e..6c10ead3690b246af378e6cbca9bd88ed345a5fa 100644 (file)
@@ -2,6 +2,9 @@
 // edition:2018
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 #![allow(unused_variables)]
 
 // Test that the drop order for parameters in a fn and async fn matches up. Also test that
index e40acff6dc1175af0966a7fd5d5bafe6670b57d7..4ec43708584acb7e6c86d4b3f822ca11e462f1dc 100644 (file)
@@ -2,6 +2,9 @@
 // edition:2018
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 #![allow(unused_variables)]
 
 // Test the drop order for parameters relative to local variables and
index 9e8304935bffc6c713a7d8eaa5d7d5e56e3b7aa2..cfd68bc0d23458cfec4ae8f6a65f4dfb65edc738 100644 (file)
@@ -2,6 +2,9 @@
 // edition:2018
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 // Test that the drop order for parameters in a fn and async fn matches up. Also test that
 // parameters (used or unused) are not dropped until the async fn is cancelled.
 // This file is mostly copy-pasted from drop-order-for-async-fn-parameters.rs
index 1d77d420127a88d7e3acfb087be53c507245e255..9ecb3b1295ee4be5fea966f18f06ed60342a436e 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // edition:2018
 
 use std::future::Future;
index 72a45b5007d7af21488d040c7a99b84990299b7c..11920b07243e6e75bc9b97ccd7a60bde914445f9 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // edition:2018
 
 struct Xyz {
index ea780d9f62214922d558ee6d054562c07d952d0a..4ddebcf20a368f70e5c0b0663a12f8a4bbe32d22 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // edition:2018
 
 use std::future::Future;
index 0d015e54f8b1c3913477fa2329b627f178f659f8..66a3b07c3bd968d86523c5c269ced1838d44933d 100644 (file)
@@ -1,6 +1,6 @@
 // Test that opaque `impl Trait` types are allowed to contain late-bound regions.
 
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // edition:2018
 
 #![feature(type_alias_impl_trait)]
index 79cd0f5fbc358d62626cf332b6629fccf67daeb9..a3d5933965a4114b3ebdcb327a4775d80fcd4338 100644 (file)
@@ -2,7 +2,7 @@
 // for completeness since .rs files linked from .rc files support this
 // notation to specify their module's attributes
 
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![feature(rustc_attrs)]
 
index cc43210d8e3b9407044fc0bcfde577bcff7b9051..d9ca7ddc7cab731c95b4949ad2dc8f3a4c54462f 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 // Bastion of the Turbofish
 // ------------------------
diff --git a/src/test/ui/box-into-boxed-slice-fail.rs b/src/test/ui/box-into-boxed-slice-fail.rs
new file mode 100644 (file)
index 0000000..5f8a3fd
--- /dev/null
@@ -0,0 +1,15 @@
+// ignore-tidy-linelength
+#![feature(box_into_boxed_slice)]
+
+use std::boxed::Box;
+use std::fmt::Debug;
+fn main() {
+    let boxed_slice = Box::new([1,2,3]) as Box<[u8]>;
+    let _ = Box::into_boxed_slice(boxed_slice);
+    //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+    //~^^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+    let boxed_trait: Box<dyn Debug> = Box::new(5u8);
+    let _ = Box::into_boxed_slice(boxed_trait);
+    //~^ ERROR the size for values of type `dyn std::fmt::Debug` cannot be known at compilation time
+    //~^^ ERROR the size for values of type `dyn std::fmt::Debug` cannot be known at compilation time
+}
diff --git a/src/test/ui/box-into-boxed-slice-fail.stderr b/src/test/ui/box-into-boxed-slice-fail.stderr
new file mode 100644 (file)
index 0000000..dfc4999
--- /dev/null
@@ -0,0 +1,43 @@
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+  --> $DIR/box-into-boxed-slice-fail.rs:8:35
+   |
+LL |     let _ = Box::into_boxed_slice(boxed_slice);
+   |                                   ^^^^^^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `std::marker::Sized` is not implemented for `[u8]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+   = note: required by `std::boxed::Box::<T>::into_boxed_slice`
+
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+  --> $DIR/box-into-boxed-slice-fail.rs:8:13
+   |
+LL |     let _ = Box::into_boxed_slice(boxed_slice);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `std::marker::Sized` is not implemented for `[u8]`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+   = note: slice and array elements must have `Sized` type
+
+error[E0277]: the size for values of type `dyn std::fmt::Debug` cannot be known at compilation time
+  --> $DIR/box-into-boxed-slice-fail.rs:12:35
+   |
+LL |     let _ = Box::into_boxed_slice(boxed_trait);
+   |                                   ^^^^^^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `std::marker::Sized` is not implemented for `dyn std::fmt::Debug`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+   = note: required by `std::boxed::Box::<T>::into_boxed_slice`
+
+error[E0277]: the size for values of type `dyn std::fmt::Debug` cannot be known at compilation time
+  --> $DIR/box-into-boxed-slice-fail.rs:12:13
+   |
+LL |     let _ = Box::into_boxed_slice(boxed_trait);
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `std::marker::Sized` is not implemented for `dyn std::fmt::Debug`
+   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
+   = note: slice and array elements must have `Sized` type
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/box-into-boxed-slice.rs b/src/test/ui/box-into-boxed-slice.rs
new file mode 100644 (file)
index 0000000..61b3d91
--- /dev/null
@@ -0,0 +1,11 @@
+// run-pass
+#![feature(box_into_boxed_slice)]
+
+use std::boxed::Box;
+fn main() {
+    assert_eq!(Box::into_boxed_slice(Box::new(5u8)), Box::new([5u8]) as Box<[u8]>);
+    assert_eq!(Box::into_boxed_slice(Box::new([25u8])), Box::new([[25u8]]) as Box<[[u8; 1]]>);
+    let a: Box<[Box<[u8; 1]>]> = Box::into_boxed_slice(Box::new(Box::new([5u8])));
+    let b: Box<[Box<[u8; 1]>]> = Box::new([Box::new([5u8])]);
+    assert_eq!(a, b);
+}
index 5027b78b38e34181c271a35d50b75654df135543..de2ffc2e5dc1d0e1e704c139262e638096c120d3 100644 (file)
@@ -4,7 +4,11 @@ error[E0404]: expected trait, found type alias `Bar`
 LL | impl Bar for Baz { }
    |      ^^^ type aliases cannot be used as traits
    |
-   = note: did you mean to use a trait alias?
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+  --> $DIR/two_files_data.rs:5:1
+   |
+LL | type Bar = dyn Foo;
+   | ^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to previous error
 
index 3994d3186817d004e4e4df3e11332b7cfcb33fc0..34582de45cb9c71cc141d2a18b466f53f1192daf 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 fn main() {
     let s = "ZͨA͑ͦ͒͋ͤ͑̚L̄͑͋Ĝͨͥ̿͒̽̈́Oͥ͛ͭ!̏"; while true { break; } //~ WARNING while_true
index 0fbd0bbcbaebd4972f84b5bc640b5613cd558675..303bc8326fdb7ef1e7d82876e3dc50bf2ab70d0e 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 #![feature(const_generics)]
 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
 
index b810efe73847e10c10ccda303e2a645136583642..fb234eb08275ef768bc1523d5538ab07bab7e21b 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![feature(const_generics)]
 //~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
diff --git a/src/test/ui/const-generics/issues/issue-69654.rs b/src/test/ui/const-generics/issues/issue-69654.rs
new file mode 100644 (file)
index 0000000..2befbe5
--- /dev/null
@@ -0,0 +1,18 @@
+#![feature(const_generics)]
+#![allow(incomplete_features)]
+
+trait Bar<O> {}
+impl<O> Bar<O> for [u8; O] {}
+//~^ ERROR expected value, found type parameter `O`
+
+struct Foo<const O: usize> {}
+impl<const O: usize> Foo<O>
+where
+    [u8; O]: Bar<[(); O]>,
+{
+    fn foo() {}
+}
+
+fn main() {
+    Foo::foo();
+}
diff --git a/src/test/ui/const-generics/issues/issue-69654.stderr b/src/test/ui/const-generics/issues/issue-69654.stderr
new file mode 100644 (file)
index 0000000..9d52603
--- /dev/null
@@ -0,0 +1,14 @@
+error[E0423]: expected value, found type parameter `O`
+  --> $DIR/issue-69654.rs:5:25
+   |
+LL | impl<O> Bar<O> for [u8; O] {}
+   |                         ^ help: a tuple variant with a similar name exists: `Ok`
+   | 
+  ::: $SRC_DIR/libcore/result.rs:LL:COL
+   |
+LL |     Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
+   |     --------------------------------------------------- similarly named tuple variant `Ok` defined here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0423`.
diff --git a/src/test/ui/consts/const_in_pattern/accept_structural.rs b/src/test/ui/consts/const_in_pattern/accept_structural.rs
new file mode 100644 (file)
index 0000000..5093fe5
--- /dev/null
@@ -0,0 +1,66 @@
+// run-pass
+
+#![warn(indirect_structural_match)]
+
+// This test is checking our logic for structural match checking by enumerating
+// the different kinds of const expressions. This test is collecting cases where
+// we have accepted the const expression as a pattern in the past and wish to
+// continue doing so.
+//
+// Even if a non-structural-match type is part of an expression in a const's
+// definition, that does not necessarily disqualify the const from being a match
+// pattern: in principle, we just need the types involved in the final value to
+// be structurally matchable.
+
+// See also RFC 1445
+
+#![feature(type_ascription)]
+
+#[derive(Copy, Clone, Debug)]
+struct NoPartialEq(u32);
+
+#[derive(Copy, Clone, Debug)]
+struct NoDerive(u32);
+
+// This impl makes `NoDerive` irreflexive.
+impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } }
+impl Eq for NoDerive { }
+
+type OND = Option<NoDerive>;
+
+fn main() {
+    const FIELD1: u32 = NoPartialEq(1).0;
+    match 1 { FIELD1 => dbg!(FIELD1), _ => panic!("whoops"), };
+    const FIELD2: u32 = NoDerive(1).0;
+    match 1 { FIELD2 => dbg!(FIELD2), _ => panic!("whoops"), };
+
+    enum CLike { One = 1, #[allow(dead_code)] Two = 2, }
+    const ONE_CAST: u32 = CLike::One as u32;
+    match 1 { ONE_CAST => dbg!(ONE_CAST), _ => panic!("whoops"), };
+
+    const NO_DERIVE_NONE: OND = None;
+    const INDIRECT: OND = NO_DERIVE_NONE;
+    match None { INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
+
+    const TUPLE: (OND, OND) = (None, None);
+    match (None, None) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
+
+    const TYPE_ASCRIPTION: OND = None: OND;
+    match None { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
+
+    const ARRAY: [OND; 2] = [None, None];
+    match [None; 2] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
+
+    const REPEAT: [OND; 2] = [None; 2];
+    match [None, None] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+
+    trait Trait: Sized { const ASSOC: Option<Self>; }
+    impl Trait for NoDerive { const ASSOC: Option<NoDerive> = None; }
+    match None { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
+
+    const BLOCK: OND = { NoDerive(10); None };
+    match None { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
+
+    const ADDR_OF: &OND = &None;
+    match &None { ADDR_OF => dbg!(ADDR_OF),  _ => panic!("whoops"), };
+}
diff --git a/src/test/ui/consts/const_in_pattern/auxiliary/consts.rs b/src/test/ui/consts/const_in_pattern/auxiliary/consts.rs
new file mode 100644 (file)
index 0000000..303c2f1
--- /dev/null
@@ -0,0 +1,11 @@
+pub struct CustomEq;
+
+impl Eq for CustomEq {}
+impl PartialEq for CustomEq {
+    fn eq(&self, _: &Self) -> bool {
+        false
+    }
+}
+
+pub const NONE: Option<CustomEq> = None;
+pub const SOME: Option<CustomEq> = Some(CustomEq);
diff --git a/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs b/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs
new file mode 100644 (file)
index 0000000..c9e6050
--- /dev/null
@@ -0,0 +1,15 @@
+// aux-build:consts.rs
+
+#![warn(indirect_structural_match)]
+
+extern crate consts;
+
+fn main() {
+    match None {
+        consts::SOME => panic!(),
+        //~^ must be annotated with `#[derive(PartialEq, Eq)]`
+        //~| must be annotated with `#[derive(PartialEq, Eq)]`
+
+        _ => {}
+    }
+}
diff --git a/src/test/ui/consts/const_in_pattern/cross-crate-fail.stderr b/src/test/ui/consts/const_in_pattern/cross-crate-fail.stderr
new file mode 100644 (file)
index 0000000..c97298f
--- /dev/null
@@ -0,0 +1,14 @@
+error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/cross-crate-fail.rs:9:9
+   |
+LL |         consts::SOME => panic!(),
+   |         ^^^^^^^^^^^^
+
+error: to use a constant of type `consts::CustomEq` in a pattern, `consts::CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/cross-crate-fail.rs:9:9
+   |
+LL |         consts::SOME => panic!(),
+   |         ^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/consts/const_in_pattern/cross-crate-pass.rs b/src/test/ui/consts/const_in_pattern/cross-crate-pass.rs
new file mode 100644 (file)
index 0000000..ccf655c
--- /dev/null
@@ -0,0 +1,14 @@
+// run-pass
+// aux-build:consts.rs
+
+#![warn(indirect_structural_match)]
+
+extern crate consts;
+use consts::CustomEq;
+
+fn main() {
+    match Some(CustomEq) {
+        consts::NONE => panic!(),
+        _ => {}
+    }
+}
diff --git a/src/test/ui/consts/const_in_pattern/custom-eq-branch-pass.rs b/src/test/ui/consts/const_in_pattern/custom-eq-branch-pass.rs
new file mode 100644 (file)
index 0000000..81a2024
--- /dev/null
@@ -0,0 +1,33 @@
+// run-pass
+
+#![feature(const_if_match)]
+#![warn(indirect_structural_match)]
+
+struct CustomEq;
+
+impl Eq for CustomEq {}
+impl PartialEq for CustomEq {
+    fn eq(&self, _: &Self) -> bool {
+        false
+    }
+}
+
+#[derive(PartialEq, Eq)]
+enum Foo {
+    Bar,
+    Baz,
+    Qux(CustomEq),
+}
+
+const BAR_BAZ: Foo = if 42 == 42 {
+    Foo::Bar
+} else {
+    Foo::Baz
+};
+
+fn main() {
+    match Foo::Qux(CustomEq) {
+        BAR_BAZ => panic!(),
+        _ => {}
+    }
+}
diff --git a/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.rs b/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.rs
new file mode 100644 (file)
index 0000000..21c4de6
--- /dev/null
@@ -0,0 +1,39 @@
+// check-pass
+
+#![feature(const_if_match)]
+#![warn(indirect_structural_match)]
+//~^ NOTE lint level is defined here
+
+struct CustomEq;
+
+impl Eq for CustomEq {}
+impl PartialEq for CustomEq {
+    fn eq(&self, _: &Self) -> bool {
+        false
+    }
+}
+
+#[derive(PartialEq, Eq)]
+enum Foo {
+    Bar,
+    Baz,
+    Qux(CustomEq),
+}
+
+// We know that `BAR_BAZ` will always be `Foo::Bar` and thus eligible for structural matching, but
+// dataflow will be more conservative.
+const BAR_BAZ: Foo = if 42 == 42 {
+    Foo::Bar
+} else {
+    Foo::Qux(CustomEq)
+};
+
+fn main() {
+    match Foo::Qux(CustomEq) {
+        BAR_BAZ => panic!(),
+        //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+        //~| WARN this was previously accepted
+        //~| NOTE see issue #62411
+        _ => {}
+    }
+}
diff --git a/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr b/src/test/ui/consts/const_in_pattern/custom-eq-branch-warn.stderr
new file mode 100644 (file)
index 0000000..06ec2a7
--- /dev/null
@@ -0,0 +1,16 @@
+warning: to use a constant of type `CustomEq` in a pattern, `CustomEq` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/custom-eq-branch-warn.rs:33:9
+   |
+LL |         BAR_BAZ => panic!(),
+   |         ^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/custom-eq-branch-warn.rs:4:9
+   |
+LL | #![warn(indirect_structural_match)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+warning: 1 warning emitted
+
diff --git a/src/test/ui/consts/const_in_pattern/issue-62614.rs b/src/test/ui/consts/const_in_pattern/issue-62614.rs
new file mode 100644 (file)
index 0000000..4ea9a28
--- /dev/null
@@ -0,0 +1,24 @@
+// run-pass
+
+struct Sum(u32, u32);
+
+impl PartialEq for Sum {
+    fn eq(&self, other: &Self) -> bool { self.0 + self.1 == other.0 + other.1 }
+}
+
+impl Eq for Sum { }
+
+#[derive(PartialEq, Eq)]
+enum Eek {
+    TheConst,
+    UnusedByTheConst(Sum)
+}
+
+const THE_CONST: Eek = Eek::TheConst;
+
+pub fn main() {
+    match Eek::UnusedByTheConst(Sum(1,2)) {
+        THE_CONST => { panic!(); }
+        _ => {}
+    }
+}
diff --git a/src/test/ui/consts/const_in_pattern/issue-65466.rs b/src/test/ui/consts/const_in_pattern/issue-65466.rs
new file mode 100644 (file)
index 0000000..0e3e0f6
--- /dev/null
@@ -0,0 +1,23 @@
+// FIXME: This still ICEs.
+//
+// ignore-test
+
+#![deny(indirect_structural_match)]
+
+#[derive(PartialEq, Eq)]
+enum O<T> {
+    Some(*const T), // Can also use PhantomData<T>
+    None,
+}
+
+struct B;
+
+const C: &[O<B>] = &[O::None];
+
+fn main() {
+    let x = O::None;
+    match &[x][..] {
+        C => (),
+        _ => (),
+    }
+}
diff --git a/src/test/ui/consts/const_in_pattern/issue-65466.stderr b/src/test/ui/consts/const_in_pattern/issue-65466.stderr
new file mode 100644 (file)
index 0000000..9fe3049
--- /dev/null
@@ -0,0 +1,15 @@
+error[E0601]: `main` function not found in crate `issue_65466`
+  --> $DIR/issue-65466.rs:1:1
+   |
+LL | / #![deny(indirect_structural_match)]
+LL | |
+LL | | #[derive(PartialEq, Eq)]
+LL | | enum O<T> {
+...  |
+LL | |     }
+LL | | }
+   | |_^ consider adding a `main` function to `$DIR/issue-65466.rs`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0601`.
diff --git a/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs b/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.rs
new file mode 100644 (file)
index 0000000..28b3fbb
--- /dev/null
@@ -0,0 +1,27 @@
+#![feature(const_if_match)]
+#![warn(indirect_structural_match)]
+
+struct NoEq;
+
+enum Foo {
+    Bar,
+    Baz,
+    Qux(NoEq),
+}
+
+// Even though any of these values can be compared structurally, we still disallow it in a pattern
+// because `Foo` does not impl `PartialEq`.
+const BAR_BAZ: Foo = if 42 == 42 {
+    Foo::Baz
+} else {
+    Foo::Bar
+};
+
+fn main() {
+    match Foo::Qux(NoEq) {
+        BAR_BAZ => panic!(),
+        //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+        //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+        _ => {}
+    }
+}
diff --git a/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.stderr b/src/test/ui/consts/const_in_pattern/no-eq-branch-fail.stderr
new file mode 100644 (file)
index 0000000..cb870ec
--- /dev/null
@@ -0,0 +1,14 @@
+error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/no-eq-branch-fail.rs:22:9
+   |
+LL |         BAR_BAZ => panic!(),
+   |         ^^^^^^^
+
+error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/no-eq-branch-fail.rs:22:9
+   |
+LL |         BAR_BAZ => panic!(),
+   |         ^^^^^^^
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/consts/const_in_pattern/reject_non_partial_eq.rs b/src/test/ui/consts/const_in_pattern/reject_non_partial_eq.rs
new file mode 100644 (file)
index 0000000..a821690
--- /dev/null
@@ -0,0 +1,32 @@
+// This test is illustrating the difference between how failing to derive
+// `PartialEq` is handled compared to failing to implement it at all.
+
+// See also RFC 1445
+
+#[derive(PartialEq, Eq)]
+struct Structural(u32);
+
+struct NoPartialEq(u32);
+
+struct NoDerive(u32);
+
+// This impl makes NoDerive irreflexive.
+impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } }
+
+impl Eq for NoDerive { }
+
+const NO_DERIVE_NONE: Option<NoDerive> = None;
+const NO_PARTIAL_EQ_NONE: Option<NoPartialEq> = None;
+
+fn main() {
+    match None {
+        NO_DERIVE_NONE => println!("NO_DERIVE_NONE"),
+        _ => panic!("whoops"),
+    }
+
+    match None {
+        NO_PARTIAL_EQ_NONE => println!("NO_PARTIAL_EQ_NONE"),
+        //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+        _ => panic!("whoops"),
+    }
+}
diff --git a/src/test/ui/consts/const_in_pattern/reject_non_partial_eq.stderr b/src/test/ui/consts/const_in_pattern/reject_non_partial_eq.stderr
new file mode 100644 (file)
index 0000000..95cfa4a
--- /dev/null
@@ -0,0 +1,8 @@
+error: to use a constant of type `NoPartialEq` in a pattern, `NoPartialEq` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_partial_eq.rs:28:9
+   |
+LL |         NO_PARTIAL_EQ_NONE => println!("NO_PARTIAL_EQ_NONE"),
+   |         ^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/consts/const_in_pattern/reject_non_structural.rs b/src/test/ui/consts/const_in_pattern/reject_non_structural.rs
new file mode 100644 (file)
index 0000000..bbeaeea
--- /dev/null
@@ -0,0 +1,93 @@
+// This test of structural match checking enumerates the different kinds of
+// const definitions, collecting cases where the const pattern is rejected.
+//
+// Note: Even if a non-structural-match type is part of an expression in a
+// const's definition, that does not necessarily disqualify the const from being
+// a match pattern: in principle, we just need the types involved in the final
+// value to be structurally matchable.
+
+// See also RFC 1445
+
+#![feature(type_ascription)]
+#![warn(indirect_structural_match)]
+//~^ NOTE lint level is defined here
+
+#[derive(Copy, Clone, Debug)]
+struct NoPartialEq;
+
+#[derive(Copy, Clone, Debug)]
+struct NoDerive;
+
+// This impl makes `NoDerive` irreflexive.
+impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } }
+
+impl Eq for NoDerive { }
+
+type OND = Option<NoDerive>;
+
+struct TrivialEq(OND);
+
+// This impl makes `TrivialEq` trivial.
+impl PartialEq for TrivialEq { fn eq(&self, _: &Self) -> bool { true } }
+
+impl Eq for TrivialEq { }
+
+fn main() {
+    #[derive(PartialEq, Eq, Debug)]
+    enum Derive<X> { Some(X), None, }
+
+    const ENUM: Derive<NoDerive> = Derive::Some(NoDerive);
+    match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), };
+    //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+    const FIELD: OND = TrivialEq(Some(NoDerive)).0;
+    match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), };
+    //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+    const NO_DERIVE_SOME: OND = Some(NoDerive);
+    const INDIRECT: OND = NO_DERIVE_SOME;
+    match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
+    //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+    const TUPLE: (OND, OND) = (None, Some(NoDerive));
+    match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
+    //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+    const TYPE_ASCRIPTION: OND = Some(NoDerive): OND;
+    match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
+    //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+    const ARRAY: [OND; 2] = [None, Some(NoDerive)];
+    match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
+    //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+    const REPEAT: [OND; 2] = [Some(NoDerive); 2];
+    match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+    //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+    trait Trait: Sized { const ASSOC: Option<Self>; }
+    impl Trait for NoDerive { const ASSOC: Option<NoDerive> = Some(NoDerive); }
+    match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
+    //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+    const BLOCK: OND = { NoDerive; Some(NoDerive) };
+    match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
+    //~^ ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| ERROR must be annotated with `#[derive(PartialEq, Eq)]`
+
+    const ADDR_OF: &OND = &Some(NoDerive);
+    match &Some(NoDerive) { ADDR_OF => dbg!(ADDR_OF), _ => panic!("whoops"), };
+    //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| WARN previously accepted by the compiler but is being phased out
+    //~| NOTE for more information, see issue #62411
+}
diff --git a/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr b/src/test/ui/consts/const_in_pattern/reject_non_structural.stderr
new file mode 100644 (file)
index 0000000..b1310cf
--- /dev/null
@@ -0,0 +1,136 @@
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:40:36
+   |
+LL |     match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), };
+   |                                    ^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:45:28
+   |
+LL |     match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), };
+   |                            ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:51:27
+   |
+LL |     match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
+   |                           ^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:56:36
+   |
+LL |     match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
+   |                                    ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:61:28
+   |
+LL |     match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
+   |                            ^^^^^^^^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:66:36
+   |
+LL |     match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
+   |                                    ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:71:33
+   |
+LL |     match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+   |                                 ^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:71:33
+   |
+LL |     match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+   |                                 ^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:79:28
+   |
+LL |     match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
+   |                            ^^^^^^^^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:84:28
+   |
+LL |     match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
+   |                            ^^^^^
+
+warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:89:29
+   |
+LL |     match &Some(NoDerive) { ADDR_OF => dbg!(ADDR_OF), _ => panic!("whoops"), };
+   |                             ^^^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/reject_non_structural.rs:12:9
+   |
+LL | #![warn(indirect_structural_match)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:40:36
+   |
+LL |     match Derive::Some(NoDerive) { ENUM => dbg!(ENUM), _ => panic!("whoops"), };
+   |                                    ^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:45:28
+   |
+LL |     match Some(NoDerive) { FIELD => dbg!(FIELD), _ => panic!("whoops"), };
+   |                            ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:51:27
+   |
+LL |     match Some(NoDerive) {INDIRECT => dbg!(INDIRECT), _ => panic!("whoops"), };
+   |                           ^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:56:36
+   |
+LL |     match (None, Some(NoDerive)) { TUPLE => dbg!(TUPLE), _ => panic!("whoops"), };
+   |                                    ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:61:28
+   |
+LL |     match Some(NoDerive) { TYPE_ASCRIPTION => dbg!(TYPE_ASCRIPTION), _ => panic!("whoops"), };
+   |                            ^^^^^^^^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:66:36
+   |
+LL |     match [None, Some(NoDerive)] { ARRAY => dbg!(ARRAY), _ => panic!("whoops"), };
+   |                                    ^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:71:33
+   |
+LL |     match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+   |                                 ^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:71:33
+   |
+LL |     match [Some(NoDerive); 2] { REPEAT => dbg!(REPEAT), _ => panic!("whoops"), };
+   |                                 ^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:79:28
+   |
+LL |     match Some(NoDerive) { NoDerive::ASSOC => dbg!(NoDerive::ASSOC), _ => panic!("whoops"), };
+   |                            ^^^^^^^^^^^^^^^
+
+error: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/reject_non_structural.rs:84:28
+   |
+LL |     match Some(NoDerive) { BLOCK => dbg!(BLOCK), _ => panic!("whoops"), };
+   |                            ^^^^^
+
+error: aborting due to 20 previous errors; 1 warning emitted
+
diff --git a/src/test/ui/consts/const_in_pattern/warn_corner_cases.rs b/src/test/ui/consts/const_in_pattern/warn_corner_cases.rs
new file mode 100644 (file)
index 0000000..c6b794d
--- /dev/null
@@ -0,0 +1,41 @@
+// run-pass
+
+// This test is checking our logic for structural match checking by enumerating
+// the different kinds of const expressions. This test is collecting cases where
+// we have accepted the const expression as a pattern in the past but we want
+// to begin warning the user that a future version of Rust may start rejecting
+// such const expressions.
+
+// The specific corner cases we are exploring here are instances where the
+// const-evaluator computes a value that *does* meet the conditions for
+// structural-match, but the const expression itself has abstractions (like
+// calls to const functions) that may fit better with a type-based analysis
+// rather than a committment to a specific value.
+
+#![warn(indirect_structural_match)]
+
+#[derive(Copy, Clone, Debug)]
+struct NoDerive(u32);
+
+// This impl makes `NoDerive` irreflexive.
+impl PartialEq for NoDerive { fn eq(&self, _: &Self) -> bool { false } }
+impl Eq for NoDerive { }
+
+fn main() {
+    const INDEX: Option<NoDerive> = [None, Some(NoDerive(10))][0];
+    match None { Some(_) => panic!("whoops"), INDEX => dbg!(INDEX), };
+    //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| WARN this was previously accepted
+
+    const fn build() -> Option<NoDerive> { None }
+    const CALL: Option<NoDerive> = build();
+    match None { Some(_) => panic!("whoops"), CALL => dbg!(CALL), };
+    //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| WARN this was previously accepted
+
+    impl NoDerive { const fn none() -> Option<NoDerive> { None } }
+    const METHOD_CALL: Option<NoDerive> = NoDerive::none();
+    match None { Some(_) => panic!("whoops"), METHOD_CALL => dbg!(METHOD_CALL), };
+    //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
+    //~| WARN this was previously accepted
+}
diff --git a/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr b/src/test/ui/consts/const_in_pattern/warn_corner_cases.stderr
new file mode 100644 (file)
index 0000000..3e7ed57
--- /dev/null
@@ -0,0 +1,34 @@
+warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/warn_corner_cases.rs:26:47
+   |
+LL |     match None { Some(_) => panic!("whoops"), INDEX => dbg!(INDEX), };
+   |                                               ^^^^^
+   |
+note: the lint level is defined here
+  --> $DIR/warn_corner_cases.rs:15:9
+   |
+LL | #![warn(indirect_structural_match)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/warn_corner_cases.rs:32:47
+   |
+LL |     match None { Some(_) => panic!("whoops"), CALL => dbg!(CALL), };
+   |                                               ^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+warning: to use a constant of type `NoDerive` in a pattern, `NoDerive` must be annotated with `#[derive(PartialEq, Eq)]`
+  --> $DIR/warn_corner_cases.rs:38:47
+   |
+LL |     match None { Some(_) => panic!("whoops"), METHOD_CALL => dbg!(METHOD_CALL), };
+   |                                               ^^^^^^^^^^^
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
+
+warning: 3 warnings emitted
+
index 07af83104241c7c2b6ea2691df4dd20dca301068..9d44aa1361cfc53223d221f3e6b093c153e5c2f4 100644 (file)
@@ -7,6 +7,7 @@
 fn foo<'a>() -> &'a () {
     Hash([0; HASH_LEN]);
     init_hash(&mut [0; HASH_LEN]);
+    let (_array,) = ([0; HASH_LEN],);
     &()
 }
 
diff --git a/src/test/ui/consts/recursive-zst-static.default.stderr b/src/test/ui/consts/recursive-zst-static.default.stderr
new file mode 100644 (file)
index 0000000..d424b22
--- /dev/null
@@ -0,0 +1,21 @@
+error[E0391]: cycle detected when const-evaluating `FOO`
+  --> $DIR/recursive-zst-static.rs:10:18
+   |
+LL | static FOO: () = FOO;
+   |                  ^^^
+   |
+note: ...which requires const-evaluating `FOO`...
+  --> $DIR/recursive-zst-static.rs:10:1
+   |
+LL | static FOO: () = FOO;
+   | ^^^^^^^^^^^^^^^^^^^^^
+   = note: ...which again requires const-evaluating `FOO`, completing the cycle
+note: cycle used when const-evaluating + checking `FOO`
+  --> $DIR/recursive-zst-static.rs:10:1
+   |
+LL | static FOO: () = FOO;
+   | ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
index 768df58e1e32e65ed229813af56a6b2309a32c63..29a467c006a492d6f16e3676672ce2452795ddbc 100644 (file)
@@ -1,3 +1,6 @@
+// revisions: default unleash
+//[unleash]compile-flags: -Zunleash-the-miri-inside-of-you
+
 // This test ensures that we do not allow ZST statics to initialize themselves without ever
 // actually creating a value of that type. This is important, as the ZST may have private fields
 // that users can reasonably expect to only get initialized by their own code. Thus unsafe code
diff --git a/src/test/ui/consts/recursive-zst-static.stderr b/src/test/ui/consts/recursive-zst-static.stderr
deleted file mode 100644 (file)
index e21dcf6..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-error[E0391]: cycle detected when const-evaluating `FOO`
-  --> $DIR/recursive-zst-static.rs:7:18
-   |
-LL | static FOO: () = FOO;
-   |                  ^^^
-   |
-note: ...which requires const-evaluating `FOO`...
-  --> $DIR/recursive-zst-static.rs:7:1
-   |
-LL | static FOO: () = FOO;
-   | ^^^^^^^^^^^^^^^^^^^^^
-   = note: ...which again requires const-evaluating `FOO`, completing the cycle
-note: cycle used when const-evaluating + checking `FOO`
-  --> $DIR/recursive-zst-static.rs:7:1
-   |
-LL | static FOO: () = FOO;
-   | ^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0391`.
diff --git a/src/test/ui/consts/recursive-zst-static.unleash.stderr b/src/test/ui/consts/recursive-zst-static.unleash.stderr
new file mode 100644 (file)
index 0000000..d424b22
--- /dev/null
@@ -0,0 +1,21 @@
+error[E0391]: cycle detected when const-evaluating `FOO`
+  --> $DIR/recursive-zst-static.rs:10:18
+   |
+LL | static FOO: () = FOO;
+   |                  ^^^
+   |
+note: ...which requires const-evaluating `FOO`...
+  --> $DIR/recursive-zst-static.rs:10:1
+   |
+LL | static FOO: () = FOO;
+   | ^^^^^^^^^^^^^^^^^^^^^
+   = note: ...which again requires const-evaluating `FOO`, completing the cycle
+note: cycle used when const-evaluating + checking `FOO`
+  --> $DIR/recursive-zst-static.rs:10:1
+   |
+LL | static FOO: () = FOO;
+   | ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0391`.
index 363bda75f16955a20f6f4bac58bd1dce606f9e7a..d8485ed7da169e552bd41a47f52e74346f3267d7 100644 (file)
@@ -1,5 +1,5 @@
 // run-rustfix
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #[allow(deprecated, unused_imports)]
 use std::sync::atomic::{AtomicIsize, ATOMIC_ISIZE_INIT};
index 00c5f7b0b1257dcfc28001fc07387d6ee03895de..b15a1bbfd92d6c0f6a7a9a569a29136135ac599a 100644 (file)
@@ -1,5 +1,5 @@
 // run-rustfix
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #[allow(deprecated, unused_imports)]
 use std::sync::atomic::{AtomicIsize, ATOMIC_ISIZE_INIT};
index 0b4c8f3952fcd0f630ed485f823daae8df20b043..35c3065ea815081e1bbb3422d84a2c43cd0a1a57 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // compile-flags: -Wunused
 
 // ensure there are no special warnings about uninhabited types
index 93fe69e0af2172305a0408eea0e65007791524ec..8d142cea5de00f06c0454a90929c62335aca5e71 100644 (file)
@@ -1,6 +1,6 @@
 // aux-build:edition-extern-crate-allowed.rs
 // edition:2015
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![warn(rust_2018_idioms)]
 
index 4309a777d33f78a781195aabd51775c8041b09c7..1049a2da8fd1c96fb0d80707885630ff7b59c97f 100644 (file)
@@ -1,5 +1,5 @@
 // edition:2018
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![feature(rust_2018_preview)]
 //~^ WARN the feature `rust_2018_preview` is included in the Rust 2018 edition
index 6aab237b94d628a34c8186bfb9ae9d5038cd7a59..984a7fabb6633ee8c750b69c46993dff237da645 100644 (file)
@@ -1,5 +1,5 @@
 // compile-flags:--emit=metadata --error-format=json --json artifacts
-// build-pass (FIXME(62277): could be check-pass?)
+// build-pass
 // ignore-pass
 // ^-- needed because `--pass check` does not emit the output needed.
 
index a985e963e5726b547b20125863d5629c99e571b4..d4860394259b7e1aeac169d0d628c8926c42cac2 100644 (file)
@@ -45,9 +45,12 @@ error[E0423]: expected value, found struct `T`
   --> $DIR/E0423.rs:14:8
    |
 LL |     if T {} == T {} { println!("Ok"); }
-   |        ^---
-   |        |
-   |        help: surround the struct literal with parenthesis: `(T {})`
+   |        ^
+   |
+help: surround the struct literal with parentheses
+   |
+LL |     if (T {}) == T {} { println!("Ok"); }
+   |        ^    ^
 
 error: aborting due to 5 previous errors
 
index 4e32ef355606cb5c67778f69411522b5d26c71c4..05abcb629b1c88e9b5232933bbe6a66c32739c17 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 // This is a stub feature that doesn't control anything, so to make tidy happy,
 // gate-test-test_2018_feature
index 28973d67564824b5f7a9138b26e3ebd02ce70b24..5364d92e0c46b43b1549895eb479a290317b0984 100644 (file)
@@ -1,2 +1,2 @@
 // compile-flags: --explain E0591
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
index e4118546616035b4ccfb6f247c2435db1ade19b9..b4e9da0fc84051339a5be4ccc69ed34173558275 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![warn(unused_must_use)]
 
index 990d94e6efc1bb5245bef77147675f7b34ab945d..0927df86927e01333019341f8513428c73baa76a 100644 (file)
@@ -1,5 +1,8 @@
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 #![feature(generators, generator_trait)]
 
 use std::ops::Generator;
index 9d4c217b76ed783bae301916e4585f5d4f6077a2..4f69c7855605a2454b37e4a88073358d6c37abb7 100644 (file)
@@ -1,5 +1,8 @@
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 #![feature(generators, generator_trait)]
 
 use std::marker::Unpin;
index 7ba711881045dd25c521f67934e492fcdf3c97ea..66dfb8c2c09843b31054cb260033ce810c4510aa 100644 (file)
@@ -1,5 +1,8 @@
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 #![feature(generators, generator_trait)]
 
 use std::ops::Generator;
index 32f3ee32d77b9d96eb1320eca4ab4edce2c5129c..fa9271c538f532ae1c5eced303bebc0313dece83 100644 (file)
@@ -1,5 +1,8 @@
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 #![feature(generators, generator_trait)]
 
 use std::fmt::Debug;
index 9289710b34bf980f58244e0459aad8794ae5b9dd..7a917a05dd9a629fc997cd6144c099178a8fce09 100644 (file)
@@ -1,5 +1,8 @@
 // run-pass
 
+// revisions: default nomiropt
+//[nomiropt]compile-flags: -Z mir-opt-level=0
+
 // ignore-emscripten no threads support
 // compile-flags: --test
 
index 157eb3863203ae62d72f40e6b8e8ec9122106498..2ab0f9fed3fc67fc9b0b4dcd99addc3f62327848 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 fn macros() {
     macro_rules! foo{
index 04b8c3aa35396374ba058fc471b989d485ae34eb..af272633f210d4d80e0abaf415d1a930fbb5f1bb 100644 (file)
@@ -1,6 +1,8 @@
 error[E0277]: `?` couldn't convert the error to `()`
   --> $DIR/issue-32709.rs:4:11
    |
+LL | fn a() -> Result<i32, ()> {
+   |           --------------- expected `()` because of this
 LL |     Err(5)?;
    |           ^ the trait `std::convert::From<{integer}>` is not implemented for `()`
    |
index 055886bf3676cd169c1787459ebb1461d3a5db6c..7dfa9c7bcdffebeeed1429c4620af026b1edd172 100644 (file)
@@ -14,8 +14,6 @@ fn main() {
     //~^ ERROR `a` does not live long enough [E0597]
     match b {
         <() as Foo<'static>>::C => { }
-        //~^ WARN must be annotated with `#[derive(PartialEq, Eq)]`
-        //~| WARN will become a hard error in a future release
         _ => { }
     }
 }
index d526ddb78e98ec6f0f952d668c114ba32b051821..bf3e58e8cdb19b1c5cfea5247b1bba8e6cc4af73 100644 (file)
@@ -1,17 +1,3 @@
-warning: to use a constant of type `std::cell::Cell` in a pattern, `std::cell::Cell` must be annotated with `#[derive(PartialEq, Eq)]`
-  --> $DIR/issue-55511.rs:16:9
-   |
-LL |         <() as Foo<'static>>::C => { }
-   |         ^^^^^^^^^^^^^^^^^^^^^^^
-   |
-note: the lint level is defined here
-  --> $DIR/issue-55511.rs:1:9
-   |
-LL | #![warn(indirect_structural_match)]
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^
-   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-   = note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
-
 error[E0597]: `a` does not live long enough
   --> $DIR/issue-55511.rs:13:28
    |
@@ -24,6 +10,6 @@ LL |         <() as Foo<'static>>::C => { }
 LL | }
    | - `a` dropped here while still borrowed
 
-error: aborting due to previous error; 1 warning emitted
+error: aborting due to previous error
 
 For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/issues/issue-71406.rs b/src/test/ui/issues/issue-71406.rs
new file mode 100644 (file)
index 0000000..6266112
--- /dev/null
@@ -0,0 +1,6 @@
+use std::sync::mpsc;
+
+fn main() {
+    let (tx, rx) = mpsc::channel::new(1);
+    //~^ ERROR expected type, found function `channel` in `mpsc`
+}
diff --git a/src/test/ui/issues/issue-71406.stderr b/src/test/ui/issues/issue-71406.stderr
new file mode 100644 (file)
index 0000000..918163b
--- /dev/null
@@ -0,0 +1,9 @@
+error[E0433]: failed to resolve: expected type, found function `channel` in `mpsc`
+  --> $DIR/issue-71406.rs:4:26
+   |
+LL |     let (tx, rx) = mpsc::channel::new(1);
+   |                          ^^^^^^^ expected type, found function `channel` in `mpsc`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0433`.
diff --git a/src/test/ui/iterators/issue-58952-filter-type-length.rs b/src/test/ui/iterators/issue-58952-filter-type-length.rs
new file mode 100644 (file)
index 0000000..046e378
--- /dev/null
@@ -0,0 +1,31 @@
+// run-pass
+//! This snippet causes the type length to blowup exponentially,
+//! so check that we don't accidentially exceed the type length limit.
+// FIXME: Once the size of iterator adaptors is further reduced,
+// increase the complexity of this test.
+
+fn main() {
+    let c = 2;
+    let bv = vec![2];
+    let b = bv
+        .iter()
+        .filter(|a| **a == c);
+
+    let _a = vec![1, 2, 3]
+        .into_iter()
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .filter(|a| b.clone().any(|b| *b == *a))
+        .collect::<Vec<_>>();
+}
index 316ee64072de0bcb4d7d56e98f6f7e1230e54fa9..a0f3aeffe9f7cf473de52d8790514a2212ee88db 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 // ignore-tidy-linelength
 
index 5ed8b2f416ecde20e1f2110a5224ee0a45cb3756..a501ac18588fb081616f81eb34adc7cc90c0e8fc 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 // ignore-tidy-linelength
 
index 9047fbb95a2ea9911a0fe100eafa681a9eaf95fb..741ea0c1ca8bc51bc91fe97636016e0880fa442b 100644 (file)
@@ -1,7 +1,7 @@
 // Issue #21633: reject duplicate loop labels in function bodies.
 // This is testing interaction between lifetime-params and labels.
 
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![allow(dead_code, unused_variables)]
 
index 9bb6a253b7f4aec03b033ccdf5ffebf1d6577881..3212b78b08cd8e6e7d1ecc00d18793614bf27568 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![allow(dead_code, unused_variables)]
 
index 4b6b65ec48b266d852052439432914c985ddb6d9..e7c3462867b5990b063bb9be1b7e4fd6a92be307 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // compile-flags: -Wunused
 
 // make sure write!() can't hide its unused Result
diff --git a/src/test/ui/mir/mir_detects_invalid_ops.rs b/src/test/ui/mir/mir_detects_invalid_ops.rs
new file mode 100644 (file)
index 0000000..0940dbe
--- /dev/null
@@ -0,0 +1,24 @@
+// build-fail
+
+fn main() {
+    divide_by_zero();
+    mod_by_zero();
+    oob_error_for_slices();
+}
+
+fn divide_by_zero() {
+    let y = 0;
+    let _z = 1 / y; //~ ERROR this operation will panic at runtime [unconditional_panic]
+}
+
+fn mod_by_zero() {
+    let y = 0;
+    let _z = 1 % y; //~ ERROR this operation will panic at runtime [unconditional_panic]
+}
+
+fn oob_error_for_slices() {
+    let a: *const [_] = &[1, 2, 3];
+    unsafe {
+        let _b = (*a)[3]; //~ ERROR this operation will panic at runtime [unconditional_panic]
+    }
+}
diff --git a/src/test/ui/mir/mir_detects_invalid_ops.stderr b/src/test/ui/mir/mir_detects_invalid_ops.stderr
new file mode 100644 (file)
index 0000000..41f0378
--- /dev/null
@@ -0,0 +1,22 @@
+error: this operation will panic at runtime
+  --> $DIR/mir_detects_invalid_ops.rs:11:14
+   |
+LL |     let _z = 1 / y;
+   |              ^^^^^ attempt to divide by zero
+   |
+   = note: `#[deny(unconditional_panic)]` on by default
+
+error: this operation will panic at runtime
+  --> $DIR/mir_detects_invalid_ops.rs:16:14
+   |
+LL |     let _z = 1 % y;
+   |              ^^^^^ attempt to calculate the remainder with a divisor of zero
+
+error: this operation will panic at runtime
+  --> $DIR/mir_detects_invalid_ops.rs:22:18
+   |
+LL |         let _b = (*a)[3];
+   |                  ^^^^^^^ index out of bounds: the len is 3 but the index is 3
+
+error: aborting due to 3 previous errors
+
index 8412cbdc54b3b2bd048c9b313e7bf79881112a8c..2dca92e2be1f346897b72ebe35107a6ef999a63b 100644 (file)
@@ -13,7 +13,10 @@ LL |
 LL |     ;
    |     - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
    |
-   = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+   |
+LL |             D("other").next(&_thing1);
+   |                                      ^
 
 error: aborting due to previous error
 
index 40cd04de5ecc14919d9525590538e2d4fb01b5ce..b4791fd22b4ad6c6d7bafead9d497aa537f5db67 100644 (file)
@@ -13,7 +13,10 @@ LL | }
    | `counter` dropped here while still borrowed
    | ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::result::Result<MutexGuard<'_>, ()>`
    |
-   = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+   |
+LL |     if let Ok(_) = counter.lock() { };
+   |                                      ^
 
 error: aborting due to previous error
 
index 0bf76485eef2ae505f08be843462b7feda9425ef..77065f0b8d21302c2432cd3b135d4945d9853aed 100644 (file)
@@ -12,7 +12,12 @@ LL | }
    | `stmt` dropped here while still borrowed
    | ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::iter::Map<Rows<'_>, [closure@$DIR/issue-54556-stephaneyfx.rs:28:14: 28:23]>`
    |
-   = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+   = note: the temporary is part of an expression at the end of a block;
+           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+   |
+LL |     let x = rows.map(|row| row).next(); x
+   |     ^^^^^^^                           ^^^
 
 error: aborting due to previous error
 
index 513dca7950af92ef170f22acddb4196a0c151c51..047fdbc9148aced01d6601d9d4698a9f050d2444 100644 (file)
@@ -12,7 +12,10 @@ LL |
 LL |     ;
    |     - ... and the borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `D`
    |
-   = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+   |
+LL |         D(&_thing1).end();
+   |                          ^
 
 error: aborting due to previous error
 
index 52d0870b78f95f4625c8b22676fa377c89ab4c1f..85920a8e7394c41953e6bfbf07146c8c5168bae9 100644 (file)
@@ -8,7 +8,10 @@ LL |     {              let mut _t1 = D(Box::new("t1")); D(&_t1).end()    } ; //
    |                                                     | borrowed value does not live long enough
    |                                                     a temporary with access to the borrow is created here ...
    |
-   = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+   |
+LL |     {              let mut _t1 = D(Box::new("t1")); D(&_t1).end();    } ; // suggest `;`
+   |                                                                  ^
 
 error[E0597]: `_t1` does not live long enough
   --> $DIR/issue-54556-used-vs-unused-tails.rs:13:55
@@ -20,7 +23,10 @@ LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end() }  } ; //
    |                                                     | borrowed value does not live long enough
    |                                                     a temporary with access to the borrow is created here ...
    |
-   = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+   |
+LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }  } ; // suggest `;`
+   |                                                                  ^
 
 error[E0597]: `_t1` does not live long enough
   --> $DIR/issue-54556-used-vs-unused-tails.rs:16:55
@@ -32,7 +38,10 @@ LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end() }; }   //
    |                                                     | borrowed value does not live long enough
    |                                                     a temporary with access to the borrow is created here ...
    |
-   = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+   |
+LL |     {            { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }; }   // suggest `;`
+   |                                                                  ^
 
 error[E0597]: `_t1` does not live long enough
   --> $DIR/issue-54556-used-vs-unused-tails.rs:19:55
@@ -44,7 +53,10 @@ LL |     let _ =      { let mut _t1 = D(Box::new("t1")); D(&_t1).end()    } ; //
    |                                                     | borrowed value does not live long enough
    |                                                     a temporary with access to the borrow is created here ...
    |
-   = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+   |
+LL |     let _ =      { let mut _t1 = D(Box::new("t1")); D(&_t1).end();    } ; // suggest `;`
+   |                                                                  ^
 
 error[E0597]: `_t1` does not live long enough
   --> $DIR/issue-54556-used-vs-unused-tails.rs:22:55
@@ -56,7 +68,10 @@ LL |     let _u =     { let mut _t1 = D(Box::new("t1")); D(&_t1).unit()   } ; //
    |                                                     | borrowed value does not live long enough
    |                                                     a temporary with access to the borrow is created here ...
    |
-   = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+   |
+LL |     let _u =     { let mut _t1 = D(Box::new("t1")); D(&_t1).unit();   } ; // suggest `;`
+   |                                                                   ^
 
 error[E0597]: `_t1` does not live long enough
   --> $DIR/issue-54556-used-vs-unused-tails.rs:25:55
@@ -68,7 +83,12 @@ LL |     let _x =     { let mut _t1 = D(Box::new("t1")); D(&_t1).end()    } ; //
    |                                                     | borrowed value does not live long enough
    |                                                     a temporary with access to the borrow is created here ...
    |
-   = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+   = note: the temporary is part of an expression at the end of a block;
+           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+   |
+LL |     let _x =     { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x    } ; // `let x = ...; x`
+   |                                                     ^^^^^^^              ^^^
 
 error[E0597]: `_t1` does not live long enough
   --> $DIR/issue-54556-used-vs-unused-tails.rs:30:55
@@ -80,7 +100,12 @@ LL |     _y =         { let mut _t1 = D(Box::new("t1")); D(&_t1).end() } ; // `l
    |                                                     | borrowed value does not live long enough
    |                                                     a temporary with access to the borrow is created here ...
    |
-   = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+   = note: the temporary is part of an expression at the end of a block;
+           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+   |
+LL |     _y =         { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
+   |                                                     ^^^^^^^              ^^^
 
 error[E0597]: `_t1` does not live long enough
   --> $DIR/issue-54556-used-vs-unused-tails.rs:37:55
@@ -93,7 +118,10 @@ LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit()   }  //
    |                                                     | borrowed value does not live long enough
    |                                                     a temporary with access to the borrow is created here ...
    |
-   = note: The temporary is part of an expression at the end of a block. Consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped.
+help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
+   |
+LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit();   }  // suggest `;`
+   |                                                                   ^
 
 error[E0597]: `_t1` does not live long enough
   --> $DIR/issue-54556-used-vs-unused-tails.rs:40:55
@@ -106,7 +134,12 @@ LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); D(&_t1).end()   }   //
    |                                                     | borrowed value does not live long enough
    |                                                     a temporary with access to the borrow is created here ...
    |
-   = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+   = note: the temporary is part of an expression at the end of a block;
+           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+   |
+LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x   }   // `let x = ...; x`
+   |                                                     ^^^^^^^              ^^^
 
 error: aborting due to 9 previous errors
 
index 465b507b788fd96d53f8adb9f4811b9b1208bb44..3f900062cbb6e459ae73f41a98c61bd3565c4486 100644 (file)
@@ -15,27 +15,21 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast-2.rs:7:18
    |
 LL |     let y: i64 = x + x;
-   |            ---   ^^^^^ expected `i64`, found `u16`
-   |            |
+   |            ---   ^^^^^
+   |            |     |
+   |            |     expected `i64`, found `u16`
+   |            |     help: you can convert an `u16` to `i64`: `(x + x).into()`
    |            expected due to this
-   |
-help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit
-   |
-LL |     let y: i64 = (x + x).try_into().unwrap();
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-2.rs:9:18
    |
 LL |     let z: i32 = x + x;
-   |            ---   ^^^^^ expected `i32`, found `u16`
-   |            |
+   |            ---   ^^^^^
+   |            |     |
+   |            |     expected `i32`, found `u16`
+   |            |     help: you can convert an `u16` to `i32`: `(x + x).into()`
    |            expected due to this
-   |
-help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit
-   |
-LL |     let z: i32 = (x + x).try_into().unwrap();
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 3 previous errors
 
index 31acdb8faf6a2da0d44691284097263338ed2e4c..cf0560a1077724a11a12c19b91bcd7f74e915f0b 100644 (file)
@@ -49,7 +49,7 @@ fn main() {
     //~^ ERROR mismatched types
     foo::<isize>(x_u16.try_into().unwrap());
     //~^ ERROR mismatched types
-    foo::<isize>(x_u8.try_into().unwrap());
+    foo::<isize>(x_u8.into());
     //~^ ERROR mismatched types
     foo::<isize>(x_isize);
     foo::<isize>(x_i64.try_into().unwrap());
@@ -89,11 +89,11 @@ fn main() {
     //~^ ERROR mismatched types
     foo::<i64>(x_u64.try_into().unwrap());
     //~^ ERROR mismatched types
-    foo::<i64>(x_u32.try_into().unwrap());
+    foo::<i64>(x_u32.into());
     //~^ ERROR mismatched types
-    foo::<i64>(x_u16.try_into().unwrap());
+    foo::<i64>(x_u16.into());
     //~^ ERROR mismatched types
-    foo::<i64>(x_u8.try_into().unwrap());
+    foo::<i64>(x_u8.into());
     //~^ ERROR mismatched types
     foo::<i64>(x_isize.try_into().unwrap());
     //~^ ERROR mismatched types
@@ -135,9 +135,9 @@ fn main() {
     //~^ ERROR mismatched types
     foo::<i32>(x_u32.try_into().unwrap());
     //~^ ERROR mismatched types
-    foo::<i32>(x_u16.try_into().unwrap());
+    foo::<i32>(x_u16.into());
     //~^ ERROR mismatched types
-    foo::<i32>(x_u8.try_into().unwrap());
+    foo::<i32>(x_u8.into());
     //~^ ERROR mismatched types
     foo::<i32>(x_isize.try_into().unwrap());
     //~^ ERROR mismatched types
@@ -181,7 +181,7 @@ fn main() {
     //~^ ERROR mismatched types
     foo::<i16>(x_u16.try_into().unwrap());
     //~^ ERROR mismatched types
-    foo::<i16>(x_u8.try_into().unwrap());
+    foo::<i16>(x_u8.into());
     //~^ ERROR mismatched types
     foo::<i16>(x_isize.try_into().unwrap());
     //~^ ERROR mismatched types
index ff92a86c3a7b4a46114e2d6ff6433d4908345c8c..cc1aa72d21451735aa556b404623486bd5914a6b 100644 (file)
@@ -141,12 +141,10 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:52:18
    |
 LL |     foo::<isize>(x_u8);
-   |                  ^^^^ expected `isize`, found `u8`
-   |
-help: you can convert an `u8` to `isize` and panic if the converted value wouldn't fit
-   |
-LL |     foo::<isize>(x_u8.try_into().unwrap());
-   |                  ^^^^^^^^^^^^^^^^^^^^^^^^
+   |                  ^^^^
+   |                  |
+   |                  expected `isize`, found `u8`
+   |                  help: you can convert an `u8` to `isize`: `x_u8.into()`
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:55:18
@@ -307,34 +305,28 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:92:16
    |
 LL |     foo::<i64>(x_u32);
-   |                ^^^^^ expected `i64`, found `u32`
-   |
-help: you can convert an `u32` to `i64` and panic if the converted value wouldn't fit
-   |
-LL |     foo::<i64>(x_u32.try_into().unwrap());
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ^^^^^
+   |                |
+   |                expected `i64`, found `u32`
+   |                help: you can convert an `u32` to `i64`: `x_u32.into()`
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:94:16
    |
 LL |     foo::<i64>(x_u16);
-   |                ^^^^^ expected `i64`, found `u16`
-   |
-help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit
-   |
-LL |     foo::<i64>(x_u16.try_into().unwrap());
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ^^^^^
+   |                |
+   |                expected `i64`, found `u16`
+   |                help: you can convert an `u16` to `i64`: `x_u16.into()`
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:96:16
    |
 LL |     foo::<i64>(x_u8);
-   |                ^^^^ expected `i64`, found `u8`
-   |
-help: you can convert an `u8` to `i64` and panic if the converted value wouldn't fit
-   |
-LL |     foo::<i64>(x_u8.try_into().unwrap());
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ^^^^
+   |                |
+   |                expected `i64`, found `u8`
+   |                help: you can convert an `u8` to `i64`: `x_u8.into()`
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:98:16
@@ -506,23 +498,19 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:138:16
    |
 LL |     foo::<i32>(x_u16);
-   |                ^^^^^ expected `i32`, found `u16`
-   |
-help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit
-   |
-LL |     foo::<i32>(x_u16.try_into().unwrap());
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ^^^^^
+   |                |
+   |                expected `i32`, found `u16`
+   |                help: you can convert an `u16` to `i32`: `x_u16.into()`
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:140:16
    |
 LL |     foo::<i32>(x_u8);
-   |                ^^^^ expected `i32`, found `u8`
-   |
-help: you can convert an `u8` to `i32` and panic if the converted value wouldn't fit
-   |
-LL |     foo::<i32>(x_u8.try_into().unwrap());
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ^^^^
+   |                |
+   |                expected `i32`, found `u8`
+   |                help: you can convert an `u8` to `i32`: `x_u8.into()`
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:142:16
@@ -709,12 +697,10 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:184:16
    |
 LL |     foo::<i16>(x_u8);
-   |                ^^^^ expected `i16`, found `u8`
-   |
-help: you can convert an `u8` to `i16` and panic if the converted value wouldn't fit
-   |
-LL |     foo::<i16>(x_u8.try_into().unwrap());
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^
+   |                ^^^^
+   |                |
+   |                expected `i16`, found `u8`
+   |                help: you can convert an `u8` to `i16`: `x_u8.into()`
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:186:16
index f673ef7fc1e690af24e09538f339193e5101eeeb..5fa06778389d9754c056948f3b04b1a0e42ff6ee 100644 (file)
@@ -1,6 +1,9 @@
 error[E0277]: `?` couldn't convert the error to `()`
   --> $DIR/option-to-result.rs:5:6
    |
+LL | fn test_result() -> Result<(),()> {
+   |                     ------------- expected `()` because of this
+LL |     let a:Option<()> = Some(());
 LL |     a?;
    |      ^ the trait `std::convert::From<std::option::NoneError>` is not implemented for `()`
    |
@@ -14,6 +17,9 @@ LL |     a.ok_or_else(|| /* error value */)?;
 error[E0277]: `?` couldn't convert the error to `std::option::NoneError`
   --> $DIR/option-to-result.rs:11:6
    |
+LL | fn test_option() -> Option<i32>{
+   |                     ----------- expected `std::option::NoneError` because of this
+LL |     let a:Result<i32, i32> = Ok(5);
 LL |     a?;
    |      ^ the trait `std::convert::From<i32>` is not implemented for `std::option::NoneError`
    |
index dd0599b4ab3631058ba7a0771f05cbc138e85f3b..2e0ebe2cfa446caa5be1650e42d29b14e022d927 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 fn main() {
     let _ = "Foo"_;
index 4769607ff395d4038f2ffd83fde2b9f97b5dc8b4..95e8e10a3ece9948deb514ea1bc2778cecd354eb 100644 (file)
@@ -1,5 +1,5 @@
 // aux-build:attributes-included.rs
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![warn(unused)]
 
index dea5ea04aa8505155a5f2138a368782af1ef8698..c63006e7a407d3ac96b11402ba4f3557e49e29d9 100644 (file)
@@ -2,7 +2,6 @@
 // no-prefer-dynamic
 
 #![feature(proc_macro_hygiene)]
-#![feature(proc_macro_mixed_site)]
 #![feature(proc_macro_quote)]
 
 #![crate_type = "proc-macro"]
index 384df571e2a80ed0142c2baf21163cc31babee22..16436a9accc8574951e3477f18b7d2274c12c071 100644 (file)
@@ -4,7 +4,11 @@ error[E0404]: expected trait, found type alias `Foo`
 LL | impl Foo for S {
    |      ^^^ type aliases cannot be used as traits
    |
-   = note: did you mean to use a trait alias?
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+  --> $DIR/issue-3907.rs:5:1
+   |
+LL | type Foo = dyn issue_3907::Foo;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: possible better candidate is found in another module, you can import it into scope
    |
 LL | use issue_3907::Foo;
index 622f0dfcda4cbd3c59a017a98bc901956ff82668..41dff2fe542053054c3052affd941957cb735c47 100644 (file)
@@ -16,7 +16,11 @@ LL | impl K for isize {}
    |      type aliases cannot be used as traits
    |      help: a trait with a similar name exists: `I`
    |
-   = note: did you mean to use a trait alias?
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+  --> $DIR/issue-5035.rs:2:1
+   |
+LL | type K = dyn I;
+   | ^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
index c86a6d70344cc967e58e255a6cad831b7c1593fa..2974d08eb23b1976545bc2c6abfa2bfe86195c5d 100644 (file)
@@ -10,7 +10,11 @@ error[E0404]: expected trait, found type alias `Typedef`
 LL | fn g<F:Typedef(isize) -> isize>(x: F) {}
    |        ^^^^^^^^^^^^^^^^^^^^^^^ type aliases cannot be used as traits
    |
-   = note: did you mean to use a trait alias?
+help: you might have meant to use `#![feature(trait_alias)]` instead of a `type` alias
+  --> $DIR/unboxed-closure-sugar-nonexistent-trait.rs:4:1
+   |
+LL | type Typedef = isize;
+   | ^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
index 65400163ddd86ab09fe09102de41923eabda44d5..72f2868e0bfd65ea44cbe5bf86aadcfc4a11b3ec 100644 (file)
@@ -1,6 +1,6 @@
 // aux-build:macro-use-warned-against.rs
 // aux-build:macro-use-warned-against2.rs
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![warn(macro_use_extern_crate, unused)]
 
index 2e10d5555908ba973f92480efa4811502c4c8af3..832632268fb2e6582c6569ff9bd73f4dc9a28c65 100644 (file)
@@ -1,6 +1,6 @@
 // run-rustfix
 // edition:2018
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // aux-build:remove-extern-crate.rs
 // compile-flags:--extern remove_extern_crate
 
index 9b04f901310ea8cc39e4a92495ec0e1d2ec32a4e..bbb84cd462d7e62cef075665a63fddbdfe4889a8 100644 (file)
@@ -1,6 +1,6 @@
 // run-rustfix
 // edition:2018
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // aux-build:remove-extern-crate.rs
 // compile-flags:--extern remove_extern_crate
 
index 7d136667b6dfb3cb9a33469bfe8a6ebc1568a1c9..12348e6e07dbccb5206bfb2ba7e6df481e7b44ff 100644 (file)
@@ -2,7 +2,7 @@
 // edition:2015
 // run-rustfix
 // rustfix-only-machine-applicable
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![feature(rust_2018_preview)]
 #![warn(rust_2018_compatibility)]
index 7d136667b6dfb3cb9a33469bfe8a6ebc1568a1c9..12348e6e07dbccb5206bfb2ba7e6df481e7b44ff 100644 (file)
@@ -2,7 +2,7 @@
 // edition:2015
 // run-rustfix
 // rustfix-only-machine-applicable
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![feature(rust_2018_preview)]
 #![warn(rust_2018_compatibility)]
index f285b2c0ee6fab0a0c8a92e2054993ac84b7ac6e..13f6f8e28291df6f1b006fece83f0373e6f142a0 100644 (file)
@@ -1,5 +1,5 @@
 // run-rustfix
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![warn(rust_2018_compatibility)]
 
index d740801b562c89cb3f3e9688213a13eff6a553a2..bed7118011e9a882bce0f87087356156de8f842f 100644 (file)
@@ -1,5 +1,5 @@
 // run-rustfix
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![warn(rust_2018_compatibility)]
 
index a3c6cfb6ae447b05744a66b3f0079544cca439e9..b5cd29f99c6b49323bad4389772d4634816f8e1e 100644 (file)
@@ -11,7 +11,12 @@ LL |     };
    |     |
    |     `*a` dropped here while still borrowed
    |
-   = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+   = note: the temporary is part of an expression at the end of a block;
+           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+   |
+LL |         let x = *a.borrow() + 1; x
+   |         ^^^^^^^                ^^^
 
 error: aborting due to previous error
 
index 46969458145863af44354f13abf48926bb7758b0..46702d364a8f398b4bf204e779f9bc75325a03cb 100644 (file)
@@ -12,7 +12,12 @@ LL | }
    | `y` dropped here while still borrowed
    | ... and the borrow might be used here, when that temporary is dropped and runs the destructor for type `std::cell::Ref<'_, std::string::String>`
    |
-   = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+   = note: the temporary is part of an expression at the end of a block;
+           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+   |
+LL |     let x = y.borrow().clone(); x
+   |     ^^^^^^^                   ^^^
 
 error[E0597]: `y` does not live long enough
   --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:17:9
@@ -27,7 +32,12 @@ LL |     };
    |     |
    |     `y` dropped here while still borrowed
    |
-   = note: The temporary is part of an expression at the end of a block. Consider forcing this temporary to be dropped sooner, before the block's local variables are dropped. For example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block.
+   = note: the temporary is part of an expression at the end of a block;
+           consider forcing this temporary to be dropped sooner, before the block's local variables are dropped
+help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
+   |
+LL |         let x = y.borrow().clone(); x
+   |         ^^^^^^^                   ^^^
 
 error: aborting due to 2 previous errors
 
index 04c7ab0ea586ffc29eba5f5dc12fe1b0863c5751..25df4a2aa3860517d1f1ff7393ed48a80855f7f3 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![warn(unused)]
 
index a49c60e1277f30df988ed5e57e7a76957ae10345..3ce7f2ce35da8fb2dcaa1cda57fee37d7fdec75e 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 
 #![warn(unused)]
 
index d232a46f8ec29b1b3b4651d39954e8c387b5bc8c..4cd1169cc1bb81b261620a2fc56aa17c4910b0ce 100644 (file)
@@ -46,9 +46,12 @@ error[E0423]: expected value, found struct variant `E::V`
   --> $DIR/struct-literal-variant-in-if.rs:10:13
    |
 LL |     if x == E::V { field } {}
-   |             ^^^^----------
-   |             |
-   |             help: surround the struct literal with parenthesis: `(E::V { field })`
+   |             ^^^^
+   |
+help: surround the struct literal with parentheses
+   |
+LL |     if x == (E::V { field }) {}
+   |             ^              ^
 
 error[E0308]: mismatched types
   --> $DIR/struct-literal-variant-in-if.rs:10:20
diff --git a/src/test/ui/suggestions/fn-needing-specified-return-type-param.rs b/src/test/ui/suggestions/fn-needing-specified-return-type-param.rs
new file mode 100644 (file)
index 0000000..2f140f8
--- /dev/null
@@ -0,0 +1,5 @@
+fn f<A>() -> A { unimplemented!() }
+fn foo() {
+    let _ = f; //~ ERROR type annotations needed for `fn() -> A`
+}
+fn main() {}
diff --git a/src/test/ui/suggestions/fn-needing-specified-return-type-param.stderr b/src/test/ui/suggestions/fn-needing-specified-return-type-param.stderr
new file mode 100644 (file)
index 0000000..b59a381
--- /dev/null
@@ -0,0 +1,11 @@
+error[E0282]: type annotations needed for `fn() -> A`
+  --> $DIR/fn-needing-specified-return-type-param.rs:3:13
+   |
+LL |     let _ = f;
+   |         -   ^ cannot infer type for type parameter `A` declared on the function `f`
+   |         |
+   |         consider giving this pattern the explicit type `fn() -> A`, where the type parameter `A` is specified
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0282`.
index 9c38322fe96fd754f209b1b26bdeb2b0d21bd645..b71878406d7645878c20a78bc286a2fae254cf45 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // compile-flags: --test
 
 #[test]
index 7a4bb75967b1f8764e08b978f2904506293774fa..33ca58bf7feb17e366cf284b0d5bb98216d63069 100644 (file)
@@ -1,6 +1,9 @@
 error[E0277]: `?` couldn't convert the error to `()`
   --> $DIR/try-on-option.rs:7:6
    |
+LL | fn foo() -> Result<u32, ()> {
+   |             --------------- expected `()` because of this
+LL |     let x: Option<u32> = None;
 LL |     x?;
    |      ^ the trait `std::convert::From<std::option::NoneError>` is not implemented for `()`
    |
index 4766d75c8f412209fae536288290fcad0509c7b0..c021ad5ee0d2bcf00f720643c544561d8cd0ad60 100644 (file)
@@ -1,4 +1,4 @@
-// build-pass (FIXME(62277): could be check-pass?)
+// check-pass
 // aux-build:underscore-imports.rs
 
 #![warn(unused_imports, unused_extern_crates)]
index 8751eb3010d4cdb5329b5a6bd2b6d765c95b0dca..90931d9b31e8b854522fed00916504a3ac6d8619 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 8751eb3010d4cdb5329b5a6bd2b6d765c95b0dca
+Subproject commit 90931d9b31e8b854522fed00916504a3ac6d8619
index 891e1a859b52486936e021235fdc36fbdd9b4100..b7c802b5e33f5a402de3780bc5a8b05e7ebad409 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 891e1a859b52486936e021235fdc36fbdd9b4100
+Subproject commit b7c802b5e33f5a402de3780bc5a8b05e7ebad409
index b2d477553361a7bbe73084a62a35183da8d1c608..63fd052a5560d5770370a771c2dfd4eccf88a2b0 100644 (file)
@@ -1750,6 +1750,7 @@ fn build_auxiliary(&self, source_path: &str, aux_dir: &Path) -> bool {
             || self.config.target.contains("wasm32")
             || self.config.target.contains("nvptx")
             || self.is_vxworks_pure_static()
+            || self.config.target.contains("sgx")
         {
             // We primarily compile all auxiliary libraries as dynamic libraries
             // to avoid code size bloat and large binaries as much as possible
index fb4611ed1ca4bec3b88763e8fc5b21c8e941c3cc..570ffd5d306227ed228d2d9e8bd85c19d6b394b9 100644 (file)
@@ -114,7 +114,7 @@ fn walk(cache: &mut Cache, root: &Path, dir: &Path, errors: &mut bool) {
 }
 
 fn check(cache: &mut Cache, root: &Path, file: &Path, errors: &mut bool) -> Option<PathBuf> {
-    // Ignore nonHTML files.
+    // Ignore non-HTML files.
     if file.extension().and_then(|s| s.to_str()) != Some("html") {
         return None;
     }
index 7de2a1f299f8744ffe109139f9f1fdf28bfec909..75491db0bff74a14dc6392b1491043bc7c924c65 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 7de2a1f299f8744ffe109139f9f1fdf28bfec909
+Subproject commit 75491db0bff74a14dc6392b1491043bc7c924c65
index 243d41598f86c739dba3941f668a42e75e47f9f1..f7fd0c670d7049df31a570abca9b0a9836943395 100644 (file)
@@ -17,7 +17,7 @@
 
 // Some error codes don't have any tests apparently...
 const IGNORE_EXPLANATION_CHECK: &[&str] =
-    &["E0570", "E0601", "E0602", "E0639", "E0729", "E0749", "E0750", "E0751"];
+    &["E0570", "E0601", "E0602", "E0639", "E0729", "E0749", "E0750"];
 
 fn check_error_code_explanation(
     f: &str,