Skip to content

werk regression #199

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

Closed
compiler-errors opened this issue May 6, 2025 · 4 comments
Closed

werk regression #199

compiler-errors opened this issue May 6, 2025 · 4 comments
Labels
from-crater A regression found via a crater run, not part of our test suite

Comments

@compiler-errors
Copy link
Member

Some type of recursive opaque + auto trait that results in infinite blowup:

https://crater-reports.s3.amazonaws.com/pr-133502-11/try%2328f13ad7c79d80decb5a3d54595a8b4105f397a3/gh/simonask.werk/log.txt

[INFO] [stdout] note: no errors encountered even though delayed bugs were created
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] note: those delayed bugs will now be shown as internal compiler errors
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: internal compiler error: errors selecting obligation during MIR typeck: [Ambiguity]
[INFO] [stdout]   |
[INFO] [stdout]   = note: delayed at /rustc/28f13ad7c79d80decb5a3d54595a8b4105f397a3/compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs:95:18
[INFO] [stdout]              0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
[INFO] [stdout]              1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
[INFO] [stdout]              2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
[INFO] [stdout]              3: <rustc_errors::DiagCtxtHandle>::delayed_bug::<alloc::string::String>
[INFO] [stdout]              4: <rustc_borrowck::type_check::TypeChecker>::fully_perform_op::<(), rustc_middle::ty::ParamEnvAnd<rustc_middle::traits::query::type_op::ProvePredicate>>
[INFO] [stdout]              5: <rustc_borrowck::type_check::TypeChecker>::normalize_and_prove_instantiated_predicates
[INFO] [stdout]              6: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_const_operand
[INFO] [stdout]              7: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
[INFO] [stdout]              8: rustc_borrowck::start_do_mir_borrowck
[INFO] [stdout]              9: <rustc_borrowck::type_check::TypeChecker>::prove_closure_bounds
[INFO] [stdout]             10: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_rvalue
[INFO] [stdout]             11: <rustc_borrowck::type_check::TypeChecker as rustc_middle::mir::visit::Visitor>::visit_body
[INFO] [stdout]             12: rustc_borrowck::start_do_mir_borrowck
[INFO] [stdout]             13: <rustc_borrowck::root_cx::BorrowCheckRootCtxt>::borrowck_root
[INFO] [stdout]             14: rustc_borrowck::mir_borrowck
[INFO] [stdout]             15: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
[INFO] [stdout]             16: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_data_structures::vec_cache::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>, rustc_query_system::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
[INFO] [stdout]             17: rustc_query_impl::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
[INFO] [stdout]             18: rustc_hir_analysis::collect::type_of::opaque::find_opaque_ty_constraints_for_rpit
[INFO] [stdout]             19: rustc_hir_analysis::collect::type_of::type_of_opaque
[INFO] [stdout]             20: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::type_of_opaque::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
[INFO] [stdout]             21: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
[INFO] [stdout]             22: rustc_query_impl::query_impl::type_of_opaque::get_query_non_incr::__rust_end_short_backtrace
[INFO] [stdout]             23: rustc_hir_analysis::collect::type_of::type_of
[INFO] [stdout]             24: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::type_of::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
[INFO] [stdout]             25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefIdCache<rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
[INFO] [stdout]             26: rustc_query_impl::query_impl::type_of::get_query_non_incr::__rust_end_short_backtrace
[INFO] [stdout]             27: rustc_hir_analysis::check::check::check_opaque
[INFO] [stdout]             28: rustc_hir_analysis::check::check::check_item_type
[INFO] [stdout]             29: rustc_hir_analysis::check::wfcheck::check_well_formed
@lcnr lcnr added the from-crater A regression found via a crater run, not part of our test suite label May 6, 2025
@lcnr lcnr changed the title werk regression werk regression May 8, 2025
@lqd
Copy link
Member

lqd commented May 16, 2025

I saw another ICE, so I kept that too just in case. godbolt for them both.

(werk is on edition 2024)

pub async fn run_task(t: &u32) {
    build_dependencies(t).await;
}

async fn build_dependencies(t: &u32) {
    Box::pin(run_task(t)).await;
    Box::pin(build_multiple(t)).await;
}

fn build_multiple(t: &u32) -> impl Future<Output = ()> + Send {
    async move {
        spawn(async move { run_task(t).await }); // MIR typeck Ambiguity
        // spawn(run_task(t)); // index out of bounds in ena
    }
}

fn spawn<T>(_: impl Future<Output = T> + Send) {}

@lcnr
Copy link
Contributor

lcnr commented May 17, 2025

fn build_multiple<'a>() -> impl Future<Output = ()> {
    spawn(async { run_task().await });
    std::future::ready(())
}

async fn run_task() {
    build_dependencies().await;
}

async fn build_dependencies() {
    Box::pin(run_task()).await;
    Box::pin(build_multiple()).await;
}

fn spawn<F: Send>(_: F) {}

@lcnr
Copy link
Contributor

lcnr commented May 17, 2025

fn build_multiple<'a>() -> impl Sized {
    spawn(async { build_dependencies().await });
}

fn build_dependencies() -> impl Future<Output = ()> /* + Send */ {
    async {
        Box::pin(build_dependencies()).await;
        async { build_multiple() }.await;
    }
}

fn spawn<F: Send>(_: F) {}

fn main() {}

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue May 17, 2025
…rowck, r=compiler-errors

check coroutines with `TypingMode::Borrowck` to avoid cyclic reasoning

MIR borrowck taints its output if an obligation fails. This could then cause `check_coroutine_obligations` to silence its error, causing us to not emit and actual error and ICE.

Fixes the ICE in rust-lang/trait-system-refactor-initiative#199. It is unfortunately still a regression.

r? compiler-errors
rust-timer added a commit to rust-lang-ci/rust that referenced this issue May 17, 2025
Rollup merge of rust-lang#141125 - lcnr:coroutine_obligations_use_borrowck, r=compiler-errors

check coroutines with `TypingMode::Borrowck` to avoid cyclic reasoning

MIR borrowck taints its output if an obligation fails. This could then cause `check_coroutine_obligations` to silence its error, causing us to not emit and actual error and ICE.

Fixes the ICE in rust-lang/trait-system-refactor-initiative#199. It is unfortunately still a regression.

r? compiler-errors
github-actions bot pushed a commit to rust-lang/miri that referenced this issue May 18, 2025
…compiler-errors

check coroutines with `TypingMode::Borrowck` to avoid cyclic reasoning

MIR borrowck taints its output if an obligation fails. This could then cause `check_coroutine_obligations` to silence its error, causing us to not emit and actual error and ICE.

Fixes the ICE in rust-lang/trait-system-refactor-initiative#199. It is unfortunately still a regression.

r? compiler-errors
@lcnr
Copy link
Contributor

lcnr commented May 18, 2025

tracked in #209

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from-crater A regression found via a crater run, not part of our test suite
Projects
None yet
Development

No branches or pull requests

3 participants