Skip to content

[bug] When I Use tauri-plugin-http and reqwest either, I got a panic #138274

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

Open
Wan9xy opened this issue Mar 9, 2025 · 8 comments
Open

[bug] When I Use tauri-plugin-http and reqwest either, I got a panic #138274

Wan9xy opened this issue Mar 9, 2025 · 8 comments
Assignees
Labels
A-async-await Area: Async & Await A-auto-traits Area: auto traits (e.g., `auto trait Send {}`) A-coercions Area: implicit and explicit `expr as Type` coercions A-trait-objects Area: trait objects, vtable layout C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@Wan9xy
Copy link

Wan9xy commented Mar 9, 2025

Code

just follow next steps

  • create a new project
D:\src>cargo create-tauri-app
✔ Project name · http3-test
✔ Identifier · com.http3-test.app
✔ Choose which language to use for your frontend · TypeScript / JavaScript - (pnpm, yarn, npm, deno, bun)
✔ Choose your package manager · yarn
✔ Choose your UI template · React - (https://react.dev/)
✔ Choose your UI flavor · TypeScript

Template created! To get started run:
  cd http3-test
  yarn
  yarn tauri android init

For Desktop development, run:
  yarn tauri dev

For Android development, run:
  yarn tauri android dev
  • add http-plugin
PS D:\src\http3-test> cargo tauri add http
    Info Installing Cargo dependency "tauri-plugin-http"...
    Updating crates.io index
      Adding tauri-plugin-http v2 to dependencies                                                                                                                                                                                                                                                             
             Features as of v2.0.0:
             + charset
             + cookies
             + http2
             + macos-system-configuration
             + rustls-tls
             - blocking
             - brotli
             - deflate
             - gzip
             - json
             - multipart
             - native-tls
             - native-tls-alpn
             - native-tls-vendored
             - rustls-tls-manual-roots
             - rustls-tls-native-roots
             - rustls-tls-webpki-roots
             - socks
             - stream
             - trust-dns
             - unsafe-headers
    Updating crates.io index
     Locking 14 packages to latest compatible versions                                                                                                                                                                                                                                                        
      Adding atomic-waker v1.1.2
      Adding cookie_store v0.21.1
      Adding core-foundation v0.9.4
      Adding data-url v0.3.1
      Adding document-features v0.2.11
      Adding h2 v0.4.8
      Adding litrs v0.4.1
      Adding psl-types v2.0.11
      Adding publicsuffix v2.3.0
      Adding system-configuration v0.6.1
      Adding system-configuration-sys v0.6.0
      Adding tauri-plugin-fs v2.2.0
      Adding tauri-plugin-http v2.3.0
      Adding tokio-macros v2.5.0
    Info Installing NPM dependency "@tauri-apps/plugin-http@>=2"...
npm WARN tar TAR_ENTRY_ERROR UNKNOWN: unknown error, open 'D:\src\http3-test\node_modules\csstype\LICENSE'
npm WARN tar TAR_ENTRY_ERROR UNKNOWN: unknown error, open 'D:\src\http3-test\node_modules\react\LICENSE'
npm WARN tar TAR_ENTRY_ERROR UNKNOWN: unknown error, open 'D:\src\http3-test\node_modules\csstype\index.js.flow'
npm WARN tar TAR_ENTRY_ERROR UNKNOWN: unknown error, open 'D:\src\http3-test\node_modules\react\index.js'
npm WARN tar TAR_ENTRY_ERROR EPERM: operation not permitted, unlink 'D:\src\http3-test\node_modules\rollup\dist\shared\index.js.DELETE.b9028c845ffc584fbb068805a7d58e0a'
npm WARN tar TAR_ENTRY_ERROR EPERM: operation not permitted, unlink 'D:\src\http3-test\node_modules\react-dom\cjs\react-dom-server.browser.development.js.DELETE.76960b8d49de689888a42ede9c85b4e1'
npm WARN tar TAR_ENTRY_ERROR EPERM: operation not permitted, unlink 'D:\src\http3-test\node_modules\react-dom\umd\react-dom-server.browser.development.js.DELETE.1d650941dcfc97f45f5af66203d98360'
npm WARN tar TAR_ENTRY_ERROR EPERM: operation not permitted, unlink 'D:\src\http3-test\node_modules\@types\react\index.d.ts.DELETE.6c7871ba6cbe85ffe9516d2f2b26e620'
    Added permission `http:default` to `default` at D:\src\http3-test\src-tauri\capabilities\default.json
    Info Adding plugin to D:\src\http3-test\src-tauri\src/lib.rs
    Info Running `cargo fmt`...
  • add reqwest
PS D:\src\http3-test> cd .\src-tauri\
PS D:\src\http3-test\src-tauri> cargo add reqwest --features http3
    Updating crates.io index
      Adding reqwest v0.12.12 to dependencies                                                                                                                                                                                                                                                                 
             Features:
             + __rustls
             + __rustls-ring
             + __tls
             + charset
             + default-tls
             + h2
             + http2
             + http3
             + macos-system-configuration
             + rustls-tls-manual-roots
             + rustls-tls-manual-roots-no-provider
             22 deactivated features
     Locking 21 packages to latest compatible versions
      Adding errno v0.3.10
      Adding fastrand v2.3.0
      Adding foreign-types v0.3.2
      Adding foreign-types-shared v0.1.1
      Adding futures v0.3.31
      Adding h3 v0.0.6
      Adding h3-quinn v0.0.7
      Adding hyper-tls v0.6.0
      Adding linux-raw-sys v0.4.15
      Adding native-tls v0.2.14
      Adding openssl v0.10.71
      Adding openssl-macros v0.1.1
      Adding openssl-probe v0.1.6
      Adding openssl-sys v0.9.106
      Adding rustix v0.38.44
      Adding schannel v0.1.27
      Adding security-framework v2.11.1
      Adding security-framework-sys v2.14.0
      Adding tempfile v3.17.1
      Adding tokio-native-tls v0.3.1
      Adding vcpkg v0.2.15
  • last setting env and run you can get panic like this
error: 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.84.1 (e71f9a9a9 2025-01-27) running on x86_64-pc-windows-msvc
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [optimized_mir] optimizing MIR for `commands::fetch::{closure#0}`
#1 [layout_of] computing layout of `{async fn body of commands::fetch<R>()}`
#2 [mir_drops_elaborated_and_const_checked] elaborating drops for `commands::fetch`
#3 [analysis] running analysis passes on this crate
end of query stack
  • at last my cargo.toml is
[package]
name = "http3-test"
version = "0.1.0"
description = "A Tauri App"
authors = ["you"]
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
# The `_lib` suffix may seem redundant but it is necessary
# to make the lib name unique and wouldn't conflict with the bin name.
# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519
name = "http3_test_lib"
crate-type = ["staticlib", "cdylib", "rlib"]

[build-dependencies]
tauri-build = { version = "2", features = [] }

[dependencies]
tauri = { version = "2", features = [] }
tauri-plugin-shell = "2"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tauri-plugin-http = "2"
reqwest = { version = "0.12.12", features = ["http3"] }

Meta

rustc --version --verbose:

OS: Windows 11 x64
rustc: rustc 1.84.1 (e71f9a9a9 2025-01-27)

Error output


error: 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.84.1 (e71f9a9a9 2025-01-27) running on x86_64-pc-windows-msvc
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [optimized_mir] optimizing MIR for `commands::fetch::{closure#0}`
#1 [layout_of] computing layout of `{async fn body of commands::fetch<R>()}`
#2 [mir_drops_elaborated_and_const_checked] elaborating drops for `commands::fetch`
#3 [analysis] running analysis passes on this crate
end of query stack

@Wan9xy Wan9xy 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 Mar 9, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 9, 2025
@saethlin
Copy link
Member

saethlin commented Mar 9, 2025

You've chopped off the useful part of the error message. Please provide the entire error message, or as much as you are allowed.

@Wan9xy
Copy link
Author

Wan9xy commented Mar 10, 2025

You've chopped off the useful part of the error message. Please provide the entire error message, or as much as you are allowed.

I'm sorry, here is the full trace with RUST_BACKTRACE=1

PS D:\src\http3-test\src-tauri> $env:RUST_BACKTRACE=1; $env:RUSTFLAGS='--cfg reqwest_unstable'; cargo run
   Compiling tauri-plugin-http v2.3.0
thread 'rustc' panicked at compiler\rustc_mir_transform\src\validate.rs:90:25:                                                                                                                                                                                                                                
broken MIR in Item(DefId(0:417 ~ tauri_plugin_http[c72f]::commands::fetch::{closure#0})) (after phase change to runtime-optimized) at bb143[0]:                                                                                                                                                               
Unsize coercion, but `Pin<Box<{async block@C:\Users\Administrator\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-plugin-http-2.3.0\src\commands.rs:317:27: 317:37}>>` isn't coercible to `Pin<Box<dyn Future<Output = std::result::Result<reqwest::Response, error::Error>> + Send + Sync>>`
stack backtrace:
   0: std::panicking::begin_panic_handler                                                                                                                                                                                                                                                                     
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/std\src\panicking.rs:665
   1: core::panicking::panic_fmt                                                                                                                                                                                                                                                                              
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/core\src\panicking.rs:76
   2: <rustc_mir_transform::sroa::ReplacementVisitor as rustc_middle::mir::visit::MutVisitor>::visit_local                                                                                                                                                                                                    
   3: <rustc_mir_transform::validate::Validator as rustc_mir_transform::pass_manager::MirPass>::run_pass                                                                                                                                                                                                      
   4: <rustc_mir_transform::simplify::SimplifyCfg as rustc_mir_transform::pass_manager::MirPass>::run_pass                                                                                                                                                                                                    
   5: rustc_mir_transform::optimized_mir                                                                                                                                                                                                                                                                      
   6: rustc_query_impl::plumbing::query_key_hash_verify_all                                                                                                                                                                                                                                                   
   7: rustc_ty_utils::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack                                                                                                                                                                                                                          
   8: rustc_query_impl::plumbing::query_key_hash_verify_all                                                                                                                                                                                                                                                   
   9: <rustc_middle::query::on_disk_cache::CacheEncoder as rustc_span::SpanEncoder>::encode_def_id                                                                                                                                                                                                            
  10: <rustc_middle::ty::context::TyCtxt>::coroutine_layout                                                                                                                                                                                                                                                   
  11: rustc_ty_utils::instance::resolve_instance_raw                                                                                                                                                                                                                                                          
  12: rustc_ty_utils::layout::layout_of                                                                                                                                                                                                                                                                       
  13: rustc_query_impl::plumbing::query_key_hash_verify_all                                                                                                                                                                                                                                                   
  14: rustc_ty_utils::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack                                                                                                                                                                                                                          
  15: rustc_query_impl::plumbing::query_key_hash_verify_all                                                                                                                                                                                                                                                   
  16: <rustc_mir_transform::known_panics_lint::KnownPanicsLint as rustc_mir_transform::pass_manager::MirLint>::run_lint                                                                                                                                                                                       
  17: rustc_mir_transform::run_analysis_to_runtime_passes                                                                                                                                                                                                                                                     
  18: rustc_mir_transform::mir_drops_elaborated_and_const_checked                                                                                                                                                                                                                                             
  19: rustc_query_impl::plumbing::query_key_hash_verify_all                                                                                                                                                                                                                                                   
  20: rustc_ty_utils::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack                                                                                                                                                                                                                          
  21: rustc_query_impl::plumbing::query_key_hash_verify_all
  22: rustc_interface::passes::resolver_for_lowering_raw
  23: rustc_interface::passes::analysis
  24: rustc_ty_utils::ty::adt_sized_constraint                                                                                                                                                                                                                                                                
  25: rustc_ty_utils::ty::adt_sized_constraint
  26: rustc_query_impl::query_system
  27: _rust_alloc_error_handler
  28: _rust_alloc_error_handler
  29: _rust_alloc_error_handler
  30: alloc::boxed::impl$28::call_once
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/alloc\src\boxed.rs:1972
  31: alloc::boxed::impl$28::call_once
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/alloc\src\boxed.rs:1972
  32: std::sys::pal::windows::thread::impl$0::new::thread_start
             at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/std\src\sys\pal\windows\thread.rs:55
  33: BaseThreadInitThunk
  34: RtlUserThreadStart
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: 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.84.1 (e71f9a9a9 2025-01-27) running on x86_64-pc-windows-msvc

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

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

query stack during panic:
#0 [optimized_mir] optimizing MIR for `commands::fetch::{closure#0}`
#1 [layout_of] computing layout of `{async fn body of commands::fetch<R>()}`
#2 [mir_drops_elaborated_and_const_checked] elaborating drops for `commands::fetch`
#3 [analysis] running analysis passes on this crate
end of query stack
note: no errors encountered even though delayed bugs were created                                                                                                                                                                                                                                             

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: error performing operation: fully_perform                                                                                                                                                                                                                                     
   --> C:\Users\Administrator\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-plugin-http-2.3.0\src\commands.rs:319:55
    |
319 |                 let rid = resources_table.add_request(Box::pin(fut));
    |                                                       ^^^^^^^^^^^^^
    |
note: delayed at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\compiler\rustc_trait_selection\src\traits\query\type_op\custom.rs:87:25
         0: std::backtrace_rs::backtrace::dbghelp64::trace
                   at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/std\src\..\..\backtrace\src\backtrace\dbghelp64.rs:91
         1: std::backtrace_rs::backtrace::trace_unsynchronized
                   at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/std\src\..\..\backtrace\src\backtrace\mod.rs:66
         2: std::backtrace::Backtrace::create
                   at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/std\src\backtrace.rs:331
         3: std::backtrace::Backtrace::capture
                   at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/std\src\backtrace.rs:296
         4: <rustc_errors::DiagCtxtHandle>::steal_fulfilled_expectation_ids
         5: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
         6: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
         7: <rustc_pattern_analysis::errors::NonExhaustiveOmittedPatternLintOnArm as rustc_errors::diagnostic::LintDiagnostic<()>>::decorate_lint
         8: <rustc_borrowck::region_infer::RegionInferenceContext>::eval_outlives
         9: <rustc_borrowck::type_check::TypeChecker>::push_region_constraints
        10: rustc_borrowck::dataflow::calculate_borrows_out_of_scope_at_location
        11: rustc_borrowck::dataflow::calculate_borrows_out_of_scope_at_location
        12: <rustc_borrowck::type_check::TypeChecker>::push_region_constraints
        13: rustc_borrowck::mir_borrowck
        14: rustc_query_impl::plumbing::query_key_hash_verify_all
        15: rustc_ty_utils::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
        16: rustc_query_impl::plumbing::query_key_hash_verify_all
        17: <rustc_pattern_analysis::rustc::RustcPatCtxt as rustc_pattern_analysis::PatCx>::lint_non_contiguous_range_endpoints
        18: <rustc_borrowck::type_check::relate_tys::NllTypeRelating as rustc_type_ir::relate::TypeRelation<rustc_middle::ty::context::TyCtxt>>::consts
        19: <rustc_borrowck::type_check::TypeChecker>::push_region_constraints
        20: rustc_borrowck::dataflow::calculate_borrows_out_of_scope_at_location
        21: rustc_borrowck::dataflow::calculate_borrows_out_of_scope_at_location
        22: <rustc_borrowck::type_check::TypeChecker>::push_region_constraints
        23: rustc_borrowck::mir_borrowck
        24: rustc_query_impl::plumbing::query_key_hash_verify_all
        25: rustc_ty_utils::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
        26: rustc_query_impl::plumbing::query_key_hash_verify_all
        27: <rustc_hir_typeck::upvar::InferBorrowKind as rustc_hir_typeck::expr_use_visitor::Delegate>::borrow
        28: rustc_hir_analysis::collect::type_of::type_of_opaque
        29: rustc_ty_utils::ty::adt_sized_constraint
        30: rustc_ty_utils::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
        31: rustc_query_impl::query_system
        32: <rustc_hir_typeck::upvar::InferBorrowKind as rustc_hir_typeck::expr_use_visitor::Delegate>::mutate
        33: rustc_hir_analysis::collect::type_of::type_of
        34: rustc_query_impl::plumbing::query_key_hash_verify_all
        35: rustc_ty_utils::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
        36: rustc_query_impl::plumbing::query_key_hash_verify_all
        37: <rustc_hir_typeck::upvar::InferBorrowKind as rustc_hir_typeck::expr_use_visitor::Delegate>::mutate
        38: rustc_hir_analysis::check::check::check_abi
        39: rustc_hir_analysis::check::wfcheck::check_well_formed
        40: rustc_query_impl::plumbing::query_key_hash_verify_all
        41: rustc_ty_utils::ty::self_ty_of_trait_impl_enabling_order_dep_trait_object_hack
        42: rustc_query_impl::plumbing::query_key_hash_verify_all
        43: <rustc_hir_typeck::upvar::InferBorrowKind as rustc_hir_typeck::expr_use_visitor::Delegate>::consume
        44: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
        45: rustc_ty_utils::ty::adt_sized_constraint
        46: rustc_ty_utils::ty::adt_sized_constraint
        47: rustc_query_impl::query_system
        48: rustc_hir_analysis::check_crate
        49: rustc_interface::passes::resolver_for_lowering_raw
        50: rustc_interface::passes::analysis
        51: rustc_ty_utils::ty::adt_sized_constraint
        52: rustc_ty_utils::ty::adt_sized_constraint
        53: rustc_query_impl::query_system
        54: _rust_alloc_error_handler
        55: _rust_alloc_error_handler
        56: _rust_alloc_error_handler
        57: alloc::boxed::impl$28::call_once
                   at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/alloc\src\boxed.rs:1972
        58: alloc::boxed::impl$28::call_once
                   at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/alloc\src\boxed.rs:1972
        59: std::sys::pal::windows::thread::impl$0::new::thread_start
                   at /rustc/e71f9a9a98b0faf423844bf0ba7438f29dc27d58\library/std\src\sys\pal\windows\thread.rs:55
        60: BaseThreadInitThunk
        61: RtlUserThreadStart
   --> C:\Users\Administrator\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-plugin-http-2.3.0\src\commands.rs:319:55
    |
319 |                 let rid = resources_table.add_request(Box::pin(fut));
    |                                                       ^^^^^^^^^^^^^

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.84.1 (e71f9a9a9 2025-01-27) running on x86_64-pc-windows-msvc

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

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

query stack during panic:
end of query stack
error: could not compile `tauri-plugin-http` (lib)                                                                                                                                                                                                                                                            

Caused by:
  process didn't exit successfully: `C:\Users\Administrator\.rustup\toolchains\stable-x86_64-pc-windows-msvc\bin\rustc.exe --crate-name tauri_plugin_http --edition=2021 C:\Users\Administrator\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-plugin-http-2.3.0\src\lib.rs --error-format=json --j
son=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=302 --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg "feature=\"charset\"" --cfg "feature=\"cookies\"" --cfg "feature=\"default\"" --cfg "feature=\"http2\"" --cfg "feature=\"macos-system-con
figuration\"" --cfg "feature=\"rustls-tls\"" --check-cfg cfg(docsrs) --check-cfg "cfg(feature, values(\"blocking\", \"brotli\", \"charset\", \"cookies\", \"dangerous-settings\", \"default\", \"deflate\", \"gzip\", \"http2\", \"json\", \"macos-system-configuration\", \"multipart\", \"native-tls\", \"nat
ive-tls-alpn\", \"native-tls-vendored\", \"rustls-tls\", \"rustls-tls-manual-roots\", \"rustls-tls-native-roots\", \"rustls-tls-webpki-roots\", \"socks\", \"stream\", \"tracing\", \"trust-dns\", \"unsafe-headers\"))" -C metadata=f5bbd12ef7328d8e -C extra-filename=-f5bbd12ef7328d8e --out-dir D:\src\http
3-test\src-tauri\target\debug\deps -L dependency=D:\src\http3-test\src-tauri\target\debug\deps --extern data_url=D:\src\http3-test\src-tauri\target\debug\deps\libdata_url-c4b4bc6a18eb5590.rmeta --extern http=D:\src\http3-test\src-tauri\target\debug\deps\libhttp-56ec124f80b94cc5.rmeta --extern regex=D:\
src\http3-test\src-tauri\target\debug\deps\libregex-5437268effc614ca.rmeta --extern reqwest=D:\src\http3-test\src-tauri\target\debug\deps\libreqwest-a462ed9329b60e2f.rmeta --extern serde=D:\src\http3-test\src-tauri\target\debug\deps\libserde-92778bc281f3868e.rmeta --extern serde_json=D:\src\http3-test\
src-tauri\target\debug\deps\libserde_json-7c1e2a1cfe44ee25.rmeta --extern tauri=D:\src\http3-test\src-tauri\target\debug\deps\libtauri-53a8933a256d0576.rmeta --extern tauri_plugin_fs=D:\src\http3-test\src-tauri\target\debug\deps\libtauri_plugin_fs-be48d9e540419561.rmeta --extern thiserror=D:\src\http3-
test\src-tauri\target\debug\deps\libthiserror-81f7ea5a76fcb05c.rmeta --extern tokio=D:\src\http3-test\src-tauri\target\debug\deps\libtokio-343acfde05be58cf.rmeta --extern url=D:\src\http3-test\src-tauri\target\debug\deps\liburl-c3180afa4404d5d1.rmeta --extern urlpattern=D:\src\http3-test\src-tauri\targ
et\debug\deps\liburlpattern-99d35f42895bb430.rmeta --cap-lints allow --cfg reqwest_unstable -L native=C:\Users\Administrator\.cargo\registry\src\index.crates.io-6f17d22bba15001f\windows_x86_64_msvc-0.52.6\lib -L native=D:\src\http3-test\src-tauri\target\debug\build\ring-8c5175d0dd056d93\out -L native=D:\src\http3-test\src-tauri\target\debug\build\webview2-com-sys-77bfefcfd4f002d3\out\x64 --cfg desktop --check-cfg cfg(mobile) --check-cfg cfg(desktop)` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN)
PS D:\src\http3-test\src-tauri> 

@moxian
Copy link
Contributor

moxian commented Mar 10, 2025

Minimized to only depend on pin-project-lite:

# Cargo.toml
[package]
name = "rustc-bug1"
version = "0.1.0"
edition = "2021"

[lib]

[dependencies]
pin-project-lite = "0.2.11"
// lib.rs
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};

use pin_project_lite::pin_project;

type CancelableResponseFuture = Pin<Box<dyn Future<Output = ()> + Send + Sync>>;

pin_project! {
    pub struct Root {
        #[pin]
        inner: InnerA,
    }
}

pin_project! {
    pub struct InnerA {
        #[pin]
        in_flight: InnerB,
    }
}

pub struct InnerB {
    inner: Pin<Box<dyn Future<Output = ()> + Send>>,
}

impl Root{
    fn new() -> Self{todo!()}
}

impl Future for Root {
    type Output = ();

    fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
        todo!();
    }
}

pub async fn fetch() {
    let fut = async move {
        Root::new().await;        
    };
    let b: CancelableResponseFuture = Box::pin(fut);
}

Bisects to 0399709 / #130847

Given the words "optimizing mir" in the ICE, probably #130735 (??)
cc @compiler-errors

@compiler-errors
Copy link
Member

I'll take a look anyways

@compiler-errors compiler-errors self-assigned this Mar 10, 2025
@moxian
Copy link
Contributor

moxian commented Mar 11, 2025

smaller and self-contained:

// rustc --crate-type=lib --edition=2021
use std::future::Future;
use std::pin::Pin;
use std::task::{Context, Poll};

struct Root {
    inner: InnerB,
}

struct InnerB {
    inner: Pin<Box<dyn Future<Output = ()>>>,
}
impl Root {
    fn new() -> Self {
        todo!()
    }
}
impl Future for Root {
    type Output = ();
    fn poll(self: Pin<&mut Self>, _: &mut Context) -> Poll<Self::Output> {
        todo!();
    }
}
async fn fetch() {
    let fut = async {
        Root::new().await;
    };
    let _: Pin<Box<dyn Future<Output = ()> + Send>> = Box::pin(fut);
}

@rustbot label: +S-has-mcve +S-has-bisection +regression-from-stable-to-stable +T-types -needs-triage +A-coercions +A-pin

@rustbot rustbot added regression-from-stable-to-stable Performance or correctness regression from one stable version to another. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-types Relevant to the types team, which will review and decide on the PR/issue. I-prioritize Issue: Indicates that prioritization has been requested for this issue. A-coercions Area: implicit and explicit `expr as Type` coercions A-pin Area: Pin and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 11, 2025
@theemathas
Copy link
Contributor

Smaller:

trait Trait {}

fn foo() -> Box<dyn Trait> {
    todo!()
}

fn fetch() {
    async {
        let fut = async {
            let _x = foo();
            async {}.await;
        };
        let _: Box<dyn Send> = Box::new(fut);
    };
}

@rustbot labels -A-pin +A-auto-traits +A-async-await +A-trait-objects

@rustbot rustbot added A-async-await Area: Async & Await A-auto-traits Area: auto traits (e.g., `auto trait Send {}`) A-trait-objects Area: trait objects, vtable layout and removed A-pin Area: Pin labels Mar 11, 2025
@apiraino
Copy link
Contributor

Assigning priority (discussion on Zulip).

So, one issue is the ICE, which seems to be on stable since long as per the previous bisection. The other thing I am not sure about is if the code created by the Tauri template should compile or is it correct that exits with an error.

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Mar 11, 2025
@matthiaskrgr
Copy link
Member

pretty sure this is a duplicate of #137916

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-auto-traits Area: auto traits (e.g., `auto trait Send {}`) A-coercions Area: implicit and explicit `expr as Type` coercions A-trait-objects Area: trait objects, vtable layout C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

8 participants