diff --git a/tests/ui/issues/issue-18611.rs b/tests/ui/associated-types/assoc-type-unsatisfied-bound.rs similarity index 71% rename from tests/ui/issues/issue-18611.rs rename to tests/ui/associated-types/assoc-type-unsatisfied-bound.rs index 57da57d83537c..76a93eed7b663 100644 --- a/tests/ui/issues/issue-18611.rs +++ b/tests/ui/associated-types/assoc-type-unsatisfied-bound.rs @@ -1,3 +1,5 @@ +//! Regression test for . + fn add_state(op: ::State) { //~^ ERROR `isize: HasState` is not satisfied //~| ERROR `isize: HasState` is not satisfied diff --git a/tests/ui/issues/issue-18611.stderr b/tests/ui/associated-types/assoc-type-unsatisfied-bound.stderr similarity index 81% rename from tests/ui/issues/issue-18611.stderr rename to tests/ui/associated-types/assoc-type-unsatisfied-bound.stderr index 4fa699de63527..3e318fcac503a 100644 --- a/tests/ui/issues/issue-18611.stderr +++ b/tests/ui/associated-types/assoc-type-unsatisfied-bound.stderr @@ -1,23 +1,23 @@ error[E0277]: the trait bound `isize: HasState` is not satisfied - --> $DIR/issue-18611.rs:1:18 + --> $DIR/assoc-type-unsatisfied-bound.rs:3:18 | LL | fn add_state(op: ::State) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize` | help: this trait has no implementations, consider adding one - --> $DIR/issue-18611.rs:6:1 + --> $DIR/assoc-type-unsatisfied-bound.rs:8:1 | LL | trait HasState { | ^^^^^^^^^^^^^^ error[E0277]: the trait bound `isize: HasState` is not satisfied - --> $DIR/issue-18611.rs:1:18 + --> $DIR/assoc-type-unsatisfied-bound.rs:3:18 | LL | fn add_state(op: ::State) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasState` is not implemented for `isize` | help: this trait has no implementations, consider adding one - --> $DIR/issue-18611.rs:6:1 + --> $DIR/assoc-type-unsatisfied-bound.rs:8:1 | LL | trait HasState { | ^^^^^^^^^^^^^^ diff --git a/tests/ui/box/box-deref-match-arm.rs b/tests/ui/box/box-deref-match-arm.rs new file mode 100644 index 0000000000000..621a577afa580 --- /dev/null +++ b/tests/ui/box/box-deref-match-arm.rs @@ -0,0 +1,19 @@ +//! Regression test for . +//! +//! This used to generate invalid IR in that even if we took the +//! `false` branch we'd still try to free the Box from the other +//! arm. This was due to treating `*Box::new(9)` as an rvalue datum +//! instead of as a place. + +//@ run-pass + +fn test(foo: bool) -> u8 { + match foo { + true => *Box::new(9), + false => 0 + } +} + +fn main() { + assert_eq!(9, test(true)); +} diff --git a/tests/ui/issues/auxiliary/issue-18501.rs b/tests/ui/cross-crate/auxiliary/inline-fn-with-trait-method-as-value.rs similarity index 74% rename from tests/ui/issues/auxiliary/issue-18501.rs rename to tests/ui/cross-crate/auxiliary/inline-fn-with-trait-method-as-value.rs index dd914b464fa58..dd90b4a082331 100644 --- a/tests/ui/issues/auxiliary/issue-18501.rs +++ b/tests/ui/cross-crate/auxiliary/inline-fn-with-trait-method-as-value.rs @@ -1,3 +1,5 @@ +//! Auxiliary crate for . + #![crate_type = "rlib"] struct Foo; diff --git a/tests/ui/cross-crate/inline-fn-with-trait-method-as-value.rs b/tests/ui/cross-crate/inline-fn-with-trait-method-as-value.rs new file mode 100644 index 0000000000000..7c68f29352493 --- /dev/null +++ b/tests/ui/cross-crate/inline-fn-with-trait-method-as-value.rs @@ -0,0 +1,15 @@ +//! Regression test for . +//! +//! Test that we don't ICE when inlining a function from another +//! crate that uses a trait method as a value due to incorrectly +//! translating the def ID of the trait during AST decoding. + +//@ run-pass + +//@ aux-build:inline-fn-with-trait-method-as-value.rs + +extern crate inline_fn_with_trait_method_as_value as issue; + +fn main() { + issue::pass_method(); +} diff --git a/tests/ui/issues/issue-18919.rs b/tests/ui/dst/dyn-fn-type-in-generic-enum.rs similarity index 71% rename from tests/ui/issues/issue-18919.rs rename to tests/ui/dst/dyn-fn-type-in-generic-enum.rs index f06771e9ea59d..a4d07b01007dc 100644 --- a/tests/ui/issues/issue-18919.rs +++ b/tests/ui/dst/dyn-fn-type-in-generic-enum.rs @@ -1,3 +1,5 @@ +//! Regression test for . + type FuncType<'f> = dyn Fn(&isize) -> isize + 'f; fn ho_func(f: Option) { diff --git a/tests/ui/issues/issue-18919.stderr b/tests/ui/dst/dyn-fn-type-in-generic-enum.stderr similarity index 86% rename from tests/ui/issues/issue-18919.stderr rename to tests/ui/dst/dyn-fn-type-in-generic-enum.stderr index 714b6d7d86be3..dc672399e6800 100644 --- a/tests/ui/issues/issue-18919.stderr +++ b/tests/ui/dst/dyn-fn-type-in-generic-enum.stderr @@ -1,17 +1,17 @@ error[E0277]: the size for values of type `dyn for<'a> Fn(&'a isize) -> isize` cannot be known at compilation time - --> $DIR/issue-18919.rs:3:15 + --> $DIR/dyn-fn-type-in-generic-enum.rs:5:15 | LL | fn ho_func(f: Option) { | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | = help: the trait `Sized` is not implemented for `dyn for<'a> Fn(&'a isize) -> isize` note: required by an implicit `Sized` bound in `Option` - --> $DIR/issue-18919.rs:7:13 + --> $DIR/dyn-fn-type-in-generic-enum.rs:9:13 | LL | enum Option { | ^ required by the implicit `Sized` requirement on this type parameter in `Option` help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box` - --> $DIR/issue-18919.rs:7:13 + --> $DIR/dyn-fn-type-in-generic-enum.rs:9:13 | LL | enum Option { | ^ this could be changed to `T: ?Sized`... diff --git a/tests/ui/issues/issue-18959.rs b/tests/ui/dyn-compatibility/dyn-incompatible-supertrait.rs similarity index 83% rename from tests/ui/issues/issue-18959.rs rename to tests/ui/dyn-compatibility/dyn-incompatible-supertrait.rs index 415fe818f5308..90a30e7920544 100644 --- a/tests/ui/issues/issue-18959.rs +++ b/tests/ui/dyn-compatibility/dyn-incompatible-supertrait.rs @@ -1,3 +1,5 @@ +//! Regression test for . + pub trait Foo { fn foo(&self, ext_thing: &T); } pub trait Bar: Foo { } impl Bar for T { } diff --git a/tests/ui/issues/issue-18959.stderr b/tests/ui/dyn-compatibility/dyn-incompatible-supertrait.stderr similarity index 87% rename from tests/ui/issues/issue-18959.stderr rename to tests/ui/dyn-compatibility/dyn-incompatible-supertrait.stderr index df47d50a01979..34f1ed729c135 100644 --- a/tests/ui/issues/issue-18959.stderr +++ b/tests/ui/dyn-compatibility/dyn-incompatible-supertrait.stderr @@ -1,12 +1,12 @@ error[E0038]: the trait `Bar` is not dyn compatible - --> $DIR/issue-18959.rs:11:12 + --> $DIR/dyn-incompatible-supertrait.rs:13:12 | LL | fn foo(b: &dyn Bar) { | ^^^^^^^ `Bar` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/issue-18959.rs:1:20 + --> $DIR/dyn-incompatible-supertrait.rs:3:20 | LL | pub trait Foo { fn foo(&self, ext_thing: &T); } | ^^^ ...because method `foo` has generic type parameters @@ -15,14 +15,14 @@ LL | pub trait Bar: Foo { } = help: consider moving `foo` to another trait error[E0038]: the trait `Bar` is not dyn compatible - --> $DIR/issue-18959.rs:18:20 + --> $DIR/dyn-incompatible-supertrait.rs:20:20 | LL | let test: &dyn Bar = &mut thing; | ^^^ `Bar` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/issue-18959.rs:1:20 + --> $DIR/dyn-incompatible-supertrait.rs:3:20 | LL | pub trait Foo { fn foo(&self, ext_thing: &T); } | ^^^ ...because method `foo` has generic type parameters @@ -31,14 +31,14 @@ LL | pub trait Bar: Foo { } = help: consider moving `foo` to another trait error[E0038]: the trait `Bar` is not dyn compatible - --> $DIR/issue-18959.rs:20:9 + --> $DIR/dyn-incompatible-supertrait.rs:22:9 | LL | foo(test); | ^^^^ `Bar` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/issue-18959.rs:1:20 + --> $DIR/dyn-incompatible-supertrait.rs:3:20 | LL | pub trait Foo { fn foo(&self, ext_thing: &T); } | ^^^ ...because method `foo` has generic type parameters diff --git a/tests/ui/issues/auxiliary/issue-18711.rs b/tests/ui/issues/auxiliary/issue-18711.rs deleted file mode 100644 index 5cb1f9c43718e..0000000000000 --- a/tests/ui/issues/auxiliary/issue-18711.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![crate_type = "rlib"] - -pub fn inner(f: F) -> F { - (move || f)() -} diff --git a/tests/ui/issues/issue-18501.rs b/tests/ui/issues/issue-18501.rs deleted file mode 100644 index 54e53e434c465..0000000000000 --- a/tests/ui/issues/issue-18501.rs +++ /dev/null @@ -1,12 +0,0 @@ -//@ run-pass -// Test that we don't ICE when inlining a function from another -// crate that uses a trait method as a value due to incorrectly -// translating the def ID of the trait during AST decoding. - -//@ aux-build:issue-18501.rs - -extern crate issue_18501 as issue; - -fn main() { - issue::pass_method(); -} diff --git a/tests/ui/issues/issue-18711.rs b/tests/ui/issues/issue-18711.rs deleted file mode 100644 index 1d5e3349a6d42..0000000000000 --- a/tests/ui/issues/issue-18711.rs +++ /dev/null @@ -1,11 +0,0 @@ -//@ run-pass -// Test that we don't panic on a RefCell borrow conflict in certain -// code paths involving unboxed closures. - - -//@ aux-build:issue-18711.rs -extern crate issue_18711 as issue; - -fn main() { - (|| issue::inner(()))(); -} diff --git a/tests/ui/issues/issue-18845.rs b/tests/ui/issues/issue-18845.rs deleted file mode 100644 index c9dc175b10a8a..0000000000000 --- a/tests/ui/issues/issue-18845.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ run-pass -// This used to generate invalid IR in that even if we took the -// `false` branch we'd still try to free the Box from the other -// arm. This was due to treating `*Box::new(9)` as an rvalue datum -// instead of as a place. - -fn test(foo: bool) -> u8 { - match foo { - true => *Box::new(9), - false => 0 - } -} - -fn main() { - assert_eq!(9, test(true)); -} diff --git a/tests/ui/issues/issue-18859.rs b/tests/ui/issues/issue-18859.rs deleted file mode 100644 index 854b7ed62f05b..0000000000000 --- a/tests/ui/issues/issue-18859.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ run-pass - -mod foo { - pub mod bar { - pub mod baz { - pub fn name() -> &'static str { - module_path!() - } - } - } -} - -fn main() { - assert_eq!(module_path!(), "issue_18859"); - assert_eq!(foo::bar::baz::name(), "issue_18859::foo::bar::baz"); -} diff --git a/tests/ui/issues/issue-18913.rs b/tests/ui/issues/issue-18913.rs deleted file mode 100644 index 7f9137d95c24f..0000000000000 --- a/tests/ui/issues/issue-18913.rs +++ /dev/null @@ -1,9 +0,0 @@ -//@ run-pass -//@ aux-build:issue-18913-1.rs -//@ aux-build:issue-18913-2.rs - -extern crate foo; - -fn main() { - assert_eq!(foo::foo(), 1); -} diff --git a/tests/ui/issues/auxiliary/issue-18913-1.rs b/tests/ui/linking/auxiliary/duplicate-rlib-crate-name-precedence-1.rs similarity index 56% rename from tests/ui/issues/auxiliary/issue-18913-1.rs rename to tests/ui/linking/auxiliary/duplicate-rlib-crate-name-precedence-1.rs index caa2c707b560d..7b2bfbba12e6e 100644 --- a/tests/ui/issues/auxiliary/issue-18913-1.rs +++ b/tests/ui/linking/auxiliary/duplicate-rlib-crate-name-precedence-1.rs @@ -1,3 +1,5 @@ +//! Auxiliary crate for . + //@ no-prefer-dynamic #![crate_type = "rlib"] diff --git a/tests/ui/issues/auxiliary/issue-18913-2.rs b/tests/ui/linking/auxiliary/duplicate-rlib-crate-name-precedence-2.rs similarity index 56% rename from tests/ui/issues/auxiliary/issue-18913-2.rs rename to tests/ui/linking/auxiliary/duplicate-rlib-crate-name-precedence-2.rs index 802f5ab3899bb..fc0d3d6ea4283 100644 --- a/tests/ui/issues/auxiliary/issue-18913-2.rs +++ b/tests/ui/linking/auxiliary/duplicate-rlib-crate-name-precedence-2.rs @@ -1,3 +1,5 @@ +//! Auxiliary crate for . + //@ no-prefer-dynamic #![crate_type = "rlib"] diff --git a/tests/ui/linking/duplicate-rlib-crate-name-precedence.rs b/tests/ui/linking/duplicate-rlib-crate-name-precedence.rs new file mode 100644 index 0000000000000..5131df3903423 --- /dev/null +++ b/tests/ui/linking/duplicate-rlib-crate-name-precedence.rs @@ -0,0 +1,11 @@ +//! Regression test for . + +//@ run-pass +//@ aux-build:duplicate-rlib-crate-name-precedence-1.rs +//@ aux-build:duplicate-rlib-crate-name-precedence-2.rs + +extern crate foo; + +fn main() { + assert_eq!(foo::foo(), 1); +} diff --git a/tests/ui/macros/module-path-in-nested-modules.rs b/tests/ui/macros/module-path-in-nested-modules.rs new file mode 100644 index 0000000000000..601599e92943e --- /dev/null +++ b/tests/ui/macros/module-path-in-nested-modules.rs @@ -0,0 +1,18 @@ +//! Regression test for . + +//@ run-pass + +mod foo { + pub mod bar { + pub mod baz { + pub fn name() -> &'static str { + module_path!() + } + } + } +} + +fn main() { + assert_eq!(module_path!(), "module_path_in_nested_modules"); + assert_eq!(foo::bar::baz::name(), "module_path_in_nested_modules::foo::bar::baz"); +} diff --git a/tests/ui/issues/issue-18988.rs b/tests/ui/traits/object/trait-object-with-send-supertrait.rs similarity index 67% rename from tests/ui/issues/issue-18988.rs rename to tests/ui/traits/object/trait-object-with-send-supertrait.rs index 9dffe5640809a..cbdc8693708c9 100644 --- a/tests/ui/issues/issue-18988.rs +++ b/tests/ui/traits/object/trait-object-with-send-supertrait.rs @@ -1,3 +1,5 @@ +//! Regression test for . + //@ check-pass #![allow(dead_code)] pub trait Foo : Send { } diff --git a/tests/ui/unboxed-closures/auxiliary/cross-crate-generic-fn-in-closure.rs b/tests/ui/unboxed-closures/auxiliary/cross-crate-generic-fn-in-closure.rs new file mode 100644 index 0000000000000..06cd968caff1e --- /dev/null +++ b/tests/ui/unboxed-closures/auxiliary/cross-crate-generic-fn-in-closure.rs @@ -0,0 +1,7 @@ +//! Auxiliary crate for . + +#![crate_type = "rlib"] + +pub fn inner(f: F) -> F { + (move || f)() +} diff --git a/tests/ui/unboxed-closures/cross-crate-generic-fn-in-closure.rs b/tests/ui/unboxed-closures/cross-crate-generic-fn-in-closure.rs new file mode 100644 index 0000000000000..5c943721103e6 --- /dev/null +++ b/tests/ui/unboxed-closures/cross-crate-generic-fn-in-closure.rs @@ -0,0 +1,12 @@ +//! Regression test for . +//! Test that we don't panic on a RefCell borrow conflict in certain +//! code paths involving unboxed closures. + +//@ run-pass + +//@ aux-build:cross-crate-generic-fn-in-closure.rs +extern crate cross_crate_generic_fn_in_closure as issue; + +fn main() { + (|| issue::inner(()))(); +} diff --git a/tests/ui/issues/issue-18906.rs b/tests/ui/where-clauses/impl-method-where-clause-resolution.rs similarity index 87% rename from tests/ui/issues/issue-18906.rs rename to tests/ui/where-clauses/impl-method-where-clause-resolution.rs index 84b0f5a178825..af2bf63ad106a 100644 --- a/tests/ui/issues/issue-18906.rs +++ b/tests/ui/where-clauses/impl-method-where-clause-resolution.rs @@ -1,3 +1,5 @@ +//! Regression test for . + //@ check-pass #![allow(dead_code)]