about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-26 08:52:31 +0000
committerbors <bors@rust-lang.org>2021-12-26 08:52:31 +0000
commitf8abed9ed48bace6be0087bcd44ed534e239b8d8 (patch)
treec594e31814d61ac75771fc4310f1e494291cf88e /src/test
parent51e8031e14a899477a5e2d78ce461cab31123354 (diff)
parentbb4c5515c185de95602ce38ad7f09c208beb0a7d (diff)
Auto merge of #92257 - fee1-dead:fix_env_further_bounds, r=oli-obk
normalize env constness for nested obligations

Closes #92230.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs14
-rw-r--r--src/test/ui/unsized/issue-30355.rs1
-rw-r--r--src/test/ui/unsized/issue-30355.stderr16
3 files changed, 30 insertions, 1 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs b/src/test/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs
new file mode 100644
index 00000000000..158c628c3e0
--- /dev/null
+++ b/src/test/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs
@@ -0,0 +1,14 @@
+// Regression test for #92230.
+//
+// check-pass
+
+#![feature(const_fn_trait_bound)]
+#![feature(const_trait_impl)]
+
+pub trait Super {}
+pub trait Sub: Super {}
+
+impl<A> const Super for &A where A: ~const Super {}
+impl<A> const Sub for &A where A: ~const Sub {}
+
+fn main() {}
diff --git a/src/test/ui/unsized/issue-30355.rs b/src/test/ui/unsized/issue-30355.rs
index 6ff5b37f6e5..01811090503 100644
--- a/src/test/ui/unsized/issue-30355.rs
+++ b/src/test/ui/unsized/issue-30355.rs
@@ -4,6 +4,7 @@ pub static Y: &'static X = {
     const Y: &'static [u8] = b"";
     &X(*Y)
     //~^ ERROR E0277
+    //~| ERROR E0277
 };
 
 fn main() {}
diff --git a/src/test/ui/unsized/issue-30355.stderr b/src/test/ui/unsized/issue-30355.stderr
index 71bbdf5dec7..62b6007a15a 100644
--- a/src/test/ui/unsized/issue-30355.stderr
+++ b/src/test/ui/unsized/issue-30355.stderr
@@ -8,6 +8,20 @@ LL |     &X(*Y)
    = note: all function arguments must have a statically known size
    = help: unsized fn params are gated as an unstable feature
 
-error: aborting due to previous error
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+  --> $DIR/issue-30355.rs:5:6
+   |
+LL |     &X(*Y)
+   |      ^ doesn't have a size known at compile-time
+   |
+   = help: within `X`, the trait `Sized` is not implemented for `[u8]`
+note: required because it appears within the type `X`
+  --> $DIR/issue-30355.rs:1:12
+   |
+LL | pub struct X([u8]);
+   |            ^
+   = note: the return type of a function must have a statically known size
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0277`.