Skip to content

Commit 7b42c69

Browse files
committed
make foo::Owned unconstructable
1 parent eb61e3a commit 7b42c69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

capnpc/src/codegen.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ fn generate_node(gen: &GeneratorContext,
12841284
(if !is_generic {
12851285
Branch(vec!(
12861286
Line("#[derive(Copy, Clone)]".into()),
1287-
Line("pub struct Owned;".to_string()),
1287+
Line("pub struct Owned(());".to_string()),
12881288
Line("impl <'a> ::capnp::traits::Owned<'a> for Owned { type Reader = Reader<'a>; type Builder = Builder<'a>; }".to_string()),
12891289
Line("impl <'a> ::capnp::traits::OwnedStruct<'a> for Owned { type Reader = Reader<'a>; type Builder = Builder<'a>; }".to_string()),
12901290
Line("impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; }".to_string())
@@ -1656,7 +1656,7 @@ fn generate_node(gen: &GeneratorContext,
16561656
mod_interior.push(if !is_generic {
16571657
Branch(vec!(
16581658
Line("#[derive(Copy, Clone)]".into()),
1659-
Line("pub struct Owned;".to_string()),
1659+
Line("pub struct Owned(());".to_string()),
16601660
Line("impl <'a> ::capnp::traits::Owned<'a> for Owned { type Reader = Client; type Builder = Client; }".to_string()),
16611661
Line("impl ::capnp::traits::Pipelined for Owned { type Pipeline = Client; }".to_string())))
16621662
} else {

0 commit comments

Comments
 (0)