Skip to content

Commit ff6f0cd

Browse files
committed
Rm impl trait + lifetime
1 parent 6e847ab commit ff6f0cd

File tree

10 files changed

+16
-20
lines changed

10 files changed

+16
-20
lines changed

crates/analysis/src/matcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use std::fmt;
66
pub(crate) fn display(
77
starting_bar: bool,
88
variants: &[(str_util::Name, bool)],
9-
) -> impl fmt::Display + '_ {
9+
) -> impl fmt::Display {
1010
CaseDisplay { starting_bar, variants }
1111
}
1212

crates/input/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl Error {
169169
///
170170
/// Any paths in the error will be relative to `root` if they are contained in `root`.
171171
#[must_use]
172-
pub fn display<'a>(&'a self, root: &'a Path) -> impl fmt::Display + 'a {
172+
pub fn display<'a>(&'a self, root: &'a Path) -> impl fmt::Display {
173173
ErrorDisplay { err: self, root }
174174
}
175175
}

crates/sml-hir/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ pub struct OrPat {
341341

342342
impl OrPat {
343343
/// Returns an iterator of all the pats in order.
344-
pub fn all_pats(&self) -> impl Iterator<Item = PatIdx> + '_ {
344+
pub fn all_pats(&self) -> impl Iterator<Item = PatIdx> {
345345
std::iter::once(self.first).chain(self.rest.iter().copied())
346346
}
347347
}

crates/sml-statics-types/src/display.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::fmt;
1212
impl Ty {
1313
/// Returns a value that displays this.
1414
#[must_use]
15-
pub fn display(self, st: &St, lines: config::DiagnosticLines) -> impl fmt::Display + '_ {
15+
pub fn display(self, st: &St, lines: config::DiagnosticLines) -> impl fmt::Display {
1616
TyDisplay {
1717
cx: TyDisplayCx { bound_vars: None, st },
1818
ty: self,
@@ -25,11 +25,7 @@ impl Ty {
2525
impl TyScheme {
2626
/// Returns a value that displays this.
2727
#[must_use]
28-
pub fn display<'a>(
29-
&'a self,
30-
st: &'a St,
31-
lines: config::DiagnosticLines,
32-
) -> impl fmt::Display + 'a {
28+
pub fn display<'a>(&'a self, st: &'a St, lines: config::DiagnosticLines) -> impl fmt::Display {
3329
TyDisplay {
3430
cx: TyDisplayCx { bound_vars: Some(&self.bound_vars), st },
3531
ty: self.ty,
@@ -273,7 +269,7 @@ impl fmt::Display for RowDisplay<'_> {
273269
}
274270

275271
impl Sym {
276-
pub(crate) fn display(self, syms: &Syms) -> impl fmt::Display + '_ {
272+
pub(crate) fn display(self, syms: &Syms) -> impl fmt::Display {
277273
SymDisplay { sym: self, syms }
278274
}
279275
}
@@ -318,7 +314,7 @@ pub fn record_meta_var<'a>(
318314
st: &'a St,
319315
rows: &'a RecordData,
320316
lines: config::DiagnosticLines,
321-
) -> impl fmt::Display + 'a {
317+
) -> impl fmt::Display {
322318
RecordMetaVarDisplay {
323319
cx: TyDisplayCx { bound_vars: None, st },
324320
rows,
@@ -366,7 +362,7 @@ impl fmt::Display for RecordMetaVarDisplay<'_> {
366362
impl Incompatible {
367363
/// Returns a value that displays this.
368364
#[must_use]
369-
pub fn display<'a>(&'a self, st: &'a St) -> impl fmt::Display + 'a {
365+
pub fn display<'a>(&'a self, st: &'a St) -> impl fmt::Display {
370366
IncompatibleDisplay { flavor: self, st }
371367
}
372368
}

crates/sml-statics-types/src/generalize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl FixedTyVars {
2626
}
2727

2828
/// Iterates over the fixed ty vars.
29-
pub fn iter(&self) -> impl Iterator<Item = Ty> + '_ {
29+
pub fn iter(&self) -> impl Iterator<Item = Ty> {
3030
self.0.iter().map(|(&idx, _)| Ty { kind: TyKind::FixedVar, idx })
3131
}
3232
}

crates/sml-statics-types/src/sym.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ impl SymValEnv {
131131
}
132132

133133
/// Returns an iterator over the key-value pairs in insertion order.
134-
pub fn iter(&self) -> impl Iterator<Item = (&str_util::Name, &ValInfo)> + '_ {
134+
pub fn iter(&self) -> impl Iterator<Item = (&str_util::Name, &ValInfo)> {
135135
self.order.iter().map(|k| (k, &self.map[k]))
136136
}
137137

138138
/// Returns an iterator over the key and mutable value pairs in an arbitrary order.
139-
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&str_util::Name, &mut ValInfo)> + '_ {
139+
pub fn iter_mut(&mut self) -> impl Iterator<Item = (&str_util::Name, &mut ValInfo)> {
140140
self.map.iter_mut()
141141
}
142142
}

crates/sml-statics/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl Error {
244244
&'a self,
245245
st: &'a sml_statics_types::St,
246246
lines: config::DiagnosticLines,
247-
) -> impl fmt::Display + 'a {
247+
) -> impl fmt::Display {
248248
ErrorKindDisplay { kind: &self.kind, st, lines }
249249
}
250250

crates/sml-statics/src/info.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl Defs {
3434
}
3535
}
3636

37-
fn with_def(&self, def: def::Def) -> impl Iterator<Item = sml_hir::Idx> + '_ {
37+
fn with_def(&self, def: def::Def) -> impl Iterator<Item = sml_hir::Idx> {
3838
std::iter::empty::<(sml_hir::Idx, &def::Set)>()
3939
.chain(self.str_exp.iter().map(|(idx, set)| (idx.into(), set)))
4040
.chain(self.sig_exp.iter().map(|(idx, set)| (idx.into(), set)))
@@ -244,7 +244,7 @@ impl Info {
244244
}
245245

246246
/// Returns indices that have the given definition.
247-
pub fn get_with_def(&self, def: def::Def) -> impl Iterator<Item = sml_hir::Idx> + '_ {
247+
pub fn get_with_def(&self, def: def::Def) -> impl Iterator<Item = sml_hir::Idx> {
248248
self.entries.defs.with_def(def)
249249
}
250250

crates/tests/src/check/expect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ impl File {
2424
self.inner.is_empty()
2525
}
2626

27-
pub fn iter(&self) -> impl Iterator<Item = (&Region, &Expect)> + '_ {
27+
pub fn iter(&self) -> impl Iterator<Item = (&Region, &Expect)> {
2828
self.inner.iter()
2929
}
3030
}

crates/tests/src/repo.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ fn is_section_comment(s: &str, comment_open: &str, section: &str) -> bool {
356356
s.trim().strip_prefix(comment_open).and_then(|s| s.strip_suffix(COMMENT_CLOSE)) == Some(section)
357357
}
358358

359-
fn get_manual_section(section: &str) -> impl Iterator<Item = &'static str> + '_ {
359+
fn get_manual_section(section: &str) -> impl Iterator<Item = &'static str> {
360360
let mut iter = MANUAL.lines();
361361
iter.find(|s| is_section_comment(s, "<!-- @begin ", section));
362362
iter.take_while(|s| !is_section_comment(s, "<!-- @end ", section))

0 commit comments

Comments
 (0)