Skip to content

Commit e680838

Browse files
committed
update pass_by_value
1 parent 563250a commit e680838

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler/rustc_feature/src/builtin_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
625625
),
626626
rustc_attr!(
627627
rustc_pass_by_value, Normal,
628-
template!(Word), WarnFollowing,
628+
template!(Word), ErrorFollowing,
629629
"#[rustc_pass_by_value] is used to mark types that must be passed by value instead of reference."
630630
),
631631
BuiltinAttribute {

compiler/rustc_lint/src/pass_by_value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ fn gen_args(cx: &LateContext<'_>, segment: &PathSegment<'_>) -> String {
7676
.map(|arg| match arg {
7777
GenericArg::Lifetime(lt) => lt.name.ident().to_string(),
7878
GenericArg::Type(ty) => {
79-
cx.tcx.sess.source_map().span_to_snippet(ty.span).unwrap_or_default()
79+
cx.tcx.sess.source_map().span_to_snippet(ty.span).unwrap_or_else(|_| "_".into())
8080
}
8181
GenericArg::Const(c) => {
82-
cx.tcx.sess.source_map().span_to_snippet(c.span).unwrap_or_default()
82+
cx.tcx.sess.source_map().span_to_snippet(c.span).unwrap_or_else(|_| "_".into())
8383
}
8484
GenericArg::Infer(_) => String::from("_"),
8585
})

0 commit comments

Comments
 (0)