summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /tests/ui/generic-associated-types
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/generic-associated-types')
-rw-r--r--tests/ui/generic-associated-types/issue-102114.current.stderr (renamed from tests/ui/generic-associated-types/issue-102114.stderr)2
-rw-r--r--tests/ui/generic-associated-types/issue-102114.next.stderr12
-rw-r--r--tests/ui/generic-associated-types/issue-102114.rs3
-rw-r--r--tests/ui/generic-associated-types/issue-86218.rs1
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait.rs1
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait.stderr8
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait2.rs19
-rw-r--r--tests/ui/generic-associated-types/issue-90014-tait2.stderr13
-rw-r--r--tests/ui/generic-associated-types/streaming_iterator.rs3
9 files changed, 26 insertions, 36 deletions
diff --git a/tests/ui/generic-associated-types/issue-102114.stderr b/tests/ui/generic-associated-types/issue-102114.current.stderr
index 8e41dee54..6e7a0b1f6 100644
--- a/tests/ui/generic-associated-types/issue-102114.stderr
+++ b/tests/ui/generic-associated-types/issue-102114.current.stderr
@@ -1,5 +1,5 @@
error[E0049]: type `B` has 1 type parameter but its trait declaration has 0 type parameters
- --> $DIR/issue-102114.rs:11:12
+ --> $DIR/issue-102114.rs:14:12
|
LL | type B<'b>;
| -- expected 0 type parameters
diff --git a/tests/ui/generic-associated-types/issue-102114.next.stderr b/tests/ui/generic-associated-types/issue-102114.next.stderr
new file mode 100644
index 000000000..6e7a0b1f6
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-102114.next.stderr
@@ -0,0 +1,12 @@
+error[E0049]: type `B` has 1 type parameter but its trait declaration has 0 type parameters
+ --> $DIR/issue-102114.rs:14:12
+ |
+LL | type B<'b>;
+ | -- expected 0 type parameters
+...
+LL | type B<T> = Wrapper<T>;
+ | ^ found 1 type parameter
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0049`.
diff --git a/tests/ui/generic-associated-types/issue-102114.rs b/tests/ui/generic-associated-types/issue-102114.rs
index de31737ef..bb6622c0a 100644
--- a/tests/ui/generic-associated-types/issue-102114.rs
+++ b/tests/ui/generic-associated-types/issue-102114.rs
@@ -1,3 +1,6 @@
+// revisions: current next
+//[next] compile-flags: -Ztrait-solver=next
+
trait A {
type B<'b>;
fn a() -> Self::B<'static>;
diff --git a/tests/ui/generic-associated-types/issue-86218.rs b/tests/ui/generic-associated-types/issue-86218.rs
index 61cfdd35a..397a0f2c6 100644
--- a/tests/ui/generic-associated-types/issue-86218.rs
+++ b/tests/ui/generic-associated-types/issue-86218.rs
@@ -17,7 +17,6 @@ trait Yay<AdditionalValue> {
impl<'a> Yay<&'a ()> for () {
type InnerStream<'s> = impl Stream<Item = i32> + 's;
- //^ ERROR does not fulfill the required lifetime
fn foo<'s>() -> Self::InnerStream<'s> {
()
}
diff --git a/tests/ui/generic-associated-types/issue-90014-tait.rs b/tests/ui/generic-associated-types/issue-90014-tait.rs
index bc3a4e129..1ce5cd319 100644
--- a/tests/ui/generic-associated-types/issue-90014-tait.rs
+++ b/tests/ui/generic-associated-types/issue-90014-tait.rs
@@ -13,7 +13,6 @@ struct Foo<'a>(&'a mut ());
impl Foo<'_> {
type Fut<'a> = impl Future<Output = ()>;
- //^ ERROR: the type `&mut ()` does not fulfill the required lifetime
fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
async { () }
diff --git a/tests/ui/generic-associated-types/issue-90014-tait.stderr b/tests/ui/generic-associated-types/issue-90014-tait.stderr
index 8330a387e..1dec7edce 100644
--- a/tests/ui/generic-associated-types/issue-90014-tait.stderr
+++ b/tests/ui/generic-associated-types/issue-90014-tait.stderr
@@ -1,18 +1,18 @@
error[E0308]: mismatched types
- --> $DIR/issue-90014-tait.rs:19:9
+ --> $DIR/issue-90014-tait.rs:18:9
|
LL | type Fut<'a> = impl Future<Output = ()>;
| ------------------------ the expected future
-...
+LL |
LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
| ------------- expected `Foo<'_>::Fut<'a>` because of return type
LL | async { () }
| ^^^^^^^^^^^^ expected future, found `async` block
|
= note: expected opaque type `Foo<'_>::Fut<'a>`
- found `async` block `[async block@$DIR/issue-90014-tait.rs:19:9: 19:21]`
+ found `async` block `[async block@$DIR/issue-90014-tait.rs:18:9: 18:21]`
note: this item must have the opaque type in its signature in order to be able to register hidden types
- --> $DIR/issue-90014-tait.rs:18:8
+ --> $DIR/issue-90014-tait.rs:17:8
|
LL | fn make_fut<'a>(&'a self) -> Self::Fut<'a> {
| ^^^^^^^^
diff --git a/tests/ui/generic-associated-types/issue-90014-tait2.rs b/tests/ui/generic-associated-types/issue-90014-tait2.rs
index dacbc93de..7fb14eddc 100644
--- a/tests/ui/generic-associated-types/issue-90014-tait2.rs
+++ b/tests/ui/generic-associated-types/issue-90014-tait2.rs
@@ -1,24 +1,9 @@
//! This test checks that opaque type collection doesn't try to normalize the projection
//! without respecting its binders (which would ICE).
//! Unfortunately we don't even reach opaque type collection, as we ICE in typeck before that.
-// known-bug: #109281
-// failure-status: 101
-// error-pattern:internal compiler error
-// normalize-stderr-test "internal compiler error.*" -> ""
-// normalize-stderr-test "DefId\([^)]*\)" -> "..."
-// normalize-stderr-test "\nerror: internal compiler error.*\n\n" -> ""
-// normalize-stderr-test "note:.*unexpectedly panicked.*\n\n" -> ""
-// normalize-stderr-test "note: we would appreciate a bug report.*\n\n" -> ""
-// normalize-stderr-test "note: compiler flags.*\n\n" -> ""
-// normalize-stderr-test "note: rustc.*running on.*\n\n" -> ""
-// normalize-stderr-test "thread.*panicked.*\n" -> ""
-// normalize-stderr-test "stack backtrace:\n" -> ""
-// normalize-stderr-test "\s\d{1,}: .*\n" -> ""
-// normalize-stderr-test "\s at .*\n" -> ""
-// normalize-stderr-test ".*note: Some details.*\n" -> ""
-// normalize-stderr-test "\n\n[ ]*\n" -> ""
-// normalize-stderr-test "compiler/.*: projection" -> "projection"
+//! See #109281 for the original report.
// edition:2018
+// error-pattern: expected generic lifetime parameter, found `'a`
#![feature(type_alias_impl_trait)]
#![allow(incomplete_features)]
diff --git a/tests/ui/generic-associated-types/issue-90014-tait2.stderr b/tests/ui/generic-associated-types/issue-90014-tait2.stderr
index 3187be333..d04788a91 100644
--- a/tests/ui/generic-associated-types/issue-90014-tait2.stderr
+++ b/tests/ui/generic-associated-types/issue-90014-tait2.stderr
@@ -1,12 +1,5 @@
-error:
- --> $DIR/issue-90014-tait2.rs:41:27
- |
-LL | fn make_fut(&self) -> Box<dyn for<'a> Trait<'a, Thing = Fut<'a>>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^query stack during panic:
-#0 [typeck] type-checking `<impl at $DIR/issue-90014-tait2.rs:40:1: 40:13>::make_fut`
-#1 [type_of] computing type of `Fut::{opaque#0}`
-#2 [check_mod_item_types] checking item types in top-level module
-#3 [analysis] running analysis passes on this crate
-end of query stack
+error[E0792]: expected generic lifetime parameter, found `'a`
+
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0792`.
diff --git a/tests/ui/generic-associated-types/streaming_iterator.rs b/tests/ui/generic-associated-types/streaming_iterator.rs
index 408b8dc99..656fb743e 100644
--- a/tests/ui/generic-associated-types/streaming_iterator.rs
+++ b/tests/ui/generic-associated-types/streaming_iterator.rs
@@ -15,8 +15,7 @@ struct Foo<T: StreamingIterator + 'static> {
// Users can bound parameters by the type constructed by that trait's associated type constructor
// of a trait using HRTB. Both type equality bounds and trait bounds of this kind are valid:
-//FIXME(#44265): This next line should parse and be valid
-//fn foo<T: for<'a> StreamingIterator<Item<'a>=&'a [i32]>>(_iter: T) { /* ... */ }
+fn _bar<T: for<'a> StreamingIterator<Item<'a>=&'a [i32]>>(_iter: T) { /* ... */ }
fn _foo<T>(_iter: T) where T: StreamingIterator, for<'a> T::Item<'a>: Display { /* ... */ }
// Full example of enumerate iterator