Skip to content

Commit

Permalink
Just return Ty directly
Browse files Browse the repository at this point in the history
  • Loading branch information
detrumi committed May 27, 2020
1 parent c11496e commit 4af8fb9
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion chalk-integration/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ impl RustIrDatabase<ChalkIr> for ChalkDatabase {
self.program_ir().unwrap().opaque_ty_data(id)
}

fn hidden_opaque_type(&self, id: OpaqueTyId<ChalkIr>) -> Arc<Ty<ChalkIr>> {
fn hidden_opaque_type(&self, id: OpaqueTyId<ChalkIr>) -> Ty<ChalkIr> {
self.program_ir().unwrap().hidden_opaque_type(id)
}

Expand Down
4 changes: 2 additions & 2 deletions chalk-integration/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ impl RustIrDatabase<ChalkIr> for Program {
self.opaque_ty_data[&id].clone()
}

fn hidden_opaque_type(&self, id: OpaqueTyId<ChalkIr>) -> Arc<Ty<ChalkIr>> {
self.hidden_opaque_types[&id].clone()
fn hidden_opaque_type(&self, id: OpaqueTyId<ChalkIr>) -> Ty<ChalkIr> {
(*self.hidden_opaque_types[&id]).clone()
}

fn adt_datum(&self, id: AdtId<ChalkIr>) -> Arc<AdtDatum<ChalkIr>> {
Expand Down
2 changes: 1 addition & 1 deletion chalk-solve/src/clauses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub fn push_auto_trait_impls_opaque<I: Interner>(
1
);

let hidden_ty = (*builder.db.hidden_opaque_type(opaque_id)).clone();
let hidden_ty = builder.db.hidden_opaque_type(opaque_id);
let binders = opaque_ty_datum.bound.clone();
builder.push_binders(&binders, |builder, _| {
let self_ty: Ty<_> = ApplicationTy {
Expand Down
2 changes: 1 addition & 1 deletion chalk-solve/src/clauses/program_clauses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl<I: Interner> ToProgramClauses<I> for OpaqueTyDatum<I> {
DomainGoal::Holds(
AliasEq {
alias: alias.clone(),
ty: (*builder.db.hidden_opaque_type(self.opaque_ty_id)).clone(),
ty: builder.db.hidden_opaque_type(self.opaque_ty_id),
}
.cast(interner),
),
Expand Down
2 changes: 1 addition & 1 deletion chalk-solve/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub trait RustIrDatabase<I: Interner>: Debug {
fn opaque_ty_data(&self, id: OpaqueTyId<I>) -> Arc<OpaqueTyDatum<I>>;

/// Returns the "hidden type" corresponding with the opaque type.
fn hidden_opaque_type(&self, id: OpaqueTyId<I>) -> Arc<Ty<I>>;
fn hidden_opaque_type(&self, id: OpaqueTyId<I>) -> Ty<I>;

/// Returns a list of potentially relevant impls for a given
/// trait-id; we also supply the type parameters that we are
Expand Down

0 comments on commit 4af8fb9

Please sign in to comment.