@@ -1261,15 +1261,14 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
12611261 opt_ns : Option < Namespace > , // `None` indicates a module path in import
12621262 finalize : Option < Finalize > ,
12631263 ) -> PathResult < ' a > {
1264- let res = self . r . resolve_path_with_ribs (
1264+ self . r . resolve_path_with_ribs (
12651265 path,
12661266 opt_ns,
12671267 & self . parent_scope ,
12681268 finalize,
12691269 Some ( & self . ribs ) ,
12701270 None ,
1271- ) ;
1272- res
1271+ )
12731272 }
12741273
12751274 // AST resolution
@@ -3486,6 +3485,10 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
34863485 //
34873486 // Similar thing, for types, happens in `report_errors` above.
34883487 let report_errors_for_call = |this : & mut Self , parent_err : Spanned < ResolutionError < ' a > > | {
3488+ if !source. is_call ( ) {
3489+ return Some ( parent_err) ;
3490+ }
3491+
34893492 // Before we start looking for candidates, we have to get our hands
34903493 // on the type user is trying to perform invocation on; basically:
34913494 // we're transforming `HashMap::new` into just `HashMap`.
@@ -3726,6 +3729,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
37263729 "resolve_qpath(qself={:?}, path={:?}, ns={:?}, finalize={:?})" ,
37273730 qself, path, ns, finalize,
37283731 ) ;
3732+
37293733 if let Some ( qself) = qself {
37303734 if qself. position == 0 {
37313735 // This is a case like `<T>::B`, where there is no
0 commit comments