diff options
| author | David Wood <david@davidtw.co> | 2018-08-08 14:50:16 +0200 |
|---|---|---|
| committer | David Wood <david@davidtw.co> | 2018-08-14 11:12:09 +0200 |
| commit | 3fc7ab237314a4ce85e612b4ce590c27f1425291 (patch) | |
| tree | c775f852e05e1272032cb053ee347315c973c7b5 /src/test/ui/auxiliary | |
| parent | 3e0a4079884eab5b54489c92f7428cda2797ea5c (diff) | |
| download | rust-3fc7ab237314a4ce85e612b4ce590c27f1425291.tar.gz rust-3fc7ab237314a4ce85e612b4ce590c27f1425291.zip | |
Merged migrated compile-fail tests and ui tests. Fixes #46841.
Diffstat (limited to 'src/test/ui/auxiliary')
31 files changed, 164 insertions, 539 deletions
diff --git a/src/test/ui/auxiliary/issue-36708.rs b/src/test/ui/auxiliary/cdylib-dep.rs index e64e63a2139..a3d0222a14c 100644 --- a/src/test/ui/auxiliary/issue-36708.rs +++ b/src/test/ui/auxiliary/cdylib-dep.rs @@ -8,8 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_type = "lib"] - -pub trait Foo { - fn foo(); -} +#![crate_type = "dylib"] diff --git a/src/test/ui/auxiliary/coherence_lib.rs b/src/test/ui/auxiliary/crateresolve1-1.rs index daa123849e4..050f2fe7329 100644 --- a/src/test/ui/auxiliary/coherence_lib.rs +++ b/src/test/ui/auxiliary/crateresolve1-1.rs @@ -8,18 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_type="lib"] +// compile-flags:-C extra-filename=-1 +#![crate_name = "crateresolve1"] +#![crate_type = "lib"] -pub trait Remote { - fn foo(&self) { } -} - -pub trait Remote1<T> { - fn foo(&self, t: T) { } -} - -pub trait Remote2<T, U> { - fn foo(&self, t: T, u: U) { } -} - -pub struct Pair<T,U>(T,U); +pub fn f() -> isize { 10 } diff --git a/src/test/ui/auxiliary/crateresolve1-2.rs b/src/test/ui/auxiliary/crateresolve1-2.rs new file mode 100644 index 00000000000..d19b3bafba5 --- /dev/null +++ b/src/test/ui/auxiliary/crateresolve1-2.rs @@ -0,0 +1,15 @@ +// Copyright 2012 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. + +// compile-flags:-C extra-filename=-2 +#![crate_name = "crateresolve1"] +#![crate_type = "lib"] + +pub fn f() -> isize { 20 } diff --git a/src/test/ui/auxiliary/crateresolve1-3.rs b/src/test/ui/auxiliary/crateresolve1-3.rs new file mode 100644 index 00000000000..c5096ac49a8 --- /dev/null +++ b/src/test/ui/auxiliary/crateresolve1-3.rs @@ -0,0 +1,15 @@ +// Copyright 2012 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. + +// compile-flags:-C extra-filename=-3 +#![crate_name = "crateresolve1"] +#![crate_type = "lib"] + +pub fn f() -> isize { 30 } diff --git a/src/test/ui/auxiliary/default_ty_param_cross_crate_crate.rs b/src/test/ui/auxiliary/default_ty_param_cross_crate_crate.rs new file mode 100644 index 00000000000..4bd8ecacb96 --- /dev/null +++ b/src/test/ui/auxiliary/default_ty_param_cross_crate_crate.rs @@ -0,0 +1,20 @@ +// Copyright 2015 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. + +#![crate_type = "lib"] +#![crate_name = "default_param_test"] +#![feature(default_type_parameter_fallback)] + +use std::marker::PhantomData; + +pub struct Foo<A, B>(PhantomData<(A, B)>); + +pub fn bleh<A=i32, X=char>() -> Foo<A, X> { Foo(PhantomData) } + diff --git a/src/test/ui/auxiliary/inference_unstable_itertools.rs b/src/test/ui/auxiliary/define_macro.rs index 2ad264ee3d8..6b6b14a896b 100644 --- a/src/test/ui/auxiliary/inference_unstable_itertools.rs +++ b/src/test/ui/auxiliary/define_macro.rs @@ -1,4 +1,4 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// 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. // @@ -8,10 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub trait IpuItertools { - fn ipu_flatten(&self) -> u32 { - 1 +#[macro_export] +macro_rules! define_macro { + ($i:ident) => { + macro_rules! $i { () => {} } } } - -impl IpuItertools for char {} diff --git a/src/test/ui/auxiliary/edition-kw-macro-2015.rs b/src/test/ui/auxiliary/edition-kw-macro-2015.rs deleted file mode 100644 index 8f80e000e3c..00000000000 --- a/src/test/ui/auxiliary/edition-kw-macro-2015.rs +++ /dev/null @@ -1,39 +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. - -// edition:2015 - -#![feature(raw_identifiers)] -#![allow(async_idents)] - -#[macro_export] -macro_rules! produces_async { - () => (pub fn async() {}) -} - -#[macro_export] -macro_rules! produces_async_raw { - () => (pub fn r#async() {}) -} - -#[macro_export] -macro_rules! consumes_async { - (async) => (1) -} - -#[macro_export] -macro_rules! consumes_async_raw { - (r#async) => (1) -} - -#[macro_export] -macro_rules! passes_ident { - ($i: ident) => ($i) -} diff --git a/src/test/ui/auxiliary/edition-kw-macro-2018.rs b/src/test/ui/auxiliary/edition-kw-macro-2018.rs deleted file mode 100644 index 85ef15858fe..00000000000 --- a/src/test/ui/auxiliary/edition-kw-macro-2018.rs +++ /dev/null @@ -1,38 +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. - -// edition:2018 - -#![allow(async_idents)] - -#[macro_export] -macro_rules! produces_async { - () => (pub fn async() {}) -} - -#[macro_export] -macro_rules! produces_async_raw { - () => (pub fn r#async() {}) -} - -#[macro_export] -macro_rules! consumes_async { - (async) => (1) -} - -#[macro_export] -macro_rules! consumes_async_raw { - (r#async) => (1) -} - -#[macro_export] -macro_rules! passes_ident { - ($i: ident) => ($i) -} diff --git a/src/test/ui/auxiliary/m1.rs b/src/test/ui/auxiliary/extern-statics.rs index b61667cfd88..07f70b177b3 100644 --- a/src/test/ui/auxiliary/m1.rs +++ b/src/test/ui/auxiliary/extern-statics.rs @@ -1,4 +1,4 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// 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. // @@ -8,4 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn foo() {} +extern { + pub static XA: u8; + pub static mut XB: u8; +} diff --git a/src/test/ui/auxiliary/inference_unstable_iterator.rs b/src/test/ui/auxiliary/inference_unstable_iterator.rs deleted file mode 100644 index b73346e6332..00000000000 --- a/src/test/ui/auxiliary/inference_unstable_iterator.rs +++ /dev/null @@ -1,24 +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. - -#![feature(staged_api)] - -#![stable(feature = "ipu_iterator", since = "1.0.0")] - -#[stable(feature = "ipu_iterator", since = "1.0.0")] -pub trait IpuIterator { - #[unstable(feature = "ipu_flatten", issue = "99999")] - fn ipu_flatten(&self) -> u32 { - 0 - } -} - -#[stable(feature = "ipu_iterator", since = "1.0.0")] -impl IpuIterator for char {} diff --git a/src/test/ui/auxiliary/lint_output_format.rs b/src/test/ui/auxiliary/lint_output_format.rs deleted file mode 100644 index 6ba66f3e45f..00000000000 --- a/src/test/ui/auxiliary/lint_output_format.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2014 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. - -#![crate_name="lint_output_format"] -#![crate_type = "lib"] -#![feature(staged_api)] -#![unstable(feature = "unstable_test_feature", issue = "0")] - -#[stable(feature = "stable_test_feature", since = "1.0.0")] -#[rustc_deprecated(since = "1.0.0", reason = "text")] -pub fn foo() -> usize { - 20 -} - -#[unstable(feature = "unstable_test_feature", issue = "0")] -pub fn bar() -> usize { - 40 -} - -#[unstable(feature = "unstable_test_feature", issue = "0")] -pub fn baz() -> usize { - 30 -} diff --git a/src/test/ui/auxiliary/xcrate_issue_43189_a.rs b/src/test/ui/auxiliary/lto-duplicate-symbols1.rs index 95b2d62e426..ea09327bd19 100644 --- a/src/test/ui/auxiliary/xcrate_issue_43189_a.rs +++ b/src/test/ui/auxiliary/lto-duplicate-symbols1.rs @@ -8,10 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_type="lib"] +// no-prefer-dynamic +#![crate_type = "rlib"] -pub trait A { - fn a(&self) {} -} -impl A for () {} +#[no_mangle] +pub extern fn foo() {} diff --git a/src/test/ui/auxiliary/xcrate_issue_43189_b.rs b/src/test/ui/auxiliary/lto-duplicate-symbols2.rs index a396c31e21d..ea09327bd19 100644 --- a/src/test/ui/auxiliary/xcrate_issue_43189_b.rs +++ b/src/test/ui/auxiliary/lto-duplicate-symbols2.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_type="lib"] +// no-prefer-dynamic -pub extern crate xcrate_issue_43189_a; +#![crate_type = "rlib"] + +#[no_mangle] +pub extern fn foo() {} diff --git a/src/test/ui/auxiliary/struct_field_privacy.rs b/src/test/ui/auxiliary/namespaced_enums.rs index 5fea97da03e..3bf39b788db 100644 --- a/src/test/ui/auxiliary/struct_field_privacy.rs +++ b/src/test/ui/auxiliary/namespaced_enums.rs @@ -8,12 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub struct A { - a: isize, - pub b: isize, +pub enum Foo { + A, + B(isize), + C { a: isize }, } -pub struct B { - pub a: isize, - b: isize, +impl Foo { + pub fn foo() {} + pub fn bar(&self) {} } diff --git a/src/test/ui/auxiliary/m2.rs b/src/test/ui/auxiliary/noexporttypelib.rs index 94ff5e4497f..5ae8e0d298e 100644 --- a/src/test/ui/auxiliary/m2.rs +++ b/src/test/ui/auxiliary/noexporttypelib.rs @@ -1,4 +1,4 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,4 +8,5 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn bar() {} +pub type oint = Option<isize>; +pub fn foo() -> oint { Some(3) } diff --git a/src/test/ui/auxiliary/two_macros.rs b/src/test/ui/auxiliary/orphan_check_diagnostics.rs index 060960f0dbc..cf3e9903b5a 100644 --- a/src/test/ui/auxiliary/two_macros.rs +++ b/src/test/ui/auxiliary/orphan_check_diagnostics.rs @@ -8,8 +8,4 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[macro_export] -macro_rules! macro_one { () => ("one") } - -#[macro_export] -macro_rules! macro_two { () => ("two") } +pub trait RemoteTrait { fn dummy(&self) { } } diff --git a/src/test/ui/auxiliary/cfg-target-thread-local.rs b/src/test/ui/auxiliary/rmeta_meta.rs index d1971a5e1ae..4207fc2373b 100644 --- a/src/test/ui/auxiliary/cfg-target-thread-local.rs +++ b/src/test/ui/auxiliary/rmeta_meta.rs @@ -8,10 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(thread_local)] -#![feature(cfg_target_thread_local)] -#![crate_type = "lib"] +// no-prefer-dynamic +// compile-flags: --emit=metadata -#[no_mangle] -#[cfg_attr(target_thread_local, thread_local)] -pub static FOO: u32 = 3; +#![crate_type="rlib"] + +pub struct Foo { + pub field: i32, +} diff --git a/src/test/ui/auxiliary/xcrate_issue_46112_rexport_core.rs b/src/test/ui/auxiliary/rmeta_rlib.rs index 80f877f834d..6096c4df05b 100644 --- a/src/test/ui/auxiliary/xcrate_issue_46112_rexport_core.rs +++ b/src/test/ui/auxiliary/rmeta_rlib.rs @@ -1,4 +1,4 @@ -// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// 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. // @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![crate_type="lib"] +#![crate_type="rlib"] -pub extern crate core; +pub struct Foo { + pub field: i32, +} diff --git a/src/test/ui/auxiliary/macro-in-other-crate.rs b/src/test/ui/auxiliary/stability_cfg2.rs index c787cedc2d0..a59f4b4e8f4 100644 --- a/src/test/ui/auxiliary/macro-in-other-crate.rs +++ b/src/test/ui/auxiliary/stability_cfg2.rs @@ -1,4 +1,4 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // @@ -8,12 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#[macro_export] -macro_rules! mac { - ($ident:ident) => { let $ident = 42; } -} +// compile-flags:--cfg foo -#[macro_export] -macro_rules! inline { - () => () -} +#![cfg_attr(foo, unstable(feature = "unstable_test_feature", issue = "0"))] +#![cfg_attr(not(foo), stable(feature = "test_feature", since = "1.0.0"))] +#![feature(staged_api)] diff --git a/src/test/ui/auxiliary/svh-a-base.rs b/src/test/ui/auxiliary/svh-a-base.rs deleted file mode 100644 index 31a97f695f0..00000000000 --- a/src/test/ui/auxiliary/svh-a-base.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 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. - -//! The `svh-a-*.rs` files are all deviations from the base file -//! svh-a-base.rs with some difference (usually in `fn foo`) that -//! should not affect the strict version hash (SVH) computation -//! (#14132). - -#![crate_name = "a"] - -macro_rules! three { - () => { 3 } -} - -pub trait U {} -pub trait V {} -impl U for () {} -impl V for () {} - -static A_CONSTANT : isize = 2; - -pub fn foo<T:U>(_: isize) -> isize { - 3 -} - -pub fn an_unused_name() -> isize { - 4 -} diff --git a/src/test/ui/auxiliary/svh-a-change-lit.rs b/src/test/ui/auxiliary/svh-a-change-lit.rs deleted file mode 100644 index 5339fc8295c..00000000000 --- a/src/test/ui/auxiliary/svh-a-change-lit.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 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. - -//! The `svh-a-*.rs` files are all deviations from the base file -//! svh-a-base.rs with some difference (usually in `fn foo`) that -//! should not affect the strict version hash (SVH) computation -//! (#14132). - -#![crate_name = "a"] - -macro_rules! three { - () => { 3 } -} - -pub trait U {} -pub trait V {} -impl U for () {} -impl V for () {} - -static A_CONSTANT : isize = 2; - -pub fn foo<T:U>(_: isize) -> isize { - 0 -} - -pub fn an_unused_name() -> isize { - 4 -} diff --git a/src/test/ui/auxiliary/svh-a-change-significant-cfg.rs b/src/test/ui/auxiliary/svh-a-change-significant-cfg.rs deleted file mode 100644 index 2a5d9446f87..00000000000 --- a/src/test/ui/auxiliary/svh-a-change-significant-cfg.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2014 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. - -//! The `svh-a-*.rs` files are all deviations from the base file -//! svh-a-base.rs with some difference (usually in `fn foo`) that -//! should not affect the strict version hash (SVH) computation -//! (#14132). - -#![crate_name = "a"] - -macro_rules! three { - () => { 3 } -} - -pub trait U {} -pub trait V {} -impl U for () {} -impl V for () {} - -static A_CONSTANT : isize = 2; - -#[cfg(some_flag)] -pub fn foo<T:U>(_: isize) -> isize { - 3 -} - -#[cfg(not(some_flag))] -pub fn an_unused_name() -> isize { - 4 -} diff --git a/src/test/ui/auxiliary/svh-a-change-trait-bound.rs b/src/test/ui/auxiliary/svh-a-change-trait-bound.rs deleted file mode 100644 index 61f2f2803ab..00000000000 --- a/src/test/ui/auxiliary/svh-a-change-trait-bound.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 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. - -//! The `svh-a-*.rs` files are all deviations from the base file -//! svh-a-base.rs with some difference (usually in `fn foo`) that -//! should not affect the strict version hash (SVH) computation -//! (#14132). - -#![crate_name = "a"] - -macro_rules! three { - () => { 3 } -} - -pub trait U {} -pub trait V {} -impl U for () {} -impl V for () {} - -static A_CONSTANT : isize = 2; - -pub fn foo<T:V>(_: isize) -> isize { - 3 -} - -pub fn an_unused_name() -> isize { - 4 -} diff --git a/src/test/ui/auxiliary/svh-a-change-type-arg.rs b/src/test/ui/auxiliary/svh-a-change-type-arg.rs deleted file mode 100644 index 270ce95be2b..00000000000 --- a/src/test/ui/auxiliary/svh-a-change-type-arg.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 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. - -//! The `svh-a-*.rs` files are all deviations from the base file -//! svh-a-base.rs with some difference (usually in `fn foo`) that -//! should not affect the strict version hash (SVH) computation -//! (#14132). - -#![crate_name = "a"] - -macro_rules! three { - () => { 3 } -} - -pub trait U {} -pub trait V {} -impl U for () {} -impl V for () {} - -static A_CONSTANT : isize = 2; - -pub fn foo<T:U>(_: i32) -> isize { - 3 -} - -pub fn an_unused_name() -> isize { - 4 -} diff --git a/src/test/ui/auxiliary/svh-a-change-type-ret.rs b/src/test/ui/auxiliary/svh-a-change-type-ret.rs deleted file mode 100644 index de4cc85a7dc..00000000000 --- a/src/test/ui/auxiliary/svh-a-change-type-ret.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 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. - -//! The `svh-a-*.rs` files are all deviations from the base file -//! svh-a-base.rs with some difference (usually in `fn foo`) that -//! should not affect the strict version hash (SVH) computation -//! (#14132). - -#![crate_name = "a"] - -macro_rules! three { - () => { 3 } -} - -pub trait U {} -pub trait V {} -impl U for () {} -impl V for () {} - -static A_CONSTANT : isize = 2; - -pub fn foo<T:U>(_: isize) -> i64 { - 3 -} - -pub fn an_unused_name() -> i32 { - 4 -} diff --git a/src/test/ui/auxiliary/svh-a-change-type-static.rs b/src/test/ui/auxiliary/svh-a-change-type-static.rs deleted file mode 100644 index 0d4c76abb10..00000000000 --- a/src/test/ui/auxiliary/svh-a-change-type-static.rs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2014 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. - -//! The `svh-a-*.rs` files are all deviations from the base file -//! svh-a-base.rs with some difference (usually in `fn foo`) that -//! should not affect the strict version hash (SVH) computation -//! (#14132). - -#![crate_name = "a"] - -macro_rules! three { - () => { 3 } -} - -pub trait U {} -pub trait V {} -impl U for () {} -impl V for () {} - -static A_CONSTANT : i32 = 2; - -pub fn foo<T:U>(_: isize) -> isize { - 3 -} - -pub fn an_unused_name() -> isize { - 4 -} diff --git a/src/test/ui/auxiliary/svh-b.rs b/src/test/ui/auxiliary/svh-b.rs deleted file mode 100644 index b8946fdc995..00000000000 --- a/src/test/ui/auxiliary/svh-b.rs +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2014 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. - -//! This is a client of the `a` crate defined in "svn-a-base.rs". The -//! rpass and cfail tests (such as "run-pass/svh-add-comment.rs") use -//! it by swapping in a different object code library crate built from -//! some variant of "svn-a-base.rs", and then we are checking if the -//! compiler properly ignores or accepts the change, based on whether -//! the change could affect the downstream crate content or not -//! (#14132). - -#![crate_name = "b"] - -extern crate a; - -pub fn foo() { assert_eq!(a::foo::<()>(0), 3); } diff --git a/src/test/ui/auxiliary/svh-uta-base.rs b/src/test/ui/auxiliary/svh-uta-base.rs deleted file mode 100644 index 6bd3ddab06c..00000000000 --- a/src/test/ui/auxiliary/svh-uta-base.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014 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. - -//! "compile-fail/svh-uta-trait.rs" is checking that we detect a -//! change from `use foo::TraitB` to use `foo::TraitB` in the hash -//! (SVH) computation (#14132), since that will affect method -//! resolution. -//! -//! This is the upstream crate. - -#![crate_name = "uta"] - -mod traits { - pub trait TraitA { fn val(&self) -> isize { 2 } } - pub trait TraitB { fn val(&self) -> isize { 3 } } -} - -impl traits::TraitA for () {} -impl traits::TraitB for () {} - -pub fn foo<T>(_: isize) -> isize { - use traits::TraitA; - let v = (); - v.val() -} diff --git a/src/test/ui/auxiliary/svh-uta-change-use-trait.rs b/src/test/ui/auxiliary/svh-uta-change-use-trait.rs deleted file mode 100644 index e8634168177..00000000000 --- a/src/test/ui/auxiliary/svh-uta-change-use-trait.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2014 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. - -//! "compile-fail/svh-uta-trait.rs" is checking that we detect a -//! change from `use foo::TraitB` to use `foo::TraitB` in the hash -//! (SVH) computation (#14132), since that will affect method -//! resolution. -//! -//! This is the upstream crate. - -#![crate_name = "uta"] - -mod traits { - pub trait TraitA { fn val(&self) -> isize { 2 } } - pub trait TraitB { fn val(&self) -> isize { 3 } } -} - -impl traits::TraitA for () {} -impl traits::TraitB for () {} - -pub fn foo<T>(_: isize) -> isize { - use traits::TraitB; - let v = (); - v.val() -} diff --git a/src/test/ui/auxiliary/svh-utb.rs b/src/test/ui/auxiliary/weak-lang-items.rs index eb3da985242..6434e62b6f7 100644 --- a/src/test/ui/auxiliary/svh-utb.rs +++ b/src/test/ui/auxiliary/weak-lang-items.rs @@ -8,15 +8,25 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -//! "compile-fail/svh-uta-trait.rs" is checking that we detect a -//! change from `use foo::TraitB` to use `foo::TraitB` in the hash -//! (SVH) computation (#14132), since that will affect method -//! resolution. -//! -//! This is the downstream crate. +// no-prefer-dynamic -#![crate_name = "utb"] +// This aux-file will require the eh_personality function to be codegen'd, but +// it hasn't been defined just yet. Make sure we don't explode. -extern crate uta; +#![no_std] +#![crate_type = "rlib"] -pub fn foo() { assert_eq!(uta::foo::<()>(0), 3); } +struct A; + +impl core::ops::Drop for A { + fn drop(&mut self) {} +} + +pub fn foo() { + let _a = A; + panic!("wut"); +} + +mod std { + pub use core::{option, fmt}; +} diff --git a/src/test/ui/auxiliary/xc_private_method_lib.rs b/src/test/ui/auxiliary/xc_private_method_lib.rs new file mode 100644 index 00000000000..5e7bc61943b --- /dev/null +++ b/src/test/ui/auxiliary/xc_private_method_lib.rs @@ -0,0 +1,43 @@ +// Copyright 2014 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. + +#![crate_type="lib"] + +pub struct Struct { + pub x: isize +} + +impl Struct { + fn static_meth_struct() -> Struct { + Struct { x: 1 } + } + + fn meth_struct(&self) -> isize { + self.x + } +} + +pub enum Enum { + Variant1(isize), + Variant2(isize) +} + +impl Enum { + fn static_meth_enum() -> Enum { + Enum::Variant2(10) + } + + fn meth_enum(&self) -> isize { + match *self { + Enum::Variant1(x) | + Enum::Variant2(x) => x + } + } +} |
