use syntax::ast;
use syntax::util::parser::PREC_POSTFIX;
-use syntax_pos::{self, Span};
+use syntax_pos::Span;
use rustc::hir;
use rustc::hir::def::Def;
use rustc::hir::map::NodeItem;
if let Some((msg, suggestion)) = self.check_ref(expr, checked_ty, expected) {
err.span_suggestion(expr.span, msg, suggestion);
} else if !self.check_for_cast(&mut err, expr, expr_ty, expected) {
- let methods = self.get_conversion_methods(expected, checked_ty);
+ let methods = self.get_conversion_methods(expr.span, expected, checked_ty);
if let Ok(expr_text) = self.tcx.sess.codemap().span_to_snippet(expr.span) {
let suggestions = iter::repeat(expr_text).zip(methods.iter())
.map(|(receiver, method)| format!("{}.{}()", receiver, method.name))
(expected, Some(err))
}
- fn get_conversion_methods(&self, expected: Ty<'tcx>, checked_ty: Ty<'tcx>)
+ fn get_conversion_methods(&self, span: Span, expected: Ty<'tcx>, checked_ty: Ty<'tcx>)
-> Vec<AssociatedItem> {
- let mut methods = self.probe_for_return_type(syntax_pos::DUMMY_SP,
+ let mut methods = self.probe_for_return_type(span,
probe::Mode::MethodCall,
expected,
checked_ty,
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-//~^^^^^^^^^^ ERROR reached the recursion limit
-
// Test that the recursion limit can be changed and that the compiler
// suggests a fix. In this case, we have a long chain of Deref impls
// which will cause an overflow during the autoderef loop.
error[E0055]: reached the recursion limit while auto-dereferencing I
- --> $DIR/recursion_limit_deref.rs:62:22
+ --> $DIR/recursion_limit_deref.rs:60:22
|
LL | let x: &Bottom = &t; //~ ERROR mismatched types
| ^^ deref recursion limit reached
|
= help: consider adding a `#![recursion_limit="20"]` attribute to your crate
-error[E0055]: reached the recursion limit while auto-dereferencing I
- |
- = help: consider adding a `#![recursion_limit="20"]` attribute to your crate
-
error[E0308]: mismatched types
- --> $DIR/recursion_limit_deref.rs:62:22
+ --> $DIR/recursion_limit_deref.rs:60:22
|
LL | let x: &Bottom = &t; //~ ERROR mismatched types
| ^^ expected struct `Bottom`, found struct `Top`
= note: expected type `&Bottom`
found type `&Top`
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
Some errors occurred: E0055, E0308.
For more information about an error, try `rustc --explain E0055`.