Skip to content

Commit de3b4d4

Browse files
committed
fix rebase
1 parent 74b7ed7 commit de3b4d4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc_middle/ty/error.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,9 @@ impl<T> Trait<T> for X {
698698
suggested |=
699699
self.suggest_constraint(db, &msg, body_owner_def_id, proj_ty, values.found);
700700
}
701-
if let (Some(hir_id), false) = (self.hir().as_local_hir_id(body_owner_def_id), suggested) {
701+
if let (Some(hir_id), false) =
702+
(body_owner_def_id.as_local().map(|id| self.hir().as_local_hir_id(id)), suggested)
703+
{
702704
// When `body_owner` is an `impl` or `trait` item, look in its associated types for
703705
// `expected` and point at it.
704706
let parent_id = self.hir().get_parent_item(hir_id);

src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ LL | Pin::new(x)
3838
|
3939
= note: expected struct `std::boxed::Box<dyn std::future::Future<Output = i32> + std::marker::Send>`
4040
found type parameter `F`
41-
= help: type parameters must be constrained to match other types
42-
= note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
4341
= 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
4442

4543
error[E0277]: `dyn std::future::Future<Output = i32> + std::marker::Send` cannot be unpinned

0 commit comments

Comments
 (0)