summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/suggest-dereferences
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /tests/ui/traits/suggest-dereferences
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.rs15
-rw-r--r--tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.stderr22
-rw-r--r--tests/ui/traits/suggest-dereferences/issue-39029.fixed (renamed from tests/ui/traits/suggest-deferences/issue-39029.fixed)0
-rw-r--r--tests/ui/traits/suggest-dereferences/issue-39029.rs (renamed from tests/ui/traits/suggest-deferences/issue-39029.rs)0
-rw-r--r--tests/ui/traits/suggest-dereferences/issue-39029.stderr (renamed from tests/ui/traits/suggest-deferences/issue-39029.stderr)0
-rw-r--r--tests/ui/traits/suggest-dereferences/issue-62530.fixed (renamed from tests/ui/traits/suggest-deferences/issue-62530.fixed)0
-rw-r--r--tests/ui/traits/suggest-dereferences/issue-62530.rs (renamed from tests/ui/traits/suggest-deferences/issue-62530.rs)0
-rw-r--r--tests/ui/traits/suggest-dereferences/issue-62530.stderr (renamed from tests/ui/traits/suggest-deferences/issue-62530.stderr)0
-rw-r--r--tests/ui/traits/suggest-dereferences/multiple-0.fixed (renamed from tests/ui/traits/suggest-deferences/multiple-0.fixed)0
-rw-r--r--tests/ui/traits/suggest-dereferences/multiple-0.rs (renamed from tests/ui/traits/suggest-deferences/multiple-0.rs)0
-rw-r--r--tests/ui/traits/suggest-dereferences/multiple-0.stderr (renamed from tests/ui/traits/suggest-deferences/multiple-0.stderr)0
-rw-r--r--tests/ui/traits/suggest-dereferences/multiple-1.rs (renamed from tests/ui/traits/suggest-deferences/multiple-1.rs)0
-rw-r--r--tests/ui/traits/suggest-dereferences/multiple-1.stderr (renamed from tests/ui/traits/suggest-deferences/multiple-1.stderr)0
-rw-r--r--tests/ui/traits/suggest-dereferences/root-obligation.fixed (renamed from tests/ui/traits/suggest-deferences/root-obligation.fixed)0
-rw-r--r--tests/ui/traits/suggest-dereferences/root-obligation.rs (renamed from tests/ui/traits/suggest-deferences/root-obligation.rs)0
-rw-r--r--tests/ui/traits/suggest-dereferences/root-obligation.stderr (renamed from tests/ui/traits/suggest-deferences/root-obligation.stderr)0
-rw-r--r--tests/ui/traits/suggest-dereferences/suggest-dereferencing-receiver-argument.fixed (renamed from tests/ui/traits/suggest-deferences/suggest-dereferencing-receiver-argument.fixed)0
-rw-r--r--tests/ui/traits/suggest-dereferences/suggest-dereferencing-receiver-argument.rs (renamed from tests/ui/traits/suggest-deferences/suggest-dereferencing-receiver-argument.rs)0
-rw-r--r--tests/ui/traits/suggest-dereferences/suggest-dereferencing-receiver-argument.stderr (renamed from tests/ui/traits/suggest-deferences/suggest-dereferencing-receiver-argument.stderr)0
19 files changed, 37 insertions, 0 deletions
diff --git a/tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.rs b/tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.rs
new file mode 100644
index 000000000..c6f9e3456
--- /dev/null
+++ b/tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.rs
@@ -0,0 +1,15 @@
+fn use_iterator<I>(itr: I)
+where
+ I: IntoIterator<Item = i32>,
+{
+}
+
+fn pass_iterator<I>(i: &dyn IntoIterator<Item = i32, IntoIter = I>)
+where
+ I: Iterator<Item = i32>,
+{
+ use_iterator(i);
+ //~^ ERROR `&dyn IntoIterator<IntoIter = I, Item = i32>` is not an iterator
+}
+
+fn main() {}
diff --git a/tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.stderr b/tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.stderr
new file mode 100644
index 000000000..bd0e7ca2c
--- /dev/null
+++ b/tests/ui/traits/suggest-dereferences/dont-suggest-unsize-deref.stderr
@@ -0,0 +1,22 @@
+error[E0277]: `&dyn IntoIterator<IntoIter = I, Item = i32>` is not an iterator
+ --> $DIR/dont-suggest-unsize-deref.rs:11:18
+ |
+LL | use_iterator(i);
+ | ------------ ^ `&dyn IntoIterator<IntoIter = I, Item = i32>` is not an iterator
+ | |
+ | required by a bound introduced by this call
+ |
+ = help: the trait `Iterator` is not implemented for `&dyn IntoIterator<IntoIter = I, Item = i32>`
+ = note: required for `&dyn IntoIterator<IntoIter = I, Item = i32>` to implement `IntoIterator`
+note: required by a bound in `use_iterator`
+ --> $DIR/dont-suggest-unsize-deref.rs:3:8
+ |
+LL | fn use_iterator<I>(itr: I)
+ | ------------ required by a bound in this function
+LL | where
+LL | I: IntoIterator<Item = i32>,
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `use_iterator`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/suggest-deferences/issue-39029.fixed b/tests/ui/traits/suggest-dereferences/issue-39029.fixed
index a1abf668b..a1abf668b 100644
--- a/tests/ui/traits/suggest-deferences/issue-39029.fixed
+++ b/tests/ui/traits/suggest-dereferences/issue-39029.fixed
diff --git a/tests/ui/traits/suggest-deferences/issue-39029.rs b/tests/ui/traits/suggest-dereferences/issue-39029.rs
index 90d097105..90d097105 100644
--- a/tests/ui/traits/suggest-deferences/issue-39029.rs
+++ b/tests/ui/traits/suggest-dereferences/issue-39029.rs
diff --git a/tests/ui/traits/suggest-deferences/issue-39029.stderr b/tests/ui/traits/suggest-dereferences/issue-39029.stderr
index 49105de3d..49105de3d 100644
--- a/tests/ui/traits/suggest-deferences/issue-39029.stderr
+++ b/tests/ui/traits/suggest-dereferences/issue-39029.stderr
diff --git a/tests/ui/traits/suggest-deferences/issue-62530.fixed b/tests/ui/traits/suggest-dereferences/issue-62530.fixed
index 406caaa00..406caaa00 100644
--- a/tests/ui/traits/suggest-deferences/issue-62530.fixed
+++ b/tests/ui/traits/suggest-dereferences/issue-62530.fixed
diff --git a/tests/ui/traits/suggest-deferences/issue-62530.rs b/tests/ui/traits/suggest-dereferences/issue-62530.rs
index 53846be73..53846be73 100644
--- a/tests/ui/traits/suggest-deferences/issue-62530.rs
+++ b/tests/ui/traits/suggest-dereferences/issue-62530.rs
diff --git a/tests/ui/traits/suggest-deferences/issue-62530.stderr b/tests/ui/traits/suggest-dereferences/issue-62530.stderr
index e47ae0b65..e47ae0b65 100644
--- a/tests/ui/traits/suggest-deferences/issue-62530.stderr
+++ b/tests/ui/traits/suggest-dereferences/issue-62530.stderr
diff --git a/tests/ui/traits/suggest-deferences/multiple-0.fixed b/tests/ui/traits/suggest-dereferences/multiple-0.fixed
index b7160b75c..b7160b75c 100644
--- a/tests/ui/traits/suggest-deferences/multiple-0.fixed
+++ b/tests/ui/traits/suggest-dereferences/multiple-0.fixed
diff --git a/tests/ui/traits/suggest-deferences/multiple-0.rs b/tests/ui/traits/suggest-dereferences/multiple-0.rs
index 9ac55177f..9ac55177f 100644
--- a/tests/ui/traits/suggest-deferences/multiple-0.rs
+++ b/tests/ui/traits/suggest-dereferences/multiple-0.rs
diff --git a/tests/ui/traits/suggest-deferences/multiple-0.stderr b/tests/ui/traits/suggest-dereferences/multiple-0.stderr
index 6a4d4b8d5..6a4d4b8d5 100644
--- a/tests/ui/traits/suggest-deferences/multiple-0.stderr
+++ b/tests/ui/traits/suggest-dereferences/multiple-0.stderr
diff --git a/tests/ui/traits/suggest-deferences/multiple-1.rs b/tests/ui/traits/suggest-dereferences/multiple-1.rs
index 91c6c7924..91c6c7924 100644
--- a/tests/ui/traits/suggest-deferences/multiple-1.rs
+++ b/tests/ui/traits/suggest-dereferences/multiple-1.rs
diff --git a/tests/ui/traits/suggest-deferences/multiple-1.stderr b/tests/ui/traits/suggest-dereferences/multiple-1.stderr
index 6e12321c2..6e12321c2 100644
--- a/tests/ui/traits/suggest-deferences/multiple-1.stderr
+++ b/tests/ui/traits/suggest-dereferences/multiple-1.stderr
diff --git a/tests/ui/traits/suggest-deferences/root-obligation.fixed b/tests/ui/traits/suggest-dereferences/root-obligation.fixed
index 7a8433f90..7a8433f90 100644
--- a/tests/ui/traits/suggest-deferences/root-obligation.fixed
+++ b/tests/ui/traits/suggest-dereferences/root-obligation.fixed
diff --git a/tests/ui/traits/suggest-deferences/root-obligation.rs b/tests/ui/traits/suggest-dereferences/root-obligation.rs
index 51bac2107..51bac2107 100644
--- a/tests/ui/traits/suggest-deferences/root-obligation.rs
+++ b/tests/ui/traits/suggest-dereferences/root-obligation.rs
diff --git a/tests/ui/traits/suggest-deferences/root-obligation.stderr b/tests/ui/traits/suggest-dereferences/root-obligation.stderr
index 1363fb8c4..1363fb8c4 100644
--- a/tests/ui/traits/suggest-deferences/root-obligation.stderr
+++ b/tests/ui/traits/suggest-dereferences/root-obligation.stderr
diff --git a/tests/ui/traits/suggest-deferences/suggest-dereferencing-receiver-argument.fixed b/tests/ui/traits/suggest-dereferences/suggest-dereferencing-receiver-argument.fixed
index ea3d1bf85..ea3d1bf85 100644
--- a/tests/ui/traits/suggest-deferences/suggest-dereferencing-receiver-argument.fixed
+++ b/tests/ui/traits/suggest-dereferences/suggest-dereferencing-receiver-argument.fixed
diff --git a/tests/ui/traits/suggest-deferences/suggest-dereferencing-receiver-argument.rs b/tests/ui/traits/suggest-dereferences/suggest-dereferencing-receiver-argument.rs
index 9eda68027..9eda68027 100644
--- a/tests/ui/traits/suggest-deferences/suggest-dereferencing-receiver-argument.rs
+++ b/tests/ui/traits/suggest-dereferences/suggest-dereferencing-receiver-argument.rs
diff --git a/tests/ui/traits/suggest-deferences/suggest-dereferencing-receiver-argument.stderr b/tests/ui/traits/suggest-dereferences/suggest-dereferencing-receiver-argument.stderr
index ede31a2c7..ede31a2c7 100644
--- a/tests/ui/traits/suggest-deferences/suggest-dereferencing-receiver-argument.stderr
+++ b/tests/ui/traits/suggest-dereferences/suggest-dereferencing-receiver-argument.stderr