]> git.lizzy.rs Git - rust.git/commitdiff
push name down to hir_expand
authorAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 30 Oct 2019 15:56:20 +0000 (18:56 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 30 Oct 2019 15:56:20 +0000 (18:56 +0300)
22 files changed:
crates/ra_hir/src/adt.rs
crates/ra_hir/src/code_model.rs
crates/ra_hir/src/expr/lower.rs
crates/ra_hir/src/from_source.rs
crates/ra_hir/src/generics.rs
crates/ra_hir/src/lib.rs
crates/ra_hir/src/nameres/collector.rs
crates/ra_hir/src/resolve.rs
crates/ra_hir/src/source_binder.rs
crates/ra_hir/src/traits.rs
crates/ra_hir/src/ty/autoderef.rs
crates/ra_hir/src/ty/infer.rs
crates/ra_hir/src/ty/infer/expr.rs
crates/ra_hir/src/ty/traits/chalk.rs
crates/ra_hir/src/type_alias.rs
crates/ra_hir_def/src/hygiene.rs
crates/ra_hir_def/src/lib.rs
crates/ra_hir_def/src/name.rs [deleted file]
crates/ra_hir_def/src/nameres/raw.rs
crates/ra_hir_def/src/path.rs
crates/ra_hir_expand/src/lib.rs
crates/ra_hir_expand/src/name.rs [new file with mode: 0644]

index d16b3a1cced2cac5b62659c2cfcf7fe39c1087c0..97424b39e00da9dd5029ad447745ae680375dca8 100644 (file)
@@ -3,7 +3,8 @@
 
 use std::sync::Arc;
 
-use hir_def::{name::AsName, type_ref::TypeRef};
+use hir_def::type_ref::TypeRef;
+use hir_expand::name::AsName;
 use ra_arena::{impl_arena_id, Arena, RawId};
 use ra_syntax::ast::{self, NameOwner, StructKind, TypeAscriptionOwner};
 
index d865c972e3f957a21f38f95a1e4db085ab36e35c..a6ce23dd10e4f04b0966940f6cd83901e6a5add9 100644 (file)
@@ -6,13 +6,13 @@
 use std::sync::Arc;
 
 use hir_def::{
-    name::{
-        self, AsName, BOOL, CHAR, F32, F64, I128, I16, I32, I64, I8, ISIZE, SELF_TYPE, STR, U128,
-        U16, U32, U64, U8, USIZE,
-    },
     type_ref::{Mutability, TypeRef},
     CrateModuleId, ModuleId,
 };
+use hir_expand::name::{
+    self, AsName, BOOL, CHAR, F32, F64, I128, I16, I32, I64, I8, ISIZE, SELF_TYPE, STR, U128, U16,
+    U32, U64, U8, USIZE,
+};
 use ra_db::{CrateId, Edition};
 use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner};
 
index 575d78198c49ee750926ad6f6ba11e58f8d4d7ea..241ad68fd8b2a7f0edf39051c965cd41b126e294 100644 (file)
@@ -1,11 +1,7 @@
 //! FIXME: write short doc here
 
