about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-04-13 07:10:43 +0000
committerbors <bors@rust-lang.org>2025-04-13 07:10:43 +0000
commit65fa0ab9246da73183b848a0c29b033779fe6f6c (patch)
tree0f3b98511d39dc9d3629d122deb74611d80f048e /tests
parentfda35a6da66a92b3614a0f03a721a81d3c66672f (diff)
parent6b26d3c37c3c907d860881c5be642e0309c24800 (diff)
downloadrust-65fa0ab9246da73183b848a0c29b033779fe6f6c.tar.gz
rust-65fa0ab9246da73183b848a0c29b033779fe6f6c.zip
Auto merge of #139734 - ChrisDenton:rollup-28qn740, r=ChrisDenton
Rollup of 6 pull requests

Successful merges:

 - #139107 (std: make `cmath` functions safe)
 - #139607 (Add regression test for #127424)
 - #139691 (Document that `opt-dist` requires metrics to be enabled)
 - #139707 (Fix comment in bootstrap)
 - #139708 (Fix name of field in doc comment)
 - #139709 (bootstrap: fix typo in doc string)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
-rw-r--r--tests/ui/const-generics/generic_const_exprs/const-generics-closure.rs13
-rw-r--r--tests/ui/const-generics/generic_const_exprs/const-generics-closure.stderr26
2 files changed, 39 insertions, 0 deletions
diff --git a/tests/ui/const-generics/generic_const_exprs/const-generics-closure.rs b/tests/ui/const-generics/generic_const_exprs/const-generics-closure.rs
new file mode 100644
index 00000000000..aad8cefe5d6
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/const-generics-closure.rs
@@ -0,0 +1,13 @@
+// Regression test for issue #127424
+
+fn bar() -> impl Into<
+    [u8; {
+        //~^ ERROR mismatched types [E0308]
+        let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
+        //~^ ERROR `for<...>` binders for closures are experimental [E0658]
+    }],
+> {
+    [89]
+}
+
+fn main() {}
diff --git a/tests/ui/const-generics/generic_const_exprs/const-generics-closure.stderr b/tests/ui/const-generics/generic_const_exprs/const-generics-closure.stderr
new file mode 100644
index 00000000000..5410bbdc125
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/const-generics-closure.stderr
@@ -0,0 +1,26 @@
+error[E0658]: `for<...>` binders for closures are experimental
+  --> $DIR/const-generics-closure.rs:6:17
+   |
+LL |         let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
+   |                 ^^^^^^^^^^^
+   |
+   = note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information
+   = help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+   = help: consider removing `for<...>`
+
+error[E0308]: mismatched types
+  --> $DIR/const-generics-closure.rs:4:10
+   |
+LL |       [u8; {
+   |  __________^
+LL | |
+LL | |         let _ = for<'a, 'b> |x: &'a &'a Vec<&'b u32>, b: bool| -> &'a Vec<&'b u32> { *x };
+LL | |
+LL | |     }],
+   | |_____^ expected `usize`, found `()`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0308, E0658.
+For more information about an error, try `rustc --explain E0308`.