Skip to content

Commit 3e11360

Browse files
committed
Construct SourceMap at the same time as SessionGlobals.
Currently `SourceMap` is constructed slightly later than `SessionGlobals`, and inserted. This commit changes things so they are done at the same time. Benefits: - `SessionGlobals::source_map` changes from `Lock<Option<Lrc<SourceMap>>>` to `Option<Lrc<SourceMap>>`. It's still optional, but mutability isn't required because it's initialized at construction. - `set_source_map` is removed, simplifying `run_compiler`, which is good because that's a critical function and it's nice to make it simpler. This requires moving things around a bit, so the necessary inputs are available when `SessionGlobals` is created, in particular the `loader` and `hash_kind`, which are no longer computed by `build_session`. These inputs are captured by the new `SourceMapInputs` type, which is threaded through various places.
1 parent 2e989dc commit 3e11360

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/doc/needless_doctest_main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub fn check(
3838
// of all `#[test]` attributes in not ignored code examples
3939
fn check_code_sample(code: String, edition: Edition, ignore: bool) -> (bool, Vec<Range<usize>>) {
4040
rustc_driver::catch_fatal_errors(|| {
41-
rustc_span::create_session_globals_then(edition, || {
41+
rustc_span::create_session_globals_then(edition, None, || {
4242
let mut test_attr_spans = vec![];
4343
let filename = FileName::anon_source_code(&code);
4444

0 commit comments

Comments
 (0)