File tree 1 file changed +11
-11
lines changed
1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,17 @@ use crate::formatting::FileRecord;
16
16
17
17
use rustc_data_structures:: sync:: Lrc ;
18
18
19
+ impl From < & FileName > for rustc_span:: FileName {
20
+ fn from ( filename : & FileName ) -> rustc_span:: FileName {
21
+ match filename {
22
+ FileName :: Real ( path) => {
23
+ rustc_span:: FileName :: Real ( rustc_span:: RealFileName :: LocalPath ( path. to_owned ( ) ) )
24
+ }
25
+ FileName :: Stdin => rustc_span:: FileName :: Custom ( "stdin" . to_owned ( ) ) ,
26
+ }
27
+ }
28
+ }
29
+
19
30
// Append a newline to the end of each file.
20
31
pub ( crate ) fn append_newline ( s : & mut String ) {
21
32
s. push ( '\n' ) ;
66
77
}
67
78
}
68
79
69
- impl From < & FileName > for rustc_span:: FileName {
70
- fn from ( filename : & FileName ) -> rustc_span:: FileName {
71
- match filename {
72
- FileName :: Real ( path) => {
73
- rustc_span:: FileName :: Real ( rustc_span:: RealFileName :: LocalPath ( path. to_owned ( ) ) )
74
- }
75
- FileName :: Stdin => rustc_span:: FileName :: Custom ( "stdin" . to_owned ( ) ) ,
76
- }
77
- }
78
- }
79
-
80
80
// SourceFile's in the SourceMap will always have Unix-style line endings
81
81
// See: https://github.com/rust-lang/rustfmt/issues/3850
82
82
// So if the user has explicitly overridden the rustfmt `newline_style`
You can’t perform that action at this time.
0 commit comments