rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.8k stars 12.5k forks source link

Rust compiler crash - cannot relate bound region - when passing wrong argument type to plotters #101589

Closed mcbridejc closed 2 years ago

mcbridejc commented 2 years ago

I accidentally stumbled upon this crash with nightly. When reverting to stable, it outputs an error message because I am passing the wrong argument type to chart.draw_series.

Code

Full project which causes the crash here: https://github.com/mcbridejc/rust-crash-demo-20220908

use gtk::prelude::*;
use plotters::prelude::*;
use plotters_cairo::CairoBackend;

const GLADE_UI_SOURCE: &'static str = include_str!("app.glade");

fn build_ui(app: &gtk::Application) {
    let builder = gtk::Builder::from_string(GLADE_UI_SOURCE);

    let window = builder.object::<gtk::Window>("MainWindow").unwrap();
    window.set_application(Some(app));

    let drawing_area: gtk::DrawingArea = builder.object("MainDrawingArea").unwrap();

    drawing_area.connect_draw(move |widget, cr| {
        let w = widget.allocated_width();
        let h = widget.allocated_height();
        let backend = CairoBackend::new(cr, (w as u32, h as u32)).unwrap();

        let root = backend.into_drawing_area();

        root.fill(&WHITE).unwrap();
        let mut chart = ChartBuilder::on(&root).caption("A test chart", ("sans-serif", 50).into_font())
        .build_cartesian_2d(-1f32..1f32, -1f32..1f32).unwrap();
        //////////////////////////////////////////////////////////
        // Here's the error
        chart.draw_series(LineSeries::new(
            // Oops, returning iterator of f32 instead of (f32, f32)
            (-50..=50).map(|x| x as f32 / 50.0),
            // The below would be the correct arg, yielding tuples instead of scalars    
            //(-50..=50).map(|x| x as f32 / 50.0).map(|x| (x, x * x)),
            &RED,
        )).unwrap();

        root.present().unwrap();

        Inhibit(false)
    });

    window.show_all();
}

fn main() {
    let app = gtk::Application::new(
        Some("any.app.id.is.fine"),
        Default::default(),
    );
    app.connect_activate(|app| {
        build_ui(app);
    });
    app.run();
}

Meta

The code is incorrect, and on stable rust, I get the following error output:

   Compiling rust-crash-demo-20220908 v0.1.0 (/home/jeff/dev/rust-bug-example)
error[E0277]: the trait bound `for<'b> &'b DynElement<'static, CairoBackend<'_>, f32>: PointCollection<'b, (f32, f32)>` is not satisfied
   --> src/main.rs:26:15
    |
