Closed
Description
Upgrading rust-encoding to Rust beta, I hit this error message:
/// A type of the bare function in `DecoderTrap` values.
#[unstable]
pub type DecoderTrapFunc =
extern "Rust" fn(decoder: &mut RawDecoder, input: &[u8], output: &mut StringWriter) -> bool;
/// Trap, which handles decoder errors.
#[stable]
#[derive(Copy, Clone)]
pub enum DecoderTrap {
/// Immediately fails on errors.
/// Corresponds to WHATWG "fatal" error algorithm.
Strict,
/// Replaces an error with a U+FFFD (decoder).
/// Corresponds to WHATWG "replacement" error algorithm.
Replace,
/// Silently ignores an error, effectively replacing it with an empty sequence.
Ignore,
/// Calls given function to handle decoder errors.
/// The function is given the current decoder, input and output writer,
/// and should return true only when it is fine to keep going.
#[unstable] Call(DecoderTrapFunc),
}
src/types.rs:380:22: 380:37 error: the trait `core::clone::Clone` is not implemented for the type `fn(&'a mut types::RawDecoder, &'b [u8], &'c mut types::StringWriter + 'c) -> bool` [E0277]
src/types.rs:380 #[unstable] Call(DecoderTrapFunc),
^~~~~~~~~~~~~~~
src/types.rs:367:16: 367:21 note: in expansion of #[derive_Clone]
src/types.rs:367:16: 367:21 note: expansion site
Shouldn’t this fn
type implement Clone
? It seems to implement Copy
.