diff --git a/actix-http/src/message.rs b/actix-http/src/message.rs index 6c07e8993..7daffef79 100644 --- a/actix-http/src/message.rs +++ b/actix-http/src/message.rs @@ -343,9 +343,17 @@ impl ResponseHead { } pub struct Message { + // Rc here should not be cloned by anyone. + // It's used to reuse allocation of T and no shared ownership is allowed. head: Rc, } +impl Clone for Message { + fn clone(&self) -> Self { + panic!("Message type should not be Clone.") + } +} + impl Message { /// Get new message from the pool of objects pub fn new() -> Self {