diff --git a/core/src/hir/lowering.rs b/core/src/hir/lowering.rs index 3f11d2f8c..3a3e8e15c 100644 --- a/core/src/hir/lowering.rs +++ b/core/src/hir/lowering.rs @@ -625,7 +625,7 @@ impl<'ast, 'errors> LoweringContext<'ast, 'errors> { Some(OutType::Opaque(OpaquePath::new( lifetimes, - Optional(true), + Optional(false), MaybeOwn::Own, tcx_id, ))) diff --git a/feature_tests/cpp2/include/OptionStruct.hpp b/feature_tests/cpp2/include/OptionStruct.hpp index 6e8aea5af..e346df919 100644 --- a/feature_tests/cpp2/include/OptionStruct.hpp +++ b/feature_tests/cpp2/include/OptionStruct.hpp @@ -18,10 +18,10 @@ inline capi::OptionStruct OptionStruct::AsFFI() const { return capi::OptionStruct { - .a = a ? a->AsFFI() : nullptr, - .b = b ? b->AsFFI() : nullptr, + .a = a.AsFFI(), + .b = b.AsFFI(), .c = c, - .d = d ? d->AsFFI() : nullptr, + .d = d.AsFFI(), }; }