Use &raw in the compiler
Like #130865 did for the standard library, we can use `&raw` in the compiler now that stage0 supports it. Also like the other issue, I did not make any doc or test changes at this time.
This commit is contained in:
@@ -233,7 +233,7 @@ impl<'sess> OnDiskCache<'sess> {
|
||||
|
||||
for (index, file) in files.iter().enumerate() {
|
||||
let index = SourceFileIndex(index as u32);
|
||||
let file_ptr: *const SourceFile = std::ptr::addr_of!(**file);
|
||||
let file_ptr: *const SourceFile = &raw const **file;
|
||||
file_to_file_index.insert(file_ptr, index);
|
||||
let source_file_id = EncodedSourceFileId::new(tcx, file);
|
||||
file_index_to_stable_id.insert(index, source_file_id);
|
||||
@@ -827,7 +827,7 @@ pub struct CacheEncoder<'a, 'tcx> {
|
||||
impl<'a, 'tcx> CacheEncoder<'a, 'tcx> {
|
||||
#[inline]
|
||||
fn source_file_index(&mut self, source_file: Lrc<SourceFile>) -> SourceFileIndex {
|
||||
self.file_to_file_index[&std::ptr::addr_of!(*source_file)]
|
||||
self.file_to_file_index[&(&raw const *source_file)]
|
||||
}
|
||||
|
||||
/// Encode something with additional information that allows to do some
|
||||
|
||||
Reference in New Issue
Block a user