1d0a2ff35Sopenharmony_ciThis directory contains snippets of code that should yield a
2d0a2ff35Sopenharmony_ciwarning/note/help/error at compilation. Syntax of annotations is described in
3d0a2ff35Sopenharmony_ci[rust documentation](https://github.com/rust-lang/rust/blob/master/src/test/COMPILER_TESTS.md).
4d0a2ff35Sopenharmony_ciFor more information check out [`compiletest` crate](https://github.com/laumann/compiletest-rs).
5d0a2ff35Sopenharmony_ci
6d0a2ff35Sopenharmony_ciTo run compile tests issue `cargo +nightly --test`.
7d0a2ff35Sopenharmony_ci
8d0a2ff35Sopenharmony_ci## Notes on working with `compiletest` crate
9d0a2ff35Sopenharmony_ci
10d0a2ff35Sopenharmony_ci* Currently code that is inside macro should not be annotated, as `compiletest`
11d0a2ff35Sopenharmony_ci    crate cannot deal with the fact that macro invocations effectively changes
12d0a2ff35Sopenharmony_ci    line numbering. To prevent this add a `// error-pattern:<your error message here>`
13d0a2ff35Sopenharmony_ci    on the top of the file and make sure that you set `deny` lint level
14d0a2ff35Sopenharmony_ci    if you want to test compiler message different than error.
15d0a2ff35Sopenharmony_ci* `compiletest` crate by default sets `allow(dead_code)` lint level so make sure
16d0a2ff35Sopenharmony_ci    that you change it to something suiting your needs even if the warning is
17d0a2ff35Sopenharmony_ci    issued prior to any macro invocation.
18d0a2ff35Sopenharmony_ci* If you get a message `error: 0 unexpected errors found, 1 expected errors not found`
19d0a2ff35Sopenharmony_ci  despite the fact that some error was bound to occur don't worry - it's a known
20d0a2ff35Sopenharmony_ci  issue in the `compiletest` crate and your error was probably not registered -
21d0a2ff35Sopenharmony_ci  make sure that your annotations are correct and that you are setting correct
22d0a2ff35Sopenharmony_ci  lint levels.
23