]> git.lizzy.rs Git - rust.git/commitdiff
Remove rustc_metadata_utils, which contains only one function
authorbjorn3 <bjorn3@users.noreply.github.com>
Thu, 25 Oct 2018 13:11:59 +0000 (15:11 +0200)
committerbjorn3 <bjorn3@users.noreply.github.com>
Sat, 3 Nov 2018 13:31:09 +0000 (14:31 +0100)
src/Cargo.lock
src/librustc_codegen_utils/Cargo.toml
src/librustc_codegen_utils/lib.rs
src/librustc_codegen_utils/link.rs
src/librustc_metadata/Cargo.toml
src/librustc_metadata/creader.rs
src/librustc_metadata/lib.rs
src/librustc_metadata_utils/Cargo.toml [deleted file]
src/librustc_metadata_utils/lib.rs [deleted file]

index 5a77816c9da27df7ceaa67b1b27f4e8e59e4b7c9..b4317864502cee0fd48979f54fb6f057b47c0bcf 100644 (file)
@@ -2144,7 +2144,7 @@ dependencies = [
  "rustc_allocator 0.0.0",
  "rustc_data_structures 0.0.0",
  "rustc_incremental 0.0.0",
- "rustc_metadata_utils 0.0.0",
+ "rustc_metadata 0.0.0",
  "rustc_mir 0.0.0",
  "rustc_target 0.0.0",
  "serialize 0.0.0",
@@ -2291,7 +2291,6 @@ dependencies = [
  "rustc 0.0.0",
  "rustc_data_structures 0.0.0",
  "rustc_errors 0.0.0",
- "rustc_metadata_utils 0.0.0",
  "rustc_target 0.0.0",
  "serialize 0.0.0",
  "syntax 0.0.0",
@@ -2299,15 +2298,6 @@ dependencies = [
  "syntax_pos 0.0.0",
 ]
 
-[[package]]
-name = "rustc_metadata_utils"
-version = "0.0.0"
-dependencies = [
- "rustc 0.0.0",
- "syntax 0.0.0",
- "syntax_pos 0.0.0",
-]
-
 [[package]]
 name = "rustc_mir"
 version = "0.0.0"
index 3a09e8e4b56066e7d05a36d353a746fe70ba4dfa..4c57e97841409a0d8a344eb797b823ce87177510 100644 (file)
@@ -20,6 +20,6 @@ rustc = { path = "../librustc" }
 rustc_allocator = { path = "../librustc_allocator" }
 rustc_target = { path = "../librustc_target" }
 rustc_data_structures = { path = "../librustc_data_structures" }
+rustc_metadata = { path = "../librustc_metadata" }
 rustc_mir = { path = "../librustc_mir" }
 rustc_incremental = { path = "../librustc_incremental" }
-rustc_metadata_utils = { path = "../librustc_metadata_utils" }
index 89cf19d047216d797cbdd40d793342a7d9e39e56..f0ce1e9b0efab2021377b8f52f57b2e18f724b47 100644 (file)
 extern crate rustc;
 extern crate rustc_allocator;
 extern crate rustc_target;
+extern crate rustc_metadata;
 extern crate rustc_mir;
 extern crate rustc_incremental;
 extern crate syntax;
 extern crate syntax_pos;
 #[macro_use] extern crate rustc_data_structures;
-extern crate rustc_metadata_utils;
 
 use std::path::PathBuf;
 
index 66e98793f420d737954619b61010e4c45648473b..b11aa687326f2536b846d10f79270bf009ab8467 100644 (file)
@@ -13,7 +13,6 @@
 use std::path::{Path, PathBuf};
 use syntax::{ast, attr};
 use syntax_pos::Span;
-use rustc_metadata_utils::validate_crate_name;
 
 pub fn out_filename(sess: &Session,
                 crate_type: config::CrateType,
@@ -52,7 +51,7 @@ pub fn find_crate_name(sess: Option<&Session>,
                        attrs: &[ast::Attribute],
                        input: &Input) -> String {
     let validate = |s: String, span: Option<Span>| {
-        validate_crate_name(sess, &s, span);
+        ::rustc_metadata::validate_crate_name(sess, &s, span);
         s
     };
 
index 6142fe78149ce219c5715d8c43f629d0c07d71a9..338824d5efe4caa862256121941b11a7e38bdbce 100644 (file)
@@ -20,4 +20,3 @@ serialize = { path = "../libserialize" }
 syntax = { path = "../libsyntax" }
 syntax_ext = { path = "../libsyntax_ext" }
 syntax_pos = { path = "../libsyntax_pos" }
-rustc_metadata_utils = { path = "../librustc_metadata_utils" }
index 4b96735eb77b4945f13bf2f5769f1ea5cb0206cc..7733ab2e246d1135fa3fac808b73ce98c0375852 100644 (file)
@@ -30,8 +30,6 @@
 use rustc::util::nodemap::FxHashSet;
 use rustc::hir::map::Definitions;
 
-use rustc_metadata_utils::validate_crate_name;
-
 use std::ops::Deref;
 use std::path::PathBuf;
 use std::{cmp, fs};
@@ -1106,7 +1104,7 @@ pub fn process_extern_crate(
                        item.ident, orig_name);
                 let orig_name = match orig_name {
                     Some(orig_name) => {
-                        validate_crate_name(Some(self.sess), &orig_name.as_str(),
+                        ::validate_crate_name(Some(self.sess), &orig_name.as_str(),
                                             Some(item.span));
                         orig_name
                     }
index 7008166b9035d7248c9f29997315a768c97e1a3a..0cc0707a3a51f263bcdf0f5ca347ed71c41f56af 100644 (file)
@@ -38,7 +38,6 @@
 extern crate rustc_errors as errors;
 extern crate syntax_ext;
 extern crate proc_macro;
-extern crate rustc_metadata_utils;
 
 #[macro_use]
 extern crate rustc;
 pub mod dynamic_lib;
 pub mod locator;
 
+pub fn validate_crate_name(
+    sess: Option<&rustc::session::Session>,
+    s: &str,
+    sp: Option<syntax_pos::Span>
+) {
+    let mut err_count = 0;
+    {
+        let mut say = |s: &str| {
+            match (sp, sess) {
+                (_, None) => bug!("{}", s),
+                (Some(sp), Some(sess)) => sess.span_err(sp, s),
+                (None, Some(sess)) => sess.err(s),
+            }
+            err_count += 1;
+        };
+        if s.is_empty() {
+            say("crate name must not be empty");
+        }
+        for c in s.chars() {
+            if c.is_alphanumeric() { continue }
+            if c == '_'  { continue }
+            say(&format!("invalid character `{}` in crate name: `{}`", c, s));
+        }
+    }
+
+    if err_count > 0 {
+        sess.unwrap().abort_if_errors();
+    }
+}
+
 __build_diagnostic_array! { librustc_metadata, DIAGNOSTICS }
diff --git a/src/librustc_metadata_utils/Cargo.toml b/src/librustc_metadata_utils/Cargo.toml
deleted file mode 100644 (file)
index 4a5e203..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-[package]
-authors = ["The Rust Project Developers"]
-name = "rustc_metadata_utils"
-version = "0.0.0"
-
-[lib]
-name = "rustc_metadata_utils"
-path = "lib.rs"
-crate-type = ["dylib"]
-
-[dependencies]
-rustc = { path = "../librustc" }
-syntax = { path = "../libsyntax" }
-syntax_pos = { path = "../libsyntax_pos" }
diff --git a/src/librustc_metadata_utils/lib.rs b/src/librustc_metadata_utils/lib.rs
deleted file mode 100644 (file)
index a1e5150..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#[macro_use]
-extern crate rustc;
-extern crate syntax_pos;
-
-use rustc::session::Session;
-use syntax_pos::Span;
-
-pub fn validate_crate_name(sess: Option<&Session>, s: &str, sp: Option<Span>) {
-    let mut err_count = 0;
-    {
-        let mut say = |s: &str| {
-            match (sp, sess) {
-                (_, None) => bug!("{}", s),
-                (Some(sp), Some(sess)) => sess.span_err(sp, s),
-                (None, Some(sess)) => sess.err(s),
-            }
-            err_count += 1;
-        };
-        if s.is_empty() {
-            say("crate name must not be empty");
-        }
-        for c in s.chars() {
-            if c.is_alphanumeric() { continue }
-            if c == '_'  { continue }
-            say(&format!("invalid character `{}` in crate name: `{}`", c, s));
-        }
-    }
-
-    if err_count > 0 {
-        sess.unwrap().abort_if_errors();
-    }
-}