From 48cb4677ce9f3a96327140db2fc77c28eafe034c Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Tue, 9 Jun 2020 17:59:40 -0400 Subject: [PATCH] Remove ABI from Fn --- chalk-integration/src/lowering.rs | 3 --- chalk-ir/src/debug.rs | 7 +------ chalk-ir/src/fold/binder_impls.rs | 2 -- chalk-ir/src/interner.rs | 6 ------ chalk-ir/src/lib.rs | 1 - chalk-parse/src/ast.rs | 1 - chalk-parse/src/parser.lalrpop | 3 +-- chalk-solve/src/test_macros.rs | 1 - 8 files changed, 2 insertions(+), 22 deletions(-) diff --git a/chalk-integration/src/lowering.rs b/chalk-integration/src/lowering.rs index 9e5676d62e7..ff963df15a3 100644 --- a/chalk-integration/src/lowering.rs +++ b/chalk-integration/src/lowering.rs @@ -134,7 +134,6 @@ impl<'k> Env<'k> { } else { return Ok(chalk_ir::TyData::Function(chalk_ir::Fn { num_binders: k.binders.len(interner), - abi: *self.fn_def_abis.get(id).unwrap(), substitution: chalk_ir::Substitution::empty(interner), }) .intern(interner) @@ -1416,7 +1415,6 @@ impl LowerTy for Ty { Ty::ForAll { lifetime_names, - abi, types, } => { let quantified_env = env.introduce(lifetime_names.iter().map(|id| { @@ -1430,7 +1428,6 @@ impl LowerTy for Ty { let function = chalk_ir::Fn { num_binders: lifetime_names.len(), - abi: abi.lower()?, substitution: Substitution::from(interner, lowered_tys), }; Ok(chalk_ir::TyData::Function(function).intern(interner)) diff --git a/chalk-ir/src/debug.rs b/chalk-ir/src/debug.rs index 70315003f54..862c4026440 100644 --- a/chalk-ir/src/debug.rs +++ b/chalk-ir/src/debug.rs @@ -222,14 +222,9 @@ impl Debug for Fn { // FIXME -- we should introduce some names or something here let Fn { num_binders, - abi, substitution, } = self; - write!( - fmt, - "extern \"{:?}\" for<{}> {:?}", - abi, num_binders, substitution - ) + write!(fmt, "for<{}> {:?}", num_binders, substitution) } } diff --git a/chalk-ir/src/fold/binder_impls.rs b/chalk-ir/src/fold/binder_impls.rs index 259858d0b1c..b514d8f1899 100644 --- a/chalk-ir/src/fold/binder_impls.rs +++ b/chalk-ir/src/fold/binder_impls.rs @@ -19,12 +19,10 @@ impl> Fold for Fn { { let Fn { num_binders, - abi, substitution, } = self; Ok(Fn { num_binders: *num_binders, - abi: TI::transfer_abi(*abi), substitution: substitution.fold_with(folder, outer_binder.shifted_in())?, }) } diff --git a/chalk-ir/src/interner.rs b/chalk-ir/src/interner.rs index a7f8c309008..1f619ba43b2 100644 --- a/chalk-ir/src/interner.rs +++ b/chalk-ir/src/interner.rs @@ -678,8 +678,6 @@ pub trait TargetInterner: Interner { &self, const_evaluated: &I::InternedConcreteConst, ) -> Self::InternedConcreteConst; - - fn transfer_abi(abi: I::FnAbi) -> Self::FnAbi; } impl TargetInterner for I { @@ -709,10 +707,6 @@ impl TargetInterner for I { ) -> Self::InternedConcreteConst { const_evaluated.clone() } - - fn transfer_abi(abi: ::FnAbi) -> Self::FnAbi { - abi - } } /// Implemented by types that have an associated interner (which diff --git a/chalk-ir/src/lib.rs b/chalk-ir/src/lib.rs index d9101e77124..890b9f0b592 100644 --- a/chalk-ir/src/lib.rs +++ b/chalk-ir/src/lib.rs @@ -747,7 +747,6 @@ impl InferenceVar { #[derive(Clone, PartialEq, Eq, Hash, HasInterner)] pub struct Fn { pub num_binders: usize, - pub abi: I::FnAbi, pub substitution: Substitution, } diff --git a/chalk-parse/src/ast.rs b/chalk-parse/src/ast.rs index 09deffa8042..dbd823dbb68 100644 --- a/chalk-parse/src/ast.rs +++ b/chalk-parse/src/ast.rs @@ -224,7 +224,6 @@ pub enum Ty { }, ForAll { lifetime_names: Vec, - abi: FnAbi, types: Vec>, }, Tuple { diff --git a/chalk-parse/src/parser.lalrpop b/chalk-parse/src/parser.lalrpop index a3ae02bcd40..7afac68e53c 100644 --- a/chalk-parse/src/parser.lalrpop +++ b/chalk-parse/src/parser.lalrpop @@ -229,9 +229,8 @@ pub Ty: Ty = { }; TyWithoutId: Ty = { - "fn" "(" > ")" => Ty::ForAll { + "fn" "(" > ")" => Ty::ForAll { lifetime_names: l.unwrap_or_default(), - abi: abi.unwrap_or_default(), types: types .into_iter() .chain(std::iter::once(ret_ty.unwrap_or_else(|| Ty::Tuple { types: Vec::new() }))) diff --git a/chalk-solve/src/test_macros.rs b/chalk-solve/src/test_macros.rs index 2faa8c6e1a6..20f39e3fdb7 100644 --- a/chalk-solve/src/test_macros.rs +++ b/chalk-solve/src/test_macros.rs @@ -14,7 +14,6 @@ macro_rules! ty { (function $n:tt $($arg:tt)*) => { chalk_ir::TyData::Function(Fn { num_binders: $n, - abi: chalk_integration::interner::ChalkFnAbi::Rust, substitution: chalk_ir::Substitution::from( &chalk_integration::interner::ChalkIr, vec![$(arg!($arg)),*] as Vec>