mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-29 02:52:11 +00:00
Adjust for salsa::Id::from_u32() being unsafe
This impacts our manual `salsa::Id` wrappers. I refactored them a bit to improve safety.
This commit is contained in:
parent
2bba385dda
commit
db72e2ff41
5 changed files with 80 additions and 183 deletions
|
|
@ -72,7 +72,9 @@ pub fn deserialize_span_data_index_map(map: &[u32]) -> SpanDataIndexMap {
|
|||
ast_id: ErasedFileAstId::from_raw(ast_id),
|
||||
},
|
||||
range: TextRange::new(start.into(), end.into()),
|
||||
ctx: SyntaxContext::from_u32(e),
|
||||
// SAFETY: We only receive spans from the server. If someone mess up the communication UB can happen,
|
||||
// but that will be their problem.
|
||||
ctx: unsafe { SyntaxContext::from_u32(e) },
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue