Skip to content

Commit

Permalink
keep module private
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Feb 23, 2024
1 parent 0ef82b0 commit 9012067
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/src/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ mod defs;
mod elision;
mod lifetimes;
mod lowering;
pub mod methods;
mod methods;
mod paths;
mod primitives;
mod ty_position;
Expand Down
20 changes: 16 additions & 4 deletions core/src/hir/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ impl ReturnableStructPath {

/// Get a map of lifetimes used on this path to lifetimes as named in the def site. See [`LinkedLifetimes`]
/// for more information.
pub fn link_lifetimes<'def, 'tcx>(&'def self, tcx: &'tcx TypeContext) -> LinkedLifetimes<'def, 'tcx> {
pub fn link_lifetimes<'def, 'tcx>(
&'def self,
tcx: &'tcx TypeContext,
) -> LinkedLifetimes<'def, 'tcx> {
match self {
Self::Struct(p) => p.link_lifetimes(tcx),
Self::OutStruct(p) => p.link_lifetimes(tcx),
Expand All @@ -149,7 +152,10 @@ impl StructPath {

/// Get a map of lifetimes used on this path to lifetimes as named in the def site. See [`LinkedLifetimes`]
/// for more information.
pub fn link_lifetimes<'def, 'tcx>(&'def self, tcx: &'tcx TypeContext) -> LinkedLifetimes<'def, 'tcx> {
pub fn link_lifetimes<'def, 'tcx>(
&'def self,
tcx: &'tcx TypeContext,
) -> LinkedLifetimes<'def, 'tcx> {
let struc = self.resolve(tcx);
let env = &struc.lifetimes;
LinkedLifetimes::new(env, None, &self.lifetimes)
Expand All @@ -164,7 +170,10 @@ impl OutStructPath {

/// Get a map of lifetimes used on this path to lifetimes as named in the def site. See [`LinkedLifetimes`]
/// for more information.
pub fn link_lifetimes<'def, 'tcx>(&'def self, tcx: &'tcx TypeContext) -> LinkedLifetimes<'def, 'tcx> {
pub fn link_lifetimes<'def, 'tcx>(
&'def self,
tcx: &'tcx TypeContext,
) -> LinkedLifetimes<'def, 'tcx> {
let struc = self.resolve(tcx);
let env = &struc.lifetimes;
LinkedLifetimes::new(env, None, &self.lifetimes)
Expand All @@ -191,7 +200,10 @@ impl<Opt, Owner> OpaquePath<Opt, Owner> {
impl<Opt, Owner: OpaqueOwner> OpaquePath<Opt, Owner> {
/// Get a map of lifetimes used on this path to lifetimes as named in the def site. See [`LinkedLifetimes`]
/// for more information.
pub fn link_lifetimes<'def, 'tcx>(&'def self, tcx: &'tcx TypeContext) -> LinkedLifetimes<'def, 'tcx> {
pub fn link_lifetimes<'def, 'tcx>(
&'def self,
tcx: &'tcx TypeContext,
) -> LinkedLifetimes<'def, 'tcx> {
let opaque = self.resolve(tcx);
let env = &opaque.lifetimes;
LinkedLifetimes::new(env, self.owner.lifetime(), &self.lifetimes)
Expand Down
4 changes: 1 addition & 3 deletions tool/src/dart/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::common::{ErrorStore, FileMap};
use askama::Template;
use diplomat_core::ast::DocsUrlGenerator;
use diplomat_core::hir::methods::borrowing_param::{
BorrowedLifetimeInfo, LifetimeEdge, LifetimeEdgeKind,
};
use diplomat_core::hir::borrowing_param::{BorrowedLifetimeInfo, LifetimeEdge, LifetimeEdgeKind};
use diplomat_core::hir::TypeContext;
use diplomat_core::hir::{
self, Lifetime, LifetimeEnv, Lifetimes, MaybeStatic, OpaqueOwner, ReturnType, SelfType,
Expand Down

0 comments on commit 9012067

Please sign in to comment.