summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:43 +0000
commit3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 (patch)
treedaf049b282ab10e8c3d03e409b3cd84ff3f7690c /tests/ui/rfcs
parentAdding debian version 1.68.2+dfsg1-1. (diff)
downloadrustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.tar.xz
rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.zip
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/rfcs')
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr6
-rw-r--r--tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr6
-rw-r--r--tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr2
-rw-r--r--tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr2
-rw-r--r--tests/ui/rfcs/rfc-2528-type-changing-struct-update/lifetime-update.stderr3
-rw-r--r--tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr4
6 files changed, 19 insertions, 4 deletions
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr
index cf5815df5..b0ac5dc44 100644
--- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.mir.stderr
@@ -11,7 +11,13 @@ LL | let foo: fn() = foo;
|
= note: expected fn pointer `fn()`
found fn item `fn() {foo}`
+ = note: fn items are distinct from fn pointers
= note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers
+ = note: when the arguments and return types match, functions can be coerced to function pointers
+help: consider casting to a fn pointer
+ |
+LL | let foo: fn() = foo as fn();
+ | ~~~~~~~~~~~
error: aborting due to previous error
diff --git a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr
index cf5815df5..b0ac5dc44 100644
--- a/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr
+++ b/tests/ui/rfcs/rfc-2396-target_feature-11/fn-ptr.thir.stderr
@@ -11,7 +11,13 @@ LL | let foo: fn() = foo;
|
= note: expected fn pointer `fn()`
found fn item `fn() {foo}`
+ = note: fn items are distinct from fn pointers
= note: functions with `#[target_feature]` can only be coerced to `unsafe` function pointers
+ = note: when the arguments and return types match, functions can be coerced to function pointers
+help: consider casting to a fn pointer
+ |
+LL | let foo: fn() = foo as fn();
+ | ~~~~~~~~~~~
error: aborting due to previous error
diff --git a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr
index 2217b8c04..48e46d3d1 100644
--- a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr
+++ b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/feature-gate.stderr
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
--> $DIR/feature-gate.rs:22:11
|
LL | ..m1
- | ^^ expected struct `State2`, found struct `State1`
+ | ^^ expected `Machine<State2>`, found `Machine<State1>`
|
= note: expected struct `Machine<State2>`
found struct `Machine<State1>`
diff --git a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr
index 5957ea7c9..831731ba4 100644
--- a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr
+++ b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/issue-92010-trait-bound-not-satisfied.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/issue-92010-trait-bound-not-satisfied.rs:8:43
|
LL | fn y(&self, y: f64) -> Self { P{y, .. self.clone() } }
- | ^^^^^^^^^^^^ expected struct `P`, found `&P<T>`
+ | ^^^^^^^^^^^^ expected `P<T>`, found `&P<T>`
|
= note: expected struct `P<T>`
found reference `&P<T>`
diff --git a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/lifetime-update.stderr b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/lifetime-update.stderr
index 5f93ad6e0..1c26eb880 100644
--- a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/lifetime-update.stderr
+++ b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/lifetime-update.stderr
@@ -1,6 +1,9 @@
error[E0597]: `s` does not live long enough
--> $DIR/lifetime-update.rs:20:17
|
+LL | let s = String::from("hello");
+ | - binding `s` declared here
+...
LL | lt_str: &s,
| ^^ borrowed value does not live long enough
...
diff --git a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr
index 6f31b1a96..f31b311c7 100644
--- a/tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr
+++ b/tests/ui/rfcs/rfc-2528-type-changing-struct-update/type-generic-update.stderr
@@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/type-generic-update.rs:46:11
|
LL | ..m1
- | ^^ expected `i32`, found `f64`
+ | ^^ expected `Machine<'_, i32, f64>`, found `Machine<'_, f64, f64>`
|
= note: expected struct `Machine<'_, i32, _>`
found struct `Machine<'_, f64, _>`
@@ -11,7 +11,7 @@ error[E0308]: mismatched types
--> $DIR/type-generic-update.rs:51:11
|
LL | ..m1
- | ^^ expected `i32`, found `f64`
+ | ^^ expected `Machine<'_, i32, i32>`, found `Machine<'_, f64, f64>`
|
= note: expected struct `Machine<'_, i32, i32>`
found struct `Machine<'_, f64, f64>`