Open Turbo87 opened 5 days ago
/cc @estebank since this seems to be diagnostics-related (?)
Backtrace looks like #114640. ICE'd while borrow-checking around https://github.com/Turbo87/crates.io/blob/cf1ac7c853bc4cea21a8fd3fdb7e17260d1a242c/src/controllers/user/me.rs#L68.
It looks a bit like #114640 and #123157, but #123157 is feature-gated-dependent.
@Turbo87 does it repro if you cargo clean
then check/build again?
does it repro if you
cargo clean
then check/build again?
yep, reproduces every time I run, also when running cargo clean
or rm -rf target
before the cargo build
. also happens on cargo check
and cargo clippy
.
Thanks for the info. That is certainly curious. @rustbot label +E-needs-mcve
Reduced as far as I could:
use std::future::Future;
fn force_send<T: Send>(_: T) {}
fn async_load<'a, T>(this: T) -> impl Future
where
T: LoadQuery<'a>,
{
async move {
LoadQuery::internal_load(this).await;
}
}
trait AppError: 'static {}
fn ice() -> impl Future<Output = Option<Box<dyn AppError>>> {
async {
let user = User {};
force_send(async_load(&user));
None
}
}
struct User {}
trait LoadQuery<'query> {
type LoadFuture: Future;
fn internal_load(self) -> Self::LoadFuture
where
Self: Sized,
{
loop {}
}
}
impl<'query, 'a> LoadQuery<'query> for &'a User
where
'a: 'query,
{
type LoadFuture = SimpleFuture;
}
struct SimpleFuture;
impl Future for SimpleFuture {
type Output = ();
fn poll(
self: std::pin::Pin<&mut Self>,
_: &mut std::task::Context<'_>,
) -> std::task::Poll<Self::Output> {
loop {}
}
}
@rustbot label: -E-needs-mcve
Code
Meta
rustc --version --verbose
:Error output
Backtrace
``` stack backtrace: 0: _rust_begin_unwind 1: core::panicking::panic_fmt 2: core::panicking::panic 3: core::option::unwrap_failed 4:::best_blame_constraint::<::free_region_constraint_info::{closure#0}>
5: ::explain_why_borrow_contains_point
6: ::report_borrowed_value_does_not_live_long_enough
7: rustc_borrowck::path_utils::each_borrow_involving_path::<::check_access_for_conflict::{closure#1}, ::check_access_for_conflict::{closure#0}, rustc_borrowck::MirBorrowckCtxt>
8: ::access_place
9: >::visit_terminator_before_primary_effect
10: ::visit_results_in_block::
11: rustc_mir_dataflow::framework::visitor::visit_results::, rustc_middle::mir::traversal::reverse_postorder::{closure#0}>, rustc_borrowck::do_mir_borrowck::{closure#2}>, rustc_borrowck::MirBorrowckCtxt>
12: rustc_borrowck::do_mir_borrowck
13: rustc_borrowck::mir_borrowck
[... omitted 2 frames ...]
14: ::prove_closure_bounds
15: ::check_rvalue
16: ::typeck_mir
17: rustc_borrowck::type_check::type_check
18: rustc_borrowck::nll::compute_regions
19: rustc_borrowck::do_mir_borrowck
20: rustc_borrowck::mir_borrowck
[... omitted 2 frames ...]
21: rustc_hir_analysis::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
[... omitted 2 frames ...]
22: rustc_middle::query::plumbing::query_get_at::>>
23: rustc_hir_analysis::collect::type_of::type_of
[... omitted 2 frames ...]
24: rustc_hir_analysis::check::check::check_item_type
25: rustc_hir_analysis::check::wfcheck::check_well_formed
[... omitted 2 frames ...]
26: ::run::, rustc_data_structures::sync::parallel::disabled::try_par_for_each_in<&[rustc_hir::hir::ImplItemId], rustc_span::ErrorGuaranteed, ::par_impl_items::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>
27: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
[... omitted 2 frames ...]
28: ::run::<(), rustc_data_structures::sync::parallel::disabled::par_for_each_in<&[rustc_hir::hir_id::OwnerId], ::par_for_each_module::{closure#0}>::{closure#0}::{closure#0}::{closure#0}>
29: rustc_hir_analysis::check_crate
30: rustc_interface::passes::analysis
[... omitted 2 frames ...]
31: ::enter::>
32: ::enter::, rustc_span::ErrorGuaranteed>>
33: >::set::, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
```