Skip to content

Commit 08bd4ff

Browse files
committed
Rename variadic to c_variadic
Function signatures with the `variadic` member set are actually C-variadic functions. Make this a little more explicit by renaming the `variadic` boolean value, `c_variadic`.
1 parent a618ad6 commit 08bd4ff

File tree

43 files changed

+119
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+119
-119
lines changed

src/librustc/hir/lowering.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ impl<'a> LoweringContext<'a> {
954954
let decl = FnDecl {
955955
inputs: vec![],
956956
output,
957-
variadic: false
957+
c_variadic: false
958958
};
959959
let body_id = self.record_body(body_expr, Some(&decl));
960960
self.is_generator = prev_is_generator;
@@ -2118,7 +2118,7 @@ impl<'a> LoweringContext<'a> {
21182118
P(hir::FnDecl {
21192119
inputs,
21202120
output,
2121-
variadic: decl.variadic,
2121+
c_variadic: decl.c_variadic,
21222122
implicit_self: decl.inputs.get(0).map_or(
21232123
hir::ImplicitSelfKind::None,
21242124
|arg| {
@@ -3973,7 +3973,7 @@ impl<'a> LoweringContext<'a> {
39733973
let outer_decl = FnDecl {
39743974
inputs: decl.inputs.clone(),
39753975
output: FunctionRetTy::Default(fn_decl_span),
3976-
variadic: false,
3976+
c_variadic: false,
39773977
};
39783978
// We need to lower the declaration outside the new scope, because we
39793979
// have to conserve the state of being inside a loop condition for the

src/librustc/hir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@ pub struct Arg {
18681868
pub struct FnDecl {
18691869
pub inputs: HirVec<Ty>,
18701870
pub output: FunctionRetTy,
1871-
pub variadic: bool,
1871+
pub c_variadic: bool,
18721872
/// Does the function have an implicit self?
18731873
pub implicit_self: ImplicitSelfKind,
18741874
}

src/librustc/hir/print.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2007,7 +2007,7 @@ impl<'a> State<'a> {
20072007
s.print_type(ty)?;
20082008
s.end()
20092009
})?;
2010-
if decl.variadic {
2010+
if decl.c_variadic {
20112011
self.s.word(", ...")?;
20122012
}
20132013
self.pclose()?;

src/librustc/ich/impls_hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ impl_stable_hash_for!(enum hir::TyKind {
368368
impl_stable_hash_for!(struct hir::FnDecl {
369369
inputs,
370370
output,
371-
variadic,
371+
c_variadic,
372372
implicit_self
373373
});
374374

src/librustc/ich/impls_ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ impl_stable_hash_for!(struct ty::GenSig<'tcx> {
232232

233233
impl_stable_hash_for!(struct ty::FnSig<'tcx> {
234234
inputs_and_output,
235-
variadic,
235+
c_variadic,
236236
unsafety,
237237
abi
238238
});

src/librustc/traits/select.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,7 +1944,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
19441944
if let ty::FnSig {
19451945
unsafety: hir::Unsafety::Normal,
19461946
abi: Abi::Rust,
1947-
variadic: false,
1947+
c_variadic: false,
19481948
..
19491949
} = self_ty.fn_sig(self.tcx()).skip_binder()
19501950
{

src/librustc/ty/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2453,7 +2453,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
24532453
self.mk_fn_sig(
24542454
params_iter,
24552455
s.output(),
2456-
s.variadic,
2456+
s.c_variadic,
24572457
hir::Unsafety::Normal,
24582458
abi::Abi::Rust,
24592459
)
@@ -2779,7 +2779,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
27792779
pub fn mk_fn_sig<I>(self,
27802780
inputs: I,
27812781
output: I::Item,
2782-
variadic: bool,
2782+
c_variadic: bool,
27832783
unsafety: hir::Unsafety,
27842784
abi: abi::Abi)
27852785
-> <I::Item as InternIteratorElement<Ty<'tcx>, ty::FnSig<'tcx>>>::Output
@@ -2788,7 +2788,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
27882788
{
27892789
inputs.chain(iter::once(output)).intern_with(|xs| ty::FnSig {
27902790
inputs_and_output: self.intern_type_list(xs),
2791-
variadic, unsafety, abi
2791+
c_variadic, unsafety, abi
27922792
})
27932793
}
27942794

src/librustc/ty/instance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl<'a, 'tcx> Instance<'tcx> {
6565
sig.map_bound(|sig| tcx.mk_fn_sig(
6666
iter::once(*env_ty.skip_binder()).chain(sig.inputs().iter().cloned()),
6767
sig.output(),
68-
sig.variadic,
68+
sig.c_variadic,
6969
sig.unsafety,
7070
sig.abi
7171
))

src/librustc/ty/relate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ impl<'tcx> Relate<'tcx> for ty::FnSig<'tcx> {
147147
{
148148
let tcx = relation.tcx();
149149

150-
if a.variadic != b.variadic {
150+
if a.c_variadic != b.c_variadic {
151151
return Err(TypeError::VariadicMismatch(
152-
expected_found(relation, &a.variadic, &b.variadic)));
152+
expected_found(relation, &a.c_variadic, &b.c_variadic)));
153153
}
154154
let unsafety = relation.relate(&a.unsafety, &b.unsafety)?;
155155
let abi = relation.relate(&a.abi, &b.abi)?;
@@ -171,7 +171,7 @@ impl<'tcx> Relate<'tcx> for ty::FnSig<'tcx> {
171171
});
172172
Ok(ty::FnSig {
173173
inputs_and_output: tcx.mk_type_list(inputs_and_output)?,
174-
variadic: a.variadic,
174+
c_variadic: a.c_variadic,
175175
unsafety,
176176
abi,
177177
})

src/librustc/ty/structural_impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ impl<'a, 'tcx> Lift<'tcx> for ty::FnSig<'a> {
396396
tcx.lift(&self.inputs_and_output).map(|x| {
397397
ty::FnSig {
398398
inputs_and_output: x,
399-
variadic: self.variadic,
399+
c_variadic: self.c_variadic,
400400
unsafety: self.unsafety,
401401
abi: self.abi,
402402
}
@@ -832,7 +832,7 @@ BraceStructTypeFoldableImpl! {
832832

833833
BraceStructTypeFoldableImpl! {
834834
impl<'tcx> TypeFoldable<'tcx> for ty::FnSig<'tcx> {
835-
inputs_and_output, variadic, unsafety, abi
835+
inputs_and_output, c_variadic, unsafety, abi
836836
}
837837
}
838838

0 commit comments

Comments
 (0)