-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Late toolchain upgrade to use nightly-2022-08-02 #1522
Conversation
Regression is still failing. Related changes: - rust-lang/rust#99420 - rust-lang/rust#99495 - rust-lang/rust#99844 - rust-lang/rust#99058
The compiler has reverted their fix to Opaque types due to performance degradation.
- Add an implementation for vtable_size and vtable_align intrinsics. - Change how we handled Foreign types. Even though they are unsized, a pointer to foreign types are thin pointers.
@@ -20,7 +20,7 @@ use std::fs::File; | |||
use std::io::{self, Read, Seek}; | |||
use std::path::{Path, PathBuf}; | |||
|
|||
use rustc_codegen_ssa::back::archive::ArchiveBuilder; | |||
use rustc_codegen_ssa::back::archive::{ArchiveBuilder, ArchiveBuilderBuilder}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub fn use_thin_pointer(&self, mir_type: Ty<'tcx>) -> bool { | ||
// ptr_metadata_ty is not defined on all types, the projection of an associated type | ||
let (metadata, _check_is_sized) = mir_type.ptr_metadata_ty(self.tcx, normalize_type); | ||
!self.is_unsized(mir_type) || metadata == self.tcx.types.unit | ||
} | ||
|
||
/// We use fat pointer if not thin pointer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expand this comment to mirror the one above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair.
ty::Ref(_, pointee_type, _) => Some(*pointee_type), | ||
ty::RawPtr(ty::TypeAndMut { ty: pointee_type, .. }) => Some(*pointee_type), | ||
_ => None, | ||
} | ||
} | ||
|
||
pub fn std_pointee_type(mir_type: Ty) -> Option<Ty> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this function doing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a doc
Description of changes:
These are changes related to the toolchain upgrade scheduled for 0.8. They are related to the following upstream changes:
Resolved issues:
Resolves #1474
Call-outs:
Unfortunately, this update took longer than usual and I couldn't finish it on time for 0.8, but I wanted to finish it on time for the next upgrade.
The upgrade uncovered an issue on how we have been handling unsized objects. Not every unsized object is hidden behind a fat pointer, like it was being assumed previously. I had to include a fix as part of this PR. (See the 3rd commit).
I have also uncovered another issue with our casting code while writing tests for the former fix. Since the second isn't a regression, I added a fixme test and I'll create a jira for it.
Testing:
How is this change tested? Old tests + new tests
Is this a refactor change? No
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.