W3cubDocs

/Rust

Error code E0206

The Copy trait was implemented on a type which is neither a struct, an enum, nor a union.

Erroneous code example:

#![allow(unused)]
fn main() {
#[derive(Copy, Clone)]
struct Bar;

impl Copy for &'static mut Bar { } // error!
}

You can only implement Copy for a struct, an enum, or a union. The previous example will fail because &'static mut Bar is not a struct, an enum, or a union.

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0206.html