Skip to content

Commit 2ea86af

Browse files
jumbatmlcnr
andcommitted
Use same name as attr.
Co-authored-by: Bastian Kauschke <[email protected]>
1 parent 671770e commit 2ea86af

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc_lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2172,7 +2172,7 @@ impl ClashingExternDeclarations {
21722172
loop {
21732173
if let ty::Adt(def, substs) = ty.kind {
21742174
let is_transparent = def.subst(tcx, substs).repr.transparent();
2175-
let is_non_null = crate::types::guaranteed_nonnull_optimization(tcx, &def);
2175+
let is_non_null = crate::types::nonnull_optimization_guaranteed(tcx, &def);
21762176
debug!(
21772177
"non_transparent_ty({:?}) -- type is transparent? {}, type is non-null? {}",
21782178
ty, is_transparent, is_non_null

src/librustc_lint/types.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ enum FfiResult<'tcx> {
527527
FfiUnsafe { ty: Ty<'tcx>, reason: String, help: Option<String> },
528528
}
529529

530-
crate fn guaranteed_nonnull_optimization<'tcx>(tcx: TyCtxt<'tcx>, def: &ty::AdtDef) -> bool {
530+
crate fn nonnull_optimization_guaranteed<'tcx>(tcx: TyCtxt<'tcx>, def: &ty::AdtDef) -> bool {
531531
tcx.get_attrs(def.did)
532532
.iter()
533533
.any(|a| tcx.sess.check_name(a, sym::rustc_nonnull_optimization_guaranteed))
@@ -541,7 +541,7 @@ crate fn ty_is_known_nonnull<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, mode: C
541541
ty::Ref(..) => true,
542542
ty::Adt(def, _) if def.is_box() && matches!(mode, CItemKind::Definition) => true,
543543
ty::Adt(def, substs) if def.repr.transparent() && !def.is_union() => {
544-
let marked_non_null = guaranteed_nonnull_optimization(tcx, &def);
544+
let marked_non_null = nonnull_optimization_guaranteed(tcx, &def);
545545

546546
if marked_non_null {
547547
return true;

0 commit comments

Comments
 (0)