-
Notifications
You must be signed in to change notification settings - Fork 187
Open
Labels
Description
ICE when a Copy
trait was implemented on Drop implementation type
- E0184
Drop
andcopy
is currently disallowed in rustc. In theory it's seems correct but it's need careful implementation. See this Opt-in copy causes types that shouldn't be Copy to be copy rust-lang/rust#20126- You can view the same on
compiler-explorer
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.