summaryrefslogtreecommitdiffstats
path: root/src/test/ui/span
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:11:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:12:43 +0000
commitcf94bdc0742c13e2a0cac864c478b8626b266e1b (patch)
tree044670aa50cc5e2b4229aa0b6b3df6676730c0a6 /src/test/ui/span
parentAdding debian version 1.65.0+dfsg1-2. (diff)
downloadrustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.tar.xz
rustc-cf94bdc0742c13e2a0cac864c478b8626b266e1b.zip
Merging upstream version 1.66.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/span')
-rw-r--r--src/test/ui/span/E0072.stderr6
-rw-r--r--src/test/ui/span/E0204.stderr8
-rw-r--r--src/test/ui/span/E0493.rs2
-rw-r--r--src/test/ui/span/E0493.stderr4
-rw-r--r--src/test/ui/span/E0535.stderr2
-rw-r--r--src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs1
-rw-r--r--src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr38
-rw-r--r--src/test/ui/span/issue-7575.rs75
-rw-r--r--src/test/ui/span/issue-7575.stderr82
-rw-r--r--src/test/ui/span/multiline-span-E0072.stderr6
-rw-r--r--src/test/ui/span/recursive-type-field.rs4
-rw-r--r--src/test/ui/span/recursive-type-field.stderr38
12 files changed, 44 insertions, 222 deletions
diff --git a/src/test/ui/span/E0072.stderr b/src/test/ui/span/E0072.stderr
index 882ed577c..20f2e0df0 100644
--- a/src/test/ui/span/E0072.stderr
+++ b/src/test/ui/span/E0072.stderr
@@ -2,12 +2,12 @@ error[E0072]: recursive type `ListNode` has infinite size
--> $DIR/E0072.rs:1:1
|
LL | struct ListNode {
- | ^^^^^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^^^^^
LL | head: u8,
LL | tail: Option<ListNode>,
- | ---------------- recursive without indirection
+ | -------- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | tail: Option<Box<ListNode>>,
| ++++ +
diff --git a/src/test/ui/span/E0204.stderr b/src/test/ui/span/E0204.stderr
index 257584843..0b2166eed 100644
--- a/src/test/ui/span/E0204.stderr
+++ b/src/test/ui/span/E0204.stderr
@@ -1,11 +1,11 @@
error[E0204]: the trait `Copy` may not be implemented for this type
- --> $DIR/E0204.rs:5:6
+ --> $DIR/E0204.rs:5:15
|
LL | foo: Vec<u32>,
| ------------- this field does not implement `Copy`
...
LL | impl Copy for Foo { }
- | ^^^^
+ | ^^^
error[E0204]: the trait `Copy` may not be implemented for this type
--> $DIR/E0204.rs:7:10
@@ -19,13 +19,13 @@ LL | ty: &'a mut bool,
= note: this error originates in the derive macro `Copy` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0204]: the trait `Copy` may not be implemented for this type
- --> $DIR/E0204.rs:17:6
+ --> $DIR/E0204.rs:17:15
|
LL | Bar { x: Vec<u32> },
| ----------- this field does not implement `Copy`
...
LL | impl Copy for EFoo { }
- | ^^^^
+ | ^^^^
error[E0204]: the trait `Copy` may not be implemented for this type
--> $DIR/E0204.rs:19:10
diff --git a/src/test/ui/span/E0493.rs b/src/test/ui/span/E0493.rs
index ad4100205..625da25a7 100644
--- a/src/test/ui/span/E0493.rs
+++ b/src/test/ui/span/E0493.rs
@@ -15,7 +15,7 @@ impl Drop for Bar {
}
const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1;
-//~^ destructors cannot be evaluated at compile-time
+//~^ ERROR destructor of
fn main() {
}
diff --git a/src/test/ui/span/E0493.stderr b/src/test/ui/span/E0493.stderr
index 29d1b0009..9db627562 100644
--- a/src/test/ui/span/E0493.stderr
+++ b/src/test/ui/span/E0493.stderr
@@ -1,10 +1,10 @@
-error[E0493]: destructors cannot be evaluated at compile-time
+error[E0493]: destructor of `(Foo, Foo)` cannot be evaluated at compile-time
--> $DIR/E0493.rs:17:17
|
LL | const F : Foo = (Foo { a : 0 }, Foo { a : 1 }).1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - value is dropped here
| |
- | constants cannot evaluate destructors
+ | the destructor for this type cannot be evaluated in constants
error: aborting due to previous error
diff --git a/src/test/ui/span/E0535.stderr b/src/test/ui/span/E0535.stderr
index f52c3f9f2..b1411bc43 100644
--- a/src/test/ui/span/E0535.stderr
+++ b/src/test/ui/span/E0535.stderr
@@ -3,6 +3,8 @@ error[E0535]: invalid argument
|
LL | #[inline(unknown)]
| ^^^^^^^
+ |
+ = help: valid inline arguments are `always` and `never`
error: aborting due to previous error
diff --git a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
index 94f578af2..4559da91e 100644
--- a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
+++ b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs
@@ -12,7 +12,6 @@ impl A {
trait C{async fn new(val: T) {} //~ ERROR `async fn` is not permitted in Rust 2015
//~^ ERROR functions in traits cannot be declared `async`
-//~| ERROR mismatched types
//~| ERROR cannot find type `T` in this scope
//~| WARN changes to closure capture in Rust 2021 will affect drop order [rust_2021_incompatible_closure_captures]
diff --git a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr
index 3814c568e..df1cafdb7 100644
--- a/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr
+++ b/src/test/ui/span/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.stderr
@@ -1,5 +1,5 @@
error: this file contains an unclosed delimiter
- --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:19:53
+ --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:18:53
|
LL | trait C{async fn new(val: T) {}
| - unclosed delimiter
@@ -25,12 +25,6 @@ LL | trait C{async fn new(val: T) {}
= help: pass `--edition 2021` to `rustc`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
-error[E0423]: expected function, found module `crate`
- --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:9:5
- |
-LL | crate(move || {} ).await
- | ^^^^^ not a function
-
error[E0412]: cannot find type `T` in this scope
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:27
|
@@ -51,7 +45,13 @@ LL | trait C{async fn new(val: T) {}
= note: `async` trait functions are not currently supported
= note: consider using the `async-trait` crate: https://crates.io/crates/async-trait
= note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
- = help: add `#![feature(return_position_impl_trait_in_trait)]` to the crate attributes to enable
+ = help: add `#![feature(async_fn_in_trait)]` to the crate attributes to enable
+
+error[E0423]: expected function, found module `crate`
+ --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:9:5
+ |
+LL | crate(move || {} ).await
+ | ^^^^^ not a function
warning: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:6:57
@@ -67,27 +67,13 @@ LL | | crate(move || {} ).await
LL | | }
| |_____^
|
- = note: requested on the command line with `-W rust-2021-incompatible-closure-captures`
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
+ = note: requested on the command line with `-W rust-2021-incompatible-closure-captures`
help: add a dummy let to cause `path` to be fully captured
|
LL | async fn create(path: impl AsRef<std::path::Path>) { let _ = &path;
| ++++++++++++++
-error[E0308]: mismatched types
- --> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:30
- |
-LL | trait C{async fn new(val: T) {}
- | ^^ expected associated type, found opaque type
- |
- ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
- |
-LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
- | ------------------------------- the found opaque type
- |
- = note: expected associated type `impl Future<Output = ()>` (trait associated opaque type at <$DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:30>)
- found opaque type `impl Future<Output = ()>` (opaque type at <$SRC_DIR/core/src/future/mod.rs:LL:COL>)
-
warning: changes to closure capture in Rust 2021 will affect drop order
--> $DIR/drop-location-span-error-rust-2021-incompatible-closure-captures-93117.rs:13:30
|
@@ -103,7 +89,7 @@ help: add a dummy let to cause `val` to be fully captured
LL | trait C{async fn new(val: T) { let _ = &val;}
| +++++++++++++
-error: aborting due to 7 previous errors; 2 warnings emitted
+error: aborting due to 6 previous errors; 2 warnings emitted
-Some errors have detailed explanations: E0308, E0412, E0423, E0670, E0706.
-For more information about an error, try `rustc --explain E0308`.
+Some errors have detailed explanations: E0412, E0423, E0670, E0706.
+For more information about an error, try `rustc --explain E0412`.
diff --git a/src/test/ui/span/issue-7575.rs b/src/test/ui/span/issue-7575.rs
deleted file mode 100644
index eddd158ae..000000000
--- a/src/test/ui/span/issue-7575.rs
+++ /dev/null
@@ -1,75 +0,0 @@
-// Test the mechanism for warning about possible missing `self` declarations.
-trait CtxtFn {
- fn f8(self, _: usize) -> usize;
- fn f9(_: usize) -> usize;
-}
-
-trait OtherTrait {
- fn f9(_: usize) -> usize;
-}
-
-// Note: this trait is not implemented, but we can't really tell
-// whether or not an impl would match anyhow without a self
-// declaration to match against, so we wind up prisizeing it as a
-// candidate. This seems not unreasonable -- perhaps the user meant to
-// implement it, after all.
-trait UnusedTrait {
- fn f9(_: usize) -> usize;
-}
-
-impl CtxtFn for usize {
- fn f8(self, i: usize) -> usize {
- i * 4
- }
-
- fn f9(i: usize) -> usize {
- i * 4
- }
-}
-
-impl OtherTrait for usize {
- fn f9(i: usize) -> usize {
- i * 8
- }
-}
-
-struct Myisize(isize);
-
-impl Myisize {
- fn fff(i: isize) -> isize {
- i
- }
-}
-
-trait ManyImplTrait {
- fn is_str() -> bool {
- false
- }
-}
-
-impl ManyImplTrait for String {
- fn is_str() -> bool {
- true
- }
-}
-
-impl ManyImplTrait for usize {}
-impl ManyImplTrait for isize {}
-impl ManyImplTrait for char {}
-impl ManyImplTrait for Myisize {}
-
-fn no_param_bound(u: usize, m: Myisize) -> usize {
- u.f8(42) + u.f9(342) + m.fff(42)
- //~^ ERROR no method named `f9` found
- //~| ERROR no method named `fff` found
-
-
-}
-
-fn param_bound<T: ManyImplTrait>(t: T) -> bool {
- t.is_str()
- //~^ ERROR no method named `is_str` found
-}
-
-fn main() {
-}
diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr
deleted file mode 100644
index 4f30edb3f..000000000
--- a/src/test/ui/span/issue-7575.stderr
+++ /dev/null
@@ -1,82 +0,0 @@
-error[E0599]: no method named `f9` found for type `usize` in the current scope
- --> $DIR/issue-7575.rs:62:18
- |
-LL | u.f8(42) + u.f9(342) + m.fff(42)
- | ^^ this is an associated function, not a method
- |
- = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
-note: candidate #1 is defined in the trait `CtxtFn`
- --> $DIR/issue-7575.rs:4:5
- |
-LL | fn f9(_: usize) -> usize;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: candidate #2 is defined in the trait `OtherTrait`
- --> $DIR/issue-7575.rs:8:5
- |
-LL | fn f9(_: usize) -> usize;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-note: candidate #3 is defined in the trait `UnusedTrait`
- --> $DIR/issue-7575.rs:17:5
- |
-LL | fn f9(_: usize) -> usize;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
- = help: items from traits can only be used if the trait is implemented and in scope
- = note: the following traits define an item `f9`, perhaps you need to implement one of them:
- candidate #1: `CtxtFn`
- candidate #2: `OtherTrait`
- candidate #3: `UnusedTrait`
-help: disambiguate the associated function for candidate #1
- |
-LL | u.f8(42) + <usize as CtxtFn>::f9(u, 342) + m.fff(42)
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-help: disambiguate the associated function for candidate #2
- |
-LL | u.f8(42) + <usize as OtherTrait>::f9(u, 342) + m.fff(42)
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-help: disambiguate the associated function for candidate #3
- |
-LL | u.f8(42) + <usize as UnusedTrait>::f9(u, 342) + m.fff(42)
- | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-error[E0599]: no method named `fff` found for struct `Myisize` in the current scope
- --> $DIR/issue-7575.rs:62:30
- |
-LL | struct Myisize(isize);
- | -------------- method `fff` not found for this struct
-...
-LL | u.f8(42) + u.f9(342) + m.fff(42)
- | --^^^
- | | |
- | | this is an associated function, not a method
- | help: use associated function syntax instead: `Myisize::fff`
- |
- = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
-note: the candidate is defined in an impl for the type `Myisize`
- --> $DIR/issue-7575.rs:39:5
- |
-LL | fn fff(i: isize) -> isize {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0599]: no method named `is_str` found for type parameter `T` in the current scope
- --> $DIR/issue-7575.rs:70:7
- |
-LL | fn param_bound<T: ManyImplTrait>(t: T) -> bool {
- | - method `is_str` not found for this type parameter
-LL | t.is_str()
- | ^^^^^^ this is an associated function, not a method
- |
- = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
-note: the candidate is defined in the trait `ManyImplTrait`
- --> $DIR/issue-7575.rs:45:5
- |
-LL | fn is_str() -> bool {
- | ^^^^^^^^^^^^^^^^^^^
- = help: items from traits can only be used if the type parameter is bounded by the trait
-help: disambiguate the associated function for the candidate
- |
-LL | <T as ManyImplTrait>::is_str(t)
- |
-
-error: aborting due to 3 previous errors
-
-For more information about this error, try `rustc --explain E0599`.
diff --git a/src/test/ui/span/multiline-span-E0072.stderr b/src/test/ui/span/multiline-span-E0072.stderr
index 79b13f45f..fc2f6e662 100644
--- a/src/test/ui/span/multiline-span-E0072.stderr
+++ b/src/test/ui/span/multiline-span-E0072.stderr
@@ -3,12 +3,12 @@ error[E0072]: recursive type `ListNode` has infinite size
|
LL | / struct
LL | | ListNode
- | |________^ recursive type has infinite size
+ | |________^
...
LL | tail: Option<ListNode>,
- | ---------------- recursive without indirection
+ | -------- recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
LL | tail: Option<Box<ListNode>>,
| ++++ +
diff --git a/src/test/ui/span/recursive-type-field.rs b/src/test/ui/span/recursive-type-field.rs
index 58ea81b83..bd4c43534 100644
--- a/src/test/ui/span/recursive-type-field.rs
+++ b/src/test/ui/span/recursive-type-field.rs
@@ -1,11 +1,11 @@
use std::rc::Rc;
-struct Foo<'a> { //~ ERROR recursive type
+struct Foo<'a> { //~ ERROR recursive types `Foo` and `Bar` have infinite size
bar: Bar<'a>,
b: Rc<Bar<'a>>,
}
-struct Bar<'a> { //~ ERROR recursive type
+struct Bar<'a> {
y: (Foo<'a>, Foo<'a>),
z: Option<Bar<'a>>,
a: &'a Foo<'a>,
diff --git a/src/test/ui/span/recursive-type-field.stderr b/src/test/ui/span/recursive-type-field.stderr
index 08e97e750..10af4c36b 100644
--- a/src/test/ui/span/recursive-type-field.stderr
+++ b/src/test/ui/span/recursive-type-field.stderr
@@ -1,35 +1,27 @@
-error[E0072]: recursive type `Foo` has infinite size
+error[E0072]: recursive types `Foo` and `Bar` have infinite size
--> $DIR/recursive-type-field.rs:3:1
|
LL | struct Foo<'a> {
- | ^^^^^^^^^^^^^^ recursive type has infinite size
+ | ^^^^^^^^^^^^^^
LL | bar: Bar<'a>,
| ------- recursive without indirection
+...
+LL | struct Bar<'a> {
+ | ^^^^^^^^^^^^^^
+LL | y: (Foo<'a>, Foo<'a>),
+ | ------- ------- recursive without indirection
+ | |
+ | recursive without indirection
|
-help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
- |
-LL | bar: Box<Bar<'a>>,
- | ++++ +
-
-error[E0072]: recursive type `Bar` has infinite size
- --> $DIR/recursive-type-field.rs:8:1
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
|
+LL ~ bar: Box<Bar<'a>>,
+LL | b: Rc<Bar<'a>>,
+ ...
LL | struct Bar<'a> {
- | ^^^^^^^^^^^^^^ recursive type has infinite size
-LL | y: (Foo<'a>, Foo<'a>),
- | ------------------ recursive without indirection
-LL | z: Option<Bar<'a>>,
- | --------------- recursive without indirection
-...
-LL | d: [Bar<'a>; 1],
- | ------------ recursive without indirection
-LL | e: Foo<'a>,
- | ------- recursive without indirection
-LL | x: Bar<'a>,
- | ------- recursive without indirection
+LL ~ y: (Box<Foo<'a>>, Box<Foo<'a>>),
|
- = help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
-error: aborting due to 2 previous errors
+error: aborting due to previous error
For more information about this error, try `rustc --explain E0072`.