Skip to content

Commit

Permalink
split the metadata code into rustc_metadata
Browse files Browse the repository at this point in the history
tests & rustdoc still broken
  • Loading branch information
arielb1 authored and Ariel Ben-Yehuda committed Nov 26, 2015
1 parent 1430a35 commit 0a8bb4c
Show file tree
Hide file tree
Showing 64 changed files with 629 additions and 908 deletions.
11 changes: 6 additions & 5 deletions mk/crates.mk
Expand Up @@ -57,7 +57,7 @@ TARGET_CRATES := libc std flate arena term \
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
rustc_data_structures rustc_front rustc_platform_intrinsics \
rustc_plugin
rustc_plugin rustc_metadata
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
TOOLS := compiletest rustdoc rustc rustbook error-index-generator

Expand Down Expand Up @@ -88,22 +88,23 @@ DEPS_test := std getopts serialize rbml term native:rust_test_helpers

DEPS_syntax := std term serialize log fmt_macros arena libc rustc_bitflags

DEPS_rustc := syntax flate arena serialize getopts rbml rustc_front\
DEPS_rustc := syntax flate arena serialize getopts rustc_front\
log graphviz rustc_llvm rustc_back rustc_data_structures
DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc
DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax
DEPS_rustc_data_structures := std log serialize
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin

rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \
rustc_metadata
DEPS_rustc_front := std syntax log serialize
DEPS_rustc_lint := rustc log syntax
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
DEPS_rustc_metadata := rustc rustc_front syntax rbml
DEPS_rustc_mir := rustc rustc_front syntax
DEPS_rustc_resolve := rustc rustc_front log syntax
DEPS_rustc_platform_intrinsics := rustc rustc_llvm
DEPS_rustc_plugin := rustc syntax
DEPS_rustc_plugin := rustc rustc_metadata syntax
DEPS_rustc_privacy := rustc rustc_front log syntax
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics
Expand Down
60 changes: 0 additions & 60 deletions src/librustc/diagnostics.rs
Expand Up @@ -1899,51 +1899,6 @@ contain references (with a maximum lifetime of `'a`).
[1]: https://github.com/rust-lang/rfcs/pull/1156
"##,

E0454: r##"
A link name was given with an empty name. Erroneous code example:
```
#[link(name = "")] extern {} // error: #[link(name = "")] given with empty name
```
The rust compiler cannot link to an external library if you don't give it its
name. Example:
```
#[link(name = "some_lib")] extern {} // ok!
```
"##,

E0458: r##"
An unknown "kind" was specified for a link attribute. Erroneous code example:
```
#[link(kind = "wonderful_unicorn")] extern {}
// error: unknown kind: `wonderful_unicorn`
```
Please specify a valid "kind" value, from one of the following:
* static
* dylib
* framework
"##,

E0459: r##"
A link was used without a name parameter. Erroneous code example:
```
#[link(kind = "dylib")] extern {}
// error: #[link(...)] specified without `name = "foo"`
```
Please add the name parameter to allow the rust compiler to find the library
you want. Example:
```
#[link(kind = "dylib", name = "some_lib")] extern {} // ok!
```
"##,

E0493: r##"
A type with a destructor was assigned to an invalid type of variable. Erroneous
code example:
Expand Down Expand Up @@ -2144,20 +2099,6 @@ register_diagnostics! {
E0400, // overloaded derefs are not allowed in constants
E0452, // malformed lint attribute
E0453, // overruled by outer forbid
E0455, // native frameworks are only available on OSX targets
E0456, // plugin `..` is not available for triple `..`
E0457, // plugin `..` only found in rlib format, but must be available...
E0460, // found possibly newer version of crate `..`
E0461, // couldn't find crate `..` with expected target triple ..
E0462, // found staticlib `..` instead of rlib or dylib
E0463, // can't find crate for `..`
E0464, // multiple matching crates for `..`
E0465, // multiple .. candidates for `..` found
E0466, // bad macro import
E0467, // bad macro reexport
E0468, // an `extern crate` loading macros must be at the crate root
E0469, // imported macro not found
E0470, // reexported macro not found
E0471, // constant evaluation error: ..
E0472, // asm! is unsupported on this target
E0473, // dereference of reference outside its lifetime
Expand All @@ -2181,5 +2122,4 @@ register_diagnostics! {
E0491, // in type `..`, reference has a longer lifetime than the data it...
E0492, // cannot borrow a constant which contains interior mutability
E0495, // cannot infer an appropriate lifetime due to conflicting requirements
E0514, // metadata version mismatch
}
2 changes: 1 addition & 1 deletion src/librustc/front/map/definitions.rs
Expand Up @@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use metadata::cstore::LOCAL_CRATE;
use middle::cstore::LOCAL_CRATE;
use middle::def_id::{DefId, DefIndex};
use rustc_data_structures::fnv::FnvHashMap;
use rustc_front::hir;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/front/map/mod.rs
Expand Up @@ -14,8 +14,8 @@ use self::MapEntry::*;
use self::collector::NodeCollector;
pub use self::definitions::{Definitions, DefKey, DefPath, DefPathData, DisambiguatedDefPathData};

use metadata::inline::InlinedItem;
use metadata::inline::InlinedItem as II;
use middle::cstore::InlinedItem;
use middle::cstore::InlinedItem as II;
use middle::def_id::DefId;

use syntax::abi;
Expand Down
5 changes: 1 addition & 4 deletions src/librustc/lib.rs
Expand Up @@ -67,7 +67,6 @@ extern crate rustc_back;
extern crate rustc_front;
extern crate rustc_data_structures;
extern crate serialize;
extern crate rbml;
extern crate collections;
#[macro_use] extern crate log;
#[macro_use] extern crate syntax;
Expand Down Expand Up @@ -101,7 +100,6 @@ pub mod front {
pub mod middle {
pub mod astconv_util;
pub mod expr_use_visitor; // STAGE0: increase glitch immunity
pub mod astencode;
pub mod cfg;
pub mod check_const;
pub mod check_static_recursion;
Expand All @@ -110,6 +108,7 @@ pub mod middle {
pub mod check_no_asm;
pub mod check_rvalues;
pub mod const_eval;
pub mod cstore;
pub mod dataflow;
pub mod dead;
pub mod def;
Expand Down Expand Up @@ -137,8 +136,6 @@ pub mod middle {
pub mod weak_lang_items;
}

pub mod metadata;

pub mod session;

pub mod lint;
Expand Down

0 comments on commit 0a8bb4c

Please sign in to comment.