Open
Description
Code
pub trait AsyncLend {
type From<'a>
where
Self: 'a;
type Into<'a>
where
Self: 'a;
async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
}
pub struct AsyncLend2<T, F, I>(T, core::marker::PhantomData<fn() -> (F, I)>);
impl<T, F, I> AsyncLend for AsyncLend2<T, F, I>
where
T: AsyncFnMut(&mut F) -> I,
{
type From<'a> = F;
type Into<'a> = I;
async fn lend(self, from: Self::From<'_>) -> Self::Into<'_> {
(self.0)(from).await
}
}
Meta
Exists on stable/beta/nightly
rustc --version --verbose
:
rustc 1.86.0 (05f9846f8 2025-03-31)
binary: rustc
commit-hash: 05f9846f893b09a1be1fc8560e33fc3c815cfecb
commit-date: 2025-03-31
host: x86_64-unknown-linux-gnu
release: 1.86.0
LLVM version: 19.1.7
Error output
Compiling ice2 v0.1.0 (/var/home/jeron/Code/test/ice2)
error[E0309]: the parameter type `T` may not live long enough
--> src/lib.rs:18:21
|
18 | type From<'a> = F;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `T` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
18 | type From<'a> = F where T: 'a;
| +++++++++++
error[E0309]: the parameter type `F` may not live long enough
--> src/lib.rs:18:21
|
18 | type From<'a> = F;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `F` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
18 | type From<'a> = F where F: 'a;
| +++++++++++
error[E0309]: the parameter type `I` may not live long enough
--> src/lib.rs:18:21
|
18 | type From<'a> = F;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `I` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
18 | type From<'a> = F where I: 'a;
| +++++++++++
error[E0309]: the parameter type `T` may not live long enough
--> src/lib.rs:19:21
|
19 | type Into<'a> = I;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `T` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
19 | type Into<'a> = I where T: 'a;
| +++++++++++
error[E0309]: the parameter type `F` may not live long enough
--> src/lib.rs:19:21
|
19 | type Into<'a> = I;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `F` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
19 | type Into<'a> = I where F: 'a;
| +++++++++++
error[E0309]: the parameter type `I` may not live long enough
--> src/lib.rs:19:21
|
19 | type Into<'a> = I;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `I` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
19 | type Into<'a> = I where I: 'a;
| +++++++++++
error[E0308]: mismatched types
--> src/lib.rs:22:18
|
14 | impl<T, F, I> AsyncLend for AsyncLend2<T, F, I>
| - found this type parameter
...
22 | (self.0)(from).await
| -------- ^^^^ expected `&mut F`, found type parameter `F`
| |
| arguments to this function are incorrect
|
= note: expected mutable reference `&mut _`
found type parameter `_`
note: method defined here
--> /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/core/src/ops/async_function.rs:34:27
help: consider mutably borrowing here
|
22 | (self.0)(&mut from).await
| ++++
error[E0311]: the parameter type `T` may not live long enough
--> src/lib.rs:9:31
|
9 | async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
| ^^^^^^^^^^^--^
| | |
| | the parameter type `T` must be valid for the anonymous lifetime as defined here...
| ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds...
|
note: ...that is required by this bound
--> src/lib.rs:4:15
|
4 | Self: 'a;
| ^^
help: consider adding an explicit lifetime bound
|
9 - async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
9 + async fn lend<'a>(self, from: Self::From<'a>) -> Self::Into<'a> where T: 'a;
|
error[E0311]: the parameter type `F` may not live long enough
--> src/lib.rs:9:31
|
9 | async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
| ^^^^^^^^^^^--^
| | |
| | the parameter type `F` must be valid for the anonymous lifetime as defined here...
| ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds...
|
note: ...that is required by this bound
--> src/lib.rs:4:15
|
4 | Self: 'a;
| ^^
help: consider adding an explicit lifetime bound
|
9 - async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
9 + async fn lend<'a>(self, from: Self::From<'a>) -> Self::Into<'a> where F: 'a;
|
error[E0311]: the parameter type `I` may not live long enough
--> src/lib.rs:9:31
|
9 | async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
| ^^^^^^^^^^^--^
| | |
| | the parameter type `I` must be valid for the anonymous lifetime as defined here...
| ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds...
|
note: ...that is required by this bound
--> src/lib.rs:4:15
|
4 | Self: 'a;
| ^^
help: consider adding an explicit lifetime bound
|
9 - async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
9 + async fn lend<'a>(self, from: Self::From<'a>) -> Self::Into<'a> where I: 'a;
|
error: internal compiler error: compiler/rustc_middle/src/ty/generics.rs:249:17: expected lifetime parameter, but found another generic parameter: GenericParamDef {
name: "F",
def_id: DefId(0:19 ~ ice2[b533]::{impl#0}::F),
index: 1,
pure_wrt_drop: false,
kind: Type {
has_default: false,
synthetic: false,
},
}
thread 'rustc' panicked at compiler/rustc_middle/src/ty/generics.rs:249:17:
Box<dyn Any>
stack backtrace:
0: 0x7f4f75dd6e40 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h6d42cc84fc840290
1: 0x7f4f7662867c - core::fmt::write::h5af61a909e3ec64d
2: 0x7f4f7792ca51 - std::io::Write::write_fmt::h5a7b54aa6e4a315d
3: 0x7f4f75dd6ca2 - std::sys::backtrace::BacktraceLock::print::h555579e7396c26ac
4: 0x7f4f75dd9122 - std::panicking::default_hook::{{closure}}::h9128866118196224
5: 0x7f4f75dd8faa - std::panicking::default_hook::h52e9e7314e0255f6
6: 0x7f4f74f33449 - std[d9e466a2d75004a2]::panicking::update_hook::<alloc[54bfe2542ace865d]::boxed::Box<rustc_driver_impl[680c351c5444d7cd]::install_ice_hook::{closure#1}>>::{closure#0}
7: 0x7f4f75dd9ca3 - std::panicking::rust_panic_with_hook::h541791bcc774ef34
8: 0x7f4f74f6e3b1 - std[d9e466a2d75004a2]::panicking::begin_panic::<rustc_errors[90b6e0e1196d63f0]::ExplicitBug>::{closure#0}
9: 0x7f4f74f63326 - std[d9e466a2d75004a2]::sys::backtrace::__rust_end_short_backtrace::<std[d9e466a2d75004a2]::panicking::begin_panic<rustc_errors[90b6e0e1196d63f0]::ExplicitBug>::{closure#0}, !>
10: 0x7f4f74f6330d - std[d9e466a2d75004a2]::panicking::begin_panic::<rustc_errors[90b6e0e1196d63f0]::ExplicitBug>
11: 0x7f4f74f78381 - <rustc_errors[90b6e0e1196d63f0]::diagnostic::BugAbort as rustc_errors[90b6e0e1196d63f0]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
12: 0x7f4f7554ff23 - rustc_middle[a78c8f6c75429410]::util::bug::opt_span_bug_fmt::<rustc_span[15ded62729b25549]::span_encoding::Span>::{closure#0}
13: 0x7f4f75538d6a - rustc_middle[a78c8f6c75429410]::ty::context::tls::with_opt::<rustc_middle[a78c8f6c75429410]::util::bug::opt_span_bug_fmt<rustc_span[15ded62729b25549]::span_encoding::Span>::{closure#0}, !>::{closure#0}
14: 0x7f4f75538bfb - rustc_middle[a78c8f6c75429410]::ty::context::tls::with_context_opt::<rustc_middle[a78c8f6c75429410]::ty::context::tls::with_opt<rustc_middle[a78c8f6c75429410]::util::bug::opt_span_bug_fmt<rustc_span[15ded62729b25549]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
15: 0x7f4f73ebcf90 - rustc_middle[a78c8f6c75429410]::util::bug::bug_fmt
16: 0x7f4f77cea415 - <rustc_middle[a78c8f6c75429410]::ty::generics::Generics>::region_param.cold
17: 0x7f4f72c0e7d7 - <rustc_middle[a78c8f6c75429410]::ty::region::Region>::opt_param_def_id
18: 0x7f4f75539b18 - <rustc_middle[a78c8f6c75429410]::ty::context::TyCtxt>::is_suitable_region
19: 0x7f4f75bf0a66 - <rustc_trait_selection[2bf3b2046bc969f2]::error_reporting::TypeErrCtxt>::construct_generic_bound_failure
20: 0x7f4f75bec78e - <rustc_trait_selection[2bf3b2046bc969f2]::error_reporting::TypeErrCtxt>::report_region_errors
21: 0x7f4f76ed0436 - <rustc_trait_selection[2bf3b2046bc969f2]::traits::engine::ObligationCtxt<rustc_trait_selection[2bf3b2046bc969f2]::traits::FulfillmentError>>::resolve_regions_and_report_errors::<indexmap[86021827789b9189]::set::IndexSet<rustc_middle[a78c8f6c75429410]::ty::Ty, core[46aa9df3d3dcdeb1]::hash::BuildHasherDefault<rustc_hash[33e007ae09964f4c]::FxHasher>>>
22: 0x7f4f76c5c968 - rustc_hir_analysis[f9dd0ea7be29e3be]::check::compare_impl_item::check_type_bounds
23: 0x7f4f76c52f3f - rustc_hir_analysis[f9dd0ea7be29e3be]::check::compare_impl_item::compare_impl_item
24: 0x7f4f76c51515 - rustc_query_impl[abff21d8349146d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[abff21d8349146d]::query_impl::compare_impl_item::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 1usize]>>
25: 0x7f4f76a9442b - rustc_query_system[9464b8c501ef87f3]::query::plumbing::try_execute_query::<rustc_query_impl[abff21d8349146d]::DynamicConfig<rustc_data_structures[6e992f72641bf6c6]::vec_cache::VecCache<rustc_span[15ded62729b25549]::def_id::LocalDefId, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[9464b8c501ef87f3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[abff21d8349146d]::plumbing::QueryCtxt, true>
26: 0x7f4f76a9664b - rustc_query_impl[abff21d8349146d]::query_impl::compare_impl_item::get_query_incr::__rust_end_short_backtrace
27: 0x7f4f7762fc2d - rustc_hir_analysis[f9dd0ea7be29e3be]::check::check::check_item_type
28: 0x7f4f76c70ccd - rustc_hir_analysis[f9dd0ea7be29e3be]::check::wfcheck::check_well_formed
29: 0x7f4f76c6f8d1 - rustc_query_impl[abff21d8349146d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[abff21d8349146d]::query_impl::check_well_formed::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 1usize]>>
30: 0x7f4f76a94827 - rustc_query_system[9464b8c501ef87f3]::query::plumbing::try_execute_query::<rustc_query_impl[abff21d8349146d]::DynamicConfig<rustc_data_structures[6e992f72641bf6c6]::vec_cache::VecCache<rustc_span[15ded62729b25549]::def_id::LocalDefId, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 1usize]>, rustc_query_system[9464b8c501ef87f3]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[abff21d8349146d]::plumbing::QueryCtxt, true>
31: 0x7f4f76a93cae - rustc_query_impl[abff21d8349146d]::query_impl::check_well_formed::get_query_incr::__rust_end_short_backtrace
32: 0x7f4f76c6c96c - rustc_hir_analysis[f9dd0ea7be29e3be]::check::wfcheck::check_mod_type_wf
33: 0x7f4f76c6c78b - rustc_query_impl[abff21d8349146d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[abff21d8349146d]::query_impl::check_mod_type_wf::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 1usize]>>
34: 0x7f4f7756855a - rustc_query_system[9464b8c501ef87f3]::query::plumbing::try_execute_query::<rustc_query_impl[abff21d8349146d]::DynamicConfig<rustc_query_system[9464b8c501ef87f3]::query::caches::DefaultCache<rustc_span[15ded62729b25549]::def_id::LocalModDefId, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[abff21d8349146d]::plumbing::QueryCtxt, true>
35: 0x7f4f77568f9a - rustc_query_impl[abff21d8349146d]::query_impl::check_mod_type_wf::get_query_incr::__rust_end_short_backtrace
36: 0x7f4f76a079aa - rustc_hir_analysis[f9dd0ea7be29e3be]::check_crate
37: 0x7f4f76a028ab - rustc_interface[84ab11ffe8dacd23]::passes::run_required_analyses
38: 0x7f4f77118f1e - rustc_interface[84ab11ffe8dacd23]::passes::analysis
39: 0x7f4f77118eef - rustc_query_impl[abff21d8349146d]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[abff21d8349146d]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 0usize]>>
40: 0x7f4f7764ef93 - rustc_query_system[9464b8c501ef87f3]::query::plumbing::try_execute_query::<rustc_query_impl[abff21d8349146d]::DynamicConfig<rustc_query_system[9464b8c501ef87f3]::query::caches::SingleCache<rustc_middle[a78c8f6c75429410]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[abff21d8349146d]::plumbing::QueryCtxt, true>
41: 0x7f4f7764e915 - rustc_query_impl[abff21d8349146d]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
42: 0x7f4f7759aea9 - rustc_interface[84ab11ffe8dacd23]::passes::create_and_enter_global_ctxt::<core[46aa9df3d3dcdeb1]::option::Option<rustc_interface[84ab11ffe8dacd23]::queries::Linker>, rustc_driver_impl[680c351c5444d7cd]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
43: 0x7f4f775ab726 - rustc_interface[84ab11ffe8dacd23]::interface::run_compiler::<(), rustc_driver_impl[680c351c5444d7cd]::run_compiler::{closure#0}>::{closure#1}
44: 0x7f4f774e0744 - std[d9e466a2d75004a2]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[84ab11ffe8dacd23]::util::run_in_thread_with_globals<rustc_interface[84ab11ffe8dacd23]::util::run_in_thread_pool_with_globals<rustc_interface[84ab11ffe8dacd23]::interface::run_compiler<(), rustc_driver_impl[680c351c5444d7cd]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
45: 0x7f4f774e0419 - <<std[d9e466a2d75004a2]::thread::Builder>::spawn_unchecked_<rustc_interface[84ab11ffe8dacd23]::util::run_in_thread_with_globals<rustc_interface[84ab11ffe8dacd23]::util::run_in_thread_pool_with_globals<rustc_interface[84ab11ffe8dacd23]::interface::run_compiler<(), rustc_driver_impl[680c351c5444d7cd]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[46aa9df3d3dcdeb1]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
46: 0x7f4f774dfbaf - std::sys::pal::unix::thread::Thread::new::thread_start::hcc5ed016d554f327
47: 0x7f4f7167f1d4 - start_thread
48: 0x7f4f71701cec - __clone3
49: 0x0 - <unknown>
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.86.0 (05f9846f8 2025-03-31) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [compare_impl_item] checking assoc item `<impl at src/lib.rs:14:1: 16:32>::{synthetic#0}` is compatible with trait definition
#1 [check_well_formed] checking that `<impl at src/lib.rs:14:1: 16:32>` is well-formed
... and 2 other queries... use `env RUST_BACKTRACE=1` to see the full query stack
Some errors have detailed explanations: E0308, E0309, E0311.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `ice2` (lib) due to 10 previous errors
Backtrace
Compiling ice2 v0.1.0 (/var/home/jeron/Code/test/ice2)
error[E0309]: the parameter type `T` may not live long enough
--> src/lib.rs:18:21
|
18 | type From<'a> = F;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `T` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
18 | type From<'a> = F where T: 'a;
| +++++++++++
error[E0309]: the parameter type `F` may not live long enough
--> src/lib.rs:18:21
|
18 | type From<'a> = F;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `F` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
18 | type From<'a> = F where F: 'a;
| +++++++++++
error[E0309]: the parameter type `I` may not live long enough
--> src/lib.rs:18:21
|
18 | type From<'a> = F;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `I` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
18 | type From<'a> = F where I: 'a;
| +++++++++++
error[E0309]: the parameter type `T` may not live long enough
--> src/lib.rs:19:21
|
19 | type Into<'a> = I;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `T` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
19 | type Into<'a> = I where T: 'a;
| +++++++++++
error[E0309]: the parameter type `F` may not live long enough
--> src/lib.rs:19:21
|
19 | type Into<'a> = I;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `F` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
19 | type Into<'a> = I where F: 'a;
| +++++++++++
error[E0309]: the parameter type `I` may not live long enough
--> src/lib.rs:19:21
|
19 | type Into<'a> = I;
| -- ^ ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds
| |
| the parameter type `I` must be valid for the lifetime `'a` as defined here...
|
help: consider adding an explicit lifetime bound
|
19 | type Into<'a> = I where I: 'a;
| +++++++++++
error[E0308]: mismatched types
--> src/lib.rs:22:18
|
14 | impl<T, F, I> AsyncLend for AsyncLend2<T, F, I>
| - found this type parameter
...
22 | (self.0)(from).await
| -------- ^^^^ expected `&mut F`, found type parameter `F`
| |
| arguments to this function are incorrect
|
= note: expected mutable reference `&mut _`
found type parameter `_`
note: method defined here
--> /rustc/05f9846f893b09a1be1fc8560e33fc3c815cfecb/library/core/src/ops/async_function.rs:34:27
help: consider mutably borrowing here
|
22 | (self.0)(&mut from).await
| ++++
error[E0311]: the parameter type `T` may not live long enough
--> src/lib.rs:9:31
|
9 | async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
| ^^^^^^^^^^^--^
| | |
| | the parameter type `T` must be valid for the anonymous lifetime as defined here...
| ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds...
|
note: ...that is required by this bound
--> src/lib.rs:4:15
|
4 | Self: 'a;
| ^^
help: consider adding an explicit lifetime bound
|
9 - async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
9 + async fn lend<'a>(self, from: Self::From<'a>) -> Self::Into<'a> where T: 'a;
|
error[E0311]: the parameter type `F` may not live long enough
--> src/lib.rs:9:31
|
9 | async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
| ^^^^^^^^^^^--^
| | |
| | the parameter type `F` must be valid for the anonymous lifetime as defined here...
| ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds...
|
note: ...that is required by this bound
--> src/lib.rs:4:15
|
4 | Self: 'a;
| ^^
help: consider adding an explicit lifetime bound
|
9 - async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
9 + async fn lend<'a>(self, from: Self::From<'a>) -> Self::Into<'a> where F: 'a;
|
error[E0311]: the parameter type `I` may not live long enough
--> src/lib.rs:9:31
|
9 | async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
| ^^^^^^^^^^^--^
| | |
| | the parameter type `I` must be valid for the anonymous lifetime as defined here...
| ...so that the type `AsyncLend2<T, F, I>` will meet its required lifetime bounds...
|
note: ...that is required by this bound
--> src/lib.rs:4:15
|
4 | Self: 'a;
| ^^
help: consider adding an explicit lifetime bound
|
9 - async fn lend(self, from: Self::From<'_>) -> Self::Into<'_>;
9 + async fn lend<'a>(self, from: Self::From<'a>) -> Self::Into<'a> where I: 'a;
|
error: internal compiler error: compiler/rustc_middle/src/ty/generics.rs:249:17: expected lifetime parameter, but found another generic parameter: GenericParamDef {
name: "F",
def_id: DefId(0:19 ~ ice2[b533]::{impl#0}::F),
index: 1,
pure_wrt_drop: false,
kind: Type {
has_default: false,
synthetic: false,
},
}
thread 'rustc' panicked at compiler/rustc_middle/src/ty/generics.rs:249:17:
Box<dyn Any>
stack backtrace:
0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
2: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
3: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
4: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
5: rustc_middle::util::bug::bug_fmt
6: <rustc_middle::ty::generics::Generics>::region_param.cold
7: <rustc_middle::ty::region::Region>::opt_param_def_id
8: <rustc_middle::ty::context::TyCtxt>::is_suitable_region
9: <rustc_trait_selection::error_reporting::TypeErrCtxt>::construct_generic_bound_failure
10: <rustc_trait_selection::error_reporting::TypeErrCtxt>::report_region_errors
11: <rustc_trait_selection::traits::engine::ObligationCtxt<rustc_trait_selection::traits::FulfillmentError>>::resolve_regions_and_report_errors::<indexmap::set::IndexSet<rustc_middle::ty::Ty, core::hash::BuildHasherDefault<rustc_hash::FxHasher>>>
12: rustc_hir_analysis::check::compare_impl_item::check_type_bounds
13: rustc_hir_analysis::check::compare_impl_item::compare_impl_item
[... omitted 1 frame ...]
14: rustc_hir_analysis::check::check::check_item_type
15: rustc_hir_analysis::check::wfcheck::check_well_formed
[... omitted 1 frame ...]
16: rustc_hir_analysis::check::wfcheck::check_mod_type_wf
[... omitted 1 frame ...]
17: rustc_hir_analysis::check_crate
18: rustc_interface::passes::run_required_analyses
19: rustc_interface::passes::analysis
[... omitted 1 frame ...]
20: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
21: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
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.86.0 (05f9846f8 2025-03-31) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
#0 [compare_impl_item] checking assoc item `<impl at src/lib.rs:14:1: 16:32>::{synthetic#0}` is compatible with trait definition
#1 [check_well_formed] checking that `<impl at src/lib.rs:14:1: 16:32>` is well-formed
#2 [check_mod_type_wf] checking that types are well-formed in top-level module
#3 [analysis] running analysis passes on this crate
end of query stack
Some errors have detailed explanations: E0308, E0309, E0311.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `ice2` (lib) due to 10 previous errors
Metadata
Metadata
Assignees
Labels
Area: Generic associated types (GATs)Category: This is a bug.Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Status: A Minimal Complete and Verifiable Example has been found for this issueRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the types team, which will review and decide on the PR/issue.