Skip to content

Commit c887b92

Browse files
committed
Rename InconsistentArgumentType fields, prior -> inconsistent.
1 parent 537c0c5 commit c887b92

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

naga/src/front/wgsl/error.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,13 @@ pub(crate) enum Error<'a> {
328328

329329
/// The prior argument whose type made the `arg_span` argument
330330
/// unacceptable.
331-
prior_span: Span,
331+
inconsistent_span: Span,
332332

333-
/// The index of the `prior_arg_span` argument.
334-
prior_index: u32,
333+
/// The index of the `inconsistent_span` argument.
334+
inconsistent_index: u32,
335335

336-
/// The type of the `prior_arg_span` argument.
337-
prior_ty: String,
336+
/// The type of the `inconsistent_span` argument.
337+
inconsistent_ty: String,
338338

339339
/// The types that would have been accepted instead of the
340340
/// first unacceptable argument.
@@ -945,9 +945,9 @@ impl<'a> Error<'a> {
945945
arg_span,
946946
arg_index,
947947
ref arg_ty,
948-
prior_span,
949-
prior_index,
950-
ref prior_ty,
948+
inconsistent_span,
949+
inconsistent_index,
950+
ref inconsistent_ty,
951951
ref allowed
952952
} => {
953953
let message = format!(
@@ -957,12 +957,12 @@ impl<'a> Error<'a> {
957957
let labels = vec![
958958
(call_span, "".into()),
959959
(arg_span, format!("argument #{} has type {arg_ty}", arg_index + 1).into()),
960-
(prior_span, format!(
961-
"this argument has type {prior_ty}, which constrains subsequent arguments"
960+
(inconsistent_span, format!(
961+
"this argument has type {inconsistent_ty}, which constrains subsequent arguments"
962962
).into()),
963963
];
964964
let mut notes = vec![
965-
format!("Because argument #{} has type {prior_ty}, only the following types", prior_index + 1),
965+
format!("Because argument #{} has type {inconsistent_ty}, only the following types", inconsistent_index + 1),
966966
format!("(or types that automatically convert to them) are accepted for argument #{}:", arg_index + 1),
967967
];
968968
notes.extend(allowed.iter().map(|ty| format!("allowed type: {ty}")));

naga/src/front/wgsl/lower/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2569,13 +2569,13 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
25692569
// Re-run the argument list to determine which prior argument
25702570
// made this one unacceptable.
25712571
let mut remaining_overloads = fun_overloads;
2572-
for (prior_index, &prior_expr) in
2572+
for (inconsistent_index, &prior_expr) in
25732573
unconverted_arguments.iter().enumerate()
25742574
{
25752575
let prior_ty =
25762576
ctx.typifier()[prior_expr].inner_with(&ctx.module.types);
25772577
remaining_overloads = remaining_overloads.arg(
2578-
prior_index,
2578+
inconsistent_index,
25792579
prior_ty,
25802580
&ctx.module.types,
25812581
);
@@ -2584,9 +2584,9 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
25842584
.is_empty()
25852585
{
25862586
// This is the argument that killed our dreams.
2587-
let prior_span =
2588-
ctx.ast_expressions.get_span(arguments[prior_index]);
2589-
let prior_ty = ctx.as_diagnostic_display(prior_ty).to_string();
2587+
let inconsistent_span =
2588+
ctx.ast_expressions.get_span(arguments[inconsistent_index]);
2589+
let inconsistent_ty = ctx.as_diagnostic_display(prior_ty).to_string();
25902590

25912591
if allowed.is_empty() {
25922592
// Some overloads did accept `ty` at `arg_index`, but
@@ -2607,9 +2607,9 @@ impl<'source, 'temp> Lowerer<'source, 'temp> {
26072607
arg_span,
26082608
arg_index: arg_index as u32,
26092609
arg_ty,
2610-
prior_span,
2611-
prior_index: prior_index as u32,
2612-
prior_ty,
2610+
inconsistent_span,
2611+
inconsistent_index: inconsistent_index as u32,
2612+
inconsistent_ty,
26132613
allowed,
26142614
}));
26152615
}

0 commit comments

Comments
 (0)