about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lib.rs
diff options
context:
space:
mode:
authorNadrieril <Nadrieril@users.noreply.github.com>2024-01-21 06:38:38 +0100
committerGitHub <noreply@github.com>2024-01-21 06:38:38 +0100
commite7f3dc76f5acbf3d1763701158f3867ef09bbc01 (patch)
treee6a1d691b4657af635db44ef503acc399b40e704 /compiler/rustc_pattern_analysis/src/lib.rs
parente8678b1030c50173ff29d77eae215b1f8472571d (diff)
parent796cdc590c0f6badb9629feb2a2b55873408cc0f (diff)
downloadrust-e7f3dc76f5acbf3d1763701158f3867ef09bbc01.tar.gz
rust-e7f3dc76f5acbf3d1763701158f3867ef09bbc01.zip
Rollup merge of #120027 - Nadrieril:remove-ty-copy-bound, r=compiler-errors
pattern_analysis: Remove `Ty: Copy` bound

To make it compatible with rust-analyzer's `Ty` which isn't `Copy` (it's an `Arc`).

r? ``@compiler-errors``
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
-rw-r--r--compiler/rustc_pattern_analysis/src/lib.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs
index 21fa8e68d82..4fd01b5e638 100644
--- a/compiler/rustc_pattern_analysis/src/lib.rs
+++ b/compiler/rustc_pattern_analysis/src/lib.rs
@@ -82,7 +82,7 @@ impl<'a, T: ?Sized> Captures<'a> for T {}
 /// Most of the crate is parameterized on a type that implements this trait.
 pub trait TypeCx: Sized + fmt::Debug {
     /// The type of a pattern.
-    type Ty: Copy + Clone + fmt::Debug; // FIXME: remove Copy
+    type Ty: Clone + fmt::Debug;
     /// Errors that can abort analysis.
     type Error: fmt::Debug;
     /// The index of an enum variant.
@@ -97,16 +97,16 @@ pub trait TypeCx: Sized + fmt::Debug {
     fn is_exhaustive_patterns_feature_on(&self) -> bool;
 
     /// The number of fields for this constructor.
-    fn ctor_arity(&self, ctor: &Constructor<Self>, ty: Self::Ty) -> usize;
+    fn ctor_arity(&self, ctor: &Constructor<Self>, ty: &Self::Ty) -> usize;
 
     /// The types of the fields for this constructor. The result must have a length of
     /// `ctor_arity()`.
-    fn ctor_sub_tys(&self, ctor: &Constructor<Self>, ty: Self::Ty) -> &[Self::Ty];
+    fn ctor_sub_tys(&self, ctor: &Constructor<Self>, ty: &Self::Ty) -> &[Self::Ty];
 
     /// The set of all the constructors for `ty`.
     ///
     /// This must follow the invariants of `ConstructorSet`
-    fn ctors_for_ty(&self, ty: Self::Ty) -> Result<ConstructorSet<Self>, Self::Error>;
+    fn ctors_for_ty(&self, ty: &Self::Ty) -> Result<ConstructorSet<Self>, Self::Error>;
 
     /// Best-effort `Debug` implementation.
     fn debug_pat(f: &mut fmt::Formatter<'_>, pat: &DeconstructedPat<'_, Self>) -> fmt::Result;