Skip to content

Commit e8e33ed

Browse files
refactor(naga): remove extraneous leading path qualifiers (#5612)
Implemented by `cargo fix -p naga --lib`.
1 parent 1ea9639 commit e8e33ed

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

naga/src/proc/constant_evaluator.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -950,10 +950,10 @@ impl<'a> ConstantEvaluator<'a> {
950950
pattern: [crate::SwizzleComponent; 4],
951951
) -> Result<Handle<Expression>, ConstantEvaluatorError> {
952952
let mut get_dst_ty = |ty| match self.types[ty].inner {
953-
crate::TypeInner::Vector { size: _, scalar } => Ok(self.types.insert(
953+
TypeInner::Vector { size: _, scalar } => Ok(self.types.insert(
954954
Type {
955955
name: None,
956-
inner: crate::TypeInner::Vector { size, scalar },
956+
inner: TypeInner::Vector { size, scalar },
957957
},
958958
span,
959959
)),
@@ -1244,13 +1244,11 @@ impl<'a> ConstantEvaluator<'a> {
12441244
Expression::ZeroValue(ty) | Expression::Compose { ty, .. } => {
12451245
match self.types[ty].inner {
12461246
TypeInner::Array { size, .. } => match size {
1247-
crate::ArraySize::Constant(len) => {
1247+
ArraySize::Constant(len) => {
12481248
let expr = Expression::Literal(Literal::U32(len.get()));
12491249
self.register_evaluated_expr(expr, span)
12501250
}
1251-
crate::ArraySize::Dynamic => {
1252-
Err(ConstantEvaluatorError::ArrayLengthDynamic)
1253-
}
1251+
ArraySize::Dynamic => Err(ConstantEvaluatorError::ArrayLengthDynamic),
12541252
},
12551253
_ => Err(ConstantEvaluatorError::InvalidArrayLengthArg),
12561254
}
@@ -1313,7 +1311,7 @@ impl<'a> ConstantEvaluator<'a> {
13131311
Expression::ZeroValue(ty)
13141312
if matches!(
13151313
self.types[ty].inner,
1316-
crate::TypeInner::Scalar(crate::Scalar {
1314+
TypeInner::Scalar(crate::Scalar {
13171315
kind: ScalarKind::Uint,
13181316
..
13191317
})
@@ -1628,7 +1626,7 @@ impl<'a> ConstantEvaluator<'a> {
16281626
return self.cast(expr, target, span);
16291627
};
16301628

1631-
let crate::TypeInner::Array {
1629+
let TypeInner::Array {
16321630
base: _,
16331631
size,
16341632
stride: _,

naga/src/proc/index.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ pub enum GuardedIndex {
239239
pub fn find_checked_indexes(
240240
module: &crate::Module,
241241
function: &crate::Function,
242-
info: &crate::valid::FunctionInfo,
242+
info: &valid::FunctionInfo,
243243
policies: BoundsCheckPolicies,
244244
) -> BitSet {
245245
use crate::Expression as Ex;
@@ -321,7 +321,7 @@ pub fn access_needs_check(
321321
mut index: GuardedIndex,
322322
module: &crate::Module,
323323
function: &crate::Function,
324-
info: &crate::valid::FunctionInfo,
324+
info: &valid::FunctionInfo,
325325
) -> Option<IndexableLength> {
326326
let base_inner = info[base].ty.inner_with(&module.types);
327327
// Unwrap safety: `Err` here indicates unindexable base types and invalid

naga/src/span.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl<E> fmt::Display for WithSpan<E>
136136
where
137137
E: fmt::Display,
138138
{
139-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> std::fmt::Result {
139+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
140140
self.inner.fmt(f)
141141
}
142142
}
@@ -304,7 +304,7 @@ impl<E> WithSpan<E> {
304304
use term::termcolor::NoColor;
305305

306306
let files = files::SimpleFile::new(path, source);
307-
let config = codespan_reporting::term::Config::default();
307+
let config = term::Config::default();
308308
let mut writer = NoColor::new(Vec::new());
309309
term::emit(&mut writer, &config, &files, &self.diagnostic()).expect("cannot write error");
310310
String::from_utf8(writer.into_inner()).unwrap()

naga/src/valid/analyzer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ impl FunctionInfo {
835835
let req = self.expressions[expr.index()].uniformity.requirements;
836836
if self
837837
.flags
838-
.contains(super::ValidationFlags::CONTROL_FLOW_UNIFORMITY)
838+
.contains(ValidationFlags::CONTROL_FLOW_UNIFORMITY)
839839
&& !req.is_empty()
840840
{
841841
if let Some(cause) = disruptor {

naga/src/valid/expression.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl super::Validator {
194194
use crate::Expression as E;
195195

196196
if !global_expr_kind.is_const_or_override(handle) {
197-
return Err(super::ConstExpressionError::NonConstOrOverride);
197+
return Err(ConstExpressionError::NonConstOrOverride);
198198
}
199199

200200
match gctx.global_expressions[handle] {
@@ -211,10 +211,10 @@ impl super::Validator {
211211
}
212212
E::Splat { value, .. } => match *mod_info[value].inner_with(gctx.types) {
213213
crate::TypeInner::Scalar { .. } => {}
214-
_ => return Err(super::ConstExpressionError::InvalidSplatType(value)),
214+
_ => return Err(ConstExpressionError::InvalidSplatType(value)),
215215
},
216216
_ if global_expr_kind.is_const(handle) || !self.allow_overrides => {
217-
return Err(super::ConstExpressionError::NonFullyEvaluatedConst)
217+
return Err(ConstExpressionError::NonFullyEvaluatedConst)
218218
}
219219
// the constant evaluator will report errors about override-expressions
220220
_ => {}

0 commit comments

Comments
 (0)