Skip to content

Commit c0bb667

Browse files
bors[bot]matklad
andauthored
Merge #2432
2432: Minimize API r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents 385899d + 04735ab commit c0bb667

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

crates/ra_hir/src/code_model.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ use ra_syntax::{ast, AstNode, SyntaxNode};
2929
use crate::{
3030
db::{DefDatabase, HirDatabase},
3131
ty::display::HirFormatter,
32-
ty::{
33-
self, InEnvironment, InferenceResult, TraitEnvironment, TraitRef, Ty, TyDefId, TypeCtor,
34-
TypeWalk,
35-
},
32+
ty::{self, InEnvironment, InferenceResult, TraitEnvironment, Ty, TyDefId, TypeCtor, TypeWalk},
3633
CallableDef, Either, HirDisplay, Name, Source,
3734
};
3835

@@ -731,10 +728,6 @@ impl Trait {
731728
db.trait_data(self.id).items.iter().map(|(_name, it)| (*it).into()).collect()
732729
}
733730

734-
pub fn trait_ref(self, db: &impl HirDatabase) -> TraitRef {
735-
TraitRef::for_trait(db, self.id)
736-
}
737-
738731
pub fn is_auto(self, db: &impl DefDatabase) -> bool {
739732
db.trait_data(self.id).auto
740733
}

crates/ra_hir_ty/src/lower.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ pub(super) fn substs_from_path_segment(
363363
}
364364

365365
impl TraitRef {
366-
pub(crate) fn from_path(
366+
fn from_path(
367367
db: &impl HirDatabase,
368368
resolver: &Resolver,
369369
path: &Path,
@@ -377,7 +377,7 @@ impl TraitRef {
377377
Some(TraitRef::from_resolved_path(db, resolver, resolved.into(), segment, explicit_self_ty))
378378
}
379379

380-
pub(super) fn from_resolved_path(
380+
pub(crate) fn from_resolved_path(
381381
db: &impl HirDatabase,
382382
resolver: &Resolver,
383383
resolved: TraitId,
@@ -391,7 +391,7 @@ impl TraitRef {
391391
TraitRef { trait_: resolved, substs }
392392
}
393393

394-
pub(crate) fn from_hir(
394+
fn from_hir(
395395
db: &impl HirDatabase,
396396
resolver: &Resolver,
397397
type_ref: &TypeRef,
@@ -415,11 +415,6 @@ impl TraitRef {
415415
substs_from_path_segment(db, resolver, segment, Some(resolved.into()), !has_self_param)
416416
}
417417

418-
pub fn for_trait(db: &impl HirDatabase, trait_: TraitId) -> TraitRef {
419-
let substs = Substs::identity(&db.generic_params(trait_.into()));
420-
TraitRef { trait_, substs }
421-
}
422-
423418
pub(crate) fn from_type_bound(
424419
db: &impl HirDatabase,
425420
resolver: &Resolver,

0 commit comments

Comments
 (0)