about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock16
-rw-r--r--src/librustc/Cargo.toml1
-rw-r--r--src/librustc/ich/impls_hir.rs2
-rw-r--r--src/librustc/middle/lang_items.rs2
-rw-r--r--src/librustc/middle/weak_lang_items.rs4
-rw-r--r--src/librustc_hir/Cargo.toml1
-rw-r--r--src/librustc_hir/lang_items.rs (renamed from src/librustc_lang_items/lang_items.rs)2
-rw-r--r--src/librustc_hir/lib.rs6
-rw-r--r--src/librustc_hir/target.rs (renamed from src/librustc_lang_items/target.rs)4
-rw-r--r--src/librustc_hir/weak_lang_items.rs (renamed from src/librustc_lang_items/weak_lang_items.rs)2
-rw-r--r--src/librustc_lang_items/Cargo.toml18
-rw-r--r--src/librustc_lang_items/lib.rs45
-rw-r--r--src/librustc_passes/Cargo.toml1
-rw-r--r--src/librustc_passes/check_attr.rs2
-rw-r--r--src/librustc_passes/lang_items.rs4
-rw-r--r--src/librustc_passes/weak_lang_items.rs4
16 files changed, 20 insertions, 94 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ca47a110353..ea2dc7f1803 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3100,7 +3100,6 @@ dependencies = [
  "rustc_feature",
  "rustc_hir",
  "rustc_index",
- "rustc_lang_items",
  "rustc_macros",
  "rustc_session",
  "rustc_span",
@@ -3620,6 +3619,7 @@ version = "0.0.0"
 name = "rustc_hir"
 version = "0.0.0"
 dependencies = [
+ "lazy_static 1.4.0",
  "rustc_ast_pretty",
  "rustc_data_structures",
  "rustc_errors",
@@ -3700,19 +3700,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "rustc_lang_items"
-version = "0.0.0"
-dependencies = [
- "lazy_static 1.4.0",
- "rustc_data_structures",
- "rustc_hir",
- "rustc_macros",
- "rustc_span",
- "serialize",
- "syntax",
-]
-
-[[package]]
 name = "rustc_lexer"
 version = "0.1.0"
 dependencies = [
@@ -3865,7 +3852,6 @@ dependencies = [
  "rustc_feature",
  "rustc_hir",
  "rustc_index",
- "rustc_lang_items",
  "rustc_session",
  "rustc_span",
  "rustc_target",
diff --git a/src/librustc/Cargo.toml b/src/librustc/Cargo.toml
index 6cd979b0bab..782c6879ac5 100644
--- a/src/librustc/Cargo.toml
+++ b/src/librustc/Cargo.toml
@@ -24,7 +24,6 @@ rustc_apfloat = { path = "../librustc_apfloat" }
 rustc_attr = { path = "../librustc_attr" }
 rustc_feature = { path = "../librustc_feature" }
 rustc_hir = { path = "../librustc_hir" }
-rustc_lang_items = { path = "../librustc_lang_items" }
 rustc_target = { path = "../librustc_target" }
 rustc_macros = { path = "../librustc_macros" }
 rustc_data_structures = { path = "../librustc_data_structures" }
diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs
index fa50632e9db..1a763e43d55 100644
--- a/src/librustc/ich/impls_hir.rs
+++ b/src/librustc/ich/impls_hir.rs
@@ -107,8 +107,6 @@ impl<'ctx> rustc_hir::HashStableContext for StableHashingContext<'ctx> {
     }
 }
 
-impl<'ctx> rustc_lang_items::HashStableContext for StableHashingContext<'ctx> {}
-
 impl<'a> ToStableHashKey<StableHashingContext<'a>> for DefId {
     type KeyType = DefPathHash;
 
diff --git a/src/librustc/middle/lang_items.rs b/src/librustc/middle/lang_items.rs
index 5f4c5e0b0e3..d9387767655 100644
--- a/src/librustc/middle/lang_items.rs
+++ b/src/librustc/middle/lang_items.rs
@@ -14,7 +14,7 @@ use crate::ty::{self, TyCtxt};
 use rustc_hir::def_id::DefId;
 use rustc_span::Span;
 
-pub use rustc_lang_items::{LangItem, LanguageItems};
+pub use rustc_hir::{LangItem, LanguageItems};
 
 impl<'tcx> TyCtxt<'tcx> {
     /// Returns the `DefId` for a given `LangItem`.
diff --git a/src/librustc/middle/weak_lang_items.rs b/src/librustc/middle/weak_lang_items.rs
index c59c1953111..c04a6f32215 100644
--- a/src/librustc/middle/weak_lang_items.rs
+++ b/src/librustc/middle/weak_lang_items.rs
@@ -2,10 +2,10 @@
 
 use crate::ty::TyCtxt;
 use rustc_hir::def_id::DefId;
-use rustc_lang_items::{lang_items, LangItem};
+use rustc_hir::{lang_items, LangItem};
 use rustc_target::spec::PanicStrategy;
 
-pub use rustc_lang_items::weak_lang_items::link_name;
+pub use rustc_hir::weak_lang_items::link_name;
 
 impl<'tcx> TyCtxt<'tcx> {
     pub fn is_weak_lang_item(&self, item_def_id: DefId) -> bool {
diff --git a/src/librustc_hir/Cargo.toml b/src/librustc_hir/Cargo.toml
index 3ae943a4ce0..cff64132532 100644
--- a/src/librustc_hir/Cargo.toml
+++ b/src/librustc_hir/Cargo.toml
@@ -19,4 +19,5 @@ rustc_span = { path = "../librustc_span" }
 rustc_errors = { path = "../librustc_errors" }
 rustc_serialize = { path = "../libserialize", package = "serialize" }
 syntax = { path = "../libsyntax" }
+lazy_static = "1"
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
diff --git a/src/librustc_lang_items/lang_items.rs b/src/librustc_hir/lang_items.rs
index c98aa70106f..c5bad979f54 100644
--- a/src/librustc_lang_items/lang_items.rs
+++ b/src/librustc_hir/lang_items.rs
@@ -9,11 +9,11 @@
 
 pub use self::LangItem::*;
 
+use crate::def_id::DefId;
 use crate::Target;
 
 use rustc_data_structures::fx::FxHashMap;
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
-use rustc_hir::def_id::DefId;
 use rustc_macros::HashStable_Generic;
 use rustc_span::symbol::{sym, Symbol};
 use rustc_span::Span;
diff --git a/src/librustc_hir/lib.rs b/src/librustc_hir/lib.rs
index e4edd34bd6e..d958dfc681b 100644
--- a/src/librustc_hir/lib.rs
+++ b/src/librustc_hir/lib.rs
@@ -17,9 +17,15 @@ mod hir;
 pub mod hir_id;
 pub mod intravisit;
 pub mod itemlikevisit;
+pub mod lang_items;
 pub mod pat_util;
 pub mod print;
 mod stable_hash_impls;
+mod target;
+pub mod weak_lang_items;
+
 pub use hir::*;
 pub use hir_id::*;
+pub use lang_items::{LangItem, LanguageItems};
 pub use stable_hash_impls::HashStableContext;
+pub use target::{MethodKind, Target};
diff --git a/src/librustc_lang_items/target.rs b/src/librustc_hir/target.rs
index db5e31981c0..501976fc3cb 100644
--- a/src/librustc_lang_items/target.rs
+++ b/src/librustc_hir/target.rs
@@ -4,8 +4,8 @@
 //! conflicts between multiple such attributes attached to the same
 //! item.
 
-use rustc_hir as hir;
-use rustc_hir::{Item, ItemKind, TraitItem, TraitItemKind};
+use crate::hir;
+use crate::{Item, ItemKind, TraitItem, TraitItemKind};
 
 use std::fmt::{self, Display};
 
diff --git a/src/librustc_lang_items/weak_lang_items.rs b/src/librustc_hir/weak_lang_items.rs
index ab2955fb3fc..79182caae8c 100644
--- a/src/librustc_lang_items/weak_lang_items.rs
+++ b/src/librustc_hir/weak_lang_items.rs
@@ -1,9 +1,9 @@
 //! Validity checking for weak lang items
 
+use crate::def_id::DefId;
 use crate::{lang_items, LangItem, LanguageItems};
 
 use rustc_data_structures::fx::FxHashMap;
-use rustc_hir::def_id::DefId;
 use rustc_span::symbol::{sym, Symbol};
 use syntax::ast;
 
diff --git a/src/librustc_lang_items/Cargo.toml b/src/librustc_lang_items/Cargo.toml
deleted file mode 100644
index eddd4fb81dc..00000000000
--- a/src/librustc_lang_items/Cargo.toml
+++ /dev/null
@@ -1,18 +0,0 @@
-[package]
-authors = ["The Rust Project Developers"]
-name = "rustc_lang_items"
-version = "0.0.0"
-edition = "2018"
-
-[lib]
-name = "rustc_lang_items"
-path = "lib.rs"
-
-[dependencies]
-lazy_static = "1"
-rustc_data_structures = { path = "../librustc_data_structures" }
-rustc_hir = { path = "../librustc_hir" }
-rustc_macros = { path = "../librustc_macros" }
-rustc_serialize = { path = "../libserialize", package = "serialize" }
-rustc_span = { path = "../librustc_span" }
-syntax = { path = "../libsyntax" }
diff --git a/src/librustc_lang_items/lib.rs b/src/librustc_lang_items/lib.rs
deleted file mode 100644
index 9bcd54b6cbf..00000000000
--- a/src/librustc_lang_items/lib.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-macro_rules! enum_from_u32 {
-    ($(#[$attr:meta])* pub enum $name:ident {
-        $($variant:ident = $e:expr,)*
-    }) => {
-        $(#[$attr])*
-        pub enum $name {
-            $($variant = $e),*
-        }
-
-        impl $name {
-            pub fn from_u32(u: u32) -> Option<$name> {
-                $(if u == $name::$variant as u32 {
-                    return Some($name::$variant)
-                })*
-                None
-            }
-        }
-    };
-    ($(#[$attr:meta])* pub enum $name:ident {
-        $($variant:ident,)*
-    }) => {
-        $(#[$attr])*
-        pub enum $name {
-            $($variant,)*
-        }
-
-        impl $name {
-            pub fn from_u32(u: u32) -> Option<$name> {
-                $(if u == $name::$variant as u32 {
-                    return Some($name::$variant)
-                })*
-                None
-            }
-        }
-    }
-}
-
-pub mod lang_items;
-mod target;
-pub mod weak_lang_items;
-
-pub use lang_items::{LangItem, LanguageItems};
-pub use target::{MethodKind, Target};
-
-pub trait HashStableContext: rustc_hir::HashStableContext {}
diff --git a/src/librustc_passes/Cargo.toml b/src/librustc_passes/Cargo.toml
index 5ed192c5932..981ef7f8796 100644
--- a/src/librustc_passes/Cargo.toml
+++ b/src/librustc_passes/Cargo.toml
@@ -17,7 +17,6 @@ rustc_errors = { path = "../librustc_errors" }
 rustc_feature = { path = "../librustc_feature" }
 rustc_hir = { path = "../librustc_hir" }
 rustc_index = { path = "../librustc_index" }
-rustc_lang_items = { path = "../librustc_lang_items" }
 rustc_session = { path = "../librustc_session" }
 rustc_target = { path = "../librustc_target" }
 syntax = { path = "../libsyntax" }
diff --git a/src/librustc_passes/check_attr.rs b/src/librustc_passes/check_attr.rs
index 57a21bf716d..d5b0971811e 100644
--- a/src/librustc_passes/check_attr.rs
+++ b/src/librustc_passes/check_attr.rs
@@ -14,7 +14,7 @@ use rustc_hir::def_id::DefId;
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
 use rustc_hir::DUMMY_HIR_ID;
 use rustc_hir::{self, HirId, Item, ItemKind, TraitItem};
-use rustc_lang_items::{MethodKind, Target};
+use rustc_hir::{MethodKind, Target};
 use rustc_session::lint::builtin::{CONFLICTING_REPR_HINTS, UNUSED_ATTRIBUTES};
 use rustc_span::symbol::sym;
 use rustc_span::Span;
diff --git a/src/librustc_passes/lang_items.rs b/src/librustc_passes/lang_items.rs
index ea5ff000512..5f5acc7fdf8 100644
--- a/src/librustc_passes/lang_items.rs
+++ b/src/librustc_passes/lang_items.rs
@@ -16,8 +16,8 @@ use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::def_id::{DefId, LOCAL_CRATE};
 use rustc_hir::itemlikevisit::ItemLikeVisitor;
-use rustc_lang_items::lang_items::{extract, ITEM_REFS};
-use rustc_lang_items::{LangItem, LanguageItems, Target};
+use rustc_hir::lang_items::{extract, ITEM_REFS};
+use rustc_hir::{LangItem, LanguageItems, Target};
 
 use rustc::ty::query::Providers;
 
diff --git a/src/librustc_passes/weak_lang_items.rs b/src/librustc_passes/weak_lang_items.rs
index a579b9354d7..55af4373778 100644
--- a/src/librustc_passes/weak_lang_items.rs
+++ b/src/librustc_passes/weak_lang_items.rs
@@ -10,7 +10,7 @@ use rustc_data_structures::fx::FxHashSet;
 use rustc_errors::struct_span_err;
 use rustc_hir as hir;
 use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
-use rustc_lang_items::weak_lang_items::WEAK_ITEMS_REFS;
+use rustc_hir::weak_lang_items::WEAK_ITEMS_REFS;
 use rustc_span::symbol::Symbol;
 use rustc_span::Span;
 
@@ -95,7 +95,7 @@ impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
     }
 
     fn visit_foreign_item(&mut self, i: &hir::ForeignItem<'_>) {
-        if let Some((lang_item, _)) = rustc_lang_items::lang_items::extract(&i.attrs) {
+        if let Some((lang_item, _)) = hir::lang_items::extract(&i.attrs) {
             self.register(lang_item, i.span);
         }
         intravisit::walk_foreign_item(self, i)