File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ fn build_module(
517
517
}
518
518
}
519
519
520
- let span = clean:: Span :: from_rustc_span ( cx. tcx . def_span ( did) ) ;
520
+ let span = clean:: Span :: new ( cx. tcx . def_span ( did) ) ;
521
521
clean:: Module { items, span }
522
522
}
523
523
Original file line number Diff line number Diff line change @@ -95,7 +95,8 @@ impl Clean<Item> for doctree::Module<'_> {
95
95
96
96
// determine if we should display the inner contents or
97
97
// the outer `mod` item for the source code.
98
- let span = Span :: from_rustc_span ( {
98
+
99
+ let span = Span :: new ( {
99
100
let where_outer = self . where_outer ( cx. tcx ) ;
100
101
let sm = cx. sess ( ) . source_map ( ) ;
101
102
let outer = sm. lookup_char_pos ( where_outer. lo ( ) ) ;
Original file line number Diff line number Diff line change @@ -343,7 +343,7 @@ crate struct Item {
343
343
rustc_data_structures:: static_assert_size!( Item , 56 ) ;
344
344
345
345
crate fn rustc_span ( def_id : DefId , tcx : TyCtxt < ' _ > ) -> Span {
346
- Span :: from_rustc_span ( def_id. as_local ( ) . map_or_else (
346
+ Span :: new ( def_id. as_local ( ) . map_or_else (
347
347
|| tcx. def_span ( def_id) ,
348
348
|local| {
349
349
let hir = tcx. hir ( ) ;
@@ -1947,15 +1947,15 @@ impl Span {
1947
1947
/// span will be updated to point to the macro invocation instead of the macro definition.
1948
1948
///
1949
1949
/// (See rust-lang/rust#39726)
1950
- crate fn from_rustc_span ( sp : rustc_span:: Span ) -> Self {
1950
+ crate fn new ( sp : rustc_span:: Span ) -> Self {
1951
1951
Self ( sp. source_callsite ( ) )
1952
1952
}
1953
1953
1954
- /// Unless you know what you're doing, use [`Self::from_rustc_span `] instead!
1954
+ /// Unless you know what you're doing, use [`Self::new `] instead!
1955
1955
///
1956
- /// Contrary to [`Self::from_rustc_span`], this constructor wraps the span as is and don't
1957
- /// perform any operation on it, even if it's from a macro expansion .
1958
- crate fn wrap ( sp : rustc_span:: Span ) -> Span {
1956
+ /// This function doesn't clean the span at all. Compare with [`Self::new`]'s body to see the
1957
+ /// difference .
1958
+ crate fn wrap_raw ( sp : rustc_span:: Span ) -> Span {
1959
1959
Self ( sp)
1960
1960
}
1961
1961
Original file line number Diff line number Diff line change @@ -597,7 +597,7 @@ fn string<T: Display>(
597
597
LinkFromSrc :: Local ( span) => {
598
598
eprintln ! ( "==> {:?}:{:?}" , span. lo( ) , span. hi( ) ) ;
599
599
context
600
- . href_from_span ( clean:: Span :: wrap ( * span) )
600
+ . href_from_span ( clean:: Span :: wrap_raw ( * span) )
601
601
. map ( |s| format ! ( "{}{}" , root_path, s) )
602
602
}
603
603
LinkFromSrc :: External ( def_id) => {
You can’t perform that action at this time.
0 commit comments