2019-05-21 17:09:58 -05:00
|
|
|
// aux-build:test-macros.rs
|
2017-07-11 10:29:08 -05:00
|
|
|
|
2018-09-09 17:54:51 -05:00
|
|
|
#![feature(custom_inner_attributes)]
|
|
|
|
|
2019-05-21 17:09:58 -05:00
|
|
|
#[macro_use]
|
|
|
|
extern crate test_macros;
|
2017-07-11 10:29:08 -05:00
|
|
|
|
2019-05-21 17:09:58 -05:00
|
|
|
#[recollect_attr]
|
2017-07-12 11:50:05 -05:00
|
|
|
fn test1() {
|
2017-07-11 10:29:08 -05:00
|
|
|
let a: i32 = "foo";
|
|
|
|
//~^ ERROR: mismatched types
|
2018-04-18 21:36:48 -05:00
|
|
|
let b: i32 = "f'oo";
|
|
|
|
//~^ ERROR: mismatched types
|
2017-07-11 10:29:08 -05:00
|
|
|
}
|
|
|
|
|
2017-07-12 11:50:05 -05:00
|
|
|
fn test2() {
|
2019-05-21 17:09:58 -05:00
|
|
|
#![recollect_attr]
|
2017-07-12 11:50:05 -05:00
|
|
|
|
|
|
|
// FIXME: should have a type error here and assert it works but it doesn't
|
|
|
|
}
|
|
|
|
|
|
|
|
trait A {
|
2019-05-21 17:09:58 -05:00
|
|
|
// FIXME: should have a #[recollect_attr] attribute here and assert that it works
|
2017-07-12 11:50:05 -05:00
|
|
|
fn foo(&self) {
|
|
|
|
let a: i32 = "foo";
|
|
|
|
//~^ ERROR: mismatched types
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct B;
|
|
|
|
|
|
|
|
impl A for B {
|
2019-05-21 17:09:58 -05:00
|
|
|
#[recollect_attr]
|
2017-07-12 11:50:05 -05:00
|
|
|
fn foo(&self) {
|
|
|
|
let a: i32 = "foo";
|
|
|
|
//~^ ERROR: mismatched types
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-21 17:09:58 -05:00
|
|
|
#[recollect_attr]
|
2017-07-11 10:29:08 -05:00
|
|
|
fn main() {
|
|
|
|
}
|