rustc: Refactor attribute checking to operate on HIR

This'll enable running queries that could be cached and overall be more amenable
to the query infastructure.
This commit is contained in:
Alex Crichton 2018-01-08 13:43:42 -08:00
parent 5f006cebfc
commit 0ecaa67e90
5 changed files with 59 additions and 47 deletions

View file

@ -1,3 +1,5 @@
error[E0601]: main function not found
error[E0518]: attribute should be applied to function
--> $DIR/issue-43106-gating-of-inline.rs:21:1
|
@ -37,7 +39,5 @@ error[E0518]: attribute should be applied to function
35 | #[inline = "2100"] impl S { }
| ^^^^^^^^^^^^^^^^^^ ---------- not a function
error[E0601]: main function not found
error: aborting due to 6 previous errors

View file

@ -10,6 +10,8 @@
// ignore-arm
// ignore-aarch64
// ignore-wasm
// ignore-emscripten
#![feature(target_feature)]

View file

@ -1,31 +1,31 @@
warning: #[target_feature = ".."] is deprecated and will eventually be removed, use #[target_feature(enable = "..")] instead
--> $DIR/target-feature-wrong.rs:16:1
--> $DIR/target-feature-wrong.rs:18:1
|
16 | #[target_feature = "+sse2"]
18 | #[target_feature = "+sse2"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: the feature named `foo` is not valid for this target
--> $DIR/target-feature-wrong.rs:18:18
|
18 | #[target_feature(enable = "foo")]
| ^^^^^^^^^^^^^^
error: #[target_feature(..)] only accepts sub-keys of `enable` currently
--> $DIR/target-feature-wrong.rs:20:18
|
20 | #[target_feature(bar)]
| ^^^
20 | #[target_feature(enable = "foo")]
| ^^^^^^^^^^^^^^
error: #[target_feature(..)] only accepts sub-keys of `enable` currently
--> $DIR/target-feature-wrong.rs:22:18
|
22 | #[target_feature(disable = "baz")]
22 | #[target_feature(bar)]
| ^^^
error: #[target_feature(..)] only accepts sub-keys of `enable` currently
--> $DIR/target-feature-wrong.rs:24:18
|
24 | #[target_feature(disable = "baz")]
| ^^^^^^^^^^^^^^^
error: #[target_feature(..)] can only be applied to `unsafe` function
--> $DIR/target-feature-wrong.rs:26:1
--> $DIR/target-feature-wrong.rs:28:1
|
26 | #[target_feature(enable = "sse2")]
28 | #[target_feature(enable = "sse2")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 4 previous errors