summaryrefslogtreecommitdiffstats
path: root/src/test/ui/array-slice-vec
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/array-slice-vec')
-rw-r--r--src/test/ui/array-slice-vec/array-break-length.stderr4
-rw-r--r--src/test/ui/array-slice-vec/slice_is_sorted_by_borrow.rs20
-rw-r--r--src/test/ui/array-slice-vec/vec-macro-with-comma-only.stderr2
3 files changed, 24 insertions, 2 deletions
diff --git a/src/test/ui/array-slice-vec/array-break-length.stderr b/src/test/ui/array-slice-vec/array-break-length.stderr
index 93f1c238b..2df7b6d7f 100644
--- a/src/test/ui/array-slice-vec/array-break-length.stderr
+++ b/src/test/ui/array-slice-vec/array-break-length.stderr
@@ -1,8 +1,8 @@
-error[E0268]: `break` outside of a loop
+error[E0268]: `break` outside of a loop or labeled block
--> $DIR/array-break-length.rs:3:17
|
LL | |_: [_; break]| {}
- | ^^^^^ cannot `break` outside of a loop
+ | ^^^^^ cannot `break` outside of a loop or labeled block
error[E0268]: `continue` outside of a loop
--> $DIR/array-break-length.rs:7:17
diff --git a/src/test/ui/array-slice-vec/slice_is_sorted_by_borrow.rs b/src/test/ui/array-slice-vec/slice_is_sorted_by_borrow.rs
new file mode 100644
index 000000000..073280d0f
--- /dev/null
+++ b/src/test/ui/array-slice-vec/slice_is_sorted_by_borrow.rs
@@ -0,0 +1,20 @@
+// check-pass
+// regression test for https://github.com/rust-lang/rust/issues/53485#issuecomment-885393452
+
+#![feature(is_sorted)]
+
+struct A {
+ name: String,
+}
+
+fn main() {
+ let a = &[
+ A {
+ name: "1".to_string(),
+ },
+ A {
+ name: "2".to_string(),
+ },
+ ];
+ assert!(a.is_sorted_by_key(|a| a.name.as_str()));
+}
diff --git a/src/test/ui/array-slice-vec/vec-macro-with-comma-only.stderr b/src/test/ui/array-slice-vec/vec-macro-with-comma-only.stderr
index abbee347c..ec4a001f4 100644
--- a/src/test/ui/array-slice-vec/vec-macro-with-comma-only.stderr
+++ b/src/test/ui/array-slice-vec/vec-macro-with-comma-only.stderr
@@ -3,6 +3,8 @@ error: no rules expected the token `,`
|
LL | vec![,];
| ^ no rules expected this token in macro call
+ |
+ = note: while trying to match end of macro
error: aborting due to previous error