diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-01-11 10:33:18 +0100 |
|---|---|---|
| committer | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-02-01 18:54:55 +0100 |
| commit | 64d0143c2c5f627e246822b4e2f501e563ec63cc (patch) | |
| tree | 480be10e878405f57051db39ecc25b3e1cd9e68f /src/libsyntax/util | |
| parent | e03d1064f0d98961b83885ce951351ae57cc7aad (diff) | |
| download | rust-64d0143c2c5f627e246822b4e2f501e563ec63cc.tar.gz rust-64d0143c2c5f627e246822b4e2f501e563ec63cc.zip | |
pretty: remove ParseSess dependency
Diffstat (limited to 'src/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/comments.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libsyntax/util/comments.rs b/src/libsyntax/util/comments.rs index c385b498ced..de33189884c 100644 --- a/src/libsyntax/util/comments.rs +++ b/src/libsyntax/util/comments.rs @@ -1,7 +1,6 @@ pub use CommentStyle::*; use crate::ast; -use crate::sess::ParseSess; use rustc_span::source_map::SourceMap; use rustc_span::{BytePos, CharPos, FileName, Pos}; @@ -191,8 +190,8 @@ fn split_block_comment_into_lines(text: &str, col: CharPos) -> Vec<String> { // it appears this function is called only from pprust... that's // probably not a good thing. -crate fn gather_comments(sess: &ParseSess, path: FileName, src: String) -> Vec<Comment> { - let cm = SourceMap::new(sess.source_map().path_mapping().clone()); +crate fn gather_comments(sm: &SourceMap, path: FileName, src: String) -> Vec<Comment> { + let cm = SourceMap::new(sm.path_mapping().clone()); let source_file = cm.new_source_file(path, src); let text = (*source_file.src.as_ref().unwrap()).clone(); |
