Skip to content
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

ICE on Nevertype typecheck #2951

Open
P-E-P opened this issue Apr 16, 2024 · 0 comments
Open

ICE on Nevertype typecheck #2951

P-E-P opened this issue Apr 16, 2024 · 0 comments

Comments

@P-E-P
Copy link
Member

P-E-P commented Apr 16, 2024

Code

#[lang="sized"]
pub trait Sized {

}

#[lang = "clone"]
pub trait Clone : Sized {
    fn clone(&self) -> Self;
}

impl Clone for ! {
    fn clone(&self) -> Self {
            *self
    }
}

https://godbolt.org/z/j3fW5bG5h

Meta

Error output

./lib.rs:121:24: error: unknown reference for resolved name: ‘Self’
  121 |     fn clone(&self) -> Self {
      |                        ^~~~
Backtrace

crab1: internal compiler error: in visit, at rust/typecheck/rust-hir-type-check-implitem.cc:468
0x15dbf12 Rust::Resolver::TypeCheckImplItem::visit(Rust::HIR::Function&)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-type-check-implitem.cc:468
0x1442fec Rust::HIR::Function::accept_vis(Rust::HIR::HIRImplVisitor&)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/hir/tree/rust-hir.cc:5011
0x15db53d Rust::Resolver::TypeCheckImplItem::Resolve(Rust::HIR::ImplBlock*, Rust::HIR::ImplItem*, Rust::TyTy::BaseType*, std::vector<Rust::TyTy::SubstitutionParamMapping, std::allocator<Rust::TyTy::SubstitutionParamMapping> >)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-type-check-implitem.cc:337
0x15b2509 Rust::Resolver::TypeCheckItem::resolve_impl_item(Rust::HIR::ImplBlock&, Rust::HIR::ImplItem&)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-type-check-item.cc:507
0x15b2389 Rust::Resolver::TypeCheckItem::ResolveImplItem(Rust::HIR::ImplBlock&, Rust::HIR::ImplItem&)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-type-check-item.cc:63
0x160e0ad Rust::Resolver::query_type(unsigned int, Rust::TyTy::BaseType**)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-type-util.cc:86
0x160685d Rust::Resolver::MethodResolver::select(Rust::TyTy::BaseType&)::$_1::operator()(unsigned int, Rust::HIR::ImplBlock*)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-dot-operator.cc:228
0x1606669 bool std::__invoke_impl<bool, Rust::Resolver::MethodResolver::select(Rust::TyTy::BaseType&)::$_1&, unsigned int, Rust::HIR::ImplBlock*>(std::__invoke_other, Rust::Resolver::MethodResolver::select(Rust::TyTy::BaseType&)::$_1&, unsigned int&&, Rust::HIR::ImplBlock*&&)
  /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61
0x1606614 std::enable_if<is_invocable_r_v<bool, Rust::Resolver::MethodResolver::select(Rust::TyTy::BaseType&)::$_1&, unsigned int, Rust::HIR::ImplBlock*>, bool>::type std::__invoke_r<bool, Rust::Resolver::MethodResolver::select(Rust::TyTy::BaseType&)::$_1&, unsigned int, Rust::HIR::ImplBlock*>(Rust::Resolver::MethodResolver::select(Rust::TyTy::BaseType&)::$_1&, unsigned int&&, Rust::HIR::ImplBlock*&&)
  /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:114
0x16064fc std::_Function_handler<bool (unsigned int, Rust::HIR::ImplBlock*), Rust::Resolver::MethodResolver::select(Rust::TyTy::BaseType&)::$_1>::_M_invoke(std::_Any_data const&, unsigned int&&, Rust::HIR::ImplBlock*&&)
  /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290
0x147a853 std::function<bool (unsigned int, Rust::HIR::ImplBlock*)>::operator()(unsigned int, Rust::HIR::ImplBlock*) const
  /usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:591
0x1474864 Rust::Analysis::Mappings::iterate_impl_blocks(std::function<bool (unsigned int, Rust::HIR::ImplBlock*)>)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/util/rust-hir-map.cc:850
0x1603ed3 Rust::Resolver::MethodResolver::select(Rust::TyTy::BaseType&)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-dot-operator.cc:203
0x161ebb8 Rust::Resolver::AutoderefCycle::try_autoderefed(Rust::TyTy::BaseType*)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-autoderef.cc:424
0x161e75a Rust::Resolver::AutoderefCycle::cycle(Rust::TyTy::BaseType*)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-autoderef.cc:330
0x160378a Rust::Resolver::MethodResolver::Probe(Rust::TyTy::BaseType*, Rust::HIR::PathIdentSegment const&, bool)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-dot-operator.cc:40
0x15d2fcc Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::MethodCallExpr&)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-type-check-expr.cc:1112
0x1442c30 Rust::HIR::MethodCallExpr::accept_vis(Rust::HIR::HIRExpressionVisitor&)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/hir/tree/rust-hir.cc:4903
0x15cc3a9 Rust::Resolver::TypeCheckExpr::Resolve(Rust::HIR::Expr*)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-type-check-expr.cc:42
0x15cd9c0 Rust::Resolver::TypeCheckExpr::visit(Rust::HIR::AssignmentExpr&)
  /home/patryp/Documents/gccrs/build/gcc/../../gcc/rust/typecheck/rust-hir-type-check-expr.cc:239
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants