From cf94bdc0742c13e2a0cac864c478b8626b266e1b Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:38 +0200 Subject: Merging upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- compiler/rustc_mir_dataflow/src/elaborate_drops.rs | 5 +-- compiler/rustc_mir_dataflow/src/errors.rs | 42 +++++++++++----------- compiler/rustc_mir_dataflow/src/lib.rs | 1 - .../src/move_paths/abs_domain.rs | 1 + 4 files changed, 25 insertions(+), 24 deletions(-) (limited to 'compiler/rustc_mir_dataflow/src') diff --git a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs index c0b0cc3c5..23403628c 100644 --- a/compiler/rustc_mir_dataflow/src/elaborate_drops.rs +++ b/compiler/rustc_mir_dataflow/src/elaborate_drops.rs @@ -823,9 +823,10 @@ where // tmp = &raw mut P; // cur = tmp as *mut T; // end = Offset(cur, len); + let mir_cast_kind = ty::cast::mir_cast_kind(iter_ty, tmp_ty); vec![ self.assign(tmp, Rvalue::AddressOf(Mutability::Mut, self.place)), - self.assign(cur, Rvalue::Cast(CastKind::Misc, Operand::Move(tmp), iter_ty)), + self.assign(cur, Rvalue::Cast(mir_cast_kind, Operand::Move(tmp), iter_ty)), self.assign( length_or_end, Rvalue::BinaryOp( @@ -893,7 +894,7 @@ where } ty::Slice(ety) => self.open_drop_for_array(*ety, None), - _ => bug!("open drop from non-ADT `{:?}`", ty), + _ => span_bug!(self.source_info.span, "open drop from non-ADT `{:?}`", ty), } } diff --git a/compiler/rustc_mir_dataflow/src/errors.rs b/compiler/rustc_mir_dataflow/src/errors.rs index cc1425787..cfacc0ec3 100644 --- a/compiler/rustc_mir_dataflow/src/errors.rs +++ b/compiler/rustc_mir_dataflow/src/errors.rs @@ -1,70 +1,70 @@ -use rustc_macros::SessionDiagnostic; +use rustc_macros::Diagnostic; use rustc_span::{Span, Symbol}; -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::path_must_end_in_filename)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_path_must_end_in_filename)] pub(crate) struct PathMustEndInFilename { #[primary_span] pub span: Span, } -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::unknown_formatter)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_unknown_formatter)] pub(crate) struct UnknownFormatter { #[primary_span] pub span: Span, } -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::duplicate_values_for)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_duplicate_values_for)] pub(crate) struct DuplicateValuesFor { #[primary_span] pub span: Span, pub name: Symbol, } -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::requires_an_argument)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_requires_an_argument)] pub(crate) struct RequiresAnArgument { #[primary_span] pub span: Span, pub name: Symbol, } -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::stop_after_dataflow_ended_compilation)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_stop_after_dataflow_ended_compilation)] pub(crate) struct StopAfterDataFlowEndedCompilation; -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::peek_must_be_place_or_ref_place)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_peek_must_be_place_or_ref_place)] pub(crate) struct PeekMustBePlaceOrRefPlace { #[primary_span] pub span: Span, } -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::peek_must_be_not_temporary)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_peek_must_be_not_temporary)] pub(crate) struct PeekMustBeNotTemporary { #[primary_span] pub span: Span, } -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::peek_bit_not_set)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_peek_bit_not_set)] pub(crate) struct PeekBitNotSet { #[primary_span] pub span: Span, } -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::peek_argument_not_a_local)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_peek_argument_not_a_local)] pub(crate) struct PeekArgumentNotALocal { #[primary_span] pub span: Span, } -#[derive(SessionDiagnostic)] -#[diag(mir_dataflow::peek_argument_untracked)] +#[derive(Diagnostic)] +#[diag(mir_dataflow_peek_argument_untracked)] pub(crate) struct PeekArgumentUntracked { #[primary_span] pub span: Span, diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs index b45c32ee9..b471d04fd 100644 --- a/compiler/rustc_mir_dataflow/src/lib.rs +++ b/compiler/rustc_mir_dataflow/src/lib.rs @@ -1,7 +1,6 @@ #![feature(associated_type_defaults)] #![feature(box_patterns)] #![feature(exact_size_is_empty)] -#![cfg_attr(bootstrap, feature(let_else))] #![feature(min_specialization)] #![feature(once_cell)] #![feature(stmt_expr_attributes)] diff --git a/compiler/rustc_mir_dataflow/src/move_paths/abs_domain.rs b/compiler/rustc_mir_dataflow/src/move_paths/abs_domain.rs index 28936274b..7806e8f45 100644 --- a/compiler/rustc_mir_dataflow/src/move_paths/abs_domain.rs +++ b/compiler/rustc_mir_dataflow/src/move_paths/abs_domain.rs @@ -48,6 +48,7 @@ impl<'tcx> Lift for PlaceElem<'tcx> { match *self { ProjectionElem::Deref => ProjectionElem::Deref, ProjectionElem::Field(f, ty) => ProjectionElem::Field(f, ty.lift()), + ProjectionElem::OpaqueCast(ty) => ProjectionElem::OpaqueCast(ty.lift()), ProjectionElem::Index(ref i) => ProjectionElem::Index(i.lift()), ProjectionElem::Subslice { from, to, from_end } => { ProjectionElem::Subslice { from, to, from_end } -- cgit v1.2.3