Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 816f7fe

Browse files
Run cargo fix --edition-idioms
1 parent 23d25a3 commit 816f7fe

File tree

230 files changed

+888
-888
lines changed

Some content is hidden

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

230 files changed

+888
-888
lines changed

crates/base-db/src/change.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct Change {
1717
}
1818

1919
impl fmt::Debug for Change {
20-
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
20+
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
2121
let mut d = fmt.debug_struct("Change");
2222
if let Some(roots) = &self.roots {
2323
d.field("roots", roots);

crates/base-db/src/input.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ impl CrateName {
104104
}
105105

106106
impl fmt::Display for CrateName {
107-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
107+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
108108
self.0.fmt(f)
109109
}
110110
}
@@ -187,7 +187,7 @@ impl From<CrateName> for CrateDisplayName {
187187
}
188188

189189
impl fmt::Display for CrateDisplayName {
190-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
190+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
191191
self.crate_name.fmt(f)
192192
}
193193
}

crates/base-db/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub const DEFAULT_LRU_CAP: usize = 128;
5757
pub trait FileLoader {
5858
/// Text of the file.
5959
fn file_text(&self, file_id: FileId) -> Arc<String>;
60-
fn resolve_path(&self, path: AnchoredPath) -> Option<FileId>;
60+
fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId>;
6161
fn relevant_crates(&self, file_id: FileId) -> Arc<FxHashSet<CrateId>>;
6262
}
6363

@@ -116,7 +116,7 @@ impl<T: SourceDatabaseExt> FileLoader for FileLoaderDelegate<&'_ T> {
116116
fn file_text(&self, file_id: FileId) -> Arc<String> {
117117
SourceDatabaseExt::file_text(self.0, file_id)
118118
}
119-
fn resolve_path(&self, path: AnchoredPath) -> Option<FileId> {
119+
fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId> {
120120
// FIXME: this *somehow* should be platform agnostic...
121121
let source_root = self.0.file_source_root(path.anchor);
122122
let source_root = self.0.source_root(source_root);

crates/cfg/src/cfg_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl CfgExpr {
8585
}
8686
}
8787

88-
fn next_cfg_expr(it: &mut SliceIter<tt::TokenTree>) -> Option<CfgExpr> {
88+
fn next_cfg_expr(it: &mut SliceIter<'_, tt::TokenTree>) -> Option<CfgExpr> {
8989
let name = match it.next() {
9090
None => return None,
9191
Some(tt::TokenTree::Leaf(tt::Leaf::Ident(ident))) => ident.text.clone(),

crates/hir-def/src/generics.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl GenericParams {
195195
}
196196
}
197197

198-
pub(crate) fn fill(&mut self, lower_ctx: &LowerCtx, node: &dyn HasGenericParams) {
198+
pub(crate) fn fill(&mut self, lower_ctx: &LowerCtx<'_>, node: &dyn HasGenericParams) {
199199
if let Some(params) = node.generic_param_list() {
200200
self.fill_params(lower_ctx, params)
201201
}
@@ -206,7 +206,7 @@ impl GenericParams {
206206

207207
pub(crate) fn fill_bounds(
208208
&mut self,
209-
lower_ctx: &LowerCtx,
209+
lower_ctx: &LowerCtx<'_>,
210210
node: &dyn ast::HasTypeBounds,
211211
target: Either<TypeRef, LifetimeRef>,
212212
) {
@@ -217,7 +217,7 @@ impl GenericParams {
217217
}
218218
}
219219

220-
fn fill_params(&mut self, lower_ctx: &LowerCtx, params: ast::GenericParamList) {
220+
fn fill_params(&mut self, lower_ctx: &LowerCtx<'_>, params: ast::GenericParamList) {
221221
for type_or_const_param in params.type_or_const_params() {
222222
match type_or_const_param {
223223
ast::TypeOrConstParam::Type(type_param) => {
@@ -259,7 +259,7 @@ impl GenericParams {
259259
}
260260
}
261261

262-
fn fill_where_predicates(&mut self, lower_ctx: &LowerCtx, where_clause: ast::WhereClause) {
262+
fn fill_where_predicates(&mut self, lower_ctx: &LowerCtx<'_>, where_clause: ast::WhereClause) {
263263
for pred in where_clause.predicates() {
264264
let target = if let Some(type_ref) = pred.ty() {
265265
Either::Left(TypeRef::from_ast(lower_ctx, type_ref))
@@ -293,7 +293,7 @@ impl GenericParams {
293293

294294
fn add_where_predicate_from_bound(
295295
&mut self,
296-
lower_ctx: &LowerCtx,
296+
lower_ctx: &LowerCtx<'_>,
297297
bound: ast::TypeBound,
298298
hrtb_lifetimes: Option<&Box<[Name]>>,
299299
target: Either<TypeRef, LifetimeRef>,

crates/hir-def/src/nameres/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,7 @@ impl ModCollector<'_, '_> {
15091509
let module = self.def_collector.def_map.module_id(self.module_id);
15101510
let def_map = &mut self.def_collector.def_map;
15111511
let update_def =
1512-
|def_collector: &mut DefCollector, id, name: &Name, vis, has_constructor| {
1512+
|def_collector: &mut DefCollector<'_>, id, name: &Name, vis, has_constructor| {
15131513
def_collector.def_map.modules[self.module_id].scope.declare(id);
15141514
def_collector.update(
15151515
self.module_id,

crates/hir-def/src/path.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ pub enum GenericArg {
8888
impl Path {
8989
/// Converts an `ast::Path` to `Path`. Works with use trees.
9090
/// It correctly handles `$crate` based path from macro call.
91-
pub fn from_src(path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
91+
pub fn from_src(path: ast::Path, ctx: &LowerCtx<'_>) -> Option<Path> {
9292
lower::lower_path(path, ctx)
9393
}
9494

@@ -188,7 +188,7 @@ impl<'a> PathSegments<'a> {
188188
}
189189

190190
impl GenericArgs {
191-
pub(crate) fn from_ast(lower_ctx: &LowerCtx, node: ast::GenericArgList) -> Option<GenericArgs> {
191+
pub(crate) fn from_ast(lower_ctx: &LowerCtx<'_>, node: ast::GenericArgList) -> Option<GenericArgs> {
192192
lower::lower_generic_args(lower_ctx, node)
193193
}
194194

crates/hir-def/src/path/lower.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::{
1515

1616
/// Converts an `ast::Path` to `Path`. Works with use trees.
1717
/// It correctly handles `$crate` based path from macro call.
18-
pub(super) fn lower_path(mut path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
18+
pub(super) fn lower_path(mut path: ast::Path, ctx: &LowerCtx<'_>) -> Option<Path> {
1919
let mut kind = PathKind::Plain;
2020
let mut type_anchor = None;
2121
let mut segments = Vec::new();
@@ -149,7 +149,7 @@ pub(super) fn lower_path(mut path: ast::Path, ctx: &LowerCtx) -> Option<Path> {
149149
}
150150

151151
pub(super) fn lower_generic_args(
152-
lower_ctx: &LowerCtx,
152+
lower_ctx: &LowerCtx<'_>,
153153
node: ast::GenericArgList,
154154
) -> Option<GenericArgs> {
155155
let mut args = Vec::new();
@@ -196,7 +196,7 @@ pub(super) fn lower_generic_args(
196196
/// Collect `GenericArgs` from the parts of a fn-like path, i.e. `Fn(X, Y)
197197
/// -> Z` (which desugars to `Fn<(X, Y), Output=Z>`).
198198
fn lower_generic_args_from_fn_path(
199-
ctx: &LowerCtx,
199+
ctx: &LowerCtx<'_>,
200200
params: Option<ast::ParamList>,
201201
ret_type: Option<ast::RetType>,
202202
) -> Option<GenericArgs> {

crates/hir-def/src/test_db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl FileLoader for TestDB {
7373
fn file_text(&self, file_id: FileId) -> Arc<String> {
7474
FileLoaderDelegate(self).file_text(file_id)
7575
}
76-
fn resolve_path(&self, path: AnchoredPath) -> Option<FileId> {
76+
fn resolve_path(&self, path: AnchoredPath<'_>) -> Option<FileId> {
7777
FileLoaderDelegate(self).resolve_path(path)
7878
}
7979
fn relevant_crates(&self, file_id: FileId) -> Arc<FxHashSet<CrateId>> {

crates/hir-def/src/type_ref.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub struct TraitRef {
8686

8787
impl TraitRef {
8888
/// Converts an `ast::PathType` to a `hir::TraitRef`.
89-
pub(crate) fn from_ast(ctx: &LowerCtx, node: ast::Type) -> Option<Self> {
89+
pub(crate) fn from_ast(ctx: &LowerCtx<'_>, node: ast::Type) -> Option<Self> {
9090
// FIXME: Use `Path::from_src`
9191
match node {
9292
ast::Type::PathType(path) => {
@@ -159,7 +159,7 @@ pub enum TraitBoundModifier {
159159

160160
impl TypeRef {
161161
/// Converts an `ast::TypeRef` to a `hir::TypeRef`.
162-
pub fn from_ast(ctx: &LowerCtx, node: ast::Type) -> Self {
162+
pub fn from_ast(ctx: &LowerCtx<'_>, node: ast::Type) -> Self {
163163
match node {
164164
ast::Type::ParenType(inner) => TypeRef::from_ast_opt(ctx, inner.ty()),
165165
ast::Type::TupleType(inner) => {
@@ -245,7 +245,7 @@ impl TypeRef {
245245
}
246246
}
247247

248-
pub(crate) fn from_ast_opt(ctx: &LowerCtx, node: Option<ast::Type>) -> Self {
248+
pub(crate) fn from_ast_opt(ctx: &LowerCtx<'_>, node: Option<ast::Type>) -> Self {
249249
match node {
250250
Some(node) => TypeRef::from_ast(ctx, node),
251251
None => TypeRef::Error,
@@ -320,7 +320,7 @@ impl TypeRef {
320320
}
321321

322322
pub(crate) fn type_bounds_from_ast(
323-
lower_ctx: &LowerCtx,
323+
lower_ctx: &LowerCtx<'_>,
324324
type_bounds_opt: Option<ast::TypeBoundList>,
325325
) -> Vec<Interned<TypeBound>> {
326326
if let Some(type_bounds) = type_bounds_opt {
@@ -331,7 +331,7 @@ pub(crate) fn type_bounds_from_ast(
331331
}
332332

333333
impl TypeBound {
334-
pub(crate) fn from_ast(ctx: &LowerCtx, node: ast::TypeBound) -> Self {
334+
pub(crate) fn from_ast(ctx: &LowerCtx<'_>, node: ast::TypeBound) -> Self {
335335
let lower_path_type = |path_type: ast::PathType| ctx.lower_path(path_type.path()?);
336336

337337
match node.kind() {

0 commit comments

Comments
 (0)