-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Cached stable hash cleanups #95524
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
Merged
Merged
Cached stable hash cleanups #95524
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
00c24dd
Move stable hash from TyS into a datastructure that can be shared wit…
oli-obk 33d0ce9
inline a trivial function
oli-obk 6ffd654
Check that the cached stable hash is the right one if debug assertion…
oli-obk 2e0ef70
Document and rename the new wrapper type
oli-obk 25d6f8e
Avoid looking at the internals of Interned directly
oli-obk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ use crate::ty::subst::{GenericArg, GenericArgKind, Subst}; | |
use crate::ty::{self, ConstInt, DefIdTree, ParamConst, ScalarInt, Term, Ty, TyCtxt, TypeFoldable}; | ||
use rustc_apfloat::ieee::{Double, Single}; | ||
use rustc_data_structures::fx::FxHashMap; | ||
use rustc_data_structures::intern::Interned; | ||
use rustc_data_structures::intern::{InTy, Interned}; | ||
use rustc_data_structures::sso::SsoHashSet; | ||
use rustc_hir as hir; | ||
use rustc_hir::def::{self, CtorKind, DefKind, Namespace}; | ||
|
@@ -1266,18 +1266,29 @@ pub trait PrettyPrinter<'tcx>: | |
ty::Ref( | ||
_, | ||
Ty(Interned( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe use nested match with the inner match matching on |
||
ty::TyS { | ||
kind: | ||
ty::Array( | ||
Ty(Interned(ty::TyS { kind: ty::Uint(ty::UintTy::U8), .. }, _)), | ||
ty::Const(Interned( | ||
ty::ConstS { | ||
val: ty::ConstKind::Value(ConstValue::Scalar(int)), | ||
.. | ||
}, | ||
_, | ||
)), | ||
), | ||
InTy { | ||
internee: | ||
ty::TyS { | ||
kind: | ||
ty::Array( | ||
Ty(Interned( | ||
InTy { | ||
internee: | ||
ty::TyS { kind: ty::Uint(ty::UintTy::U8), .. }, | ||
.. | ||
}, | ||
_, | ||
)), | ||
ty::Const(Interned( | ||
ty::ConstS { | ||
val: ty::ConstKind::Value(ConstValue::Scalar(int)), | ||
.. | ||
}, | ||
_, | ||
)), | ||
), | ||
.. | ||
}, | ||
.. | ||
}, | ||
_, | ||
|
@@ -1439,7 +1450,11 @@ pub trait PrettyPrinter<'tcx>: | |
// Byte/string slices, printed as (byte) string literals. | ||
( | ||
ConstValue::Slice { data, start, end }, | ||
ty::Ref(_, Ty(Interned(ty::TyS { kind: ty::Slice(t), .. }, _)), _), | ||
ty::Ref( | ||
_, | ||
Ty(Interned(InTy { internee: ty::TyS { kind: ty::Slice(t), .. }, .. }, _)), | ||
_, | ||
), | ||
) if *t == u8_type => { | ||
// The `inspect` here is okay since we checked the bounds, and there are | ||
// no relocations (we have an active slice reference here). We don't use | ||
|
@@ -1450,7 +1465,11 @@ pub trait PrettyPrinter<'tcx>: | |
} | ||
( | ||
ConstValue::Slice { data, start, end }, | ||
ty::Ref(_, Ty(Interned(ty::TyS { kind: ty::Str, .. }, _)), _), | ||
ty::Ref( | ||
_, | ||
Ty(Interned(InTy { internee: ty::TyS { kind: ty::Str, .. }, .. }, _)), | ||
_, | ||
), | ||
) => { | ||
// The `inspect` here is okay since we checked the bounds, and there are no | ||
// relocations (we have an active `str` reference here). We don't use this | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.