-use hir_def::{
-    hygiene::Hygiene,
-    name::{self, AsName, Name},
-    path::GenericArgs,
-    type_ref::TypeRef,
-};
+use hir_def::{hygiene::Hygiene, path::GenericArgs, type_ref::TypeRef};
+use hir_expand::name::{self, AsName, Name};
 use ra_arena::Arena;
 use ra_syntax::{
     ast::{
index b9fbaa367f212aa521cd6fec6df20d3e95bd3644..a9de0145538b630aa3dc93fdc7345fb8b19e0089 100644 (file)
@@ -1,6 +1,6 @@
 //! FIXME: write short doc here
 
-use hir_def::name::AsName;
+use hir_expand::name::AsName;
 use ra_syntax::ast::{self, AstNode, NameOwner};
 
 use crate::{
index 9d5d18564838ec13c33ce1179c13831bfb5542f9..52e1fbf2946b121047a93e50230dfb9a11a86583 100644 (file)
@@ -6,10 +6,10 @@
 use std::sync::Arc;
 
 use hir_def::{
-    name::{self, AsName},
     path::Path,
     type_ref::{TypeBound, TypeRef},
 };
+use hir_expand::name::{self, AsName};
 use ra_syntax::ast::{self, DefaultTypeParamOwner, NameOwner, TypeBoundsOwner, TypeParamsOwner};
 
 use crate::{
index 989818c0e9840bfa6b268ebad88e24fda4ac7f1e..603b0c3dc3f16fe32fb428f6f2a840dc02c57163 100644 (file)
@@ -81,8 +81,7 @@ fn from(it: $sv) -> $e {
 };
 
 pub use hir_def::{
-    name::Name,
     path::{Path, PathKind},
     type_ref::Mutability,
 };
-pub use hir_expand::either::Either;
+pub use hir_expand::{either::Either, name::Name};
index 2f342870b136c67457fc64fecc5ea3b3ecf70244..e2e13805acc07a17a32aae199b9807ca284aa6ad 100644 (file)
@@ -1,6 +1,7 @@
 //! FIXME: write short doc here
 
-use hir_def::{attr::Attr, name, nameres::raw};
+use hir_def::{attr::Attr, nameres::raw};
+use hir_expand::name;
 use ra_cfg::CfgOptions;
 use ra_db::FileId;
 use ra_syntax::{ast, SmolStr};
index 2a783b61e3bb3914eeacb903ffcbd71311b30ad9..f77c9df9f0232523b5015822ea56a0874fc36f8f 100644 (file)
@@ -2,10 +2,10 @@
 use std::sync::Arc;
 
 use hir_def::{
-    name::{self, Name},
     path::{Path, PathKind},
     CrateModuleId,
 };
+use hir_expand::name::{self, Name};
 use rustc_hash::FxHashSet;
 
 use crate::{
index 544433a0ab20733e20a544cbe88e291044a2c7a5..01f51ba5d4707e18f4132769372c849819cc1989 100644 (file)
@@ -7,7 +7,8 @@
 //! purely for "IDE needs".
 use std::sync::Arc;
 
-use hir_def::{name::AsName, path::known};
+use hir_def::path::known;
+use hir_expand::name::AsName;
 use ra_db::FileId;
 use ra_syntax::{
     ast::{self, AstNode},
index 514c813ab1c9cdaa1a1f363bcedeeafe46f82d4a..1a45dacba92d837acd0232bab31f263d0005f79d 100644 (file)
@@ -2,7 +2,8 @@
 
 use std::sync::Arc;
 
-use hir_def::name::AsName;
+use hir_expand::name::AsName;
+
 use ra_syntax::ast::{self, NameOwner};
 use rustc_hash::FxHashMap;
 
index 03c45546d2df66b3dc159acf6379b1dce4ed0afc..3645ee831c91113985ea8df816dca03d80af7935 100644 (file)
@@ -5,7 +5,7 @@
 
 use std::iter::successors;
 
-use hir_def::name;
+use hir_expand::name;
 use log::{info, warn};
 
 use super::{traits::Solution, Canonical, Substs, Ty, TypeWalk};
index 7466ee3413890df7f6cdf43dd951fbfe69f787db..6694467a36cbb6df712fd63e22c4d944120358c4 100644 (file)
 use rustc_hash::FxHashMap;
 
 use hir_def::{
-    name,
     path::known,
     type_ref::{Mutability, TypeRef},
 };
+use hir_expand::name;
 use ra_arena::map::ArenaMap;
 use ra_prof::profile;
 use test_utils::tested_by;
index bc6437b4482258f594e3a4aadd3fd1fe5766b8f2..fed52df39cef186978fb4edc18786e8620f150e0 100644 (file)
@@ -3,10 +3,8 @@
 use std::iter::{repeat, repeat_with};
 use std::sync::Arc;
 
-use hir_def::{
-    name,
-    path::{GenericArg, GenericArgs},
-};
+use hir_def::path::{GenericArg, GenericArgs};
+use hir_expand::name;
 
 use super::{BindingMode, Expectation, InferenceContext, InferenceDiagnostic, TypeMismatch};
 use crate::{
index 2dd4c2fae52980d81dac578285f065d232fe5664..39ef9218279e6d7013f499ac38a51c83110754ed 100644 (file)
@@ -9,7 +9,8 @@
 };
 use chalk_rust_ir::{AssociatedTyDatum, ImplDatum, StructDatum, TraitDatum};
 
-use hir_def::name;
+use hir_expand::name;
+
 use ra_db::salsa::{InternId, InternKey};
 
 use super::{Canonical, ChalkContext, Impl, Obligation};
index 87126ee7f412016697896ef0d7c99928ab2b9498..078e6295eaa3f826612957b1f164e63ef2e13034 100644 (file)
@@ -2,10 +2,9 @@
 
 use std::sync::Arc;
 
-use hir_def::{
-    name::{AsName, Name},
-    type_ref::TypeRef,
-};
+use hir_def::type_ref::TypeRef;
+use hir_expand::name::{AsName, Name};
+
 use ra_syntax::ast::NameOwner;
 
 use crate::{
index f51c46fcb86be125a8f4e13e621f1d71c805a8b0..94de2c57c2148a78ab1ae6683026717786765cb9 100644 (file)
@@ -4,13 +4,15 @@
 //! this moment, this is horribly incomplete and handles only `$crate`.
 // Should this be moved to `hir_expand`? Seems like it.
 
-use hir_expand::either::Either;
-use hir_expand::{db::AstDatabase, HirFileId};
+use hir_expand::{
+    db::AstDatabase,
+    either::Either,
+    name::{AsName, Name},
+    HirFileId,
+};
 use ra_db::CrateId;
 use ra_syntax::ast;
 
-use crate::name::{AsName, Name};
-
 #[derive(Debug)]
 pub struct Hygiene {
     // This is what `$crate` expands to
index 0de728dc1a1781f78a59f4f1b9ff40660e129811..5135dda56a211327ce9f0f48919d9ae6723d8346 100644 (file)
@@ -9,7 +9,6 @@
 
 pub mod db;
 pub mod attr;
-pub mod name;
 pub mod path;
 pub mod type_ref;
 pub mod hygiene;
diff --git a/crates/ra_hir_def/src/name.rs b/crates/ra_hir_def/src/name.rs
deleted file mode 100644 (file)
index 720896e..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-//! FIXME: write short doc here
-
-use std::fmt;
-
-use ra_syntax::{ast, SmolStr};
-
-/// `Name` is a wrapper around string, which is used in hir for both references
-/// and declarations. In theory, names should also carry hygiene info, but we are
-/// not there yet!
-#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
-pub struct Name(Repr);
-
-#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
-enum Repr {
-    Text(SmolStr),
-    TupleField(usize),
-}
-
-impl fmt::Display for Name {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        match &self.0 {
-            Repr::Text(text) => fmt::Display::fmt(&text, f),
-            Repr::TupleField(idx) => fmt::Display::fmt(&idx, f),
-        }
-    }
-}
-
-impl Name {
-    /// Note: this is private to make creating name from random string hard.
-    /// Hopefully, this should allow us to integrate hygiene cleaner in the
-    /// future, and to switch to interned representation of names.
-    const fn new_text(text: SmolStr) -> Name {
-        Name(Repr::Text(text))
-    }
-
-    pub fn new_tuple_field(idx: usize) -> Name {
-        Name(Repr::TupleField(idx))
-    }
-
-    /// Shortcut to create inline plain text name
-    const fn new_inline_ascii(len: usize, text: &[u8]) -> Name {
-        Name::new_text(SmolStr::new_inline_from_ascii(len, text))
-    }
-
-    /// Resolve a name from the text of token.
-    fn resolve(raw_text: &SmolStr) -> Name {
-        let raw_start = "r#";
-        if raw_text.as_str().starts_with(raw_start) {
-            Name::new_text(SmolStr::new(&raw_text[raw_start.len()..]))
-        } else {
-            Name::new_text(raw_text.clone())
-        }
-    }
-
-    pub fn missing() -> Name {
-        Name::new_text("[missing name]".into())
-    }
-
-    pub fn as_tuple_index(&self) -> Option<usize> {
-        match self.0 {
-            Repr::TupleField(idx) => Some(idx),
-            _ => None,
-        }
-    }
-}
-
-pub trait AsName {
-    fn as_name(&self) -> Name;
-}
-
-impl AsName for ast::NameRef {
-    fn as_name(&self) -> Name {
-        match self.as_tuple_field() {
-            Some(idx) => Name::new_tuple_field(idx),
-            None => Name::resolve(self.text()),
-        }
-    }
-}
-
-impl AsName for ast::Name {
-    fn as_name(&self) -> Name {
-        Name::resolve(self.text())
-    }
-}
-
-impl AsName for ast::FieldKind {
-    fn as_name(&self) -> Name {
-        match self {
-            ast::FieldKind::Name(nr) => nr.as_name(),
-            ast::FieldKind::Index(idx) => Name::new_tuple_field(idx.text().parse().unwrap()),
-        }
-    }
-}
-
-impl AsName for ra_db::Dependency {
-    fn as_name(&self) -> Name {
-        Name::new_text(self.name.clone())
-    }
-}
-
-// Primitives
-pub const ISIZE: Name = Name::new_inline_ascii(5, b"isize");
-pub const I8: Name = Name::new_inline_ascii(2, b"i8");
-pub const I16: Name = Name::new_inline_ascii(3, b"i16");
-pub const I32: Name = Name::new_inline_ascii(3, b"i32");
-pub const I64: Name = Name::new_inline_ascii(3, b"i64");
-pub const I128: Name = Name::new_inline_ascii(4, b"i128");
-pub const USIZE: Name = Name::new_inline_ascii(5, b"usize");
-pub const U8: Name = Name::new_inline_ascii(2, b"u8");
-pub const U16: Name = Name::new_inline_ascii(3, b"u16");
-pub const U32: Name = Name::new_inline_ascii(3, b"u32");
-pub const U64: Name = Name::new_inline_ascii(3, b"u64");
-pub const U128: Name = Name::new_inline_ascii(4, b"u128");
-pub const F32: Name = Name::new_inline_ascii(3, b"f32");
-pub const F64: Name = Name::new_inline_ascii(3, b"f64");
-pub const BOOL: Name = Name::new_inline_ascii(4, b"bool");
-pub const CHAR: Name = Name::new_inline_ascii(4, b"char");
-pub const STR: Name = Name::new_inline_ascii(3, b"str");
-
-// Special names
-pub const SELF_PARAM: Name = Name::new_inline_ascii(4, b"self");
-pub const SELF_TYPE: Name = Name::new_inline_ascii(4, b"Self");
-pub const MACRO_RULES: Name = Name::new_inline_ascii(11, b"macro_rules");
-
-// Components of known path (value or mod name)
-pub const STD: Name = Name::new_inline_ascii(3, b"std");
-pub const ITER: Name = Name::new_inline_ascii(4, b"iter");
-pub const OPS: Name = Name::new_inline_ascii(3, b"ops");
-pub const FUTURE: Name = Name::new_inline_ascii(6, b"future");
-pub const RESULT: Name = Name::new_inline_ascii(6, b"result");
-pub const BOXED: Name = Name::new_inline_ascii(5, b"boxed");
-
-// Components of known path (type name)
-pub const INTO_ITERATOR_TYPE: Name = Name::new_inline_ascii(12, b"IntoIterator");
-pub const ITEM_TYPE: Name = Name::new_inline_ascii(4, b"Item");
-pub const TRY_TYPE: Name = Name::new_inline_ascii(3, b"Try");
-pub const OK_TYPE: Name = Name::new_inline_ascii(2, b"Ok");
-pub const FUTURE_TYPE: Name = Name::new_inline_ascii(6, b"Future");
-pub const RESULT_TYPE: Name = Name::new_inline_ascii(6, b"Result");
-pub const OUTPUT_TYPE: Name = Name::new_inline_ascii(6, b"Output");
-pub const TARGET_TYPE: Name = Name::new_inline_ascii(6, b"Target");
-pub const BOX_TYPE: Name = Name::new_inline_ascii(3, b"Box");
index f1896c0cc087994037fb7f0b3682dd41b0bba4ac..56831e409fd68c06a79006029b43674896b14c81 100644 (file)
@@ -2,7 +2,12 @@
 
 use std::{ops::Index, sync::Arc};
 
-use hir_expand::{ast_id_map::AstIdMap, db::AstDatabase, either::Either};
+use hir_expand::{
+    ast_id_map::AstIdMap,
+    db::AstDatabase,
+    either::Either,
+    name::{AsName, Name},
+};
 use ra_arena::{impl_arena_id, map::ArenaMap, Arena, RawId};
 use ra_syntax::{
     ast::{self, AttrsOwner, NameOwner},
 };
 
 use crate::{
-    attr::Attr,
-    db::DefDatabase2,
-    hygiene::Hygiene,
-    name::{AsName, Name},
-    path::Path,
-    FileAstId, HirFileId, ModuleSource, Source,
+    attr::Attr, db::DefDatabase2, hygiene::Hygiene, path::Path, FileAstId, HirFileId, ModuleSource,
+    Source,
 };
 
 /// `RawItems` is a set of top-level items in a file (except for impls).
index 8d57e7761623c355dc7b8645f8f3696a7de3eb61..d0b842a6b1b0af851dcbf1362c32dd91816c99a0 100644 (file)
@@ -2,19 +2,17 @@
 
 use std::{iter, sync::Arc};
 
-use hir_expand::either::Either;
+use hir_expand::{
+    either::Either,
+    name::{self, AsName, Name},
+};
 use ra_db::CrateId;
 use ra_syntax::{
     ast::{self, NameOwner, TypeAscriptionOwner},
     AstNode,
 };
 
-use crate::{
-    hygiene::Hygiene,
-    name::{self, AsName, Name},
-    type_ref::TypeRef,
-    Source,
-};
+use crate::{hygiene::Hygiene, type_ref::TypeRef, Source};
 
 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
 pub struct Path {
@@ -392,8 +390,9 @@ fn convert_path(prefix: Option<Path>, path: ast::Path, hygiene: &Hygiene) -> Opt
 }
 
 pub mod known {
+    use hir_expand::name;
+
     use super::{Path, PathKind};
-    use crate::name;
 
     pub fn std_iter_into_iterator() -> Path {
         Path::from_simple_segments(
index 6359b2b4d93bc266675c9ea8bc70ac7ae133a04c..cf28de3d8cc7364493ed76085fafeb82685c68b3 100644 (file)
@@ -7,6 +7,7 @@
 pub mod db;
 pub mod ast_id_map;
 pub mod either;
+pub mod name;
 
 use std::hash::{Hash, Hasher};
 
diff --git a/crates/ra_hir_expand/src/name.rs b/crates/ra_hir_expand/src/name.rs
new file mode 100644 (file)
index 0000000..720896e
--- /dev/null
@@ -0,0 +1,142 @@
+//! FIXME: write short doc here
+
+use std::fmt;
+
+use ra_syntax::{ast, SmolStr};
+
+/// `Name` is a wrapper around string, which is used in hir for both references
+/// and declarations. In theory, names should also carry hygiene info, but we are
+/// not there yet!
+#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
+pub struct Name(Repr);
+
+#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
+enum Repr {
+    Text(SmolStr),
+    TupleField(usize),
+}
+
+impl fmt::Display for Name {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        match &self.0 {
+            Repr::Text(text) => fmt::Display::fmt(&text, f),
+            Repr::TupleField(idx) => fmt::Display::fmt(&idx, f),
+        }
+    }
+}
+
+impl Name {
+    /// Note: this is private to make creating name from random string hard.
+    /// Hopefully, this should allow us to integrate hygiene cleaner in the
+    /// future, and to switch to interned representation of names.
+    const fn new_text(text: SmolStr) -> Name {
+        Name(Repr::Text(text))
+    }
+
+    pub fn new_tuple_field(idx: usize) -> Name {
+        Name(Repr::TupleField(idx))
+    }
+
+    /// Shortcut to create inline plain text name
+    const fn new_inline_ascii(len: usize, text: &[u8]) -> Name {
+        Name::new_text(SmolStr::new_inline_from_ascii(len, text))
+    }
+
+    /// Resolve a name from the text of token.
+    fn resolve(raw_text: &SmolStr) -> Name {
+        let raw_start = "r#";
+        if raw_text.as_str().starts_with(raw_start) {
+            Name::new_text(SmolStr::new(&raw_text[raw_start.len()..]))
+        } else {
+            Name::new_text(raw_text.clone())
+        }
+    }
+
+    pub fn missing() -> Name {
+        Name::new_text("[missing name]".into())
+    }
+
+    pub fn as_tuple_index(&self) -> Option<usize> {
+        match self.0 {
+            Repr::TupleField(idx) => Some(idx),
+            _ => None,
+        }
+    }
+}
+
+pub trait AsName {
+    fn as_name(&self) -> Name;
+}
+
+impl AsName for ast::NameRef {
+    fn as_name(&self) -> Name {
+        match self.as_tuple_field() {
+            Some(idx) => Name::new_tuple_field(idx),
+            None => Name::resolve(self.text()),
+        }
+    }
+}
+
+impl AsName for ast::Name {
+    fn as_name(&self) -> Name {
+        Name::resolve(self.text())
+    }
+}
+
+impl AsName for ast::FieldKind {
+    fn as_name(&self) -> Name {
+        match self {
+            ast::FieldKind::Name(nr) => nr.as_name(),
+            ast::FieldKind::Index(idx) => Name::new_tuple_field(idx.text().parse().unwrap()),
+        }
+    }
+}
+
+impl AsName for ra_db::Dependency {
+    fn as_name(&self) -> Name {
+        Name::new_text(self.name.clone())
+    }
+}
+
+// Primitives
+pub const ISIZE: Name = Name::new_inline_ascii(5, b"isize");
+pub const I8: Name = Name::new_inline_ascii(2, b"i8");
+pub const I16: Name = Name::new_inline_ascii(3, b"i16");
+pub const I32: Name = Name::new_inline_ascii(3, b"i32");
+pub const I64: Name = Name::new_inline_ascii(3, b"i64");
+pub const I128: Name = Name::new_inline_ascii(4, b"i128");
+pub const USIZE: Name = Name::new_inline_ascii(5, b"usize");
+pub const U8: Name = Name::new_inline_ascii(2, b"u8");
+pub const U16: Name = Name::new_inline_ascii(3, b"u16");
+pub const U32: Name = Name::new_inline_ascii(3, b"u32");
+pub const U64: Name = Name::new_inline_ascii(3, b"u64");
+pub const U128: Name = Name::new_inline_ascii(4, b"u128");
+pub const F32: Name = Name::new_inline_ascii(3, b"f32");
+pub const F64: Name = Name::new_inline_ascii(3, b"f64");
+pub const BOOL: Name = Name::new_inline_ascii(4, b"bool");
+pub const CHAR: Name = Name::new_inline_ascii(4, b"char");
+pub const STR: Name = Name::new_inline_ascii(3, b"str");
+
+// Special names
+pub const SELF_PARAM: Name = Name::new_inline_ascii(4, b"self");
+pub const SELF_TYPE: Name = Name::new_inline_ascii(4, b"Self");
+pub const MACRO_RULES: Name = Name::new_inline_ascii(11, b"macro_rules");
+
+// Components of known path (value or mod name)
+pub const STD: Name = Name::new_inline_ascii(3, b"std");
+pub const ITER: Name = Name::new_inline_ascii(4, b"iter");
+pub const OPS: Name = Name::new_inline_ascii(3, b"ops");
+pub const FUTURE: Name = Name::new_inline_ascii(6, b"future");
+pub const RESULT: Name = Name::new_inline_ascii(6, b"result");
+pub const BOXED: Name = Name::new_inline_ascii(5, b"boxed");
+
+// Components of known path (type name)
+pub const INTO_ITERATOR_TYPE: Name = Name::new_inline_ascii(12, b"IntoIterator");
+pub const ITEM_TYPE: Name = Name::new_inline_ascii(4, b"Item");
+pub const TRY_TYPE: Name = Name::new_inline_ascii(3, b"Try");
+pub const OK_TYPE: Name = Name::new_inline_ascii(2, b"Ok");
+pub const FUTURE_TYPE: Name = Name::new_inline_ascii(6, b"Future");
+pub const RESULT_TYPE: Name = Name::new_inline_ascii(6, b"Result");
+pub const OUTPUT_TYPE: Name = Name::new_inline_ascii(6, b"Output");
+pub const TARGET_TYPE: Name = Name::new_inline_ascii(6, b"Target");
+pub const BOX_TYPE: Name = Name::new_inline_ascii(3, b"Box");