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 - Copy trait was implemented on Drop implementation type - [E0184] #2510

Open
MahadMuhammad opened this issue Aug 3, 2023 · 4 comments
Labels

Comments

@MahadMuhammad
Copy link
Contributor

ICE when a Copy trait was implemented on Drop implementation type - E0184


I tried this Code from E0184

#![allow(unused)]
fn main() {
#[derive(Copy)]
struct Foo; // error!

impl Drop for Foo {
    fn drop(&mut self) {
    }
}
}

Meta

  • What version of Rust GCC were you using, git sha i6c63150705816e38906fafd4517d0c1d1b4adcc3
  • gccrs (Compiler-Explorer-Build-gcc-dba8bc5bf8247161b6eff4f738b6479382f770f2-binutils-2.40) 13.0.1 20230417 (experimental)

Error output

  • Internal Compiler Error.
Backtrace

➜  gccrs-build gcc/crab1 ../mahad-testsuite/E0184.rs 
crab1: internal compiler error: in get_traits_to_derive, at rust/expand/rust-expand-visitor.cc:121
0x7c1241 get_traits_to_derive
  ../../gccrs/gcc/rust/expand/rust-expand-visitor.cc:121
0xb73ce2 Rust::ExpandVisitor::expand_inner_stmts(Rust::AST::BlockExpr&)
  ../../gccrs/gcc/rust/expand/rust-expand-visitor.cc:352
0xb73f94 Rust::ExpandVisitor::visit(Rust::AST::BlockExpr&)
  ../../gccrs/gcc/rust/expand/rust-expand-visitor.cc:872
0xb76d6c void Rust::ExpandVisitor::expand_macro_children<std::vector<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> >, std::allocator<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > > >, std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > >(std::vector<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> >, std::allocator<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > > >&, std::function<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > (Rust::AST::SingleASTNode)>)
  ../../gccrs/gcc/rust/expand/rust-expand-visitor.h:127
0xb731b0 Rust::ExpandVisitor::expand_inner_items(std::vector<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> >, std::allocator<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > > >&)
  ../../gccrs/gcc/rust/expand/rust-expand-visitor.cc:318
0xab778e Rust::Session::expansion(Rust::AST::Crate&)
  ../../gccrs/gcc/rust/rust-session-manager.cc:880
0xabe0f8 Rust::Session::compile_crate(char const*)
  ../../gccrs/gcc/rust/rust-session-manager.cc:590
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.

@CohenArthur
Copy link
Member

Interesting - we should be missing the error but it should not cause an ICE. @P-E-P do you want to investigate this ICE? Since it occurs in get_traits_to_derive

@P-E-P
Copy link
Member

P-E-P commented Aug 3, 2023

Interesting - we should be missing the error but it should not cause an ICE. @P-E-P do you want to investigate this ICE? Since it occurs in get_traits_to_derive

I will take a look but several things have changed in this function in #2496 (including a fix), this may be already fixed.

@P-E-P
Copy link
Member

P-E-P commented Aug 3, 2023

I confirm that #2496 does not fix the issue. I'll investigate. NO, that's wrong.

@P-E-P
Copy link
Member

P-E-P commented Aug 3, 2023

I confirm that #2496 does not fix the issue. I'll investigate.

Well I'm dumb. This PR does fix the issue. Sure I did compile the rust but I did not recompile crab1 before 🤡

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

No branches or pull requests

3 participants