Skip to content

Commit b97ed58

Browse files
committed
Align to all changes since last issue260 was touched
1 parent 9cb300c commit b97ed58

File tree

1 file changed

+29
-18
lines changed

1 file changed

+29
-18
lines changed

tests/integration/panic.rs

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use chalk_ir::interner::{ChalkIr, RawId};
1+
use chalk_integration::interner::{ChalkIr, RawId};
22
use chalk_ir::*;
33
use chalk_rust_ir::*;
44
use chalk_solve::{RustIrDatabase, SolverChoice};
@@ -27,13 +27,13 @@ impl RustIrDatabase<ChalkIr> for MockDatabase {
2727
assert_eq!(id.0.index, 0);
2828
Arc::new(chalk_rust_ir::TraitDatum {
2929
id,
30-
binders: chalk_ir::Binders::new(
31-
chalk_ir::ParameterKinds::new(&ChalkIr),
32-
chalk_rust_ir::TraitDatumBound {
30+
binders: Binders::new(
31+
VariableKinds::new(&ChalkIr),
32+
TraitDatumBound {
3333
where_clauses: vec![],
3434
},
3535
),
36-
flags: chalk_rust_ir::TraitFlags {
36+
flags: TraitFlags {
3737
auto: false,
3838
marker: false,
3939
upstream: false,
@@ -52,13 +52,13 @@ impl RustIrDatabase<ChalkIr> for MockDatabase {
5252
let substitution = Ty::new(
5353
&ChalkIr,
5454
ApplicationTy {
55-
name: TypeName::Struct(StructId(RawId { index: 1 })),
55+
name: TypeName::Adt(AdtId(RawId { index: 1 })),
5656
substitution: Substitution::empty(&ChalkIr),
5757
},
5858
);
5959

6060
let binders = Binders::new(
61-
ParameterKinds::new(&ChalkIr),
61+
VariableKinds::new(&ChalkIr),
6262
ImplDatumBound {
6363
trait_ref: TraitRef {
6464
trait_id: TraitId(RawId { index: 0 }),
@@ -87,18 +87,18 @@ impl RustIrDatabase<ChalkIr> for MockDatabase {
8787
unimplemented!()
8888
}
8989

90-
fn struct_datum(&self, id: StructId<ChalkIr>) -> Arc<StructDatum<ChalkIr>> {
90+
fn adt_datum(&self, id: AdtId<ChalkIr>) -> Arc<AdtDatum<ChalkIr>> {
9191
unimplemented!()
9292
}
9393

94-
fn as_struct_id(&self, type_name: &TypeName<ChalkIr>) -> Option<StructId<ChalkIr>> {
94+
fn fn_def_datum(&self, fn_def_id: FnDefId<ChalkIr>) -> Arc<FnDefDatum<ChalkIr>> {
9595
unimplemented!()
9696
}
9797

9898
fn impls_for_trait(
9999
&self,
100100
trait_id: TraitId<ChalkIr>,
101-
parameters: &[Parameter<ChalkIr>],
101+
parameters: &[GenericArg<ChalkIr>],
102102
) -> Vec<ImplId<ChalkIr>> {
103103
assert_eq!(trait_id.0.index, 0);
104104
vec![ImplId(RawId { index: 1 })]
@@ -111,7 +111,7 @@ impl RustIrDatabase<ChalkIr> for MockDatabase {
111111
fn impl_provided_for(
112112
&self,
113113
auto_trait_id: TraitId<ChalkIr>,
114-
struct_id: StructId<ChalkIr>,
114+
struct_id: AdtId<ChalkIr>,
115115
) -> bool {
116116
unimplemented!()
117117
}
@@ -120,14 +120,26 @@ impl RustIrDatabase<ChalkIr> for MockDatabase {
120120
unimplemented!()
121121
}
122122

123+
fn program_clauses_for_env(
124+
&self,
125+
environment: &Environment<ChalkIr>,
126+
) -> ProgramClauses<ChalkIr> {
127+
ProgramClauses::new(&ChalkIr)
128+
}
129+
123130
fn interner(&self) -> &ChalkIr {
124131
&ChalkIr
125132
}
133+
134+
fn is_object_safe(&self, trait_id: TraitId<ChalkIr>) -> bool {
135+
unimplemented!()
136+
}
126137
}
127138

128139
#[test]
129140
fn unwind_safety() {
130141
use self::MockDatabase;
142+
use chalk_integration::interner::{self, ChalkIr};
131143
use chalk_ir::*;
132144
use std::panic;
133145

@@ -155,14 +167,13 @@ fn unwind_safety() {
155167
trait_id: TraitId(interner::RawId { index: 0 }),
156168
substitution: Substitution::from1(
157169
&ChalkIr,
158-
ParameterKind::Ty(
159-
TyData::Apply(ApplicationTy {
160-
name: TypeName::Struct(StructId(interner::RawId { index: 1 })),
170+
Ty::new(
171+
&ChalkIr,
172+
ApplicationTy {
173+
name: TypeName::Adt(AdtId(interner::RawId { index: 1 })),
161174
substitution: Substitution::empty(&ChalkIr),
162-
})
163-
.intern(&ChalkIr),
164-
)
165-
.intern(&ChalkIr),
175+
},
176+
),
166177
),
167178
})))
168179
.intern(&ChalkIr),

0 commit comments

Comments
 (0)