1
Fork 0
Commit graph

46 commits

Author SHA1 Message Date
Mazdak Farrokhzad
742ec4b9bf ast: remove implicit pprust dependency via Display.
Instead just use `pprust::path_to_string(..)` where needed.

This has two benefits:

a) The AST definition is now independent of printing it.
   (Therefore we get closer to extracting a data-crate.)

b) Debugging should be easier as program flow is clearer.
2019-10-13 06:58:51 +02:00
varkor
38121173e2 Rename MetaItem.node to MetaItem.kind 2019-09-26 18:21:48 +01:00
varkor
17726f6b52 Rename Lit.node to Lit.kind 2019-09-26 18:21:09 +01:00
Vadim Petrochenkov
f7434aef26 Support "soft" feature-gating using a lint
Use it for feature-gating `#[bench]`
2019-09-07 21:37:51 +03:00
Mark Rousskov
0f985817bd Replace AstBuilder with inherent methods 2019-07-31 08:55:37 -04:00
Mark Rousskov
b2c5065b04 Remove Span argument from ExtCtxt::attribute
MetaItem.span was always equivalent
2019-07-31 08:55:37 -04:00
Vadim Petrochenkov
6e4f16173c Demote template check error to a lint for #[test] and #[bench] 2019-07-24 12:29:45 +03:00
Vadim Petrochenkov
76b1ffaf6c syntax_ext: Reuse built-in attribute template checking for macro attributes 2019-07-24 12:29:45 +03:00
Vadim Petrochenkov
1ee0ce82cb syntax: Migrate built-in macros to the regular stability checking 2019-07-07 13:04:07 +03:00
Vadim Petrochenkov
3542995ff9 syntax: Keep full Stability in SyntaxExtension 2019-07-07 13:04:07 +03:00
Vadim Petrochenkov
920a17a60c privacy: Only opaque macros leak private things 2019-07-06 16:59:08 +03:00
John Kåre Alsaker
6d387463aa Remove GlobalArenas and use Arena instead 2019-05-31 09:44:37 +02:00
Esteban Küber
609ffa1a89 Reword malformed attribute input diagnostics
- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
- Use consistend error message: "malformed `attrname` attribute input"
- Provide suggestions when possible
- Move note/help to label/suggestion
- Use consistent wording "ill-formed" -> "malformed"
- Move diagnostic logic out of parser
2019-05-25 11:55:50 -07:00
Nicholas Nethercote
ea9fac5687 Return a Symbol from name_or_empty functions. 2019-05-13 09:31:32 +10:00
Nicholas Nethercote
999c1fc281 Remove the equality operation between Symbol and strings.
And also the equality between `Path` and strings, because `Path` is made
up of `Symbol`s.
2019-05-13 09:31:30 +10:00
Nicholas Nethercote
fb084a48e2 Pass a Symbol to check_name, emit_feature_err, and related functions. 2019-05-13 09:29:22 +10:00
Taylor Cramer
e617025e96 Add rustc_allow_const_fn_ptr 2019-04-23 15:55:31 -07:00
Vadim Petrochenkov
db74efce69 Make meta-item API compatible with LocalInternedString::get soundness fix 2019-03-17 17:04:58 +03:00
Vadim Petrochenkov
0cf96131f4 Refactor away NestedMetaItemKind
Remove methods `Attribute::span` and `MetaItem::span` duplicating public fields
2019-03-16 23:14:42 +03:00
Vadim Petrochenkov
63116d313d Rename MetaItem::ident to MetaItem::path 2019-03-16 23:13:15 +03:00
Vadim Petrochenkov
8371caf5ee syntax: Do not accidentally treat multi-segment meta-items as single-segment 2019-03-16 23:13:15 +03:00
Vadim Petrochenkov
b11502fbc0 Mention unwind(aborts) in diagnostics for #[unwind]
Simplify input validation for `#[unwind]`, add tests
2019-02-27 09:37:05 +03:00
Mazdak Farrokhzad
0bc8f6f3f4
Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasper
Rename rustc_errors dependency in rust 2018 crates

I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules.

Related: rust-lang/cargo#5653

cc #58099

r? @Centril
2019-02-13 04:37:04 +01:00
Mazdak Farrokhzad
856e41142c
Rollup merge of #58166 - euclio:deprecation-shorthand, r=petrochenkov
allow shorthand syntax for deprecation reason

Fixes #48271.

Created based on discussion in #56896.
2019-02-13 04:37:02 +01:00
Taiki Endo
c360ba285c Cleanup imports 2019-02-13 00:31:51 +09:00
Taiki Endo
3216c7656a Rename rustc_errors dependency in rust 2018 crates 2019-02-13 00:28:52 +09:00
Alexander Regueiro
c3e182cf43 rustc: doc comments 2019-02-10 23:42:32 +00:00
Taiki Endo
7bb082d27f libsyntax => 2018 2019-02-07 02:33:01 +09:00
Andy Russell
113b7f7be1
allow shorthand syntax for deprecation reason 2019-02-05 15:26:26 -05:00
Oliver Scherer
4056b575e2 Add suggestions to deprecation lints 2019-01-30 17:49:04 +01:00
Andy Russell
0897ffc28f
remove _with_applicability from suggestion fns 2019-01-26 23:07:55 -05:00
Simonas Kazlauskas
f38d0da893 Implement optimize(size) and optimize(speed) 2019-01-24 20:13:50 +02:00
Vadim Petrochenkov
41c65992c5 Implement basic input validation for built-in attributes 2019-01-13 14:17:19 +03:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
csmoe
a76690f6a4 optimize unsupported literal diag message 2018-10-22 20:28:37 +08:00
csmoe
fb7c76bad5 update meta item checking test 2018-10-20 11:11:31 +08:00
csmoe
d3b018ccdb suggest to trim prefix in nested meta items 2018-10-20 11:11:31 +08:00
csmoe
30c6698193 handle errors based on parse_sess 2018-10-20 11:11:31 +08:00
csmoe
2ed2d1a7e6 suggest to remove prefix b in lint string 2018-10-20 11:11:31 +08:00
Oliver Schneider
ec74d3533a Stabilize min_const_fn 2018-10-05 10:36:14 +02:00
Oliver Schneider
1f943849b1 Update error id to an unused one 2018-10-03 10:07:05 +02:00
Oliver Schneider
9e46c0b689 Only promote calls to #[rustc_promotable] const fns 2018-10-03 10:07:05 +02:00
Vadim Petrochenkov
b0a05c5981 Validate syntax of cfg attributes 2018-09-06 01:18:30 +03:00
Oliver Schneider
472ca71598 Implement the min_const_fn feature gate 2018-08-31 08:39:59 +02:00
Andy Russell
5468e12ca0
add label to unknown meta item error 2018-06-30 21:38:18 -04:00
Andy Russell
011eaed59d
factor built-in attribute parsing into submodule 2018-06-30 20:44:20 -04:00