Skip to content

Commit a220652

Browse files
committed
remove DesugaringKind::Resize
1 parent 0a0b470 commit a220652

File tree

4 files changed

+24
-22
lines changed

4 files changed

+24
-22
lines changed

compiler/rustc_errors/src/emitter.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
use Destination::*;
1111

1212
use rustc_span::source_map::SourceMap;
13-
use rustc_span::{DesugaringKind, FileLines, SourceFile, Span};
13+
// use rustc_span::{DesugaringKind, FileLines, SourceFile, Span};
14+
use rustc_span::{FileLines, SourceFile, Span};
1415

1516
use crate::snippet::{
1617
Annotation, AnnotationColumn, AnnotationType, Line, MultilineAnnotation, Style, StyledString,
@@ -405,7 +406,7 @@ pub trait Emitter: Translate {
405406
for (i, trace) in macro_backtrace.iter().rev().enumerate().filter(|(_, trace)| {
406407
!matches!(
407408
trace.kind,
408-
ExpnKind::Inlined | ExpnKind::Desugaring(DesugaringKind::Resize)
409+
ExpnKind::Inlined //| ExpnKind::Desugaring(DesugaringKind::Resize)
409410
) && !trace.def_site.is_dummy()
410411
}) {
411412
if always_backtrace {

compiler/rustc_middle/src/ty/mod.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -2402,12 +2402,13 @@ impl<'tcx> TyCtxt<'tcx> {
24022402
/// `Span` points at an attribute and not user code.
24032403
#[inline(always)]
24042404
pub fn mark_span_for_resize(self, span: Span) -> Span {
2405-
if true {
2406-
return span;
2407-
}
2408-
self.with_stable_hashing_context(|hcx| {
2409-
span.mark_with_reason(None, rustc_span::DesugaringKind::Resize, span.edition(), hcx)
2410-
})
2405+
span
2406+
// if true {
2407+
// return span;
2408+
// }
2409+
// self.with_stable_hashing_context(|hcx| {
2410+
// span.mark_with_reason(None, rustc_span::DesugaringKind::Resize, span.edition(), hcx)
2411+
// })
24112412
}
24122413

24132414
pub fn adjust_ident(self, mut ident: Ident, scope: DefId) -> Ident {

compiler/rustc_span/src/hygiene.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1156,10 +1156,10 @@ pub enum DesugaringKind {
11561156
ForLoop,
11571157
WhileLoop,
11581158
Replace,
1159-
/// Used to proactively mark `Span`s that have been modified from another `Span`. This allows
1160-
/// the diagnostics machinery to be able to detect spans coming from proc-macros that do not
1161-
/// point to user code.
1162-
Resize,
1159+
// /// Used to proactively mark `Span`s that have been modified from another `Span`. This allows
1160+
// /// the diagnostics machinery to be able to detect spans coming from proc-macros that do not
1161+
// /// point to user code.
1162+
// Resize,
11631163
}
11641164

11651165
impl DesugaringKind {
@@ -1176,7 +1176,7 @@ impl DesugaringKind {
11761176
DesugaringKind::ForLoop => "`for` loop",
11771177
DesugaringKind::WhileLoop => "`while` loop",
11781178
DesugaringKind::Replace => "drop and replace",
1179-
DesugaringKind::Resize => "a resized `Span`",
1179+
// DesugaringKind::Resize => "a resized `Span`",
11801180
}
11811181
}
11821182
}

compiler/rustc_span/src/lib.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -884,15 +884,15 @@ impl Span {
884884
)
885885
}
886886

887-
pub fn peel_ctxt(mut self) -> Span {
888-
loop {
889-
let data = self.data().ctxt.outer_expn_data();
890-
if let ExpnKind::Desugaring(DesugaringKind::Resize) = data.kind {
891-
self = data.call_site;
892-
} else {
893-
break;
894-
}
895-
}
887+
pub fn peel_ctxt(self) -> Span {
888+
// loop {
889+
// let data = self.data().ctxt.outer_expn_data();
890+
// if let ExpnKind::Desugaring(DesugaringKind::Resize) = data.kind {
891+
// self = data.call_site;
892+
// } else {
893+
// break;
894+
// }
895+
// }
896896
self
897897
}
898898

0 commit comments

Comments
 (0)