@@ -1260,15 +1260,14 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
12601260 opt_ns : Option < Namespace > , // `None` indicates a module path in import
12611261 finalize : Option < Finalize > ,
12621262 ) -> PathResult < ' a > {
1263- let res = self . r . resolve_path_with_ribs (
1263+ self . r . resolve_path_with_ribs (
12641264 path,
12651265 opt_ns,
12661266 & self . parent_scope ,
12671267 finalize,
12681268 Some ( & self . ribs ) ,
12691269 None ,
1270- ) ;
1271- res
1270+ )
12721271 }
12731272
12741273 // AST resolution
@@ -3481,6 +3480,10 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
34813480 //
34823481 // Similar thing, for types, happens in `report_errors` above.
34833482 let report_errors_for_call = |this : & mut Self , parent_err : Spanned < ResolutionError < ' a > > | {
3483+ if !source. is_call ( ) {
3484+ return Some ( parent_err) ;
3485+ }
3486+
34843487 // Before we start looking for candidates, we have to get our hands
34853488 // on the type user is trying to perform invocation on; basically:
34863489 // we're transforming `HashMap::new` into just `HashMap`.
@@ -3721,6 +3724,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
37213724 "resolve_qpath(qself={:?}, path={:?}, ns={:?}, finalize={:?})" ,
37223725 qself, path, ns, finalize,
37233726 ) ;
3727+
37243728 if let Some ( qself) = qself {
37253729 if qself. position == 0 {
37263730 // This is a case like `<T>::B`, where there is no
0 commit comments