mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Merge various rustc_attr based tests
This commit is contained in:
parent
4279da583c
commit
e2e751e76d
@ -160,6 +160,8 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
|
||||
|
||||
if tcx.features().rustc_attrs {
|
||||
tcx.sess.time("outlives_testing", || outlives::test::test_inferred_outlives(tcx));
|
||||
tcx.sess.time("variance_testing", || variance::test::test_variance(tcx));
|
||||
collect::test_opaque_hidden_types(tcx);
|
||||
}
|
||||
|
||||
tcx.sess.time("coherence_checking", || {
|
||||
@ -175,14 +177,6 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
|
||||
let _ = tcx.ensure().crate_inherent_impls_overlap_check(());
|
||||
});
|
||||
|
||||
if tcx.features().rustc_attrs {
|
||||
tcx.sess.time("variance_testing", || variance::test::test_variance(tcx));
|
||||
}
|
||||
|
||||
if tcx.features().rustc_attrs {
|
||||
collect::test_opaque_hidden_types(tcx);
|
||||
}
|
||||
|
||||
// Make sure we evaluate all static and (non-associated) const items, even if unused.
|
||||
// If any of these fail to evaluate, we do not want this crate to pass compilation.
|
||||
tcx.hir().par_body_owners(|item_def_id| {
|
||||
|
@ -1,3 +1,69 @@
|
||||
error: [*, o]
|
||||
--> $DIR/variance.rs:8:29
|
||||
|
|
||||
LL | type NotCapturedEarly<'a> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, o]
|
||||
--> $DIR/variance.rs:11:26
|
||||
|
|
||||
LL | type CapturedEarly<'a> = impl Sized + Captures<'a>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, o, o]
|
||||
--> $DIR/variance.rs:14:56
|
||||
|
|
||||
LL | type NotCapturedLate<'a> = dyn for<'b> Iterator<Item = impl Sized>;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, o, o]
|
||||
--> $DIR/variance.rs:18:49
|
||||
|
|
||||
LL | type Captured<'a> = dyn for<'b> Iterator<Item = impl Sized + Captures<'a>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o, o]
|
||||
--> $DIR/variance.rs:22:27
|
||||
|
|
||||
LL | type Bar<'a, 'b: 'b, T> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:34:32
|
||||
|
|
||||
LL | type ImplicitCapture<'a> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:37:42
|
||||
|
|
||||
LL | type ExplicitCaptureFromHeader<'a> = impl Sized + Captures<'i>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:40:39
|
||||
|
|
||||
LL | type ExplicitCaptureFromGat<'a> = impl Sized + Captures<'a>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:45:32
|
||||
|
|
||||
LL | type ImplicitCapture<'a> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:48:42
|
||||
|
|
||||
LL | type ExplicitCaptureFromHeader<'a> = impl Sized + Captures<'i>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:51:39
|
||||
|
|
||||
LL | type ExplicitCaptureFromGat<'a> = impl Sized + Captures<'a>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from `dyn` type
|
||||
--> $DIR/variance.rs:14:56
|
||||
|
|
||||
@ -110,72 +176,6 @@ LL | type ExplicitCaptureFromGat<'a> = impl Sized + Captures<'a>;
|
||||
|
|
||||
= note: `ExplicitCaptureFromGat` must be used in combination with a concrete type within the same impl
|
||||
|
||||
error: [*, o]
|
||||
--> $DIR/variance.rs:8:29
|
||||
|
|
||||
LL | type NotCapturedEarly<'a> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, o]
|
||||
--> $DIR/variance.rs:11:26
|
||||
|
|
||||
LL | type CapturedEarly<'a> = impl Sized + Captures<'a>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, o, o]
|
||||
--> $DIR/variance.rs:14:56
|
||||
|
|
||||
LL | type NotCapturedLate<'a> = dyn for<'b> Iterator<Item = impl Sized>;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, o, o]
|
||||
--> $DIR/variance.rs:18:49
|
||||
|
|
||||
LL | type Captured<'a> = dyn for<'b> Iterator<Item = impl Sized + Captures<'a>>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o, o]
|
||||
--> $DIR/variance.rs:22:27
|
||||
|
|
||||
LL | type Bar<'a, 'b: 'b, T> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:34:32
|
||||
|
|
||||
LL | type ImplicitCapture<'a> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:37:42
|
||||
|
|
||||
LL | type ExplicitCaptureFromHeader<'a> = impl Sized + Captures<'i>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:40:39
|
||||
|
|
||||
LL | type ExplicitCaptureFromGat<'a> = impl Sized + Captures<'a>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:45:32
|
||||
|
|
||||
LL | type ImplicitCapture<'a> = impl Sized;
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:48:42
|
||||
|
|
||||
LL | type ExplicitCaptureFromHeader<'a> = impl Sized + Captures<'i>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, *, o, o]
|
||||
--> $DIR/variance.rs:51:39
|
||||
|
|
||||
LL | type ExplicitCaptureFromGat<'a> = impl Sized + Captures<'a>;
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 24 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0657`.
|
||||
|
@ -1,3 +1,9 @@
|
||||
error: [o]
|
||||
--> $DIR/variance-associated-consts.rs:13:1
|
||||
|
|
||||
LL | struct Foo<T: Trait> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unconstrained generic constant
|
||||
--> $DIR/variance-associated-consts.rs:14:12
|
||||
|
|
||||
@ -6,11 +12,5 @@ LL | field: [u8; <T as Trait>::Const]
|
||||
|
|
||||
= help: try adding a `where` bound using this expression: `where [(); <T as Trait>::Const]:`
|
||||
|
||||
error: [o]
|
||||
--> $DIR/variance-associated-consts.rs:13:1
|
||||
|
|
||||
LL | struct Foo<T: Trait> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -1,11 +1,3 @@
|
||||
error[E0392]: lifetime parameter `'a` is never used
|
||||
--> $DIR/variance-regions-direct.rs:52:14
|
||||
|
|
||||
LL | struct Test7<'a> {
|
||||
| ^^ unused lifetime parameter
|
||||
|
|
||||
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
|
||||
|
||||
error: [+, +, +]
|
||||
--> $DIR/variance-regions-direct.rs:9:1
|
||||
|
|
||||
@ -48,6 +40,14 @@ error: [-, +, o]
|
||||
LL | enum Test8<'a, 'b, 'c:'b> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0392]: lifetime parameter `'a` is never used
|
||||
--> $DIR/variance-regions-direct.rs:52:14
|
||||
|
|
||||
LL | struct Test7<'a> {
|
||||
| ^^ unused lifetime parameter
|
||||
|
|
||||
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
|
||||
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0392`.
|
||||
|
@ -1,3 +1,33 @@
|
||||
error: [-, +, o, *]
|
||||
--> $DIR/variance-regions-indirect.rs:8:1
|
||||
|
|
||||
LL | enum Base<'a, 'b, 'c:'b, 'd> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, o, +, -]
|
||||
--> $DIR/variance-regions-indirect.rs:16:1
|
||||
|
|
||||
LL | struct Derived1<'w, 'x:'y, 'y, 'z> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [o, o, *]
|
||||
--> $DIR/variance-regions-indirect.rs:22:1
|
||||
|
|
||||
LL | struct Derived2<'a, 'b:'a, 'c> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [o, +, *]
|
||||
--> $DIR/variance-regions-indirect.rs:28:1
|
||||
|
|
||||
LL | struct Derived3<'a:'b, 'b, 'c> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [-, +, o]
|
||||
--> $DIR/variance-regions-indirect.rs:34:1
|
||||
|
|
||||
LL | struct Derived4<'a, 'b, 'c:'b> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0392]: lifetime parameter `'d` is never used
|
||||
--> $DIR/variance-regions-indirect.rs:8:26
|
||||
|
|
||||
@ -30,36 +60,6 @@ LL | struct Derived3<'a:'b, 'b, 'c> {
|
||||
|
|
||||
= help: consider removing `'c`, referring to it in a field, or using a marker such as `PhantomData`
|
||||
|
||||
error: [-, +, o, *]
|
||||
--> $DIR/variance-regions-indirect.rs:8:1
|
||||
|
|
||||
LL | enum Base<'a, 'b, 'c:'b, 'd> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, o, +, -]
|
||||
--> $DIR/variance-regions-indirect.rs:16:1
|
||||
|
|
||||
LL | struct Derived1<'w, 'x:'y, 'y, 'z> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [o, o, *]
|
||||
--> $DIR/variance-regions-indirect.rs:22:1
|
||||
|
|
||||
LL | struct Derived2<'a, 'b:'a, 'c> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [o, +, *]
|
||||
--> $DIR/variance-regions-indirect.rs:28:1
|
||||
|
|
||||
LL | struct Derived3<'a:'b, 'b, 'c> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [-, +, o]
|
||||
--> $DIR/variance-regions-indirect.rs:34:1
|
||||
|
|
||||
LL | struct Derived4<'a, 'b, 'c:'b> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0392`.
|
||||
|
@ -1,3 +1,27 @@
|
||||
error: [+, +]
|
||||
--> $DIR/variance-trait-bounds.rs:16:1
|
||||
|
|
||||
LL | struct TestStruct<U,T:Setter<U>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, +]
|
||||
--> $DIR/variance-trait-bounds.rs:21:1
|
||||
|
|
||||
LL | enum TestEnum<U,T:Setter<U>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, +]
|
||||
--> $DIR/variance-trait-bounds.rs:27:1
|
||||
|
|
||||
LL | struct TestContraStruct<U,T:Setter<U>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, +]
|
||||
--> $DIR/variance-trait-bounds.rs:33:1
|
||||
|
|
||||
LL | struct TestBox<U,T:Getter<U>+Setter<U>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0392]: type parameter `U` is never used
|
||||
--> $DIR/variance-trait-bounds.rs:21:15
|
||||
|
|
||||
@ -25,30 +49,6 @@ LL | struct TestBox<U,T:Getter<U>+Setter<U>> {
|
||||
= help: consider removing `U`, referring to it in a field, or using a marker such as `PhantomData`
|
||||
= help: if you intended `U` to be a const parameter, use `const U: /* Type */` instead
|
||||
|
||||
error: [+, +]
|
||||
--> $DIR/variance-trait-bounds.rs:16:1
|
||||
|
|
||||
LL | struct TestStruct<U,T:Setter<U>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, +]
|
||||
--> $DIR/variance-trait-bounds.rs:21:1
|
||||
|
|
||||
LL | enum TestEnum<U,T:Setter<U>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, +]
|
||||
--> $DIR/variance-trait-bounds.rs:27:1
|
||||
|
|
||||
LL | struct TestContraStruct<U,T:Setter<U>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: [*, +]
|
||||
--> $DIR/variance-trait-bounds.rs:33:1
|
||||
|
|
||||
LL | struct TestBox<U,T:Getter<U>+Setter<U>> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0392`.
|
||||
|
Loading…
Reference in New Issue
Block a user