summaryrefslogtreecommitdiffstats
path: root/tests/ui/lifetimes
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lifetimes')
-rw-r--r--tests/ui/lifetimes/anonymize-unnamed-bound-vars-in-binders.rs27
-rw-r--r--tests/ui/lifetimes/issue-95023.stderr2
-rw-r--r--tests/ui/lifetimes/lifetime-elision-return-type-trait.stderr6
-rw-r--r--tests/ui/lifetimes/unusual-rib-combinations.stderr4
4 files changed, 36 insertions, 3 deletions
diff --git a/tests/ui/lifetimes/anonymize-unnamed-bound-vars-in-binders.rs b/tests/ui/lifetimes/anonymize-unnamed-bound-vars-in-binders.rs
new file mode 100644
index 000000000..05e3763e9
--- /dev/null
+++ b/tests/ui/lifetimes/anonymize-unnamed-bound-vars-in-binders.rs
@@ -0,0 +1,27 @@
+// build-pass
+// issue: #115807
+
+trait Chip: for<'a> TraitWithLifetime<'a> + SomeMarker {
+ fn compute(&self);
+}
+
+trait SomeMarker {}
+
+trait TraitWithLifetime<'a>: SomeMarker {}
+
+trait Machine {
+ fn run();
+}
+
+struct BasicMachine;
+
+impl Machine for BasicMachine {
+ fn run() {
+ let chips: [&dyn Chip; 0] = [];
+ let _ = chips.map(|chip| chip.compute());
+ }
+}
+
+fn main() {
+ BasicMachine::run();
+}
diff --git a/tests/ui/lifetimes/issue-95023.stderr b/tests/ui/lifetimes/issue-95023.stderr
index 5b93eff86..6361d8ad3 100644
--- a/tests/ui/lifetimes/issue-95023.stderr
+++ b/tests/ui/lifetimes/issue-95023.stderr
@@ -36,7 +36,7 @@ error[E0220]: associated type `B` not found for `Self`
--> $DIR/issue-95023.rs:6:44
|
LL | fn foo<const N: usize>(&self) -> Self::B<{N}>;
- | ^ associated type `B` not found
+ | ^ help: `Self` has the following associated type: `Output`
error: aborting due to 5 previous errors
diff --git a/tests/ui/lifetimes/lifetime-elision-return-type-trait.stderr b/tests/ui/lifetimes/lifetime-elision-return-type-trait.stderr
index ef1127c59..421ab3fcf 100644
--- a/tests/ui/lifetimes/lifetime-elision-return-type-trait.stderr
+++ b/tests/ui/lifetimes/lifetime-elision-return-type-trait.stderr
@@ -3,6 +3,12 @@ error[E0277]: the trait bound `Result<(), _>: Future` is not satisfied
|
LL | fn foo() -> impl Future<Item=(), Error=Box<dyn Error>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Future` is not implemented for `Result<(), _>`
+ |
+help: this trait has no implementations, consider adding one
+ --> $DIR/lifetime-elision-return-type-trait.rs:1:1
+ |
+LL | trait Future {
+ | ^^^^^^^^^^^^
error: aborting due to previous error
diff --git a/tests/ui/lifetimes/unusual-rib-combinations.stderr b/tests/ui/lifetimes/unusual-rib-combinations.stderr
index 01ec69a61..92a2ef2f4 100644
--- a/tests/ui/lifetimes/unusual-rib-combinations.stderr
+++ b/tests/ui/lifetimes/unusual-rib-combinations.stderr
@@ -56,7 +56,7 @@ LL | fn d<const C: S>() {}
| ^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
+ = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
error: `&dyn for<'a> Foo<'a>` is forbidden as the type of a const generic parameter
--> $DIR/unusual-rib-combinations.rs:29:21
@@ -65,7 +65,7 @@ LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the only supported types are integers, `bool` and `char`
- = help: more complex types are supported with `#![feature(adt_const_params)]`
+ = help: add `#![feature(adt_const_params)]` to the crate attributes to enable more complex and user defined types
error: aborting due to 9 previous errors