about summary refs log tree commit diff
path: root/src/test/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-24 14:12:10 +0000
committerbors <bors@rust-lang.org>2021-10-24 14:12:10 +0000
commit00d5e42e776da900049fe19087bc9b0057ec70cd (patch)
treef168b0920764af97f372d7faa608611cd3f09f79 /src/test/ui
parented08a67566d7d1d9dd2ad928ff21c23e841a4345 (diff)
parenteee29fd34c9fdc9afddfc3108d8e36199854f0b3 (diff)
downloadrust-00d5e42e776da900049fe19087bc9b0057ec70cd.tar.gz
rust-00d5e42e776da900049fe19087bc9b0057ec70cd.zip
Auto merge of #90235 - matthiaskrgr:rollup-7pqtevk, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #89558 (Add rustc lint, warning when iterating over hashmaps)
 - #90100 (Skip documentation for tier 2 targets on dist-x86_64-apple-darwin)
 - #90155 (Fix alignment of method headings for scannability)
 - #90162 (Mark `{array, slice}::{from_ref, from_mut}` as const fn)
 - #90221 (Fix ICE when forgetting to `Box` a parameter to a `Self::func` call)
 - #90234 (Temporarily turn overflow checks off for rustc-rayon-core)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test/ui')
-rw-r--r--src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs13
-rw-r--r--src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr17
2 files changed, 30 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs b/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs
new file mode 100644
index 00000000000..1e36b2fabf2
--- /dev/null
+++ b/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.rs
@@ -0,0 +1,13 @@
+// Checks that we do not ICE when comparing `Self` to `Pin`
+// edition:2021
+
+struct S;
+
+impl S {
+    fn foo(_: Box<Option<S>>) {}
+    fn bar() {
+        Self::foo(None) //~ ERROR mismatched types
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr b/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr
new file mode 100644
index 00000000000..c15b772b79c
--- /dev/null
+++ b/src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr
@@ -0,0 +1,17 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-90213-expected-boxfuture-self-ice.rs:9:19
+   |
+LL |         Self::foo(None)
+   |                   ^^^^ expected struct `Box`, found enum `Option`
+   |
+   = note: expected struct `Box<Option<S>>`
+                found enum `Option<_>`
+   = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+help: store this in the heap by calling `Box::new`
+   |
+LL |         Self::foo(Box::new(None))
+   |                   +++++++++    +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.