FuelLabs / sway

🌴 Empowering everyone to build reliable and efficient smart contracts.
https://docs.fuel.network/docs/sway/
Apache License 2.0
62.71k stars 5.36k forks source link

The garbage collector and autogenerated types are causing a runtime panic #5698

Closed sdankel closed 3 months ago

sdankel commented 7 months ago

Autocomplete in LSP is not working in many cases. It seems to be using an older version of the token map, as I see this error in the LSP logs when it doesn’t work:

thread '<unnamed>' panicked at sway-core/src/concurrent_slab.rs:90:14:
no entry found for key
sdankel commented 7 months ago

concurrent_slab.rs:

    pub fn get(&self, index: usize) -> Arc<T> {
        let inner = self.inner.read().unwrap();

        let value = inner.get(&index).unwrap_or_else(|| {
            let backtrace = std::backtrace::Backtrace::force_capture();
            eprintln!("backtrace: {:#?}", backtrace);
            panic!("Failed to get value from index: {}", index);
        });

        value.clone()
    }
Backtrace [
    { fn: "std::backtrace_rs::backtrace::libunwind::trace", file: "/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/libunwind.rs", line: 104 },
    { fn: "std::backtrace_rs::backtrace::trace_unsynchronized", file: "/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/../../backtrace/src/backtrace/mod.rs", line: 66 },
    { fn: "std::backtrace::Backtrace::create", file: "/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/backtrace.rs", line: 331 },
    { fn: "std::backtrace::Backtrace::force_capture", file: "/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/backtrace.rs", line: 313 },
    { fn: "sway_core::concurrent_slab::ConcurrentSlab<T>::get" },
    { fn: "sway_core::semantic_analysis::namespace::trait_map::TraitMap::insert_for_type" },
    { fn: "sway_core::semantic_analysis::namespace::trait_map::TraitMap::check_if_trait_constraints_are_satisfied_for_type" },
    { fn: "sway_core::semantic_analysis::ast_node::declaration::auto_impl::AutoImplAbiEncodeContext::auto_impl_abi_encode" },
    { fn: "sway_core::semantic_analysis::module::<impl sway_core::language::ty::module::TyModule>::type_check" },
    { fn: "sway_core::semantic_analysis::program::<impl sway_core::language::ty::program::TyProgram>::type_check" },
    { fn: "sway_core::parsed_to_ast" },
    { fn: "sway_core::compile_to_ast" },
    { fn: "forc_pkg::pkg::check" },
    { fn: "sway_lsp::core::session::compile" },
    { fn: "sway_lsp::core::session::parse_project" },
    { fn: "std::sys_common::backtrace::__rust_begin_short_backtrace" },
    { fn: "core::ops::function::FnOnce::call_once{{vtable.shim}}" },
    { fn: "<alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once", file: "/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs", line: 2007 },
    { fn: "<alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once", file: "/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/boxed.rs", line: 2007 },
    { fn: "std::sys::unix::thread::Thread::new::thread_start", file: "/rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/sys/unix/thread.rs", line: 108 },
    { fn: "__pthread_start" },
]
thread '<unnamed>' panicked at sway-core/src/concurrent_slab.rs:94:13:
JoshuaBatty commented 7 months ago

I've been digging into this, it actually isn't caused by auto complete, it just so happens that auto complete LSP request is triggered when a key is pressed.

It appears this only started happening after #5306 was introduced. There is a conflict with how the garbage collection is operating and how types are constructed in the below functions.

pub fn auto_impl_abi_encode(&mut self, decl: &ty::TyDecl) -> Option<TyAstNode> {
    match decl {
        TyDecl::StructDecl(_) => self.struct_auto_impl_abi_encode(decl),
        TyDecl::EnumDecl(_) => self.enum_auto_impl_abi_encode(decl),
        _ => None,
    }
} 

We should have had a CI test to catch this when the garbage collector PR was implemented in #5251. However, at that time, we were only performing GC every 10th keystroke and it was overloading the stack in CI. Now that we have reduced this to every 3rd keystroke it seems to be fine for CI. I've just put up a PR https://github.com/FuelLabs/sway/pull/5704 that can recreate this crash. Hopefully it will help debug how to resolve the underlying issue, and also prevent this sort of bug to creep through in the future.

Here is a stack trace of the error that is happening for reference. It's getting triggered by the .get call below at line 738 in trait_map.rs

