From 0105e3c31dbb2984e5c4b9d51cc3b27767e7683c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 15 Dec 2019 19:56:54 +0000 Subject: Avoid mention of `crate::` outside of top-level imports --- dhall/src/semantics/core/context.rs | 3 +-- dhall/src/semantics/core/value.rs | 3 +-- dhall/src/semantics/core/valuef.rs | 12 ++++++------ dhall/src/semantics/core/var.rs | 10 +++++----- 4 files changed, 13 insertions(+), 15 deletions(-) (limited to 'dhall/src/semantics/core') diff --git a/dhall/src/semantics/core/context.rs b/dhall/src/semantics/core/context.rs index 00e1493..c3da823 100644 --- a/dhall/src/semantics/core/context.rs +++ b/dhall/src/semantics/core/context.rs @@ -1,12 +1,11 @@ use std::collections::HashMap; use std::rc::Rc; -use crate::syntax::{Label, V}; - use crate::core::value::Value; use crate::core::valuef::ValueF; use crate::core::var::{AlphaVar, Shift, Subst}; use crate::error::TypeError; +use crate::syntax::{Label, V}; #[derive(Debug, Clone)] enum CtxItem { diff --git a/dhall/src/semantics/core/value.rs b/dhall/src/semantics/core/value.rs index bd7a9b9..68b879b 100644 --- a/dhall/src/semantics/core/value.rs +++ b/dhall/src/semantics/core/value.rs @@ -1,8 +1,6 @@ use std::cell::{Ref, RefCell, RefMut}; use std::rc::Rc; -use crate::syntax::{Builtin, Const, Span}; - use crate::core::context::TypecheckContext; use crate::core::valuef::ValueF; use crate::core::var::{AlphaVar, Shift, Subst}; @@ -10,6 +8,7 @@ use crate::error::{TypeError, TypeMessage}; use crate::phase::normalize::{apply_any, normalize_whnf}; use crate::phase::typecheck::{builtin_to_value, const_to_value}; use crate::phase::{NormalizedExpr, Typed}; +use crate::syntax::{Builtin, Const, Span}; #[derive(Debug, Clone, Copy)] pub(crate) enum Form { diff --git a/dhall/src/semantics/core/valuef.rs b/dhall/src/semantics/core/valuef.rs index e9ac391..e11d5d7 100644 --- a/dhall/src/semantics/core/valuef.rs +++ b/dhall/src/semantics/core/valuef.rs @@ -1,14 +1,14 @@ use std::collections::HashMap; -use crate::syntax::{ - Builtin, Const, ExprF, Integer, InterpolatedTextContents, Label, - NaiveDouble, Natural, -}; - use crate::core::value::{ToExprOptions, Value}; use crate::core::var::{AlphaLabel, AlphaVar, Shift, Subst}; use crate::phase::typecheck::rc; use crate::phase::{Normalized, NormalizedExpr}; +use crate::syntax; +use crate::syntax::{ + Builtin, Const, ExprF, Integer, InterpolatedTextContents, Label, + NaiveDouble, Natural, +}; /// A semantic value. Subexpressions are Values, which are partially evaluated expressions that are /// normalized on-demand. @@ -117,7 +117,7 @@ impl ValueF { .collect(), )), ValueF::Equivalence(x, y) => rc(ExprF::BinOp( - crate::syntax::BinOp::Equivalence, + syntax::BinOp::Equivalence, x.to_expr(opts), y.to_expr(opts), )), diff --git a/dhall/src/semantics/core/var.rs b/dhall/src/semantics/core/var.rs index f9d3478..184a372 100644 --- a/dhall/src/semantics/core/var.rs +++ b/dhall/src/semantics/core/var.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use crate::syntax::{Label, V}; +use crate::syntax::{ExprF, InterpolatedTextContents, Label, V}; /// Stores a pair of variables: a normal one and one /// that corresponds to the alpha-normalized version of the first one. @@ -190,7 +190,7 @@ impl Shift for std::cell::RefCell { } } -impl Shift for crate::syntax::ExprF { +impl Shift for ExprF { fn shift(&self, delta: isize, var: &AlphaVar) -> Option { Some(self.traverse_ref_with_special_handling_of_binders( |v| Ok(v.shift(delta, var)?), @@ -222,7 +222,7 @@ where } } -impl Shift for crate::syntax::InterpolatedTextContents { +impl Shift for InterpolatedTextContents { fn shift(&self, delta: isize, var: &AlphaVar) -> Option { Some(self.traverse_ref(|x| Ok(x.shift(delta, var)?))?) } @@ -262,7 +262,7 @@ impl> Subst for std::cell::RefCell { } } -impl, E: Clone> Subst for crate::syntax::ExprF { +impl, E: Clone> Subst for ExprF { fn subst_shift(&self, var: &AlphaVar, val: &S) -> Self { self.map_ref_with_special_handling_of_binders( |v| v.subst_shift(var, val), @@ -277,7 +277,7 @@ impl> Subst for Vec { } } -impl> Subst for crate::syntax::InterpolatedTextContents { +impl> Subst for InterpolatedTextContents { fn subst_shift(&self, var: &AlphaVar, val: &S) -> Self { self.map_ref(|x| x.subst_shift(var, val)) } -- cgit v1.2.3