summaryrefslogtreecommitdiffstats
path: root/tests/ui/trivial-bounds
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /tests/ui/trivial-bounds
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/trivial-bounds')
-rw-r--r--tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr4
-rw-r--r--tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.rs2
-rw-r--r--tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr8
3 files changed, 8 insertions, 6 deletions
diff --git a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr
index 39b60c311..c054ddb89 100644
--- a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr
+++ b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr
@@ -7,7 +7,7 @@ LL | *t
help: consider changing this to be a mutable reference
|
LL | fn reborrow_mut<'a>(t: &'a mut &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
- | ~~~~~~~~~~~~~~~~~~~
+ | +++
error[E0596]: cannot borrow `**t` as mutable, as it is behind a `&` reference
--> $DIR/trivial-bounds-inconsistent-copy-reborrow.rs:10:6
@@ -18,7 +18,7 @@ LL | {*t}
help: consider changing this to be a mutable reference
|
LL | fn copy_reborrow_mut<'a>(t: &'a mut &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
- | ~~~~~~~~~~~~~~~~~~~
+ | +++
error: aborting due to 2 previous errors
diff --git a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.rs b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.rs
index 3416503b8..f98c3164d 100644
--- a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.rs
+++ b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.rs
@@ -1,6 +1,8 @@
// check-pass
// Check tautalogically false `Copy` bounds
+
#![feature(trivial_bounds)]
+#![allow(dropping_references, dropping_copy_types)]
fn copy_string(t: String) -> String where String: Copy { //~ WARNING trivial_bounds
is_copy(&t);
diff --git a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr
index 1e2662389..deeb352a2 100644
--- a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr
+++ b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy.stderr
@@ -1,5 +1,5 @@
warning: trait bound String: Copy does not depend on any type or lifetime parameters
- --> $DIR/trivial-bounds-inconsistent-copy.rs:5:51
+ --> $DIR/trivial-bounds-inconsistent-copy.rs:7:51
|
LL | fn copy_string(t: String) -> String where String: Copy {
| ^^^^
@@ -7,19 +7,19 @@ LL | fn copy_string(t: String) -> String where String: Copy {
= note: `#[warn(trivial_bounds)]` on by default
warning: trait bound String: Copy does not depend on any type or lifetime parameters
- --> $DIR/trivial-bounds-inconsistent-copy.rs:12:56
+ --> $DIR/trivial-bounds-inconsistent-copy.rs:14:56
|
LL | fn copy_out_string(t: &String) -> String where String: Copy {
| ^^^^
warning: trait bound String: Copy does not depend on any type or lifetime parameters
- --> $DIR/trivial-bounds-inconsistent-copy.rs:16:55
+ --> $DIR/trivial-bounds-inconsistent-copy.rs:18:55
|
LL | fn copy_string_with_param<T>(x: String) where String: Copy {
| ^^^^
warning: trait bound for<'b> &'b mut i32: Copy does not depend on any type or lifetime parameters
- --> $DIR/trivial-bounds-inconsistent-copy.rs:22:76
+ --> $DIR/trivial-bounds-inconsistent-copy.rs:24:76
|
LL | fn copy_mut<'a>(t: &&'a mut i32) -> &'a mut i32 where for<'b> &'b mut i32: Copy {
| ^^^^