about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Wood <david.wood2@arm.com>2025-02-03 15:54:25 +0000
committerDavid Wood <david.wood2@arm.com>2025-06-16 23:04:35 +0000
commit183458263b0aea42a6ea8b8417117abcae178679 (patch)
treec17e556d5fda1524efff2217a744ae90c87d018f
parent5d17987d7189a883c3c42a6eb17255e2ea060d6f (diff)
downloadrust-183458263b0aea42a6ea8b8417117abcae178679.tar.gz
rust-183458263b0aea42a6ea8b8417117abcae178679.zip
tests: bless remaining tests
These tests just need blessing, they don't have any interesting behaviour
changes.

Some of these tests have new errors because `LegacyReceiver` cannot be
proven to be implemented now that it is also testing for `MetaSized` -
but this is just a consequence of the other errors in the test.
-rw-r--r--tests/incremental/hashes/trait_defs.rs12
-rw-r--r--tests/incremental/hashes/trait_impls.rs2
-rw-r--r--tests/ui/attributes/dump-preds.stderr3
-rw-r--r--tests/ui/const-generics/unused-type-param-suggestion.rs1
-rw-r--r--tests/ui/const-generics/unused-type-param-suggestion.stderr1
-rw-r--r--tests/ui/extern/unsized-extern-derefmove.rs13
-rw-r--r--tests/ui/extern/unsized-extern-derefmove.stderr52
-rw-r--r--tests/ui/nll/issue-50716.rs3
-rw-r--r--tests/ui/nll/issue-50716.stderr20
-rw-r--r--tests/ui/traits/cache-reached-depth-ice.rs5
-rw-r--r--tests/ui/traits/cache-reached-depth-ice.stderr6
-rw-r--r--tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.stderr7
-rw-r--r--tests/ui/traits/next-solver/normalize/normalize-param-env-2.stderr19
-rw-r--r--tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr16
14 files changed, 135 insertions, 25 deletions
diff --git a/tests/incremental/hashes/trait_defs.rs b/tests/incremental/hashes/trait_defs.rs
index 7141ddb0d7e..50b56441cca 100644
--- a/tests/incremental/hashes/trait_defs.rs
+++ b/tests/incremental/hashes/trait_defs.rs
@@ -30,7 +30,7 @@ trait TraitVisibility { }
 #[cfg(not(any(cfail1,cfail4)))]
 #[rustc_clean(cfg="cfail2")]
 #[rustc_clean(cfg="cfail3")]
-#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes")]
+#[rustc_clean(cfg="cfail5", except="opt_hir_owner_nodes,predicates_of")]
 #[rustc_clean(cfg="cfail6")]
 pub trait TraitVisibility { }
 
@@ -43,7 +43,7 @@ trait TraitUnsafety { }
 #[cfg(not(any(cfail1,cfail4)))]
 #[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
 #[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
+#[rustc_clean(except="opt_hir_owner_nodes,predicates_of", cfg="cfail5")]
 #[rustc_clean(cfg="cfail6")]
 unsafe trait TraitUnsafety { }
 