26  |         chart.draw_series(LineSeries::new(
    |               ^^^^^^^^^^^ the trait `for<'b> PointCollection<'b, (f32, f32)>` is not implemented for `&'b DynElement<'static, CairoBackend<'_>, f32>`
    |
    = help: the following implementations were found:
              <&'a DynElement<'b, DB, Coord> as PointCollection<'a, Coord>>
note: required by a bound in `ChartContext::<'a, DB, CT>::draw_series`
   --> /home/jeff/.cargo/git/checkouts/plotters-514b572fd2567842/7f8b12d/plotters/src/chart/context.rs:126:24
    |
126 |         for<'b> &'b E: PointCollection<'b, CT::From, B>,
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `ChartContext::<'a, DB, CT>::draw_series`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `rust-crash-demo-20220908` due to previous error

rustc --version --verbose:

rustc 1.65.0-nightly (748038961 2022-08-25)
binary: rustc
commit-hash: 7480389611f9d04bd34adf41a2b3029be4eb815e
commit-date: 2022-08-25
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 15.0.0

Error output

error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(56:611 ~ plotters[b1d9]::chart::context::{impl#1}::draw_series::'b), 'b) }) <= '_#53r

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/compiler/rustc_errors/src/lib.rs:1393:9
stack backtrace:
   0:     0x7f3a50427400 - std::backtrace_rs::backtrace::libunwind::trace::h2aab03b73f72c7df
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7f3a50427400 - std::backtrace_rs::backtrace::trace_unsynchronized::h3eca5d21f7d69aac
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3a50427400 - std::sys_common::backtrace::_print_fmt::hea9c617086d0512c
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f3a50427400 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hcd4c2c2cfdd5d0d6
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f3a5048212e - core::fmt::write::h10f610544bba85e2
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/core/src/fmt/mod.rs:1202:17
   5:     0x7f3a50418295 - std::io::Write::write_fmt::had4054a873710e65
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/io/mod.rs:1672:15
   6:     0x7f3a5042a0c3 - std::sys_common::backtrace::_print::h4dd267ef32d500e5
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f3a5042a0c3 - std::sys_common::backtrace::print::hd055a8f91e18a346
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f3a5042a0c3 - std::panicking::default_hook::{{closure}}::hd0c792ae4e63357e
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/panicking.rs:295:22
   9:     0x7f3a50429daf - std::panicking::default_hook::h22fbb26b98df9cc4
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/panicking.rs:314:9
  10:     0x7f3a52c52331 - <rustc_driver[82175be88d0838b5]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[200d113468b3e67d]::ops::function::FnOnce<(&core[200d113468b3e67d]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7f3a5042a8fd - std::panicking::rust_panic_with_hook::ha5fcab7510d2c291
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/panicking.rs:702:17
  12:     0x7f3a53b49861 - std[76b05c926e7310dd]::panicking::begin_panic::<rustc_errors[3aa815ae69db3b1c]::ExplicitBug>::{closure#0}
  13:     0x7f3a53b44e56 - std[76b05c926e7310dd]::sys_common::backtrace::__rust_end_short_backtrace::<std[76b05c926e7310dd]::panicking::begin_panic<rustc_errors[3aa815ae69db3b1c]::ExplicitBug>::{closure#0}, !>
  14:     0x7f3a53b28e26 - std[76b05c926e7310dd]::panicking::begin_panic::<rustc_errors[3aa815ae69db3b1c]::ExplicitBug>
  15:     0x7f3a53b1a416 - std[76b05c926e7310dd]::panic::panic_any::<rustc_errors[3aa815ae69db3b1c]::ExplicitBug>
  16:     0x7f3a53b19a11 - <rustc_errors[3aa815ae69db3b1c]::HandlerInner>::span_bug::<rustc_span[58882ad2522b3487]::span_encoding::Span, &alloc[3b320fcdbc309927]::string::String>
  17:     0x7f3a53b198d0 - <rustc_errors[3aa815ae69db3b1c]::Handler>::span_bug::<rustc_span[58882ad2522b3487]::span_encoding::Span, &alloc[3b320fcdbc309927]::string::String>
  18:     0x7f3a53ad5b48 - rustc_middle[3717ca78a5dec842]::ty::context::tls::with_context_opt::<rustc_middle[3717ca78a5dec842]::ty::context::tls::with_opt<rustc_middle[3717ca78a5dec842]::util::bug::opt_span_bug_fmt<rustc_span[58882ad2522b3487]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  19:     0x7f3a53ad59e6 - rustc_middle[3717ca78a5dec842]::util::bug::opt_span_bug_fmt::<rustc_span[58882ad2522b3487]::span_encoding::Span>
  20:     0x7f3a53ad59a4 - rustc_middle[3717ca78a5dec842]::util::bug::span_bug_fmt::<rustc_span[58882ad2522b3487]::span_encoding::Span>
  21:     0x7f3a5164ab06 - <rustc_infer[48ac37f9552e45ad]::infer::region_constraints::RegionConstraintCollector>::make_eqregion
  22:     0x7f3a5165017f - <rustc_infer[48ac37f9552e45ad]::infer::equate::Equate as rustc_middle[3717ca78a5dec842]::ty::relate::TypeRelation>::relate_with_variance::<rustc_middle[3717ca78a5dec842]::ty::sty::Region>
  23:     0x7f3a5164ee94 - rustc_middle[3717ca78a5dec842]::ty::relate::super_relate_tys::<rustc_infer[48ac37f9552e45ad]::infer::equate::Equate>
  24:     0x7f3a5155ab83 - <rustc_infer[48ac37f9552e45ad]::infer::equate::Equate as rustc_middle[3717ca78a5dec842]::ty::relate::TypeRelation>::tys
  25:     0x7f3a51f2d000 - <rustc_infer[48ac37f9552e45ad]::infer::at::At>::eq::<rustc_middle[3717ca78a5dec842]::ty::Ty>
  26:     0x7f3a539c1271 - <rustc_infer[48ac37f9552e45ad]::infer::InferCtxt>::can_eq::<rustc_middle[3717ca78a5dec842]::ty::Ty>
  27:     0x7f3a539c712d - <rustc_infer[48ac37f9552e45ad]::infer::InferCtxt as rustc_trait_selection[31a146d52257b6bc]::traits::error_reporting::suggestions::InferCtxtExt>::suggest_dereferences
  28:     0x7f3a539dfa76 - <rustc_infer[48ac37f9552e45ad]::infer::InferCtxt as rustc_trait_selection[31a146d52257b6bc]::traits::error_reporting::InferCtxtExt>::report_selection_error
  29:     0x7f3a539e987d - <rustc_infer[48ac37f9552e45ad]::infer::InferCtxt as rustc_trait_selection[31a146d52257b6bc]::traits::error_reporting::InferCtxtPrivExt>::report_fulfillment_error
  30:     0x7f3a539dc01d - <rustc_infer[48ac37f9552e45ad]::infer::InferCtxt as rustc_trait_selection[31a146d52257b6bc]::traits::error_reporting::InferCtxtExt>::report_fulfillment_errors
  31:     0x7f3a51746bca - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_argument_types
  32:     0x7f3a516707cd - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  33:     0x7f3a5166ef33 - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  34:     0x7f3a516dbdac - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  35:     0x7f3a5166ede4 - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  36:     0x7f3a520c111d - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_return_expr
  37:     0x7f3a520be1eb - rustc_typeck[190a4d868a0d33f8]::check::check::check_fn
  38:     0x7f3a526ce270 - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_expr_closure
  39:     0x7f3a51671b23 - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  40:     0x7f3a51743908 - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_argument_types
  41:     0x7f3a516707cd - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  42:     0x7f3a516dbdac - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  43:     0x7f3a5166ede4 - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  44:     0x7f3a520c111d - <rustc_typeck[190a4d868a0d33f8]::check::fn_ctxt::FnCtxt>::check_return_expr
  45:     0x7f3a520be1eb - rustc_typeck[190a4d868a0d33f8]::check::check::check_fn
  46:     0x7f3a520b0fa3 - <rustc_infer[48ac37f9552e45ad]::infer::InferCtxtBuilder>::enter::<&rustc_middle[3717ca78a5dec842]::ty::context::TypeckResults, <rustc_typeck[190a4d868a0d33f8]::check::inherited::InheritedBuilder>::enter<rustc_typeck[190a4d868a0d33f8]::check::typeck_with_fallback<rustc_typeck[190a4d868a0d33f8]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[3717ca78a5dec842]::ty::context::TypeckResults>::{closure#0}>
  47:     0x7f3a520aebe4 - rustc_typeck[190a4d868a0d33f8]::check::typeck
  48:     0x7f3a5236619d - <rustc_query_system[35f63f7c4b517368]::dep_graph::graph::DepGraph<rustc_middle[3717ca78a5dec842]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3717ca78a5dec842]::ty::context::TyCtxt, rustc_span[58882ad2522b3487]::def_id::LocalDefId, &rustc_middle[3717ca78a5dec842]::ty::context::TypeckResults>
  49:     0x7f3a5235ebe0 - rustc_query_system[35f63f7c4b517368]::query::plumbing::try_execute_query::<rustc_query_impl[1e3c2d3b78f56143]::plumbing::QueryCtxt, rustc_query_system[35f63f7c4b517368]::query::caches::DefaultCache<rustc_span[58882ad2522b3487]::def_id::LocalDefId, &rustc_middle[3717ca78a5dec842]::ty::context::TypeckResults>>
  50:     0x7f3a52b47f58 - <rustc_query_impl[1e3c2d3b78f56143]::Queries as rustc_middle[3717ca78a5dec842]::ty::query::QueryEngine>::typeck
  51:     0x7f3a5297ceeb - rustc_data_structures[e320fec9a50473a]::sync::par_for_each_in::<&[rustc_span[58882ad2522b3487]::def_id::LocalDefId], <rustc_middle[3717ca78a5dec842]::hir::map::Map>::par_body_owners<rustc_typeck[190a4d868a0d33f8]::check::typeck_item_bodies::{closure#0}>::{closure#0}>
  52:     0x7f3a5297cca3 - rustc_typeck[190a4d868a0d33f8]::check::typeck_item_bodies
  53:     0x7f3a52887ec5 - <rustc_query_system[35f63f7c4b517368]::dep_graph::graph::DepGraph<rustc_middle[3717ca78a5dec842]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3717ca78a5dec842]::ty::context::TyCtxt, (), ()>
  54:     0x7f3a52886f7f - rustc_query_system[35f63f7c4b517368]::query::plumbing::try_execute_query::<rustc_query_impl[1e3c2d3b78f56143]::plumbing::QueryCtxt, rustc_query_system[35f63f7c4b517368]::query::caches::DefaultCache<(), ()>>
  55:     0x7f3a528869b1 - rustc_query_system[35f63f7c4b517368]::query::plumbing::get_query::<rustc_query_impl[1e3c2d3b78f56143]::queries::typeck_item_bodies, rustc_query_impl[1e3c2d3b78f56143]::plumbing::QueryCtxt>
  56:     0x7f3a5262c12f - <rustc_session[720028cef8e445d5]::session::Session>::time::<(), rustc_typeck[190a4d868a0d33f8]::check_crate::{closure#7}>
  57:     0x7f3a5262bf25 - rustc_typeck[190a4d868a0d33f8]::check_crate
  58:     0x7f3a52629d52 - rustc_interface[4cd9d1ba33da26b9]::passes::analysis
  59:     0x7f3a529c8e92 - <rustc_query_system[35f63f7c4b517368]::dep_graph::graph::DepGraph<rustc_middle[3717ca78a5dec842]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3717ca78a5dec842]::ty::context::TyCtxt, (), core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>>
  60:     0x7f3a529c8617 - rustc_query_system[35f63f7c4b517368]::query::plumbing::try_execute_query::<rustc_query_impl[1e3c2d3b78f56143]::plumbing::QueryCtxt, rustc_query_system[35f63f7c4b517368]::query::caches::DefaultCache<(), core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>>>
  61:     0x7f3a529c810e - rustc_query_system[35f63f7c4b517368]::query::plumbing::get_query::<rustc_query_impl[1e3c2d3b78f56143]::queries::analysis, rustc_query_impl[1e3c2d3b78f56143]::plumbing::QueryCtxt>
  62:     0x7f3a525325e7 - <rustc_interface[4cd9d1ba33da26b9]::passes::QueryContext>::enter::<rustc_driver[82175be88d0838b5]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>>
  63:     0x7f3a5252e75e - <rustc_interface[4cd9d1ba33da26b9]::interface::Compiler>::enter::<rustc_driver[82175be88d0838b5]::run_compiler::{closure#1}::{closure#2}, core[200d113468b3e67d]::result::Result<core[200d113468b3e67d]::option::Option<rustc_interface[4cd9d1ba33da26b9]::queries::Linker>, rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>>
  64:     0x7f3a5252a2fc - rustc_span[58882ad2522b3487]::with_source_map::<core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>, rustc_interface[4cd9d1ba33da26b9]::interface::create_compiler_and_run<core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>, rustc_driver[82175be88d0838b5]::run_compiler::{closure#1}>::{closure#1}>
  65:     0x7f3a52529d82 - rustc_interface[4cd9d1ba33da26b9]::interface::create_compiler_and_run::<core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>, rustc_driver[82175be88d0838b5]::run_compiler::{closure#1}>
  66:     0x7f3a52528921 - <scoped_tls[b2ec032a876a0ff7]::ScopedKey<rustc_span[58882ad2522b3487]::SessionGlobals>>::set::<rustc_interface[4cd9d1ba33da26b9]::interface::run_compiler<core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>, rustc_driver[82175be88d0838b5]::run_compiler::{closure#1}>::{closure#0}, core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>>
  67:     0x7f3a5252860f - std[76b05c926e7310dd]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[4cd9d1ba33da26b9]::util::run_in_thread_pool_with_globals<rustc_interface[4cd9d1ba33da26b9]::interface::run_compiler<core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>, rustc_driver[82175be88d0838b5]::run_compiler::{closure#1}>::{closure#0}, core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>>::{closure#0}, core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>>
  68:     0x7f3a52a6e549 - <<std[76b05c926e7310dd]::thread::Builder>::spawn_unchecked_<rustc_interface[4cd9d1ba33da26b9]::util::run_in_thread_pool_with_globals<rustc_interface[4cd9d1ba33da26b9]::interface::run_compiler<core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>, rustc_driver[82175be88d0838b5]::run_compiler::{closure#1}>::{closure#0}, core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>>::{closure#0}, core[200d113468b3e67d]::result::Result<(), rustc_errors[3aa815ae69db3b1c]::ErrorGuaranteed>>::{closure#1} as core[200d113468b3e67d]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  69:     0x7f3a50434523 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h234c9f70a7e6c5bd
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/alloc/src/boxed.rs:1940:9
  70:     0x7f3a50434523 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hae8fb94b47e06af2
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/alloc/src/boxed.rs:1940:9
  71:     0x7f3a50434523 - std::sys::unix::thread::Thread::new::thread_start::hdbfed6a2cd9a6e41
                               at /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/library/std/src/sys/unix/thread.rs:108:17
  72:     0x7f3a50169b43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  73:     0x7f3a501fba00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  74:                0x0 - <unknown>

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.65.0-nightly (748038961 2022-08-25) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `build_ui`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `rust-crash-demo-20220908`
Backtrace

``` thread 'rustc' panicked at 'Box', /rustc/7480389611f9d04bd34adf41a2b3029be4eb815e/compiler/rustc_errors/src/lib.rs:1393:9 stack backtrace: 0: std::panicking::begin_panic:: 1: std::panic::panic_any:: 2: ::span_bug:: 3: ::span_bug:: 4: rustc_middle::ty::context::tls::with_context_opt::::{closure#0}, ()>::{closure#0}, ()> 5: rustc_middle::util::bug::opt_span_bug_fmt:: 6: rustc_middle::util::bug::span_bug_fmt:: 7: ::make_eqregion 8: ::relate_with_variance:: 9: rustc_middle::ty::relate::super_relate_tys:: 10: ::tys 11: ::eq:: 12: ::can_eq:: 13: ::suggest_dereferences 14: ::report_selection_error 15: ::report_fulfillment_error 16: ::report_fulfillment_errors 17: ::check_argument_types 18: ::check_expr_with_expectation_and_args 19: ::check_expr_with_expectation_and_args 20: ::check_block_with_expected 21: ::check_expr_with_expectation_and_args 22: ::check_return_expr 23: rustc_typeck::check::check::check_fn 24: ::check_expr_closure 25: ::check_expr_with_expectation_and_args 26: ::check_argument_types 27: ::check_expr_with_expectation_and_args 28: ::check_block_with_expected 29: ::check_expr_with_expectation_and_args 30: ::check_return_expr 31: rustc_typeck::check::check::check_fn 32: ::enter::<&rustc_middle::ty::context::TypeckResults, ::enter::{closure#1}, &rustc_middle::ty::context::TypeckResults>::{closure#0}> 33: rustc_typeck::check::typeck 34: >::with_task:: 35: rustc_query_system::query::plumbing::try_execute_query::> 36: ::typeck 37: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], ::par_body_owners::{closure#0}> 38: rustc_typeck::check::typeck_item_bodies 39: >::with_task:: 40: rustc_query_system::query::plumbing::try_execute_query::> 41: rustc_query_system::query::plumbing::get_query:: 42: ::time::<(), rustc_typeck::check_crate::{closure#7}> 43: rustc_typeck::check_crate 44: rustc_interface::passes::analysis 45: >::with_task::> 46: rustc_query_system::query::plumbing::try_execute_query::>> 47: rustc_query_system::query::plumbing::get_query:: 48: ::enter::> 49: ::enter::, rustc_errors::ErrorGuaranteed>> 50: rustc_span::with_source_map::, rustc_interface::interface::create_compiler_and_run, rustc_driver::run_compiler::{closure#1}>::{closure#1}> 51: rustc_interface::interface::create_compiler_and_run::, rustc_driver::run_compiler::{closure#1}> 52: >::set::, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>> ```

compiler-errors commented 2 years ago

@mcbridejc please update your nightly build, this should be fixed

mcbridejc commented 2 years ago

Oh so it is. Apologies for the noise.