diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-29 01:34:06 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-10-29 01:34:06 +0000 |
| commit | 599ffab6cd240486fe63d22b01504b24938fc384 (patch) | |
| tree | ad1762c98c2109c18e3eb46d299f795d8d4fee29 /compiler/rustc_middle/src | |
| parent | 9f57edf2e261ade3c926d69459162057f15164d6 (diff) | |
| download | rust-599ffab6cd240486fe63d22b01504b24938fc384.tar.gz rust-599ffab6cd240486fe63d22b01504b24938fc384.zip | |
Remove region from adjustments
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/adjustment.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/compiler/rustc_middle/src/ty/adjustment.rs b/compiler/rustc_middle/src/ty/adjustment.rs index 71833eea5c0..c56038d358c 100644 --- a/compiler/rustc_middle/src/ty/adjustment.rs +++ b/compiler/rustc_middle/src/ty/adjustment.rs @@ -82,7 +82,7 @@ pub enum PointerCoercion { /// `Box<[i32]>` is an `Adjust::Unsize` with the target `Box<[i32]>`. #[derive(Clone, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)] pub struct Adjustment<'tcx> { - pub kind: Adjust<'tcx>, + pub kind: Adjust, pub target: Ty<'tcx>, } @@ -93,20 +93,20 @@ impl<'tcx> Adjustment<'tcx> { } #[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)] -pub enum Adjust<'tcx> { +pub enum Adjust { /// Go from ! to any type. NeverToAny, /// Dereference once, producing a place. - Deref(Option<OverloadedDeref<'tcx>>), + Deref(Option<OverloadedDeref>), /// Take the address and produce either a `&` or `*` pointer. - Borrow(AutoBorrow<'tcx>), + Borrow(AutoBorrow), Pointer(PointerCoercion), /// Take a pinned reference and reborrow as a `Pin<&mut T>` or `Pin<&T>`. - ReborrowPin(ty::Region<'tcx>, hir::Mutability), + ReborrowPin(hir::Mutability), } /// An overloaded autoderef step, representing a `Deref(Mut)::deref(_mut)` @@ -115,17 +115,16 @@ pub enum Adjust<'tcx> { /// being those shared by both the receiver and the returned reference. #[derive(Copy, Clone, PartialEq, Debug, TyEncodable, TyDecodable, HashStable)] #[derive(TypeFoldable, TypeVisitable)] -pub struct OverloadedDeref<'tcx> { - pub region: ty::Region<'tcx>, +pub struct OverloadedDeref { pub mutbl: hir::Mutability, /// The `Span` associated with the field access or method call /// that triggered this overloaded deref. pub span: Span, } -impl<'tcx> OverloadedDeref<'tcx> { +impl OverloadedDeref { /// Get the zst function item type for this method call. - pub fn method_call(&self, tcx: TyCtxt<'tcx>, source: Ty<'tcx>) -> Ty<'tcx> { + pub fn method_call<'tcx>(&self, tcx: TyCtxt<'tcx>, source: Ty<'tcx>) -> Ty<'tcx> { let trait_def_id = match self.mutbl { hir::Mutability::Not => tcx.require_lang_item(LangItem::Deref, None), hir::Mutability::Mut => tcx.require_lang_item(LangItem::DerefMut, None), @@ -187,9 +186,9 @@ impl From<AutoBorrowMutability> for hir::Mutability { #[derive(Copy, Clone, PartialEq, Debug, TyEncodable, TyDecodable, HashStable)] #[derive(TypeFoldable, TypeVisitable)] -pub enum AutoBorrow<'tcx> { +pub enum AutoBorrow { /// Converts from T to &T. - Ref(ty::Region<'tcx>, AutoBorrowMutability), + Ref(AutoBorrowMutability), /// Converts from T to *T. RawPtr(hir::Mutability), |