@@ -57,7 +57,7 @@ trait TraitAddMethod {
 #[cfg(not(any(cfail1,cfail4)))]
 #[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
 #[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
+#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids,predicates_of", cfg="cfail5")]
 #[rustc_clean(cfg="cfail6")]
 pub trait TraitAddMethod {
     fn method();
@@ -74,7 +74,7 @@ trait TraitChangeMethodName {
 #[cfg(not(any(cfail1,cfail4)))]
 #[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
 #[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
+#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids,predicates_of", cfg="cfail5")]
 #[rustc_clean(cfg="cfail6")]
 trait TraitChangeMethodName {
     fn methodChanged();
@@ -559,7 +559,7 @@ trait TraitAddBuiltinBoundToMethodTypeParameter {
 #[cfg(not(any(cfail1,cfail4)))]
 #[rustc_clean(cfg="cfail2")]
 #[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail5")]
+#[rustc_clean(except="opt_hir_owner_nodes,predicates_of", cfg="cfail5")]
 #[rustc_clean(cfg="cfail6")]
 trait TraitAddBuiltinBoundToMethodTypeParameter {
     #[rustc_clean(except="opt_hir_owner_nodes", cfg="cfail2")]
@@ -827,7 +827,7 @@ trait TraitAddAssociatedConstant {
 #[cfg(not(any(cfail1,cfail4)))]
 #[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
 #[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
+#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids,predicates_of", cfg="cfail5")]
 #[rustc_clean(cfg="cfail6")]
 trait TraitAddAssociatedConstant {
     const Value: u32;
diff --git a/tests/incremental/hashes/trait_impls.rs b/tests/incremental/hashes/trait_impls.rs
index a5003a8d432..8faf6806b90 100644
--- a/tests/incremental/hashes/trait_impls.rs
+++ b/tests/incremental/hashes/trait_impls.rs
@@ -34,7 +34,7 @@ impl ChangeMethodNameTrait for Foo {
 #[cfg(not(any(cfail1,cfail4)))]
 #[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail2")]
 #[rustc_clean(cfg="cfail3")]
-#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids", cfg="cfail5")]
+#[rustc_clean(except="opt_hir_owner_nodes,associated_item_def_ids,predicates_of", cfg="cfail5")]
 #[rustc_clean(cfg="cfail6")]
 pub trait ChangeMethodNameTrait {
     #[rustc_clean(cfg="cfail3")]
diff --git a/tests/ui/attributes/dump-preds.stderr b/tests/ui/attributes/dump-preds.stderr
index 7db2abc5ffe..e63b51a4740 100644
--- a/tests/ui/attributes/dump-preds.stderr
+++ b/tests/ui/attributes/dump-preds.stderr
@@ -4,6 +4,7 @@ error: rustc_dump_predicates
 LL | trait Trait<T>: Iterator<Item: Copy>
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
+   = note: Binder { value: TraitPredicate(<Self as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }
    = note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
    = note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
    = note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }
@@ -16,6 +17,7 @@ error: rustc_dump_predicates
 LL |     type Assoc<P: Eq>: std::ops::Deref<Target = ()>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
+   = note: Binder { value: TraitPredicate(<Self as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }
    = note: Binder { value: TraitPredicate(<Self as std::iter::Iterator>, polarity:Positive), bound_vars: [] }
    = note: Binder { value: TraitPredicate(<<Self as std::iter::Iterator>::Item as std::marker::Copy>, polarity:Positive), bound_vars: [] }
    = note: Binder { value: TraitPredicate(<T as std::marker::Sized>, polarity:Positive), bound_vars: [] }
@@ -35,7 +37,6 @@ LL |     type Assoc<P: Eq>: std::ops::Deref<Target = ()>
    = note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::ops::Deref>, polarity:Positive), bound_vars: [] }
    = note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::Sized>, polarity:Positive), bound_vars: [] }
    = note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::MetaSized>, polarity:Positive), bound_vars: [] }
-   = note: Binder { value: TraitPredicate(<<Self as Trait<T>>::Assoc<P> as std::marker::PointeeSized>, polarity:Positive), bound_vars: [] }
 
 error: aborting due to 3 previous errors
 
diff --git a/tests/ui/const-generics/unused-type-param-suggestion.rs b/tests/ui/const-generics/unused-type-param-suggestion.rs
index fb0ccb4fdcd..b8ae4f6b56b 100644
--- a/tests/ui/const-generics/unused-type-param-suggestion.rs
+++ b/tests/ui/const-generics/unused-type-param-suggestion.rs
@@ -25,3 +25,4 @@ type C<N: Sized> = ();
 type D<N: ?Sized> = ();
 //~^ ERROR type parameter `N` is never used
 //~| HELP consider removing `N`
+//~| HELP if you intended `N` to be a const parameter
diff --git a/tests/ui/const-generics/unused-type-param-suggestion.stderr b/tests/ui/const-generics/unused-type-param-suggestion.stderr
index 67b704d8bc7..a7aa477ab31 100644
--- a/tests/ui/const-generics/unused-type-param-suggestion.stderr
+++ b/tests/ui/const-generics/unused-type-param-suggestion.stderr
@@ -47,6 +47,7 @@ LL | type D<N: ?Sized> = ();
    |        ^ unused type parameter
    |
    = help: consider removing `N` or referring to it in the body of the type alias
+   = help: if you intended `N` to be a const parameter, use `const N: /* Type */` instead
 
 error: aborting due to 6 previous errors
 
diff --git a/tests/ui/extern/unsized-extern-derefmove.rs b/tests/ui/extern/unsized-extern-derefmove.rs
index 4ec9e53f49d..c02375266ab 100644
--- a/tests/ui/extern/unsized-extern-derefmove.rs
+++ b/tests/ui/extern/unsized-extern-derefmove.rs
@@ -1,15 +1,20 @@
-//! Regression test for #79409
-
 #![feature(extern_types)]
 
-unsafe extern "C" {
+// Regression test for #79409
+
+extern "C" {
     type Device;
 }
 
 unsafe fn make_device() -> Box<Device> {
+//~^ ERROR the size for values of type `Device` cannot be known
     Box::from_raw(0 as *mut _)
+//~^ ERROR the size for values of type `Device` cannot be known
+//~| ERROR the size for values of type `Device` cannot be known
 }
 
 fn main() {
-    let d: Device = unsafe { *make_device() }; //~ERROR the size for values of type `Device` cannot be known at compilation time
+    let d: Device = unsafe { *make_device() };
+//~^ ERROR the size for values of type `Device` cannot be known
+//~| ERROR the size for values of type `Device` cannot be known
 }
diff --git a/tests/ui/extern/unsized-extern-derefmove.stderr b/tests/ui/extern/unsized-extern-derefmove.stderr
index c43184d94e1..d6be76a9d62 100644
--- a/tests/ui/extern/unsized-extern-derefmove.stderr
+++ b/tests/ui/extern/unsized-extern-derefmove.stderr
@@ -1,5 +1,43 @@
+error[E0277]: the size for values of type `Device` cannot be known
+  --> $DIR/unsized-extern-derefmove.rs:9:28
+   |
+LL | unsafe fn make_device() -> Box<Device> {
+   |                            ^^^^^^^^^^^ doesn't have a known size
+   |
+   = help: the trait `MetaSized` is not implemented for `Device`
+note: required by a bound in `Box`
+  --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
+
+error[E0277]: the size for values of type `Device` cannot be known
+  --> $DIR/unsized-extern-derefmove.rs:11:19
+   |
+LL |     Box::from_raw(0 as *mut _)
+   |     ------------- ^^^^^^^^^^^ the trait `MetaSized` is not implemented for `Device`
+   |     |
+   |     required by a bound introduced by this call
+   |
+   = note: the trait bound `Device: MetaSized` is not satisfied
+note: required by a bound in `Box::<T>::from_raw`
+  --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
+help: consider borrowing here
+   |
+LL |     Box::from_raw(&0 as *mut _)
+   |                   +
+LL |     Box::from_raw(&mut 0 as *mut _)
+   |                   ++++
+
+error[E0277]: the size for values of type `Device` cannot be known
+  --> $DIR/unsized-extern-derefmove.rs:11:5
+   |
+LL |     Box::from_raw(0 as *mut _)
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a known size
+   |
+   = help: the trait `MetaSized` is not implemented for `Device`
+note: required by a bound in `Box`
+  --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
+
 error[E0277]: the size for values of type `Device` cannot be known at compilation time
-  --> $DIR/unsized-extern-derefmove.rs:14:9
+  --> $DIR/unsized-extern-derefmove.rs:17:9
    |
 LL |     let d: Device = unsafe { *make_device() };
    |         ^ doesn't have a size known at compile-time
@@ -11,6 +49,16 @@ help: consider borrowing here
 LL |     let d: &Device = unsafe { *make_device() };
    |            +
 
-error: aborting due to 1 previous error
+error[E0277]: the size for values of type `Device` cannot be known
+  --> $DIR/unsized-extern-derefmove.rs:17:31
+   |
+LL |     let d: Device = unsafe { *make_device() };
+   |                               ^^^^^^^^^^^^^ doesn't have a known size
+   |
+   = help: the trait `MetaSized` is not implemented for `Device`
+note: required by a bound in `Box`
+  --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
+
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/nll/issue-50716.rs b/tests/ui/nll/issue-50716.rs
index c2fc345fa2b..c24d41e94e8 100644
--- a/tests/ui/nll/issue-50716.rs
+++ b/tests/ui/nll/issue-50716.rs
@@ -1,4 +1,3 @@
-//
 // Regression test for the issue #50716: NLL ignores lifetimes bounds
 // derived from `Sized` requirements
 
@@ -6,7 +5,7 @@ trait A {
     type X: ?Sized;
 }
 
-fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
+fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) //~ ERROR mismatched types
 where
     for<'b> &'b T: A,
     <&'static T as A>::X: Sized
diff --git a/tests/ui/nll/issue-50716.stderr b/tests/ui/nll/issue-50716.stderr
index a09e7670515..edd7fd765da 100644
--- a/tests/ui/nll/issue-50716.stderr
+++ b/tests/ui/nll/issue-50716.stderr
@@ -1,5 +1,20 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-50716.rs:8:27
+   |
+LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
+   |                           ^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
+   |
+   = note: expected trait `<<&'a T as A>::X as MetaSized>`
+              found trait `<<&'static T as A>::X as MetaSized>`
+note: the lifetime `'a` as defined here...
+  --> $DIR/issue-50716.rs:8:8
+   |
+LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
+   |        ^^
+   = note: ...does not necessarily outlive the static lifetime
+
 error: lifetime may not live long enough
-  --> $DIR/issue-50716.rs:14:14
+  --> $DIR/issue-50716.rs:13:14
    |
 LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
    |        -- lifetime `'a` defined here
@@ -7,5 +22,6 @@ LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>)
 LL |     let _x = *s;
    |              ^^ proving this value is `Sized` requires that `'a` must outlive `'static`
 
-error: aborting due to 1 previous error
+error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/traits/cache-reached-depth-ice.rs b/tests/ui/traits/cache-reached-depth-ice.rs
index 8c2391113d7..bc62adf4842 100644
--- a/tests/ui/traits/cache-reached-depth-ice.rs
+++ b/tests/ui/traits/cache-reached-depth-ice.rs
@@ -1,4 +1,5 @@
-#![feature(rustc_attrs)]
+#![feature(rustc_attrs, sized_hierarchy)]
+use std::marker::PointeeSized;
 
 // Test for a particular corner case where the evaluation
 // cache can get out of date. The problem here is that
@@ -37,7 +38,7 @@ struct C {
 }
 
 #[rustc_evaluate_where_clauses]
-fn test<X: ?Sized + Send>() {}
+fn test<X: PointeeSized + Send>() {}
 
 fn main() {
     test::<A>();
diff --git a/tests/ui/traits/cache-reached-depth-ice.stderr b/tests/ui/traits/cache-reached-depth-ice.stderr
index e84ebc91ae1..fd76dc92dfb 100644
--- a/tests/ui/traits/cache-reached-depth-ice.stderr
+++ b/tests/ui/traits/cache-reached-depth-ice.stderr
@@ -1,8 +1,8 @@
 error: evaluate(Binder { value: TraitPredicate(<A as std::marker::Send>, polarity:Positive), bound_vars: [] }) = Ok(EvaluatedToOk)
-  --> $DIR/cache-reached-depth-ice.rs:43:5
+  --> $DIR/cache-reached-depth-ice.rs:44:5
    |
-LL | fn test<X: ?Sized + Send>() {}
-   |                     ---- predicate
+LL | fn test<X: PointeeSized + Send>() {}
+   |                           ---- predicate
 ...
 LL |     test::<A>();
    |     ^^^^^^^^^
diff --git a/tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.stderr b/tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.stderr
index 8901805a20f..1eb445f4848 100644
--- a/tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.stderr
+++ b/tests/ui/traits/next-solver/cycles/normalizes-to-is-not-productive.stderr
@@ -12,6 +12,13 @@ LL | impl<T: Bound, U> Trait<U> for T {
    |         -----     ^^^^^^^^     ^
    |         |
    |         unsatisfied trait bound introduced here
+note: required by a bound in `Bound`
+  --> $DIR/normalizes-to-is-not-productive.rs:8:1
+   |
+LL | / trait Bound {
+LL | |     fn method();
+LL | | }
+   | |_^ required by this bound in `Bound`
 
 error[E0277]: the trait bound `Foo: Bound` is not satisfied
   --> $DIR/normalizes-to-is-not-productive.rs:47:19
diff --git a/tests/ui/traits/next-solver/normalize/normalize-param-env-2.stderr b/tests/ui/traits/next-solver/normalize/normalize-param-env-2.stderr
index d179c805962..8d8909625ff 100644
--- a/tests/ui/traits/next-solver/normalize/normalize-param-env-2.stderr
+++ b/tests/ui/traits/next-solver/normalize/normalize-param-env-2.stderr
@@ -19,6 +19,23 @@ error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: A<T>`
 LL |         Self::Assoc: A<T>,
    |                      ^^^^
 
+error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc: MetaSized`
+  --> $DIR/normalize-param-env-2.rs:24:22
+   |
+LL |         Self::Assoc: A<T>,
+   |                      ^^^^
+   |
+note: required by a bound in `A`
+  --> $DIR/normalize-param-env-2.rs:9:1
+   |
+LL | / trait A<T> {
+LL | |     type Assoc;
+LL | |
+LL | |     fn f()
+...  |
+LL | | }
+   | |_^ required by this bound in `A`
+
 error[E0275]: overflow evaluating the requirement `<() as A<T>>::Assoc well-formed`
   --> $DIR/normalize-param-env-2.rs:24:22
    |
@@ -46,6 +63,6 @@ LL |     where
 LL |         Self::Assoc: A<T>,
    |                      ^^^^ required by this bound in `A::f`
 
-error: aborting due to 5 previous errors
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0275`.
diff --git a/tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr b/tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr
index f5fd9ce9864..9f7f74f9466 100644
--- a/tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr
+++ b/tests/ui/traits/next-solver/normalize/normalize-param-env-4.next.stderr
@@ -4,6 +4,20 @@ error[E0275]: overflow evaluating the requirement `<T as Trait>::Assoc: Trait`
 LL |     <T as Trait>::Assoc: Trait,
    |                          ^^^^^
 
-error: aborting due to 1 previous error
+error[E0275]: overflow evaluating the requirement `<T as Trait>::Assoc: MetaSized`
+  --> $DIR/normalize-param-env-4.rs:19:26
+   |
+LL |     <T as Trait>::Assoc: Trait,
+   |                          ^^^^^
+   |
+note: required by a bound in `Trait`
+  --> $DIR/normalize-param-env-4.rs:7:1
+   |
+LL | / trait Trait {
+LL | |     type Assoc;
+LL | | }
+   | |_^ required by this bound in `Trait`
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0275`.