From 0819cfbe7b84a1398dc755c813dcae94a5eb7976 Mon Sep 17 00:00:00 2001 From: fakeshadow <24548779@qq.com> Date: Mon, 18 Jan 2021 09:16:14 +0800 Subject: [PATCH] add panic and comment --- actix-http/src/message.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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 {