diff --git a/core/src/hir/type_context.rs b/core/src/hir/type_context.rs index 747261783..7c7fc3c41 100644 --- a/core/src/hir/type_context.rs +++ b/core/src/hir/type_context.rs @@ -103,7 +103,7 @@ impl TypeContext { ) } - pub fn all_traits<'tcx>(&'tcx self) -> impl Iterator { + pub fn all_traits<'tcx>(&'tcx self) -> impl Iterator { self.traits .iter() .enumerate() @@ -203,7 +203,7 @@ impl TypeContext { pub(super) fn from_ast_without_validation<'ast>( env: &'ast Env, attr_validator: impl AttributeValidator + 'static, - ) -> Result<(LoweringContext, Self), Vec> { + ) -> Result<(LoweringContext<'ast>, Self), Vec> { let mut ast_out_structs = SmallVec::<[_; 16]>::new(); let mut ast_structs = SmallVec::<[_; 16]>::new(); let mut ast_opaques = SmallVec::<[_; 16]>::new(); diff --git a/tool/src/c/ty.rs b/tool/src/c/ty.rs index be3e16929..744838f2c 100644 --- a/tool/src/c/ty.rs +++ b/tool/src/c/ty.rs @@ -78,7 +78,7 @@ pub struct TyGenContext<'cx, 'tcx> { pub impl_header_path: &'cx String, } -impl<'cx, 'tcx> TyGenContext<'cx, 'tcx> { +impl<'tcx> TyGenContext<'_, 'tcx> { pub fn gen_enum_def(&self, def: &'tcx hir::EnumDef) -> Header { let mut decl_header = Header::new(self.decl_header_path.clone(), self.is_for_cpp); let ty_name = self.formatter.fmt_type_name(self.id.try_into().unwrap()); diff --git a/tool/src/cpp/ty.rs b/tool/src/cpp/ty.rs index 73af006a5..92e774e6e 100644 --- a/tool/src/cpp/ty.rs +++ b/tool/src/cpp/ty.rs @@ -61,7 +61,7 @@ pub(super) struct TyGenContext<'ccx, 'tcx, 'header> { pub generating_struct_fields: bool, } -impl<'ccx, 'tcx: 'ccx, 'header> TyGenContext<'ccx, 'tcx, 'header> { +impl<'ccx, 'tcx: 'ccx> TyGenContext<'ccx, 'tcx, '_> { /// Adds an enum definition to the current decl and impl headers. /// /// The enum is defined in C++ using a `class` with a single private field that is the diff --git a/tool/src/dart/mod.rs b/tool/src/dart/mod.rs index dc1baeff6..c4a524422 100644 --- a/tool/src/dart/mod.rs +++ b/tool/src/dart/mod.rs @@ -146,7 +146,7 @@ struct TyGenContext<'a, 'cx> { helper_classes: &'a mut BTreeMap, } -impl<'a, 'cx> TyGenContext<'a, 'cx> { +impl<'cx> TyGenContext<'_, 'cx> { fn gen(&mut self, id: TypeId) -> (String, String) { let ty = self.tcx.resolve_type(id); diff --git a/tool/src/demo_gen/terminus.rs b/tool/src/demo_gen/terminus.rs index 1169b2f07..e9e621cda 100644 --- a/tool/src/demo_gen/terminus.rs +++ b/tool/src/demo_gen/terminus.rs @@ -144,7 +144,7 @@ pub(super) struct TerminusInfo { pub imports: BTreeSet, } -impl<'ctx, 'tcx> RenderTerminusContext<'ctx, 'tcx> { +impl RenderTerminusContext<'_, '_> { /// See [`TerminusInfo`] for more information on termini. /// /// Right now, we only check for the existence of `&mut DiplomatWrite` in the function parameters to determine a valid render termini. diff --git a/tool/src/js/converter.rs b/tool/src/js/converter.rs index 7a3b74b2d..616d59262 100644 --- a/tool/src/js/converter.rs +++ b/tool/src/js/converter.rs @@ -58,7 +58,7 @@ pub(super) enum JsToCConversionContext { WriteToBuffer(&'static str, usize), } -impl<'jsctx, 'tcx> TyGenContext<'jsctx, 'tcx> { +impl<'tcx> TyGenContext<'_, 'tcx> { // #region C to JS /// Given a type from Rust, convert it into something Typescript will understand. /// We use this to double-check our Javascript work as well. diff --git a/tool/src/js/gen.rs b/tool/src/js/gen.rs index ae3bb1001..12413817d 100644 --- a/tool/src/js/gen.rs +++ b/tool/src/js/gen.rs @@ -33,7 +33,7 @@ pub(super) struct TyGenContext<'ctx, 'tcx> { pub imports: RefCell>, } -impl<'ctx, 'tcx> TyGenContext<'ctx, 'tcx> { +impl<'tcx> TyGenContext<'_, 'tcx> { /// Generates the code at the top of every `.d.ts` and `.mjs` file. /// /// This could easily be an [inherited template](https://djc.github.io/askama/template_syntax.html#template-inheritance), if you want to be a little more strict about how templates are used. diff --git a/tool/src/kotlin/mod.rs b/tool/src/kotlin/mod.rs index 771c93ecd..9b64e8975 100644 --- a/tool/src/kotlin/mod.rs +++ b/tool/src/kotlin/mod.rs @@ -261,7 +261,7 @@ struct TyGenContext<'a, 'cx> { callback_params: &'a mut Vec, } -impl<'a, 'cx> TyGenContext<'a, 'cx> { +impl<'cx> TyGenContext<'_, 'cx> { fn gen_infallible_return_type_name(&self, success_type: &SuccessType) -> Cow<'cx, str> { match success_type { SuccessType::Unit => self.formatter.fmt_void().into(), diff --git a/tool/src/lib.rs b/tool/src/lib.rs index dbf7b714d..5dae5355e 100644 --- a/tool/src/lib.rs +++ b/tool/src/lib.rs @@ -211,7 +211,7 @@ struct ErrorContext<'tcx> { method: Option>, } -impl<'tcx> fmt::Display for ErrorContext<'tcx> { +impl fmt::Display for ErrorContext<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let ty = &self.ty; if let Some(ref method) = self.method { @@ -226,7 +226,7 @@ impl<'tcx> fmt::Display for ErrorContext<'tcx> { #[must_use] pub struct ErrorContextGuard<'a, 'tcx, E>(&'a ErrorStore<'tcx, E>, ErrorContext<'tcx>); -impl<'a, 'tcx, E> Drop for ErrorContextGuard<'a, 'tcx, E> { +impl Drop for ErrorContextGuard<'_, '_, E> { fn drop(&mut self) { let _ = mem::replace(&mut *self.0.context.borrow_mut(), mem::take(&mut self.1)); }