Skip to content

Commit d992736

Browse files
committed
Remove unused
1 parent 8040f4a commit d992736

File tree

14 files changed

+20
-69
lines changed

14 files changed

+20
-69
lines changed

crates/hir_ty/src/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use smallvec::SmallVec;
1414
use crate::{
1515
db::HirDatabase, primitive, to_assoc_type_id, to_chalk_trait_id, utils::generics, Binders,
1616
CallableSig, FnPointer, FnSig, FnSubst, GenericArg, Interner, ProjectionTy, Substitution,
17-
TraitRef, Ty, TyDefId, TyExt, TyKind, TypeWalk, ValueTyDefId,
17+
TraitRef, Ty, TyDefId, TyExt, TyKind, ValueTyDefId,
1818
};
1919

2020
/// This is a builder for `Ty` or anything that needs a `Substitution`.

crates/hir_ty/src/chalk_cast.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
//! Implementations of the Chalk `Cast` trait for our types.
22
3-
use chalk_ir::{
4-
cast::{Cast, CastTo},
5-
interner::HasInterner,
6-
};
3+
use chalk_ir::interner::HasInterner;
74

8-
use crate::{
9-
AliasEq, CallableSig, DomainGoal, GenericArg, GenericArgData, Interner, PolyFnSig,
10-
ReturnTypeImplTraits, TraitRef, Ty, WhereClause,
11-
};
5+
use crate::{CallableSig, ReturnTypeImplTraits};
126

