Skip to content

Commit dbd19f6

Browse files
committed
c2rust-refactor: Outline modules by default
1 parent 72e5c26 commit dbd19f6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

c2rust-refactor/src/ast_builder/builder.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ pub struct Builder {
349349
unsafety: Unsafe,
350350
constness: Const,
351351
ext: Extern,
352+
inline: Inline,
352353
attrs: AttrVec,
353354
span: Span,
354355
id: NodeId,
@@ -368,6 +369,7 @@ impl Builder {
368369
unsafety: Unsafe::No,
369370
constness: Const::No,
370371
ext: Extern::None,
372+
inline: Inline::No,
371373
attrs: AttrVec::new(),
372374
span: DUMMY_SP,
373375
id: DUMMY_NODE_ID,
@@ -385,6 +387,13 @@ impl Builder {
385387
self.vis("pub")
386388
}
387389

390+
pub fn inline(self) -> Self {
391+
Builder {
392+
inline: Inline::Yes,
393+
..self
394+
}
395+
}
396+
388397
pub fn set_mutbl<M: Make<Mutability>>(self, mutbl: M) -> Self {
389398
let mutbl = mutbl.make(&self);
390399
Builder {
@@ -1773,7 +1782,7 @@ impl Builder {
17731782
inner_span: self.span,
17741783
inject_use_span: DUMMY_SP,
17751784
};
1776-
ModKind::Loaded(items, Inline::Yes, spans)
1785+
ModKind::Loaded(items, self.inline, spans)
17771786
}
17781787

17791788
pub fn mac_item<M>(self, mac: M) -> P<Item>

0 commit comments

Comments
 (0)