Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c1d1f7a

Browse files
authoredJun 5, 2025
Rollup merge of #142012 - oli-obk:no-optional-spans, r=fee1-dead
Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of None Turns out many locations actually have a span available that we could use, so I used it
2 parents 5e140db + fd3da4b commit c1d1f7a

File tree

77 files changed

+250
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+250
-250
lines changed
 

‎compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
732732
span: Span,
733733
args: Option<&'hir hir::GenericArgs<'hir>>,
734734
) -> &'hir hir::Path<'hir> {
735-
let def_id = self.tcx.require_lang_item(lang_item, Some(span));
735+
let def_id = self.tcx.require_lang_item(lang_item, span);
736736
let def_kind = self.tcx.def_kind(def_id);
737737
let res = Res::Def(def_kind, def_id);
738738
self.arena.alloc(hir::Path {

‎compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
263263
// something that already has `Fn`-like bounds (or is a closure), so we can't
264264
// restrict anyways.
265265
} else {
266-
let copy_did = self.infcx.tcx.require_lang_item(LangItem::Copy, Some(span));
266+
let copy_did = self.infcx.tcx.require_lang_item(LangItem::Copy, span);
267267
self.suggest_adding_bounds(&mut err, ty, copy_did, span);
268268
}
269269

@@ -1915,7 +1915,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
19151915

19161916
let local_ty = self.body.local_decls[place.local].ty;
19171917
let typeck_results = tcx.typeck(self.mir_def_id());
1918-
let clone = tcx.require_lang_item(LangItem::Clone, Some(body.span));
1918+
let clone = tcx.require_lang_item(LangItem::Clone, body.span);
19191919
for expr in expr_finder.clones {
19201920
if let hir::ExprKind::MethodCall(_, rcvr, _, span) = expr.kind
19211921
&& let Some(rcvr_ty) = typeck_results.node_type_opt(rcvr.hir_id)

0 commit comments

Comments
 (0)
Please sign in to comment.