File tree Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Expand file tree Collapse file tree 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -484,7 +484,7 @@ impl Renderer {
484
484
}
485
485
486
486
if let Some ( path) = & cause. path {
487
- let mut origin = Origin :: new ( path. as_ref ( ) ) ;
487
+ let mut origin = Origin :: path ( path. as_ref ( ) ) ;
488
488
origin. primary = true ;
489
489
490
490
let source_map = SourceMap :: new ( & cause. source , cause. line_start ) ;
@@ -719,7 +719,7 @@ impl Renderer {
719
719
is_cont : bool ,
720
720
) {
721
721
if let Some ( path) = & snippet. path {
722
- let mut origin = Origin :: new ( path. as_ref ( ) ) ;
722
+ let mut origin = Origin :: path ( path. as_ref ( ) ) ;
723
723
// print out the span location and spacer before we print the annotated source
724
724
// to do this, we need to know if this span will be primary
725
725
let is_primary = primary_path == Some ( & origin. path ) ;
Original file line number Diff line number Diff line change @@ -411,7 +411,7 @@ impl<'a> Patch<'a> {
411
411
/// let input = &[
412
412
/// Group::with_title(Level::ERROR.title("mismatched types").id("E0308"))
413
413
/// .element(
414
- /// Origin::new ("$DIR/mismatched-types.rs")
414
+ /// Origin::path ("$DIR/mismatched-types.rs")
415
415
/// )
416
416
/// ];
417
417
/// ```
@@ -431,7 +431,7 @@ impl<'a> Origin<'a> {
431
431
/// not allowed to be passed to this function.
432
432
///
433
433
/// </div>
434
- pub fn new ( path : impl Into < Cow < ' a , str > > ) -> Self {
434
+ pub fn path ( path : impl Into < Cow < ' a , str > > ) -> Self {
435
435
Self {
436
436
path : path. into ( ) ,
437
437
line : None ,
@@ -467,7 +467,7 @@ impl<'a> Origin<'a> {
467
467
468
468
impl < ' a > From < Cow < ' a , str > > for Origin < ' a > {
469
469
fn from ( origin : Cow < ' a , str > ) -> Self {
470
- Self :: new ( origin)
470
+ Self :: path ( origin)
471
471
}
472
472
}
473
473
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ fn main() {}
88
88
) ,
89
89
Group :: with_title ( Level :: NOTE . title ( "required by a bound in `flatten`" ) )
90
90
. element (
91
- Origin :: new ( "/rustc/FAKE_PREFIX/library/core/src/iter/traits/iterator.rs" )
91
+ Origin :: path ( "/rustc/FAKE_PREFIX/library/core/src/iter/traits/iterator.rs" )
92
92
. line ( 1556 )
93
93
. char_column ( 4 ) ,
94
94
) ,
Original file line number Diff line number Diff line change @@ -1743,7 +1743,7 @@ fn main() {
1743
1743
Level :: NOTE
1744
1744
. title ( "for a trait to be dyn compatible it needs to allow building a vtable\n for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>" ) )
1745
1745
. element (
1746
- Origin :: new ( "$SRC_DIR/core/src/cmp.rs" )
1746
+ Origin :: path ( "$SRC_DIR/core/src/cmp.rs" )
1747
1747
. line ( 334 )
1748
1748
. char_column ( 14 )
1749
1749
. primary ( true )
You can’t perform that action at this time.
0 commit comments