Skip to content

Compile won't finish for ever with dynamic. #84102

Closed
@aobatact

Description

@aobatact

I tried this code:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=02201e00b6564bb0149acccfdf698b9d

I expected to see this happen: Compiles or have some error.

Instead, this happened: Compile won't finish for ever. Commenting out the final line will make it work.

Meta

I tried in my environment and Rust Playground.
rustc --version --verbose:

rustc 1.51.0 (2fd73fabe 2021-03-23)
binary: rustc
commit-hash: 2fd73fabe469357a12c2c974c140f67e7cdd76d0
commit-date: 2021-03-23
host: x86_64-unknown-linux-gnu
release: 1.51.0
LLVM version: 11.0.1

Backtrace
I couldn't get the backtace.

With cargo +nightly rustc --bin symbolic-diffs -- -Z time-passes I got below.

time:   0.000; rss:   65MB ->   65MB (   +0MB)  parse_crate
time:   0.000; rss:   65MB ->   65MB (   +0MB)  attributes_injection
time:   0.001; rss:   65MB ->   65MB (   +0MB)  incr_comp_prepare_session_directory
time:   0.000; rss:   65MB ->   65MB (   +0MB)  incr_comp_garbage_collect_session_directories
time:   0.000; rss:   65MB ->   65MB (   +0MB)  recursion_limit
time:   0.000; rss:   65MB ->   65MB (   +0MB)  plugin_loading
time:   0.000; rss:   65MB ->   65MB (   +0MB)  plugin_registration
time:   0.000; rss:   74MB ->   74MB (   +0MB)  crate_injection
time:   0.006; rss:   76MB ->   95MB (  +19MB)  expand_crate
time:   0.000; rss:   95MB ->   95MB (   +0MB)  check_unused_macros
time:   0.006; rss:   76MB ->   95MB (  +19MB)  macro_expand_crate
time:   0.000; rss:   95MB ->   95MB (   +0MB)  maybe_building_test_harness
time:   0.000; rss:   95MB ->   95MB (   +0MB)  AST_validation
time:   0.000; rss:   95MB ->   95MB (   +0MB)  maybe_create_a_macro_crate
time:   0.000; rss:   95MB ->   95MB (   +0MB)  finalize_imports
time:   0.000; rss:   95MB ->   96MB (   +2MB)  finalize_macro_resolutions
time:   0.002; rss:   96MB ->   97MB (   +1MB)  late_resolve_crate
time:   0.000; rss:   97MB ->   97MB (   +0MB)  resolve_check_unused
time:   0.000; rss:   97MB ->   97MB (   +0MB)  resolve_report_errors
time:   0.000; rss:   97MB ->   97MB (   +0MB)  resolve_postprocess
time:   0.002; rss:   95MB ->   97MB (   +3MB)  resolve_crate
time:   0.000; rss:   97MB ->   97MB (   +0MB)  complete_gated_feature_checking
time:   0.009; rss:   67MB ->   97MB (  +30MB)  configure_and_expand
time:   0.000; rss:   97MB ->   97MB (   +0MB)  prepare_outputs
time:   0.000; rss:   97MB ->   97MB (   +0MB)  blocked_on_dep_graph_loading
time:   0.001; rss:   98MB ->   99MB (   +1MB)  hir_lowering
time:   0.000; rss:   99MB ->   99MB (   +0MB)  early_lint_checks
time:   0.000; rss:  101MB ->  104MB (   +2MB)  setup_global_ctxt
time:   0.001; rss:   99MB ->  104MB (   +5MB)  create_global_ctxt
time:   0.000; rss:  104MB ->  107MB (   +4MB)  looking_for_entry_point
time:   0.000; rss:  107MB ->  107MB (   +0MB)  looking_for_plugin_registrar
time:   0.000; rss:  107MB ->  107MB (   +0MB)  looking_for_derive_registrar
time:   0.002; rss:  104MB ->  111MB (   +7MB)  misc_checking_1
time:   0.001; rss:  111MB ->  111MB (   +0MB)  type_collecting
time:   0.000; rss:  111MB ->  111MB (   +0MB)  impl_wf_inference
time:   0.000; rss:  114MB ->  114MB (   +0MB)  unsafety_checking
time:   0.000; rss:  114MB ->  114MB (   +0MB)  orphan_checking
time:   0.001; rss:  111MB ->  114MB (   +3MB)  coherence_checking
time:   0.001; rss:  114MB ->  114MB (   +0MB)  wf_checking
time:   0.005; rss:  114MB ->  117MB (   +3MB)  item_types_checking
time:   0.004; rss:  117MB ->  119MB (   +2MB)  item_bodies_checking
time:   0.012; rss:  111MB ->  119MB (   +8MB)  type_check_crate
time:   0.001; rss:  119MB ->  119MB (   +0MB)  match_checking
time:   0.001; rss:  119MB ->  119MB (   +0MB)  liveness_and_intrinsic_checking
time:   0.002; rss:  119MB ->  119MB (   +0MB)  misc_checking_2
time:   0.002; rss:  119MB ->  121MB (   +2MB)  MIR_borrow_checking
time:   0.000; rss:  121MB ->  121MB (   +0MB)  MIR_effect_checking
time:   0.000; rss:  121MB ->  121MB (   +0MB)  layout_testing
time:   0.000; rss:  121MB ->  121MB (   +0MB)  death_checking
time:   0.000; rss:  121MB ->  121MB (   +0MB)  unused_lib_feature_checking
time:   0.014; rss:  121MB ->  148MB (  +27MB)  crate_lints
time:   0.000; rss:  148MB ->  148MB (   +0MB)  module_lints
time:   0.015; rss:  121MB ->  148MB (  +27MB)  lint_checking
time:   0.001; rss:  148MB ->  148MB (   +0MB)  privacy_checking_modules
time:   0.017; rss:  121MB ->  148MB (  +27MB)  misc_checking_3
time:   0.000; rss:  148MB ->  148MB (   +0MB)  monomorphization_collector_root_collections

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions