Skip to content

Commit 59edb9d

Browse files
committed
Remove Candidate::source_info
1 parent 7bc827b commit 59edb9d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

compiler/rustc_const_eval/src/transform/promote_consts.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ pub struct Candidate {
9797
location: Location,
9898
}
9999

100-
impl Candidate {
101-
fn source_info(&self, body: &Body<'_>) -> SourceInfo {
102-
*body.source_info(self.location)
103-
}
104-
}
105-
106100
struct Collector<'a, 'tcx> {
107101
ccx: &'a ConstCx<'a, 'tcx>,
108102
temps: IndexVec<Local, TempState>,
@@ -969,7 +963,7 @@ pub fn promote_candidates<'tcx>(
969963
// Declare return place local so that `mir::Body::new` doesn't complain.
970964
let initial_locals = iter::once(LocalDecl::new(tcx.types.never, body.span)).collect();
971965

972-
let mut scope = body.source_scopes[candidate.source_info(body).scope].clone();
966+
let mut scope = body.source_scopes[body.source_info(candidate.location).scope].clone();
973967
scope.parent_scope = None;
974968

975969
let promoted = Body::new(

0 commit comments

Comments
 (0)