1 // aux-build:first_crate.rs
2 // aux-build:second_crate.rs
3 // revisions:rpass1 rpass2
5 // Regression test for issue #92163
6 // Under certain circumstances, we may end up trying to
7 // decode a foreign `Span` from the incremental cache, without previously
8 // having imported the `SourceFile`s from the owning crate. This can happen
9 // if the `Span` comes from a transitive dependency (so we never try to resolve
10 // items from the crate during expansion/resolution).
12 // Previously, this would result in an ICE, since we would not have loaded
13 // the corresponding `SourceFile` for the `StableSourceFileId` we decoded.
14 // This test verifies that the decoding of a foreign `Span` will always
15 // try to import the `SourceFile`s from the foreign crate, instead of
16 // relying on that having already happened during expansion.
18 extern crate second_crate;
24 // This returns `first_crate::Foo`, causing
25 // us to encode the `AdtDef `first_crate::Foo` (along with its `Span`s)
26 // into the query cache for the `TypeckResults` for this function.
27 second_crate::make_it();