be even more precise about "cast" vs "coercion"
This commit is contained in:
parent
5e60d1f87e
commit
bd31e3ed70
90 changed files with 291 additions and 233 deletions
|
@ -579,7 +579,7 @@ pub struct CopyNonOverlapping<'tcx> {
|
|||
pub count: Operand<'tcx>,
|
||||
}
|
||||
|
||||
/// Represents how a `TerminatorKind::Call` was constructed, used for diagnostics
|
||||
/// Represents how a [`TerminatorKind::Call`] was constructed, used for diagnostics.
|
||||
#[derive(Clone, Copy, TyEncodable, TyDecodable, Debug, PartialEq, Hash, HashStable)]
|
||||
#[derive(TypeFoldable, TypeVisitable)]
|
||||
pub enum CallSource {
|
||||
|
@ -1403,7 +1403,7 @@ pub enum CastKind {
|
|||
/// * [`PointerCoercion::MutToConstPointer`]
|
||||
///
|
||||
/// Both are runtime nops, so should be [`CastKind::PtrToPtr`] instead in runtime MIR.
|
||||
PointerCoercion(PointerCoercion),
|
||||
PointerCoercion(PointerCoercion, CoercionSource),
|
||||
IntToInt,
|
||||
FloatToInt,
|
||||
FloatToFloat,
|
||||
|
@ -1419,6 +1419,15 @@ pub enum CastKind {
|
|||
Transmute,
|
||||
}
|
||||
|
||||
/// Represents how a [`CastKind::PointerCoercion`] was constructed, used for diagnostics.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable)]
|
||||
pub enum CoercionSource {
|
||||
/// The coercion was manually written by the user with an `as` cast.
|
||||
AsCast,
|
||||
/// The coercion was automatically inserted by the compiler.
|
||||
Implicit,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, TyEncodable, TyDecodable, Hash, HashStable)]
|
||||
#[derive(TypeFoldable, TypeVisitable)]
|
||||
pub enum AggregateKind<'tcx> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue