diff options
author | Nadrieril | 2019-12-15 19:56:54 +0000 |
---|---|---|
committer | Nadrieril | 2019-12-15 19:56:54 +0000 |
commit | 0105e3c31dbb2984e5c4b9d51cc3b27767e7683c (patch) | |
tree | 0e0a5eff865529fec1709201d241bd99ca14baba /dhall/src/semantics/core | |
parent | ec761bbd0de807bf1cb0da9389d714e3d812dd6d (diff) |
Avoid mention of `crate::` outside of top-level imports
Diffstat (limited to '')
-rw-r--r-- | dhall/src/semantics/core/context.rs | 3 | ||||
-rw-r--r-- | dhall/src/semantics/core/value.rs | 3 | ||||
-rw-r--r-- | dhall/src/semantics/core/valuef.rs | 12 | ||||
-rw-r--r-- | dhall/src/semantics/core/var.rs | 10 |
4 files changed, 13 insertions, 15 deletions
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<T: Shift> Shift for std::cell::RefCell<T> { } } -impl<T: Shift, E: Clone> Shift for crate::syntax::ExprF<T, E> { +impl<T: Shift, E: Clone> Shift for ExprF<T, E> { fn shift(&self, delta: isize, var: &AlphaVar) -> Option<Self> { Some(self.traverse_ref_with_special_handling_of_binders( |v| Ok(v.shift(delta, var)?), @@ -222,7 +222,7 @@ where } } -impl<T: Shift> Shift for crate::syntax::InterpolatedTextContents<T> { +impl<T: Shift> Shift for InterpolatedTextContents<T> { fn shift(&self, delta: isize, var: &AlphaVar) -> Option<Self> { Some(self.traverse_ref(|x| Ok(x.shift(delta, var)?))?) } @@ -262,7 +262,7 @@ impl<S, T: Subst<S>> Subst<S> for std::cell::RefCell<T> { } } -impl<S: Shift, T: Subst<S>, E: Clone> Subst<S> for crate::syntax::ExprF<T, E> { +impl<S: Shift, T: Subst<S>, E: Clone> Subst<S> for ExprF<T, E> { 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<S, T: Subst<S>> Subst<S> for Vec<T> { } } -impl<S, T: Subst<S>> Subst<S> for crate::syntax::InterpolatedTextContents<T> { +impl<S, T: Subst<S>> Subst<S> for InterpolatedTextContents<T> { fn subst_shift(&self, var: &AlphaVar, val: &S) -> Self { self.map_ref(|x| x.subst_shift(var, val)) } |