Skip to content

Commit 5de9c84

Browse files
committed
Fix rustc_pass_by_value.
1 parent 1c737d6 commit 5de9c84

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: compiler/rustc_hir/src/hir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl LifetimeName {
132132

133133
impl fmt::Display for Lifetime {
134134
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
135-
self.ident.fmt(f)
135+
if self.ident.name != kw::Empty { self.ident.name.fmt(f) } else { "'_".fmt(f) }
136136
}
137137
}
138138

Diff for: compiler/rustc_lint/src/pass_by_value.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn gen_args(cx: &LateContext<'_>, segment: &PathSegment<'_>) -> String {
7878
.args
7979
.iter()
8080
.map(|arg| match arg {
81-
GenericArg::Lifetime(lt) => lt.ident.to_string(),
81+
GenericArg::Lifetime(lt) => lt.to_string(),
8282
GenericArg::Type(ty) => {
8383
cx.tcx.sess.source_map().span_to_snippet(ty.span).unwrap_or_else(|_| "_".into())
8484
}

0 commit comments

Comments
 (0)