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(
517517 }
518518 }
519519
520- let span = clean:: Span :: from_rustc_span ( cx. tcx . def_span ( did) ) ;
520+ let span = clean:: Span :: new ( cx. tcx . def_span ( did) ) ;
521521 clean:: Module { items, span }
522522}
523523
Original file line number Diff line number Diff line change @@ -95,7 +95,8 @@ impl Clean<Item> for doctree::Module<'_> {
9595
9696 // determine if we should display the inner contents or
9797 // the outer `mod` item for the source code.
98- let span = Span :: from_rustc_span ( {
98+
99+ let span = Span :: new ( {
99100 let where_outer = self . where_outer ( cx. tcx ) ;
100101 let sm = cx. sess ( ) . source_map ( ) ;
101102 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 {
343343rustc_data_structures:: static_assert_size!( Item , 56 ) ;
344344
345345crate 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 (
347347 || tcx. def_span ( def_id) ,
348348 |local| {
349349 let hir = tcx. hir ( ) ;
@@ -1947,15 +1947,15 @@ impl Span {
19471947 /// span will be updated to point to the macro invocation instead of the macro definition.
19481948 ///
19491949 /// (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 {
19511951 Self ( sp. source_callsite ( ) )
19521952 }
19531953
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!
19551955 ///
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 {
19591959 Self ( sp)
19601960 }
19611961
Original file line number Diff line number Diff line change @@ -597,7 +597,7 @@ fn string<T: Display>(
597597 LinkFromSrc :: Local ( span) => {
598598 eprintln ! ( "==> {:?}:{:?}" , span. lo( ) , span. hi( ) ) ;
599599 context
600- . href_from_span ( clean:: Span :: wrap ( * span) )
600+ . href_from_span ( clean:: Span :: wrap_raw ( * span) )
601601 . map ( |s| format ! ( "{}{}" , root_path, s) )
602602 }
603603 LinkFromSrc :: External ( def_id) => {
You can’t perform that action at this time.
0 commit comments