Skip to content

Commit 4cefa72

Browse files
committed
Consistently use ety for extern type variables
1 parent 599fad8 commit 4cefa72

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

syntax/check.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fn do_typecheck(cx: &mut Check) {
4646
match api {
4747
Api::Struct(strct) => check_api_struct(cx, strct),
4848
Api::Enum(enm) => check_api_enum(cx, enm),
49-
Api::CxxType(ty) | Api::RustType(ty) => check_api_type(cx, ty),
49+
Api::CxxType(ety) | Api::RustType(ety) => check_api_type(cx, ety),
5050
Api::CxxFunction(efn) | Api::RustFunction(efn) => check_api_fn(cx, efn),
5151
_ => {}
5252
}
@@ -207,10 +207,10 @@ fn check_api_enum(cx: &mut Check, enm: &Enum) {
207207
}
208208
}
209209

210-
fn check_api_type(cx: &mut Check, ty: &ExternType) {
211-
check_reserved_name(cx, &ty.ident);
210+
fn check_api_type(cx: &mut Check, ety: &ExternType) {
211+
check_reserved_name(cx, &ety.ident);
212212

213-
if let Some(reason) = cx.types.required_trivial.get(&ty.ident) {
213+
if let Some(reason) = cx.types.required_trivial.get(&ety.ident) {
214214
let what = match reason {
215215
TrivialReason::StructField(strct) => format!("a field of `{}`", strct.ident),
216216
TrivialReason::FunctionArgument(efn) => format!("an argument of `{}`", efn.ident),
@@ -220,7 +220,7 @@ fn check_api_type(cx: &mut Check, ty: &ExternType) {
220220
"needs a cxx::ExternType impl in order to be used as {}",
221221
what,
222222
);
223-
cx.error(ty, msg);
223+
cx.error(ety, msg);
224224
}
225225
}
226226

syntax/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fn parse_foreign_mod(
221221
}
222222

223223
let mut types = items.iter().filter_map(|item| match item {
224-
Api::CxxType(ty) | Api::RustType(ty) => Some(&ty.ident),
224+
Api::CxxType(ety) | Api::RustType(ety) => Some(&ety.ident),
225225
Api::TypeAlias(alias) => Some(&alias.ident),
226226
_ => None,
227227
});

0 commit comments

Comments
 (0)