Skip to content

Commit 0cf7b6a

Browse files
committed
method calls :3
1 parent 478ba4b commit 0cf7b6a

36 files changed

+193
-173
lines changed

compiler/rustc_hir_typeck/src/expr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,8 +1633,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16331633
expected: Expectation<'tcx>,
16341634
) -> Ty<'tcx> {
16351635
let rcvr_t = self.check_expr(rcvr);
1636-
// no need to check for bot/err -- callee does that
1637-
let rcvr_t = self.structurally_resolve_type(rcvr.span, rcvr_t);
1636+
let rcvr_t = self.try_structurally_resolve_type(rcvr.span, rcvr_t);
16381637

16391638
match self.lookup_method(rcvr_t, segment, segment.ident.span, expr, rcvr, args) {
16401639
Ok(method) => {

compiler/rustc_hir_typeck/src/method/confirm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
182182
assert_eq!(n, pick.autoderefs);
183183

184184
let mut adjustments = self.adjust_steps(&autoderef);
185-
let mut target = self.structurally_resolve_type(autoderef.span(), ty);
185+
let mut target = self.try_structurally_resolve_type(autoderef.span(), ty);
186186

187187
match pick.autoref_or_ptr_adjustment {
188188
Some(probe::AutorefOrPtrAdjustment::Autoref { mutbl, unsize }) => {

compiler/rustc_hir_typeck/src/method/probe.rs

Lines changed: 116 additions & 25 deletions
Large diffs are not rendered by default.

compiler/rustc_middle/src/traits/query.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ impl<'tcx> FromIterator<DropckConstraint<'tcx>> for DropckConstraint<'tcx> {
154154
#[derive(Debug, HashStable)]
155155
pub struct CandidateStep<'tcx> {
156156
pub self_ty: Canonical<'tcx, QueryResponse<'tcx, Ty<'tcx>>>,
157+
pub self_ty_is_opaque: bool,
157158
pub autoderefs: usize,
158159
/// `true` if the type results from a dereference of a raw pointer.
159160
/// when assembling candidates, we include these steps, but not when

tests/ui/closures/deduce-signature/obligation-with-leaking-placeholders.next.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | needs_foo(|x| {
55
| ^
66
...
77
LL | x.to_string();
8-
| - type must be known at this point
8+
| --------- type must be known at this point
99
|
1010
help: consider giving this closure parameter an explicit type
1111
|

tests/ui/impl-trait/call_method_ambiguous.next.stderr

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/ui/impl-trait/call_method_ambiguous.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ revisions: current next
22
//@[next] compile-flags: -Znext-solver
3-
//@[current] run-pass
3+
//@ run-pass
44

55
trait Get {
66
fn get(&mut self) -> u32;
@@ -24,7 +24,6 @@ where
2424
fn foo(n: usize, m: &mut ()) -> impl Get + use<'_> {
2525
if n > 0 {
2626
let mut iter = foo(n - 1, m);
27-
//[next]~^ ERROR type annotations needed
2827
assert_eq!(iter.get(), 1);
2928
}
3029
m

tests/ui/impl-trait/call_method_on_inherent_impl.next.stderr

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/ui/impl-trait/call_method_on_inherent_impl.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ revisions: current next
22
//@[next] compile-flags: -Znext-solver
3-
//@[current] check-pass
3+
//@ check-pass
44

55
trait MyDebug {
66
fn my_debug(&self);
@@ -16,7 +16,6 @@ where
1616
fn my_foo() -> impl std::fmt::Debug {
1717
if false {
1818
let x = my_foo();
19-
//[next]~^ ERROR type annotations needed
2019
x.my_debug();
2120
}
2221
()

tests/ui/impl-trait/call_method_on_inherent_impl_on_rigid_type.current.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0599]: no method named `my_debug` found for reference `&impl Debug` in the current scope
2-
--> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:16:11
2+
--> $DIR/call_method_on_inherent_impl_on_rigid_type.rs:15:11
33
|
44
LL | x.my_debug();
55
| ^^^^^^^^ method not found in `&impl Debug`

0 commit comments

Comments
 (0)