Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE on improperly implemented TryFrom #74047

Closed
sbosnick opened this issue Jul 5, 2020 · 4 comments · Fixed by #74703
Closed

ICE on improperly implemented TryFrom #74047

sbosnick opened this issue Jul 5, 2020 · 4 comments · Fixed by #74703
Assignees
Labels
A-async-await Area: Async & Await A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sbosnick
Copy link

sbosnick commented Jul 5, 2020

rustc lib.rs --edition=2018 --crate-type lib produces an ICE for the code given below. This code should produce
an error (the TryFrom implementation is missing associated items).

Code

(UPDATED: Here's MCVE: #74047 (comment))

use std::convert::{TryFrom, TryInto};
use std::io;
use std::os::unix::net::UnixStream;
use std::path::Path;

pub struct MyStream { }

impl MyStream {
    pub async fn connect(path: impl AsRef<Path>) -> io::Result<MyStream> {
        let socket = Socket::new()?;

        let stream: MyStream = socket.into_unix_stream().try_into()?;

        loop {}
    }

}

impl TryFrom<UnixStream> for MyStream {
}

pub struct Socket { }

impl Socket {
    pub fn new() -> io::Result<Socket> {
        loop {}
    }

    pub fn into_unix_stream(self) -> UnixStream {
        loop {}
    }
}

Meta

rustc --version --verbose:

rustc 1.44.1 (c7087fe00 2020-06-17)
binary: rustc
commit-hash: c7087fe00d2ba919df1d813c040a5d47e43b0fe7
commit-date: 2020-06-17
host: x86_64-unknown-linux-gnu
release: 1.44.1
LLVM version: 9.0

Error also occurs on beta and nightly.

Error output

thread 'rustc' panicked at 'no entry found for key', src/librustc_mir_build/build/mod.rs:345:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.1 (c7087fe00 2020-06-17) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

error: internal compiler error: cat_expr Errd
  --> src/lib.rs:12:32
   |
12 |         let stream: MyStream = socket.into_unix_stream().try_into()?;
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: internal compiler error: cat_expr Errd
  --> src/lib.rs:12:32
   |
12 |         let stream: MyStream = socket.into_unix_stream().try_into()?;
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: internal compiler error: cat_expr Errd
  --> src/lib.rs:12:68
   |
12 |         let stream: MyStream = socket.into_unix_stream().try_into()?;
   |                                                                    ^

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:366:17
stack backtrace:
   0:     0x7f129fb65ab4 - backtrace::backtrace::libunwind::trace::h812748238d609e46
                               at /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1:     0x7f129fb65ab4 - backtrace::backtrace::trace_unsynchronized::h7c97e818aebf09c8
                               at /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2:     0x7f129fb65ab4 - std::sys_common::backtrace::_print_fmt::h60d914263b0ccd71
                               at src/libstd/sys_common/backtrace.rs:78
   3:     0x7f129fb65ab4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf78227137afc7565
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x7f129fba3bac - core::fmt::write::h543cdf60775f89bf
                               at src/libcore/fmt/mod.rs:1069
   5:     0x7f129fb574d3 - std::io::Write::write_fmt::h0c7f3ce24c679426
                               at src/libstd/io/mod.rs:1504
   6:     0x7f129fb6aab5 - std::sys_common::backtrace::_print::h80e55e24be231368
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x7f129fb6aab5 - std::sys_common::backtrace::print::h3b197b9c1261c865
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x7f129fb6aab5 - std::panicking::default_hook::{{closure}}::ha6c807149ce20f8f
                               at src/libstd/panicking.rs:198
   9:     0x7f129fb6a7f2 - std::panicking::default_hook::he49a9c12e358cc45
                               at src/libstd/panicking.rs:218
  10:     0x7f12a0107923 - rustc_driver::report_ice::h303988fb5b9997d4
  11:     0x7f129fb6b235 - std::panicking::rust_panic_with_hook::h93f74f5ef2f71f31
                               at src/libstd/panicking.rs:515
  12:     0x7f12a28f125e - std::panicking::begin_panic::hc68bee93462232be
  13:     0x7f12a292aa12 - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::h1f879c4351fba67a
  14:     0x7f12a024c166 - core::ptr::drop_in_place::h4d80a69fc5b8b26d
  15:     0x7f12a0254536 - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h11773fcd49f47beb
  16:     0x7f12a027801d - core::ptr::drop_in_place::ha136f12949be28b0
  17:     0x7f12a025ea45 - rustc_interface::interface::run_compiler_in_existing_thread_pool::h1fe14dfeda5e7ff8
  18:     0x7f12a011152d - scoped_tls::ScopedKey<T>::set::h7ef5c845735c44d5
  19:     0x7f12a010e3d4 - rustc_ast::attr::with_globals::h80403999168944fb
  20:     0x7f12a0119a92 - std::sys_common::backtrace::__rust_begin_short_backtrace::h65e906f83ddca1d2
  21:     0x7f12a026140e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4a7aeea8942a4e2c
  22:     0x7f129fb7b2aa - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hf207c3654ee300a0
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
  23:     0x7f129fb7b2aa - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h66e0c6190e34816b
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
  24:     0x7f129fb7b2aa - std::sys::unix::thread::Thread::new::thread_start::h30687bc0b1c3cd55
                               at src/libstd/sys/unix/thread.rs:87
  25:     0x7f129fabb609 - start_thread
                               at /build/glibc-YYA7BZ/glibc-2.31/nptl/pthread_create.c:477
  26:     0x7f129f9cf103 - __clone
  27:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.1 (c7087fe00 2020-06-17) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

thread panicked while panicking. aborting.
Illegal instruction (core dumped)
Backtrace

hread 'rustc' panicked at 'no entry found for key', src/librustc_mir_build/build/mod.rs:345:9
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:78
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:59
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1069
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1504
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:62
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:218
  10: rustc_driver::report_ice
  11: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:515
  12: rust_begin_unwind
             at src/libstd/panicking.rs:419
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:111
  14: core::option::expect_failed
             at src/libcore/option.rs:1260
  15: rustc_mir_build::build::expr::as_place::<impl rustc_mir_build::build::Builder>::expr_as_place
  16: rustc_mir_build::build::expr::as_place::<impl rustc_mir_build::build::Builder>::as_place
  17: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  18: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::expr_as_temp
  19: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_operand
  20: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand
  21: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand
  22: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  23: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  24: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::expr_as_temp
  25: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_operand
  26: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand
  27: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand
  28: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  29: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  30: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  31: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::break_scope
  32: rustc_mir_build::build::expr::stmt::<impl rustc_mir_build::build::Builder>::stmt_expr
  33: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  34: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::expr_as_temp
  35: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  36: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  37: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  38: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
  39: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
  40: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  41: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  42: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block_stmts
  43: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  44: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  45: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  46: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  47: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  48: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block_stmts
  49: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  50: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  51: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
  52: rustc_mir_build::build::construct_fn
  53: rustc_infer::infer::InferCtxtBuilder::enter
  54: rustc_mir_build::build::mir_built
  55: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_built>::compute
  56: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  57: rustc_query_system::query::plumbing::get_query
  58: rustc_mir::transform::check_unsafety::unsafety_check_result
  59: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::unsafety_check_result>::compute
  60: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  61: rustc_query_system::query::plumbing::get_query
  62: <rustc_mir::transform::check_unsafety::UnsafetyChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
  63: <rustc_mir::transform::check_unsafety::UnsafetyChecker as rustc_middle::mir::visit::Visitor>::visit_statement
  64: rustc_mir::transform::check_unsafety::unsafety_check_result
  65: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::unsafety_check_result>::compute
  66: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  67: rustc_query_system::query::plumbing::get_query
  68: rustc_mir::transform::mir_const
  69: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_const>::compute
  70: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  71: rustc_query_system::query::plumbing::get_query
  72: rustc_mir::transform::mir_validated
  73: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_validated>::compute
  74: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  75: rustc_query_system::query::plumbing::get_query
  76: rustc_mir::borrow_check::mir_borrowck
  77: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_borrowck>::compute
  78: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  79: rustc_query_system::query::plumbing::get_query
  80: rustc_typeck::collect::type_of::type_of
  81: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  82: rustc_query_system::query::plumbing::get_query
  83: rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::try_expand_impl_trait_type::OpaqueTypeExpander::expand_opaque_ty
  84: rustc_middle::ty::util::<impl rustc_middle::ty::context::TyCtxt>::try_expand_impl_trait_type
  85: rustc_typeck::check::check_item_type
  86: rustc_middle::hir::map::Map::visit_item_likes_in_module
  87: rustc_typeck::check::check_mod_item_types
  88: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::check_mod_item_types>::compute
  89: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  90: rustc_query_system::query::plumbing::get_query
  91: rustc_query_system::query::plumbing::ensure_query
  92: rustc_typeck::check_crate
  93: rustc_interface::passes::analysis
  94: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  95: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  96: rustc_query_system::query::plumbing::get_query
  97: rustc_middle::ty::context::tls::enter_global
  98: rustc_interface::interface::run_compiler_in_existing_thread_pool
  99: scoped_tls::ScopedKey<T>::set
 100: rustc_ast::attr::with_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.1 (c7087fe00 2020-06-17) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

query stack during panic:
#0 [mir_built] building MIR for
#1 [unsafety_check_result] unsafety-checking `MyStream::connect::{{closure}}#0`
#2 [unsafety_check_result] unsafety-checking `MyStream::connect`
#3 [mir_const] processing `MyStream::connect`
#4 [mir_validated] processing `MyStream::connect`
#5 [mir_borrowck] borrow-checking `MyStream::connect`
#6 [type_of] processing `MyStream::connect::{{opaque}}#0`
#7 [check_mod_item_types] checking item types in top-level module
#8 [analysis] running analysis passes on this crate
end of query stack
error: internal compiler error: cat_expr Errd
  --> src/lib.rs:12:32
   |
12 |         let stream: MyStream = socket.into_unix_stream().try_into()?;
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: internal compiler error: cat_expr Errd
  --> src/lib.rs:12:32
   |
12 |         let stream: MyStream = socket.into_unix_stream().try_into()?;
   |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: internal compiler error: cat_expr Errd
  --> src/lib.rs:12:68
   |
12 |         let stream: MyStream = socket.into_unix_stream().try_into()?;
   |                                                                    ^

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:366:17
stack backtrace:
   0:     0x7f2c1885cab4 - backtrace::backtrace::libunwind::trace::h812748238d609e46
                               at /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1:     0x7f2c1885cab4 - backtrace::backtrace::trace_unsynchronized::h7c97e818aebf09c8
                               at /cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2:     0x7f2c1885cab4 - std::sys_common::backtrace::_print_fmt::h60d914263b0ccd71
                               at src/libstd/sys_common/backtrace.rs:78
   3:     0x7f2c1885cab4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf78227137afc7565
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x7f2c1889abac - core::fmt::write::h543cdf60775f89bf
                               at src/libcore/fmt/mod.rs:1069
   5:     0x7f2c1884e4d3 - std::io::Write::write_fmt::h0c7f3ce24c679426
                               at src/libstd/io/mod.rs:1504
   6:     0x7f2c18861ab5 - std::sys_common::backtrace::_print::h80e55e24be231368
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x7f2c18861ab5 - std::sys_common::backtrace::print::h3b197b9c1261c865
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x7f2c18861ab5 - std::panicking::default_hook::{{closure}}::ha6c807149ce20f8f
                               at src/libstd/panicking.rs:198
   9:     0x7f2c188617f2 - std::panicking::default_hook::he49a9c12e358cc45
                               at src/libstd/panicking.rs:218
  10:     0x7f2c18dfe923 - rustc_driver::report_ice::h303988fb5b9997d4
  11:     0x7f2c18862235 - std::panicking::rust_panic_with_hook::h93f74f5ef2f71f31
                               at src/libstd/panicking.rs:515
  12:     0x7f2c1b5e825e - std::panicking::begin_panic::hc68bee93462232be
  13:     0x7f2c1b621a12 - <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop::h1f879c4351fba67a
  14:     0x7f2c18f43166 - core::ptr::drop_in_place::h4d80a69fc5b8b26d
  15:     0x7f2c18f4b536 - <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop::h11773fcd49f47beb
  16:     0x7f2c18f6f01d - core::ptr::drop_in_place::ha136f12949be28b0
  17:     0x7f2c18f55a45 - rustc_interface::interface::run_compiler_in_existing_thread_pool::h1fe14dfeda5e7ff8
  18:     0x7f2c18e0852d - scoped_tls::ScopedKey<T>::set::h7ef5c845735c44d5
  19:     0x7f2c18e053d4 - rustc_ast::attr::with_globals::h80403999168944fb
  20:     0x7f2c18e10a92 - std::sys_common::backtrace::__rust_begin_short_backtrace::h65e906f83ddca1d2
  21:     0x7f2c18f5840e - core::ops::function::FnOnce::call_once{{vtable.shim}}::h4a7aeea8942a4e2c
  22:     0x7f2c188722aa - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hf207c3654ee300a0
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
  23:     0x7f2c188722aa - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h66e0c6190e34816b
                               at /rustc/c7087fe00d2ba919df1d813c040a5d47e43b0fe7/src/liballoc/boxed.rs:1008
  24:     0x7f2c188722aa - std::sys::unix::thread::Thread::new::thread_start::h30687bc0b1c3cd55
                               at src/libstd/sys/unix/thread.rs:87
  25:     0x7f2c187b2609 - start_thread
                               at /build/glibc-YYA7BZ/glibc-2.31/nptl/pthread_create.c:477
  26:     0x7f2c186c6103 - __clone
  27:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.44.1 (c7087fe00 2020-06-17) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

query stack during panic:
end of query stack
thread panicked while panicking. aborting.
Illegal instruction (core dumped)

@sbosnick sbosnick added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 5, 2020
@jonas-schievink jonas-schievink added A-async-await Area: Async & Await A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jul 5, 2020
@lcnr
Copy link
Contributor

lcnr commented Jul 5, 2020

Thanks! Further minimized:

use std::convert::{TryFrom, TryInto};
use std::io;

pub struct MyStream;
pub struct OtherStream;

pub async fn connect() -> io::Result<MyStream> {
    let stream: MyStream = OtherStream.try_into()?;
    Ok(stream)
}

impl TryFrom<OtherStream> for MyStream {}

@JohnTitor
Copy link
Member

Assigning P-high as discussed as part of the Prioritization Working Group process and removing I-prioritize.

@JohnTitor JohnTitor added P-high High priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jul 6, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jul 6, 2020
@tmandry tmandry added the AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. label Jul 7, 2020
@nikomatsakis
Copy link
Contributor

Don't know the cause yet, but if you remove the async keyword or the ? operator, then you get this error:

error[E0046]: not all trait items implemented, missing: `Error`, `try_from`
  --> src/lib.rs:15:1
   |
15 | impl TryFrom<OtherStream> for MyStream {}
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Error`, `try_from` in implementation
   |
   = help: implement the missing item: `type Error = Type;`
   = help: implement the missing item: `fn try_from(_: T) -> std::result::Result<Self, <Self as std::convert::TryFrom<T>>::Error> { todo!() }`

My hunch is that somehow, lacking those items, the type of .try_from() is coming up with something that doesn't implement the expected traits -- I would bet that we are getting an error type, based on some of the output at the end. Perhaps some of the logic in MIR is failing as a result. The actual ICE location though isn't that illuminating:

fn var_local_id(&self, id: hir::HirId, for_guard: ForGuard) -> Local {
self.var_indices[&id].local_id(for_guard)
}

@tmandry
Copy link
Member

tmandry commented Jul 24, 2020

I did some digging here. The source of the panic is here, during HAIR construction:

if let ty::Error(_) = ty.kind {
// Avoid ICEs (e.g., #50577 and #50585).
return Pat { span: pat.span, ty, kind: Box::new(PatKind::Wild) };
}

In this case, the binding err below is of the error type (meaning type check for it failed). By replacing the binding with _ we prevent a local from being created for it, which means that when we try to generate code that reads the local we get a panic here.

pub async fn connect()
 ->
    /*impl Trait*/ ::std::future::from_generator(move |mut _task_context| {
        {
            let _t =
                {
                    let stream:
                            MyStream =
                        match ::std::ops::Try::into_result(OtherStream.try_into())
                            {
                            ::std::result::Result::Err(err) // `err` replaced with `_` here!
                            =>

                                #[allow(unreachable_code)]
                                return ::std::ops::Try::from_error(::std::convert::From::from(err)),
                            ::std::result::Result::Ok(val)
                            =>

                                #[allow(unreachable_code)]
                                val,
                        };
                    Ok(stream)
                };
            _t
        }
    })

I'm not sure what the correct fix is here. Replacing the binding with _ was done to prevent other ICEs, but we can't generate valid MIR without the local info.

More fundamentally: We're building MIR during typeck because this is an async fn. In the past we probably never would have gotten to this stage.

Backtrace:

thread 'rustc' panicked at 'no entry found for key', src/librustc_mir_build/build/mod.rs:354:9
stack backtrace:
   0: std::backtrace_rs::backtrace::libunwind::trace
             at ./src/libstd/../backtrace/src/backtrace/libunwind.rs:96
   1: std::backtrace_rs::backtrace::trace_unsynchronized
             at ./src/libstd/../backtrace/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at ./src/libstd/sys_common/backtrace.rs:77
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at ./src/libstd/sys_common/backtrace.rs:58
   4: core::fmt::write
             at ./src/libcore/fmt/mod.rs:1117
   5: std::io::Write::write_fmt
             at ./src/libstd/io/mod.rs:1508
   6: std::sys_common::backtrace::_print
             at ./src/libstd/sys_common/backtrace.rs:61
   7: std::sys_common::backtrace::print
             at ./src/libstd/sys_common/backtrace.rs:48
   8: std::panicking::default_hook::{{closure}}
             at ./src/libstd/panicking.rs:198
   9: std::panicking::default_hook
             at ./src/libstd/panicking.rs:217
  10: <alloc::boxed::Box<F> as core::ops::function::Fn<A>>::call
             at ./src/liballoc/boxed.rs:1095
  11: rustc_driver::report_ice
             at ./src/librustc_driver/lib.rs:1158
  12: std::panicking::rust_panic_with_hook
             at ./src/libstd/panicking.rs:530
  13: rust_begin_unwind
             at ./src/libstd/panicking.rs:437
  14: core::panicking::panic_fmt
             at ./src/libcore/panicking.rs:85
  15: core::option::expect_failed
             at ./src/libcore/option.rs:1265
  16: core::option::Option<T>::expect
             at ./src/libcore/option.rs:347
  17: <std::collections::hash::map::HashMap<K,V,S> as core::ops::index::Index<&Q>>::index
             at ./src/libstd/collections/hash/map.rs:1004
  18: rustc_mir_build::build::Builder::var_local_id
             at ./src/librustc_mir_build/build/mod.rs:354
  19: rustc_mir_build::build::expr::as_place::<impl rustc_mir_build::build::Builder>::expr_as_place
             at ./src/librustc_mir_build/build/expr/as_place.rs:169
  20: rustc_mir_build::build::expr::as_place::<impl rustc_mir_build::build::Builder>::as_place_builder
             at ./src/librustc_mir_build/build/expr/as_place.rs:84
  21: rustc_mir_build::build::expr::as_place::<impl rustc_mir_build::build::Builder>::as_place
             at ./src/librustc_mir_build/build/expr/as_place.rs:73
  22: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:408
  23: <rustc_mir_build::hair::Expr as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:53
  24: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
  25: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::expr_as_temp
             at ./src/librustc_mir_build/build/expr/as_temp.rs:112
  26: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::as_temp::{{closure}}
             at ./src/librustc_mir_build/build/expr/as_temp.rs:29
  27: stacker::maybe_grow
             at /usr/local/google/home/tmandry/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
  28: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
  29: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::as_temp
             at ./src/librustc_mir_build/build/expr/as_temp.rs:29
  30: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:143
  31: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:196
  32: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:116
  33: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_call_operand::{{closure}}
             at ./src/librustc_mir_build/build/expr/as_operand.rs:162
  34: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
  35: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:161
  36: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:116
  37: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_local_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:82
  38: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:200
  39: core::iter::adapters::map_fold::{{closure}}
             at ./src/libcore/iter/adapters/mod.rs:833
  40: core::iter::traits::iterator::Iterator::fold
             at ./src/libcore/iter/traits/iterator.rs:2003
  41: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
             at ./src/libcore/iter/adapters/mod.rs:873
  42: core::iter::traits::iterator::Iterator::for_each
             at ./src/libcore/iter/traits/iterator.rs:649
  43: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::spec_extend
             at ./src/liballoc/vec.rs:2140
  44: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
             at ./src/liballoc/vec.rs:2120
  45: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
             at ./src/liballoc/vec.rs:1995
  46: core::iter::traits::iterator::Iterator::collect
             at ./src/libcore/iter/traits/iterator.rs:1652
  47: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:198
  48: <rustc_mir_build::hair::Expr as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:53
  49: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
  50: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::expr_as_temp
             at ./src/librustc_mir_build/build/expr/as_temp.rs:112
  51: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::as_temp::{{closure}}
             at ./src/librustc_mir_build/build/expr/as_temp.rs:29
  52: stacker::maybe_grow
             at /usr/local/google/home/tmandry/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
  53: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
  54: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::as_temp
             at ./src/librustc_mir_build/build/expr/as_temp.rs:29
  55: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:143
  56: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:196
  57: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:116
  58: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_call_operand::{{closure}}
             at ./src/librustc_mir_build/build/expr/as_operand.rs:162
  59: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
  60: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::expr_as_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:161
  61: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:116
  62: rustc_mir_build::build::expr::as_operand::<impl rustc_mir_build::build::Builder>::as_local_call_operand
             at ./src/librustc_mir_build/build/expr/as_operand.rs:82
  63: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:200
  64: core::iter::adapters::map_fold::{{closure}}
             at ./src/libcore/iter/adapters/mod.rs:833
  65: core::iter::traits::iterator::Iterator::fold
             at ./src/libcore/iter/traits/iterator.rs:2003
  66: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
             at ./src/libcore/iter/adapters/mod.rs:873
  67: core::iter::traits::iterator::Iterator::for_each
             at ./src/libcore/iter/traits/iterator.rs:649
  68: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::spec_extend
             at ./src/liballoc/vec.rs:2140
  69: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
             at ./src/liballoc/vec.rs:2120
  70: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
             at ./src/liballoc/vec.rs:1995
  71: core::iter::traits::iterator::Iterator::collect
             at ./src/libcore/iter/traits/iterator.rs:1652
  72: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:198
  73: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
  74: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
  75: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:46
  76: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
  77: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:46
  78: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
  79: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
  80: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::break_scope
             at ./src/librustc_mir_build/build/scope.rs:523
  81: rustc_mir_build::build::expr::stmt::<impl rustc_mir_build::build::Builder>::stmt_expr
             at ./src/librustc_mir_build/build/expr/stmt.rs:97
  82: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:396
  83: <rustc_mir_build::hair::Expr as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:53
  84: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
  85: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::expr_as_temp
             at ./src/librustc_mir_build/build/expr/as_temp.rs:112
  86: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::as_temp::{{closure}}
             at ./src/librustc_mir_build/build/expr/as_temp.rs:29
  87: stacker::maybe_grow
             at /usr/local/google/home/tmandry/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
  88: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
  89: rustc_mir_build::build::expr::as_temp::<impl rustc_mir_build::build::Builder>::as_temp
             at ./src/librustc_mir_build/build/expr/as_temp.rs:29
  90: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:63
  91: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
  92: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
  93: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:46
  94: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
  95: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:46
  96: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
  97: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
  98: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:46
  99: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 100: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:46
 101: <rustc_mir_build::hair::Expr as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:53
 102: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 103: rustc_mir_build::build::matches::<impl rustc_mir_build::build::Builder>::lower_match_arms::{{closure}}::{{closure}}
             at ./src/librustc_mir_build/build/matches/mod.rs:260
 104: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 105: rustc_mir_build::build::matches::<impl rustc_mir_build::build::Builder>::lower_match_arms::{{closure}}
             at ./src/librustc_mir_build/build/matches/mod.rs:237
 106: core::iter::adapters::map_fold::{{closure}}
             at ./src/libcore/iter/adapters/mod.rs:833
 107: core::iter::traits::iterator::Iterator::fold
             at ./src/libcore/iter/traits/iterator.rs:2003
 108: <core::iter::adapters::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
             at ./src/libcore/iter/adapters/mod.rs:873
 109: core::iter::traits::iterator::Iterator::for_each
             at ./src/libcore/iter/traits/iterator.rs:649
 110: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::spec_extend
             at ./src/liballoc/vec.rs:2140
 111: <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter
             at ./src/liballoc/vec.rs:2120
 112: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
             at ./src/liballoc/vec.rs:1995
 113: core::iter::traits::iterator::Iterator::collect
             at ./src/libcore/iter/traits/iterator.rs:1652
 114: rustc_mir_build::build::matches::<impl rustc_mir_build::build::Builder>::lower_match_arms
             at ./src/librustc_mir_build/build/matches/mod.rs:230
 115: rustc_mir_build::build::matches::<impl rustc_mir_build::build::Builder>::match_expr
             at ./src/librustc_mir_build/build/matches/mod.rs:105
 116: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:52
 117: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
 118: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 119: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:46
 120: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 121: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:46
 122: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
 123: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 124: rustc_mir_build::build::matches::<impl rustc_mir_build::build::Builder>::expr_into_pattern
             at ./src/librustc_mir_build/build/matches/mod.rs:402
 125: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block_stmts::{{closure}}::{{closure}}
             at ./src/librustc_mir_build/build/block.rs:131
 126: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 127: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block_stmts::{{closure}}
             at ./src/librustc_mir_build/build/block.rs:123
 128: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_opt_scope
             at ./src/librustc_mir_build/build/scope.rs:411
 129: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block_stmts
             at ./src/librustc_mir_build/build/block.rs:119
 130: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block::{{closure}}::{{closure}}
             at ./src/librustc_mir_build/build/block.rs:40
 131: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 132: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block::{{closure}}
             at ./src/librustc_mir_build/build/block.rs:29
 133: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_opt_scope
             at ./src/librustc_mir_build/build/scope.rs:411
 134: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block
             at ./src/librustc_mir_build/build/block.rs:28
 135: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:49
 136: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
 137: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 138: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:46
 139: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 140: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:46
 141: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
 142: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 143: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:46
 144: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 145: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:46
 146: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
 147: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 148: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:232
 149: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
 150: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 151: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:46
 152: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 153: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:46
 154: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
 155: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 156: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block_stmts
             at ./src/librustc_mir_build/build/block.rs:184
 157: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block::{{closure}}::{{closure}}
             at ./src/librustc_mir_build/build/block.rs:40
 158: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 159: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block::{{closure}}
             at ./src/librustc_mir_build/build/block.rs:29
 160: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_opt_scope
             at ./src/librustc_mir_build/build/scope.rs:411
 161: rustc_mir_build::build::block::<impl rustc_mir_build::build::Builder>::ast_block
             at ./src/librustc_mir_build/build/block.rs:28
 162: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:49
 163: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
 164: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 165: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:46
 166: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 167: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:46
 168: <rustc_mir_build::hair::ExprRef as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:42
 169: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 170: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr::{{closure}}
             at ./src/librustc_mir_build/build/expr/into.rs:46
 171: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 172: rustc_mir_build::build::expr::into::<impl rustc_mir_build::build::Builder>::into_expr
             at ./src/librustc_mir_build/build/expr/into.rs:46
 173: <rustc_mir_build::hair::Expr as rustc_mir_build::build::into::EvalInto>::eval_into
             at ./src/librustc_mir_build/build/into.rs:53
 174: rustc_mir_build::build::into::<impl rustc_mir_build::build::Builder>::into
             at ./src/librustc_mir_build/build/into.rs:30
 175: rustc_mir_build::build::Builder::args_and_body
             at ./src/librustc_mir_build/build/mod.rs:959
 176: rustc_mir_build::build::construct_fn::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_mir_build/build/mod.rs:621
 177: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 178: rustc_mir_build::build::construct_fn::{{closure}}::{{closure}}
             at ./src/librustc_mir_build/build/mod.rs:620
 179: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_breakable_scope
             at ./src/librustc_mir_build/build/scope.rs:392
 180: rustc_mir_build::build::construct_fn::{{closure}}
             at ./src/librustc_mir_build/build/mod.rs:615
 181: rustc_mir_build::build::scope::<impl rustc_mir_build::build::Builder>::in_scope
             at ./src/librustc_mir_build/build/scope.rs:455
 182: rustc_mir_build::build::construct_fn
             at ./src/librustc_mir_build/build/mod.rs:606
 183: rustc_mir_build::build::mir_build::{{closure}}
             at ./src/librustc_mir_build/build/mod.rs:163
 184: rustc_infer::infer::InferCtxtBuilder::enter
             at ./src/librustc_infer/infer/mod.rs:621
 185: rustc_mir_build::build::mir_build
             at ./src/librustc_mir_build/build/mod.rs:72
 186: rustc_mir_build::build::mir_built
             at ./src/librustc_mir_build/build/mod.rs:34
 187: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::mir_built>::compute
             at ./src/librustc_middle/ty/query/plumbing.rs:381
 188: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
             at ./src/librustc_query_system/dep_graph/graph.rs:303
 189: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task
             at ./src/librustc_query_system/dep_graph/graph.rs:200
 190: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:599
 191: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
 192: stacker::maybe_grow
             at /usr/local/google/home/tmandry/.cargo/registry/src/gh.neting.cc-1ecc6299db9ec823/stacker-0.1.9/src/lib.rs:52
 193: rustc_data_structures::stack::ensure_sufficient_stack
             at ./src/librustc_data_structures/stack.rs:16
 194: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:72
 195: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1721
 196: rustc_middle::ty::context::tls::set_tlv
             at ./src/librustc_middle/ty/context.rs:1705
 197: rustc_middle::ty::context::tls::enter_context
             at ./src/librustc_middle/ty/context.rs:1721
 198: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query::{{closure}}
             at ./src/librustc_middle/ty/query/plumbing.rs:71
 199: rustc_middle::ty::context::tls::with_related_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1809
 200: rustc_middle::ty::context::tls::with_context::{{closure}}
             at ./src/librustc_middle/ty/context.rs:1793
 201: rustc_middle::ty::context::tls::with_context_opt
             at ./src/librustc_middle/ty/context.rs:1782
 202: rustc_middle::ty::context::tls::with_context
             at ./src/librustc_middle/ty/context.rs:1793
 203: rustc_middle::ty::context::tls::with_related_context
             at ./src/librustc_middle/ty/context.rs:1806
 204: rustc_middle::ty::query::plumbing::<impl rustc_query_system::query::QueryContext for rustc_middle::ty::context::TyCtxt>::start_query
             at ./src/librustc_middle/ty/query/plumbing.rs:60
 205: rustc_query_system::query::plumbing::force_query_with_job::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:589
 206: rustc_query_system::query::plumbing::with_diagnostics
             at ./src/librustc_query_system/query/plumbing.rs:296
 207: rustc_query_system::query::plumbing::force_query_with_job
             at ./src/librustc_query_system/query/plumbing.rs:588
 208: rustc_query_system::query::plumbing::try_execute_query
             at ./src/librustc_query_system/query/plumbing.rs:415
 209: rustc_query_system::query::plumbing::get_query_impl::{{closure}}
             at ./src/librustc_query_system/query/plumbing.rs:639
 210: <rustc_query_system::query::caches::DefaultCache<K,V> as rustc_query_system::query::caches::QueryCache>::lookup
             at ./src/librustc_query_system/query/caches.rs:111
 211: rustc_query_system::query::plumbing::try_get_cached
             at ./src/librustc_query_system/query/plumbing.rs:369
 212: rustc_query_system::query::plumbing::get_query_impl
             at ./src/librustc_query_system/query/plumbing.rs:631
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.47.0-dev running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib

query stack during panic:
#0 [mir_built] building MIR for `connect::{{closure}}#0`
#1 [unsafety_check_result] unsafety-checking `connect::{{closure}}#0`
#2 [unsafety_check_result] unsafety-checking `connect`
#3 [mir_const] processing MIR for `connect`
#4 [mir_validated] processing `connect`
#5 [mir_borrowck] borrow-checking `connect`
#6 [type_of] computing type of `connect::{{opaque}}#0`
#7 [check_mod_item_types] checking item types in top-level module
#8 [analysis] running analysis passes on this crate
end of query stack

@tmandry tmandry self-assigned this Jul 24, 2020
JohnTitor added a commit to JohnTitor/rust that referenced this issue Jul 24, 2020
Fix ICE while building MIR with type errors

See rust-lang#74047 (comment) for background. Replacing a binding with `PatKind::Wild` (introduced in rust-lang#51789 and later refactored in rust-lang#67439) caused an ICE downstream while building MIR.

I noticed that taking this code out no longer triggers the ICEs it was added to prevent. I'm not sure what else changed, or if this change is _correct_, but it does seem to be passing ui tests at least.

r? @oli-obk
cc @estebank

Fixes rust-lang#74047.
@bors bors closed this as completed in 62e75a1 Jul 24, 2020
JohnTitor referenced this issue in JohnTitor/rust Mar 6, 2021
…nkov

Move some tests to more suitable subdirs

## The results from classifui

(The full results can be found here: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427)

- [lint-expr-stmt-attrs-for-early-lints.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/lint-expr-stmt-attrs-for-early-lints.rs) <sup>unknown</sup>: lint (1.566), feature-gates (-0.632), numbers-arithmetic (-0.955)
- [try-block.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/try-block.rs) <sup>unknown</sup>: binding (1.385), try-block (-0.097), lint (-0.932)
- [backtrace-debuginfo.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/backtrace-debuginfo.rs) <sup>unknown</sup>: macros (1.365), cfg (-0.279), drop (-0.291)
- [issues/issue-3521.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-3521.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/3521)</sup>: consts (1.298), enum (-0.872), in-band-lifetimes (-0.978)
- [impl-bounds-checking.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-bounds-checking.rs) <sup>unknown</sup>: traits (1.243), for (-0.999), shadowed (-0.999)
- [issues/issue-17718.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-17718.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/17718)</sup>: binding (1.236), consts (0.315), extern (-0.779)
- [issue-6157.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-6157.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/6157)</sup>: regions (1.213), unboxed-closures (-0.285), traits (-0.510)
- [issues/issue-44373.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-44373.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/44373)</sup>: consts (1.187), nll (0.427), borrowck (-0.704)
- [nullable-pointer-ffi-compat.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/nullable-pointer-ffi-compat.rs) <sup>unknown</sup>: regions (1.184), consts (0.650), traits (-0.571)
- [issues/issue-52992.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-52992.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/52992)</sup>: nll (1.132), associated-types (-0.628), parser (-0.893)
- [issues/issue-2330.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2330.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2330)</sup>: traits (1.116), directory_ownership (-0.691), compare-method (-0.981)
- [issue-74047.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-74047.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/74047)</sup>: async-await (1.109), impl-trait (-0.629), resolve (-0.781)
- [issues/issue-33140.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33140.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/33140)</sup>: traits (1.063), coherence (-0.832), codemap_tests (-0.944)
- [issues/issue-28576.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-28576.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/28576)</sup>: traits (1.062), associated-types (-0.333), impl-trait (-0.697)
- [issues/issue-7222.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-7222.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/7222)</sup>: binding (1.062), consts (-0.226), numbers-arithmetic (-0.294)
- [tup.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/tup.rs) <sup>unknown</sup>: structs-enums (1.061), threads-sendsync (-0.550), moves (-0.790)
- [issues/issue-15261.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-15261.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/15261)</sup>: consts (1.052), where-clauses (-0.833), macros (-0.862)
- [issues/issue-76179.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-76179.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/76179)</sup>: associated-types (1.048), process (-0.887), rfc-2457 (-0.984)
- [issues/issue-42344.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-42344.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/42344)</sup>: borrowck (1.043), macros (-0.481), specialization (-0.966)
- [issues/issue-18661.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18661.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/18661)</sup>: unboxed-closures (1.038), mir (-0.648), higher-rank-trait-bounds (-0.688)
- [issues/issue-2633.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2633.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2633)</sup>: structs-enums (1.020), functions-closures (-0.722), lint (-0.967)

Some notes:
- If there are related tests (e.g. it's for the same issue), they are moved along with it.
- Moved try-block.rs to the `try-block` dir.
- Moved tup.rs to the `tuple` dir.
- Moved some tests that classified as consts to the `statics` dir, as it seems they have statics actually.
- Skipped backtrace-debuginfo.rs because I think classifui overrates their helper macros.

cc rust-lang#73494
r? `@petrochenkov`
m-ou-se referenced this issue in m-ou-se/rust Mar 6, 2021
…nkov

Move some tests to more suitable subdirs

## The results from classifui

(The full results can be found here: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427)

- [lint-expr-stmt-attrs-for-early-lints.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/lint-expr-stmt-attrs-for-early-lints.rs) <sup>unknown</sup>: lint (1.566), feature-gates (-0.632), numbers-arithmetic (-0.955)
- [try-block.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/try-block.rs) <sup>unknown</sup>: binding (1.385), try-block (-0.097), lint (-0.932)
- [backtrace-debuginfo.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/backtrace-debuginfo.rs) <sup>unknown</sup>: macros (1.365), cfg (-0.279), drop (-0.291)
- [issues/issue-3521.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-3521.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/3521)</sup>: consts (1.298), enum (-0.872), in-band-lifetimes (-0.978)
- [impl-bounds-checking.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-bounds-checking.rs) <sup>unknown</sup>: traits (1.243), for (-0.999), shadowed (-0.999)
- [issues/issue-17718.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-17718.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/17718)</sup>: binding (1.236), consts (0.315), extern (-0.779)
- [issue-6157.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-6157.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/6157)</sup>: regions (1.213), unboxed-closures (-0.285), traits (-0.510)
- [issues/issue-44373.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-44373.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/44373)</sup>: consts (1.187), nll (0.427), borrowck (-0.704)
- [nullable-pointer-ffi-compat.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/nullable-pointer-ffi-compat.rs) <sup>unknown</sup>: regions (1.184), consts (0.650), traits (-0.571)
- [issues/issue-52992.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-52992.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/52992)</sup>: nll (1.132), associated-types (-0.628), parser (-0.893)
- [issues/issue-2330.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2330.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2330)</sup>: traits (1.116), directory_ownership (-0.691), compare-method (-0.981)
- [issue-74047.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-74047.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/74047)</sup>: async-await (1.109), impl-trait (-0.629), resolve (-0.781)
- [issues/issue-33140.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33140.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/33140)</sup>: traits (1.063), coherence (-0.832), codemap_tests (-0.944)
- [issues/issue-28576.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-28576.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/28576)</sup>: traits (1.062), associated-types (-0.333), impl-trait (-0.697)
- [issues/issue-7222.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-7222.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/7222)</sup>: binding (1.062), consts (-0.226), numbers-arithmetic (-0.294)
- [tup.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/tup.rs) <sup>unknown</sup>: structs-enums (1.061), threads-sendsync (-0.550), moves (-0.790)
- [issues/issue-15261.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-15261.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/15261)</sup>: consts (1.052), where-clauses (-0.833), macros (-0.862)
- [issues/issue-76179.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-76179.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/76179)</sup>: associated-types (1.048), process (-0.887), rfc-2457 (-0.984)
- [issues/issue-42344.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-42344.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/42344)</sup>: borrowck (1.043), macros (-0.481), specialization (-0.966)
- [issues/issue-18661.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18661.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/18661)</sup>: unboxed-closures (1.038), mir (-0.648), higher-rank-trait-bounds (-0.688)
- [issues/issue-2633.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2633.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2633)</sup>: structs-enums (1.020), functions-closures (-0.722), lint (-0.967)

Some notes:
- If there are related tests (e.g. it's for the same issue), they are moved along with it.
- Moved try-block.rs to the `try-block` dir.
- Moved tup.rs to the `tuple` dir.
- Moved some tests that classified as consts to the `statics` dir, as it seems they have statics actually.
- Skipped backtrace-debuginfo.rs because I think classifui overrates their helper macros.

cc rust-lang#73494
r? ``@petrochenkov``
JohnTitor referenced this issue in JohnTitor/rust Mar 7, 2021
…nkov

Move some tests to more suitable subdirs

## The results from classifui

(The full results can be found here: https://gist.github.com/JohnTitor/c9e00840990b5e4a8fc562ec3571e427)

- [lint-expr-stmt-attrs-for-early-lints.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/lint-expr-stmt-attrs-for-early-lints.rs) <sup>unknown</sup>: lint (1.566), feature-gates (-0.632), numbers-arithmetic (-0.955)
- [try-block.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/try-block.rs) <sup>unknown</sup>: binding (1.385), try-block (-0.097), lint (-0.932)
- [backtrace-debuginfo.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/backtrace-debuginfo.rs) <sup>unknown</sup>: macros (1.365), cfg (-0.279), drop (-0.291)
- [issues/issue-3521.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-3521.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/3521)</sup>: consts (1.298), enum (-0.872), in-band-lifetimes (-0.978)
- [impl-bounds-checking.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-bounds-checking.rs) <sup>unknown</sup>: traits (1.243), for (-0.999), shadowed (-0.999)
- [issues/issue-17718.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-17718.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/17718)</sup>: binding (1.236), consts (0.315), extern (-0.779)
- [issue-6157.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-6157.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/6157)</sup>: regions (1.213), unboxed-closures (-0.285), traits (-0.510)
- [issues/issue-44373.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-44373.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/44373)</sup>: consts (1.187), nll (0.427), borrowck (-0.704)
- [nullable-pointer-ffi-compat.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/nullable-pointer-ffi-compat.rs) <sup>unknown</sup>: regions (1.184), consts (0.650), traits (-0.571)
- [issues/issue-52992.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-52992.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/52992)</sup>: nll (1.132), associated-types (-0.628), parser (-0.893)
- [issues/issue-2330.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2330.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2330)</sup>: traits (1.116), directory_ownership (-0.691), compare-method (-0.981)
- [issue-74047.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issue-74047.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/74047)</sup>: async-await (1.109), impl-trait (-0.629), resolve (-0.781)
- [issues/issue-33140.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-33140.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/33140)</sup>: traits (1.063), coherence (-0.832), codemap_tests (-0.944)
- [issues/issue-28576.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-28576.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/28576)</sup>: traits (1.062), associated-types (-0.333), impl-trait (-0.697)
- [issues/issue-7222.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-7222.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/7222)</sup>: binding (1.062), consts (-0.226), numbers-arithmetic (-0.294)
- [tup.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/tup.rs) <sup>unknown</sup>: structs-enums (1.061), threads-sendsync (-0.550), moves (-0.790)
- [issues/issue-15261.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-15261.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/15261)</sup>: consts (1.052), where-clauses (-0.833), macros (-0.862)
- [issues/issue-76179.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-76179.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/76179)</sup>: associated-types (1.048), process (-0.887), rfc-2457 (-0.984)
- [issues/issue-42344.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-42344.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/42344)</sup>: borrowck (1.043), macros (-0.481), specialization (-0.966)
- [issues/issue-18661.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-18661.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/18661)</sup>: unboxed-closures (1.038), mir (-0.648), higher-rank-trait-bounds (-0.688)
- [issues/issue-2633.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-2633.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/2633)</sup>: structs-enums (1.020), functions-closures (-0.722), lint (-0.967)

Some notes:
- If there are related tests (e.g. it's for the same issue), they are moved along with it.
- Moved try-block.rs to the `try-block` dir.
- Moved tup.rs to the `tuple` dir.
- Moved some tests that classified as consts to the `statics` dir, as it seems they have statics actually.
- Skipped backtrace-debuginfo.rs because I think classifui overrates their helper macros.

cc rust-lang#73494
r? ```@petrochenkov```
@tmandry tmandry moved this to Done in wg-async work Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-async-await Area: Async & Await A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html AsyncAwait-Triaged Async-await issues that have been triaged during a working group meeting. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants