diff --git a/src/librustc/session/config.rs b/src/librustc/session/config.rs index a415d1f991fcd..d45d6f7964c82 100644 --- a/src/librustc/session/config.rs +++ b/src/librustc/session/config.rs @@ -482,6 +482,7 @@ pub enum CrateType { CrateTypeStaticlib, CrateTypeCdylib, CrateTypeProcMacro, + // Should not be present. CrateTypeMetadata, } @@ -1558,7 +1559,6 @@ pub fn parse_crate_types_from_list(list_list: Vec) -> Result CrateTypeCdylib, "bin" => CrateTypeExecutable, "proc-macro" => CrateTypeProcMacro, - "metadata" => CrateTypeMetadata, _ => { return Err(format!("unknown crate type: `{}`", part)); @@ -1643,7 +1643,7 @@ impl fmt::Display for CrateType { CrateTypeStaticlib => "staticlib".fmt(f), CrateTypeCdylib => "cdylib".fmt(f), CrateTypeProcMacro => "proc-macro".fmt(f), - CrateTypeMetadata => "metadata".fmt(f), + CrateTypeMetadata => unreachable!(), } } } diff --git a/src/test/compile-fail/auxiliary/rmeta_meta.rs b/src/test/compile-fail/auxiliary/rmeta_meta.rs deleted file mode 100644 index 7bd1a96f452d8..0000000000000 --- a/src/test/compile-fail/auxiliary/rmeta_meta.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// no-prefer-dynamic - -#![crate_type="metadata"] - -pub struct Foo { - pub field: i32, -} diff --git a/src/test/compile-fail/auxiliary/rmeta_rlib.rs b/src/test/compile-fail/auxiliary/rmeta_rlib.rs deleted file mode 100644 index 6096c4df05bb0..0000000000000 --- a/src/test/compile-fail/auxiliary/rmeta_rlib.rs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -#![crate_type="rlib"] - -pub struct Foo { - pub field: i32, -} diff --git a/src/test/compile-fail/rmeta-lib-pass.rs b/src/test/compile-fail/rmeta-lib-pass.rs deleted file mode 100644 index f2ac37a2ce9f5..0000000000000 --- a/src/test/compile-fail/rmeta-lib-pass.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:rmeta_rlib.rs -// no-prefer-dynamic -// must-compile-successfully - -// Check that building a metadata crate works with a dependent, rlib crate. -// This is a cfail test since there is no executable to run. - -#![crate_type="metadata"] - -extern crate rmeta_rlib; -use rmeta_rlib::Foo; - -pub fn main() { - let _ = Foo { field: 42 }; -} diff --git a/src/test/compile-fail/rmeta-pass.rs b/src/test/compile-fail/rmeta-pass.rs deleted file mode 100644 index 2c0b6f77c1e08..0000000000000 --- a/src/test/compile-fail/rmeta-pass.rs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:rmeta_meta.rs -// no-prefer-dynamic -// must-compile-successfully - -// Check that building a metadata crate works with a dependent, metadata-only -// crate. -// This is a cfail test since there is no executable to run. - -#![crate_type="metadata"] - -extern crate rmeta_meta; -use rmeta_meta::Foo; - -pub fn main() { - let _ = Foo { field: 42 }; -} diff --git a/src/test/compile-fail/rmeta.rs b/src/test/compile-fail/rmeta.rs deleted file mode 100644 index e81e0541096d6..0000000000000 --- a/src/test/compile-fail/rmeta.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// no-prefer-dynamic - -// Check that building a metadata crate finds an error. - -#![crate_type="metadata"] - -fn main() { - let _ = Foo; //~ ERROR unresolved name `Foo` -} diff --git a/src/test/compile-fail/rmeta_lib.rs b/src/test/compile-fail/rmeta_lib.rs deleted file mode 100644 index 3b7d1f3cc904a..0000000000000 --- a/src/test/compile-fail/rmeta_lib.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:rmeta_meta.rs -// no-prefer-dynamic -// error-pattern: crate `rmeta_meta` required to be available in rlib, but it was not available - -// Check that building a non-metadata crate fails if a dependent crate is -// metadata-only. - -extern crate rmeta_meta; -use rmeta_meta::Foo; - -fn main() { - let _ = Foo { field: 42 }; -} diff --git a/src/test/compile-fail/rmeta_meta_main.rs b/src/test/compile-fail/rmeta_meta_main.rs deleted file mode 100644 index 1c922c281397a..0000000000000 --- a/src/test/compile-fail/rmeta_meta_main.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// aux-build:rmeta_meta.rs -// no-prefer-dynamic - -// Check that building a metadata crate finds an error with a dependent, -// metadata-only crate. - -#![crate_type="metadata"] - -extern crate rmeta_meta; -use rmeta_meta::Foo; - -fn main() { - let _ = Foo { field2: 42 }; //~ ERROR struct `rmeta_meta::Foo` has no field named `field2` -} diff --git a/src/test/run-pass/auxiliary/rmeta_rlib.rs b/src/test/run-pass/auxiliary/rmeta_rlib.rs deleted file mode 100644 index 28c11315fa1cd..0000000000000 --- a/src/test/run-pass/auxiliary/rmeta_rlib.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// no-prefer-dynamic - -#![crate_type="rlib"] -#![crate_name="rmeta_aux"] - -pub struct Foo { - pub field: i32, -} diff --git a/src/test/run-pass/auxiliary/rmeta_rmeta.rs b/src/test/run-pass/auxiliary/rmeta_rmeta.rs deleted file mode 100644 index 394845b66f3d3..0000000000000 --- a/src/test/run-pass/auxiliary/rmeta_rmeta.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// no-prefer-dynamic - -#![crate_type="metadata"] -#![crate_name="rmeta_aux"] - -pub struct Foo { - pub field2: i32, -} diff --git a/src/test/run-pass/rmeta.rs b/src/test/run-pass/rmeta.rs deleted file mode 100644 index 11684d8663af8..0000000000000 --- a/src/test/run-pass/rmeta.rs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2016 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 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Test that using rlibs and rmeta dep crates work together. Specifically, that -// there can be both an rmeta and an rlib file and rustc will prefer the rlib. - -// aux-build:rmeta_rmeta.rs -// aux-build:rmeta_rlib.rs - -extern crate rmeta_aux; -use rmeta_aux::Foo; - -pub fn main() { - let _ = Foo { field: 42 }; -}