Change:
The multi-line errors should be extended to include this testcase. missed this because the didn't go through . I tried but that didn't work either. If someone can point me to to where to catch it, I can probably fix this too. cc Code: Error: Change to:

Discussion:
!msg.contains("if and else have incompatible types") && !msg.contains("if may be missing an else clause") && !msg.contains("match arms have incompatible types") && <del> !msg.contains("structure constructor specifies a structure of type") { </del> <ins> !msg.contains("structure constructor specifies a structure of type") && !msg.contains("has an incompatible type for trait") { </ins> return None } let first = msg.match_indices("expected").filter(|s| {

impl Foo for SignedBar { const BAR: i32 = -1; <del> //~^ ERROR E0326 </del> <ins> //~^ ERROR implemented const `BAR` has an incompatible type for trait //~| expected u32, //~| found i32 [E0326] </ins> } fn main() {}

impl<T: fmt::Debug> ops::FnOnce<(),> for Debuger<T> { type Output = (); fn call_once(self, _args: ()) { <del> //~^ ERROR `call_once` has an incompatible type for trait: expected "rust-call" fn, found "Rust" fn </del> <ins> //~^ ERROR `call_once` has an incompatible type for trait //~| expected "rust-call" fn, //~| found "Rust" fn </ins> println!("{:?}", self.x); } }

impl<'a, T> Fn<(&'a T,)> for Foo { extern "rust-call" fn call(&self, (_,): (T,)) {} <del> //~^ ERROR: has an incompatible type for trait: expected &-ptr </del> <ins> //~^ ERROR: has an incompatible type for trait //~| expected &-ptr </ins> } impl<'a, T> FnMut<(&'a T,)> for Foo { extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} <del> //~^ ERROR: has an incompatible type for trait: expected &-ptr </del> <ins> //~^ ERROR: has an incompatible type for trait //~| expected &-ptr </ins> } impl<'a, T> FnOnce<(&'a T,)> for Foo { type Output = (); extern "rust-call" fn call_once(self, (_,): (T,)) {} <del> //~^ ERROR: has an incompatible type for trait: expected &-ptr </del> <ins> //~^ ERROR: has an incompatible type for trait //~| expected &-ptr </ins> } fn main() {}

<ins> // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those terms. struct S; impl Iterator for S { type Item = i32; fn next(&mut self) -> Result<i32, i32> { Ok(7) } //~^ ERROR method `next` has an incompatible type for trait //~| expected enum `core::option::Option` //~|    found enum `core::result::Result` [E0053] } fn main() {} </ins>

impl Deref for Thing { //~^ ERROR not all trait items implemented, missing: `Target` [E0046] fn deref(&self) -> i8 { self.0 } <del> //~^ ERROR method `deref` has an incompatible type for trait: expected &-ptr, found i8 [E0053] </del> <ins> //~^ ERROR method `deref` has an incompatible type for trait //~| expected &-ptr //~| found i8 [E0053] </ins> } let thing = Thing(72);

impl Mumbo for usize { // Cannot have a larger effect than the trait: unsafe fn jumbo(&self, x: &usize) { *self + *x; } <del> //~^ ERROR expected normal fn, found unsafe fn </del> <ins> //~^ ERROR method `jumbo` has an incompatible type for trait //~| expected normal fn, //~| found unsafe fn </ins> } fn main() {}

impl Foo for u32 { fn len(&self) -> u32 { *self } <del> //~^ ERROR incompatible type for trait: expected unsafe fn, found normal fn </del> <ins> //~^ ERROR method `len` has an incompatible type for trait //~| expected unsafe fn, //~| found normal fn </ins> } fn main() { }