Skip to content

Commit 85fdef0

Browse files
authored
Rollup merge of #97616 - TaKO8Ki:remove-unnecessary-option, r=Dylan-DPC
Remove an unnecessary `Option`
2 parents 2c3a8cf + 8d007aa commit 85fdef0

File tree

2 files changed

+11
-4
lines changed
  • compiler

2 files changed

+11
-4
lines changed

compiler/rustc_trait_selection/src/traits/wf.rs

+10-3
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,17 @@ pub fn trait_obligations<'a, 'tcx>(
8181
body_id: hir::HirId,
8282
trait_ref: &ty::TraitRef<'tcx>,
8383
span: Span,
84-
item: Option<&'tcx hir::Item<'tcx>>,
84+
item: &'tcx hir::Item<'tcx>,
8585
) -> Vec<traits::PredicateObligation<'tcx>> {
86-
let mut wf =
87-
WfPredicates { infcx, param_env, body_id, span, out: vec![], recursion_depth: 0, item };
86+
let mut wf = WfPredicates {
87+
infcx,
88+
param_env,
89+
body_id,
90+
span,
91+
out: vec![],
92+
recursion_depth: 0,
93+
item: Some(item),
94+
};
8895
wf.compute_trait_ref(trait_ref, Elaborate::All);
8996
debug!(obligations = ?wf.out);
9097
wf.normalize()

compiler/rustc_typeck/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ fn check_impl<'tcx>(
12281228
fcx.body_id,
12291229
&trait_ref,
12301230
ast_trait_ref.path.span,
1231-
Some(item),
1231+
item,
12321232
);
12331233
debug!(?obligations);
12341234
for obligation in obligations {

0 commit comments

Comments
 (0)