1
Fork 0

use silent emitter for rustdoc highlighting pass

This commit is contained in:
Andy Russell 2019-11-03 12:04:01 -05:00
parent b43a682259
commit d06a4ded13
No known key found for this signature in database
GPG key ID: BE2221033EDBC374
5 changed files with 19 additions and 79 deletions

View file

@ -11,7 +11,7 @@ use std::fmt::Display;
use std::io;
use std::io::prelude::*;
use syntax::source_map::{SourceMap, FilePathMapping};
use syntax::source_map::SourceMap;
use syntax::parse::lexer;
use syntax::parse::token::{self, Token};
use syntax::sess::ParseSess;
@ -33,7 +33,7 @@ pub fn render_with_highlighting(
class, tooltip).unwrap();
}
let sess = ParseSess::new(FilePathMapping::empty());
let sess = ParseSess::with_silent_emitter();
let fm = sess.source_map().new_source_file(
FileName::Custom(String::from("rustdoc-highlighting")),
src.to_owned(),