]> git.lizzy.rs Git - rust.git/blob - tests/ui/proc-macro/attribute-with-error.rs
Rollup merge of #106717 - klensy:typo, r=lcnr
[rust.git] / tests / ui / proc-macro / attribute-with-error.rs
1 // aux-build:test-macros.rs
2
3 #![feature(custom_inner_attributes)]
4
5 #[macro_use]
6 extern crate test_macros;
7
8 #[recollect_attr]
9 fn test1() {
10     let a: i32 = "foo";
11     //~^ ERROR: mismatched types
12     let b: i32 = "f'oo";
13     //~^ ERROR: mismatched types
14 }
15
16 fn test2() {
17     #![recollect_attr]
18
19     // FIXME: should have a type error here and assert it works but it doesn't
20 }
21
22 trait A {
23     // FIXME: should have a #[recollect_attr] attribute here and assert that it works
24     fn foo(&self) {
25         let a: i32 = "foo";
26         //~^ ERROR: mismatched types
27     }
28 }
29
30 struct B;
31
32 impl A for B {
33     #[recollect_attr]
34     fn foo(&self) {
35         let a: i32 = "foo";
36         //~^ ERROR: mismatched types
37     }
38 }
39
40 #[recollect_attr]
41 fn main() {
42 }