let traitItems = map_trait_items
    .clone()
    .into_iter()
    .map(|(name, item)| match &item {
        ty::TyTraitItem::Fn(decl_ref) => {
            let mut decl = (*decl_engine.get(decl_ref.id())).clone();
thread '<unnamed>' panicked at sway-core/src/concurrent_slab.rs:90:14:
no entry found for key
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_display
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:178:5
   3: core::panicking::panic_str
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:152:5
   4: core::option::expect_failed
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:1985:5
   5: core::option::Option<T>::expect
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:894:21
   6: <std::collections::hash::map::HashMap<K,V,S> as core::ops::index::Index<&Q>>::index
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/collections/hash/map.rs:1341:23
   7: sway_core::concurrent_slab::ConcurrentSlab<T>::get
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/concurrent_slab.rs:90:14
   8: <sway_core::decl_engine::engine::DeclEngine as sway_core::decl_engine::engine::DeclEngineGet<sway_core::decl_engine::id::DeclId<sway_core::language::ty::declaration::function::TyFunctionDecl>,sway_core::language::ty::declaration::function::TyFunctionDecl>>::get
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/decl_engine/engine.rs:89:17
   9: sway_core::semantic_analysis::namespace::trait_map::TraitMap::filter_by_type_inner::{{closure}}
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/namespace/trait_map.rs:739:50
  10: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:305:13
  11: core::option::Option<T>::map
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:1072:29
  12: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/iter/adapters/map.rs:103:26
  13: <im::hash::map::HashMap<K,V,S> as core::iter::traits::collect::FromIterator<(K,V)>>::from_iter
             at /Users/josh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/im-15.1.0/./src/hash/map.rs:1982:23
  14: core::iter::traits::iterator::Iterator::collect
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/iter/traits/iterator.rs:2054:9
  15: sway_core::semantic_analysis::namespace::trait_map::TraitMap::filter_by_type_inner
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/namespace/trait_map.rs:733:51
  16: sway_core::semantic_analysis::namespace::trait_map::TraitMap::filter_by_type
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/namespace/trait_map.rs:603:9
  17: sway_core::semantic_analysis::namespace::trait_map::TraitMap::insert_for_type
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/namespace/trait_map.rs:450:21
  18: sway_core::semantic_analysis::namespace::trait_map::TraitMap::check_if_trait_constraints_are_satisfied_for_type::{{closure}}
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/namespace/trait_map.rs:1095:21
  19: sway_error::handler::Handler::scope
             at /Users/josh/Documents/rust/fuel/sway/sway-error/src/handler.rs:60:27
  20: sway_core::semantic_analysis::namespace::trait_map::TraitMap::check_if_trait_constraints_are_satisfied_for_type

also, if i add the following eprintln!("decl_ref: {:#?}", decl_ref.name().span()); before it crashes, i get

decl_ref: Span {
    src (ptr): 0x0000000128209020,
    source_id: None,
    start: 0,
    end: 0,
    as_str(): "",
}

It seems that some of these dummy spans are slipping in which the GC see's and clears from the engines. I would have expected these to be recreated again on the next compilation but they don't seem to be?

Here are some more observations.

So it seems that possibly a TyFunctionDecl is being cleared from the DeclEngine during GC that it still expects to be there.

So If i then don’t remove `TyFunctionDecls during GC and then run again it now crashes when trying to access TyImplTraits. I also get it with TyStructDecl && TyAbiDecl

8: <sway_core::decl_engine::engine::DeclEngine as sway_core::decl_engine::engine::DeclEngineGet<sway_core::decl_engine::id::DeclId<sway_core::language::ty::declaration::impl_trait::TyImplTrait>,sway_core::language::ty::declaration::impl_trait::TyImplTrait>>::get

If I disable clearing the type engine and only clear the decl engine with the below then this seems to work.

decl_engine_clear_module!(
    // function_slab, ty::TyFunctionDecl;
    trait_slab, ty::TyTraitDecl;
    trait_fn_slab, ty::TyTraitFn;
    trait_type_slab, ty::TyTraitType;
    // impl_trait_slab, ty::TyImplTrait;
    // struct_slab, ty::TyStructDecl;
    storage_slab, ty::TyStorageDecl;
    // abi_slab, ty::TyAbiDecl;
    constant_slab, ty::TyConstantDecl;
    enum_slab, ty::TyEnumDecl;
    type_alias_slab, ty::TyTypeAliasDecl;
);

So the above seems to be 1 issue. If I comment out clearing the decl engine and just do the type engine then we encounter a whole seperate problem.

thread '<unnamed>' panicked at sway-core/src/concurrent_slab.rs:90:14:
no entry found for key
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_display
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:178:5
   3: core::panicking::panic_str
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:152:5
   4: core::option::expect_failed
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:1985:5
   5: core::option::Option<T>::expect
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:894:21
   6: <std::collections::hash::map::HashMap<K,V,S> as core::ops::index::Index<&Q>>::index
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/collections/hash/map.rs:1341:23
   7: sway_core::concurrent_slab::ConcurrentSlab<T>::get
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/concurrent_slab.rs:90:14
   8: sway_core::type_system::engine::TypeEngine::get
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/type_system/engine.rs:92:9
   9: sway_core::semantic_analysis::ast_node::expression::typed_expression::method_application::monomorphize_method_application
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/expression/typed_expression/method_application.rs:599:19
  10: sway_core::semantic_analysis::ast_node::expression::typed_expression::method_application::type_check_method_application
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/expression/typed_expression/method_application.rs:363:5
  11: sway_core::semantic_analysis::ast_node::expression::typed_expression::<impl sway_core::language::ty::expression::expression::TyExpression>::type_check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs:264:17
  12: sway_core::semantic_analysis::ast_node::<impl sway_core::language::ty::ast_node::TyAstNode>::type_check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/mod.rs:148:33
  13: sway_core::semantic_analysis::ast_node::code_block::<impl sway_core::language::ty::code_block::TyCodeBlock>::type_check::{{closure}}
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/code_block.rs:23:17
  14: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:294:13
  15: <core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::find_map
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/iter/macros.rs:319:38
  16: <core::iter::adapters::filter_map::FilterMap<I,F> as core::iter::traits::iterator::Iterator>::next
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/iter/adapters/filter_map.rs:62:9
  17: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/vec/spec_from_iter_nested.rs:26:32
  18: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/vec/spec_from_iter.rs:33:9
  19: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/vec/mod.rs:2753:9
  20: core::iter::traits::iterator::Iterator::collect
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/iter/traits/iterator.rs:2054:9
  21: sway_core::semantic_analysis::ast_node::code_block::<impl sway_core::language::ty::code_block::TyCodeBlock>::type_check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/code_block.rs:18:34
  22: sway_core::semantic_analysis::ast_node::declaration::function::<impl sway_core::language::ty::declaration::function::TyFunctionDecl>::type_check_body
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/function.rs:200:20
  23: sway_core::semantic_analysis::ast_node::declaration::function::<impl sway_core::language::ty::declaration::function::TyFunctionDecl>::type_check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/function.rs:36:9
  24: sway_core::semantic_analysis::ast_node::declaration::impl_trait::type_check_impl_method
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs:996:9
  25: sway_core::semantic_analysis::ast_node::declaration::impl_trait::type_check_trait_implementation
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs:814:39
  26: sway_core::semantic_analysis::ast_node::declaration::impl_trait::<impl sway_core::language::ty::declaration::impl_trait::TyImplTrait>::type_check_impl_trait
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs:162:33
  27: sway_core::semantic_analysis::ast_node::declaration::declaration::<impl sway_core::language::ty::declaration::declaration::TyDecl>::type_check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/declaration.rs:171:27
xunilrj commented 7 months ago

The issue is that auto generated code, or anything using Span:dummy(), does not have a source_id nor a module_id and it is being collected in every gc. We just need to retain them.

JoshuaBatty commented 7 months ago

I did suspect that and replaced all of the Span::dummy() 's with a dummy span containing a source_id = Some(SourceId::reserved()) so that it wouldn't get cleared by the GC. However, I was then running into other compiler panics with unify_check.

thread '<unnamed>' panicked at sway-core/src/concurrent_slab.rs:90:14:
no entry found for key
stack backtrace:
   0: rust_begin_unwind
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:645:5
   1: core::panicking::panic_fmt
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_display
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:178:5
   3: core::panicking::panic_str
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/panicking.rs:152:5
   4: core::option::expect_failed
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:1985:5
   5: core::option::Option<T>::expect
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/option.rs:894:21
   6: <std::collections::hash::map::HashMap<K,V,S> as core::ops::index::Index<&Q>>::index
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/collections/hash/map.rs:1341:23
   7: sway_core::concurrent_slab::ConcurrentSlab<T>::get
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/concurrent_slab.rs:90:14
   8: sway_core::type_system::engine::TypeEngine::get
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/type_system/engine.rs:100:9
   9: sway_core::type_system::unify::unify_check::UnifyCheck::check_inner
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/type_system/unify/unify_check.rs:232:26
  10: sway_core::type_system::unify::unify_check::UnifyCheck::check_multiple
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/type_system/unify/unify_check.rs:662:17
  11: sway_core::type_system::unify::unify_check::UnifyCheck::check_inner
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/type_system/unify/unify_check.rs:270:24
  12: sway_core::type_system::unify::unify_check::UnifyCheck::check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/type_system/unify/unify_check.rs:220:9
  13: sway_core::semantic_analysis::namespace::trait_map::TraitMap::filter_by_type::{{closure}}
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/namespace/trait_map.rs:599:53
  14: sway_core::semantic_analysis::namespace::trait_map::TraitMap::filter_by_type_inner
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/namespace/trait_map.rs:725:27
  15: sway_core::semantic_analysis::namespace::trait_map::TraitMap::filter_by_type
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/namespace/trait_map.rs:603:9
  16: sway_core::semantic_analysis::namespace::trait_map::TraitMap::insert_for_type
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/namespace/trait_map.rs:450:21
  17: sway_core::semantic_analysis::type_check_context::TypeCheckContext::insert_trait_implementation_for_type
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/type_check_context.rs:1536:9
  18: sway_core::semantic_analysis::type_check_context::TypeCheckContext::find_method_for_type
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/type_check_context.rs:1177:17
  19: sway_core::semantic_analysis::ast_node::expression::typed_expression::method_application::resolve_method_name
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/expression/typed_expression/method_application.rs:507:28
  20: sway_core::semantic_analysis::ast_node::expression::typed_expression::method_application::type_check_method_application
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/expression/typed_expression/method_application.rs:52:49
  21: sway_core::semantic_analysis::ast_node::expression::typed_expression::<impl sway_core::language::ty::expression::expression::TyExpression>::type_check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/expression/typed_expression.rs:264:17
  22: sway_core::semantic_analysis::ast_node::<impl sway_core::language::ty::ast_node::TyAstNode>::type_check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/mod.rs:148:33
  23: sway_core::semantic_analysis::ast_node::code_block::<impl sway_core::language::ty::code_block::TyCodeBlock>::type_check::{{closure}}
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/code_block.rs:23:17
  24: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/ops/function.rs:294:13
  25: <core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::find_map
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/slice/iter/macros.rs:319:38
  26: <core::iter::adapters::filter_map::FilterMap<I,F> as core::iter::traits::iterator::Iterator>::next
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/iter/adapters/filter_map.rs:62:9
  27: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/vec/spec_from_iter_nested.rs:26:32
  28: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/vec/spec_from_iter.rs:33:9
  29: <alloc::vec::Vec<T> as core::iter::traits::collect::FromIterator<T>>::from_iter
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/alloc/src/vec/mod.rs:2753:9
  30: core::iter::traits::iterator::Iterator::collect
             at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/core/src/iter/traits/iterator.rs:2054:9
  31: sway_core::semantic_analysis::ast_node::code_block::<impl sway_core::language::ty::code_block::TyCodeBlock>::type_check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/code_block.rs:18:34
  32: sway_core::semantic_analysis::ast_node::declaration::function::<impl sway_core::language::ty::declaration::function::TyFunctionDecl>::type_check_body
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/function.rs:200:20
  33: sway_core::semantic_analysis::ast_node::declaration::function::<impl sway_core::language::ty::declaration::function::TyFunctionDecl>::type_check
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/function.rs:36:9
  34: sway_core::semantic_analysis::ast_node::declaration::impl_trait::type_check_impl_method
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs:996:9
  35: sway_core::semantic_analysis::ast_node::declaration::impl_trait::type_check_trait_implementation
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs:814:39
  36: sway_core::semantic_analysis::ast_node::declaration::impl_trait::<impl sway_core::language::ty::declaration::impl_trait::TyImplTrait>::type_check_impl_trait
             at /Users/josh/Documents/rust/fuel/sway/sway-core/src/semantic_analysis/ast_node/declaration/impl_trait.rs:238:33
JoshuaBatty commented 3 months ago

Should be addressed in #5813