137
macro_rules! has_interner {
148
($t:ty) => {
@@ -18,15 +12,5 @@ macro_rules! has_interner {
1812
};
1913
}
2014

21-
macro_rules! transitive_impl {
22-
($a:ty, $b:ty, $c:ty) => {
23-
impl CastTo<$c> for $a {
24-
fn cast_to(self, interner: &Interner) -> $c {
25-
self.cast::<$b>(interner).cast(interner)
26-
}
27-
}
28-
};
29-
}
30-
3115
has_interner!(CallableSig);
3216
has_interner!(ReturnTypeImplTraits);

crates/hir_ty/src/infer.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ use syntax::SmolStr;
3838

3939
use super::{
4040
DomainGoal, Guidance, InEnvironment, ProjectionTy, Solution, TraitEnvironment, TraitRef, Ty,
41-
TypeWalk,
4241
};
4342
use crate::{
4443
db::HirDatabase, fold_tys, infer::diagnostics::InferenceDiagnostic,

crates/hir_ty/src/infer/coerce.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ impl<'a> InferenceContext<'a> {
7373
// Pointer weakening and function to pointer
7474
match (from_ty.kind(&Interner), to_ty.kind(&Interner)) {
7575
// `*mut T` -> `*const T`
76-
(TyKind::Raw(m1, inner), TyKind::Raw(m2 @ Mutability::Not, ..)) => {
76+
(TyKind::Raw(_, inner), TyKind::Raw(m2 @ Mutability::Not, ..)) => {
7777
from_ty = TyKind::Raw(*m2, inner.clone()).intern(&Interner);
7878
}
7979
// `&mut T` -> `&T`
80-
(TyKind::Ref(m1, lt, inner), TyKind::Ref(m2 @ Mutability::Not, ..)) => {
80+
(TyKind::Ref(_, lt, inner), TyKind::Ref(m2 @ Mutability::Not, ..)) => {
8181
from_ty = TyKind::Ref(*m2, lt.clone(), inner.clone()).intern(&Interner);
8282
}
8383
// `&T` -> `*const T`

crates/hir_ty/src/infer/expr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use crate::{
2424
utils::{generics, Generics},
2525
AdtId, Binders, CallableDefId, FnPointer, FnSig, FnSubst, InEnvironment, Interner,
2626
ProjectionTyExt, Rawness, Scalar, Substitution, TraitRef, Ty, TyBuilder, TyExt, TyKind,
27-
TypeWalk,
2827
};
2928

3029
use super::{

crates/hir_ty/src/infer/unify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use super::{DomainGoal, InferenceContext};
1212
use crate::{
1313
fold_tys, static_lifetime, AliasEq, AliasTy, BoundVar, Canonical, CanonicalVarKinds,
1414
DebruijnIndex, FnPointer, FnSubst, InEnvironment, InferenceVar, Interner, Scalar, Substitution,
15-
Ty, TyExt, TyKind, TypeWalk, WhereClause,
15+
Ty, TyExt, TyKind, WhereClause,
1616
};
1717

1818
impl<'a> InferenceContext<'a> {

crates/hir_ty/src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! The type system. We currently use this to infer types for completion, hover
22
//! information and various assists.
33
4-
#![allow(unused)]
5-
64
#[allow(unused)]
75
macro_rules! eprintln {
86
($($tt:tt)*) => { stdx::eprintln!($($tt)*) };
@@ -34,7 +32,6 @@ use std::sync::Arc;
3432

3533
use base_db::salsa;
3634
use chalk_ir::{
37-
cast::{CastTo, Caster},
3835
fold::{Fold, Shift},
3936
interner::HasInterner,
4037
UintTy,

crates/hir_ty/src/lower.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use crate::{
3535
AliasEq, AliasTy, Binders, BoundVar, CallableSig, DebruijnIndex, DynTy, FnPointer, FnSig,
3636
FnSubst, ImplTraitId, OpaqueTy, PolyFnSig, ProjectionTy, QuantifiedWhereClause,
3737
QuantifiedWhereClauses, ReturnTypeImplTrait, ReturnTypeImplTraits, Substitution,
38-
TraitEnvironment, TraitRef, TraitRefExt, Ty, TyBuilder, TyKind, TypeWalk, WhereClause,
38+
TraitEnvironment, TraitRef, TraitRefExt, Ty, TyBuilder, TyKind, WhereClause,
3939
};
4040

4141
#[derive(Debug)]

crates/hir_ty/src/method_resolution.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ use std::{iter, sync::Arc};
66

77
use arrayvec::ArrayVec;
88
use base_db::CrateId;
9-
use chalk_ir::{
10-
cast::Cast,
11-
fold::{Fold, Folder},
12-
Fallible, Mutability, UniverseIndex,
13-
};
9+
use chalk_ir::{cast::Cast, Mutability, UniverseIndex};
1410
use hir_def::{
1511
lang_item::LangItemTarget, nameres::DefMap, AssocContainerId, AssocItemId, FunctionId,
1612
GenericDefId, HasModule, ImplId, Lookup, ModuleId, TraitId,
@@ -25,9 +21,9 @@ use crate::{
2521
primitive::{self, FloatTy, IntTy, UintTy},
2622
static_lifetime,
2723
utils::all_super_traits,
28-
AdtId, BoundVar, Canonical, CanonicalVarKinds, DebruijnIndex, FnPointer, FnSig, ForeignDefId,
24+
AdtId, Canonical, CanonicalVarKinds, DebruijnIndex, FnPointer, FnSig, ForeignDefId,
2925
InEnvironment, Interner, Scalar, Substitution, TraitEnvironment, TraitRefExt, Ty, TyBuilder,
30-
TyExt, TyKind, TypeWalk,
26+
TyExt, TyKind,
3127
};
3228

3329
/// This is used as a key for indexing impls.

crates/hir_ty/src/traits.rs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::{
1212
Solution, TraitRefExt, Ty, TyKind, WhereClause,
1313
};
1414

15-
use self::chalk::{from_chalk, Interner, ToChalk};
15+
use self::chalk::Interner;
1616

1717
pub(crate) mod chalk;
1818

@@ -101,8 +101,7 @@ pub(crate) fn trait_solve_query(
101101
// We currently don't deal with universes (I think / hope they're not yet
102102
// relevant for our use cases?)
103103
let u_canonical = chalk_ir::UCanonical { canonical, universes: 1 };
104-
let solution = solve(db, krate, &u_canonical);
105-
solution.map(|solution| solution_from_chalk(db, solution))
104+
solve(db, krate, &u_canonical)
106105
}
107106

108107
fn solve(
@@ -170,13 +169,6 @@ fn is_chalk_print() -> bool {
170169
std::env::var("CHALK_PRINT").is_ok()
171170
}
172171

173-
fn solution_from_chalk(
174-
db: &dyn HirDatabase,
175-
solution: chalk_solve::Solution<Interner>,
176-
) -> Solution {
177-
solution
178-
}
179-
180172
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
181173
pub enum FnTrait {
182174
FnOnce,

0 commit comments

Comments
 (0)