75 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
de6046fa0f remove rustc_error_codes deps except in rustc_driver 2020-01-18 21:53:53 +01:00
Mazdak Farrokhzad
6007641d21 gating diagnostics -> rustc_session::parse 2020-01-11 03:15:32 +01:00
Mazdak Farrokhzad
8bd3d240e3 nix syntax::errors & prefer rustc_errors over errors 2020-01-10 07:41:30 +01:00
Mazdak Farrokhzad
2c3e5d3de0 - remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}
- remove syntax::{help!, span_help!, span_note!}
- remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!}
- lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints
- inline syntax::{struct_span_warn!, diagnostic_used!}
- stringify_error_code! -> error_code! & use it more.
- find_plugin_registrar: de-fatalize an error
- de-fatalize metadata errors
- move type_error_struct! to rustc_typeck
- struct_span_err! -> rustc_errors
2020-01-08 04:25:33 +01:00
Vadim Petrochenkov
70f1d57048 Rename syntax_pos to rustc_span in source code 2020-01-01 09:15:18 +03:00
Vadim Petrochenkov
3d57b8bcc0 doc comments: Less attribute mimicking 2019-12-28 12:33:18 +03:00
Mark Rousskov
a06baa56b9 Format the world 2019-12-22 17:42:47 -05:00
Ross MacArthur
f7256d28d1
Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
Oliver Scherer
5e17e39881 Require stable/unstable annotations for the constness of all stable functions with a const modifier 2019-12-13 11:27:02 +01:00
Mazdak Farrokhzad
79077f13ff move GateIssue to rustc_feature & simplify emit_feature_err 2019-11-30 07:40:28 +01:00
Mazdak Farrokhzad
70234f16df builtin_attrs.rs -> rustc_feature 2019-11-30 02:34:18 +01:00
Mazdak Farrokhzad
d04b838a44 move is_builtin_attr to syntax::attr 2019-11-30 02:20:07 +01:00
Mazdak Farrokhzad
6cab02cf14 simplify gated cfgs logic 2019-11-30 01:57:53 +01:00
Mazdak Farrokhzad
8ad4d15f38 move AttributeTemplate to builtin_attrs 2019-11-30 00:56:46 +01:00
Mazdak Farrokhzad
3d080a4a77 introduce crate rustc_feature and move active, accepted, and removed to it 2019-11-30 00:25:40 +01:00
Camille GILLOT
3d97a91e7f Remove extern crate. 2019-11-17 22:37:16 +01:00
Camille GILLOT
efcb695f4c Further HashStable_Generic derives. 2019-11-17 22:37:10 +01:00
Camille GILLOT
c2e1658c67 Use proc_macro for HashStable derive in libsyntax. 2019-11-17 22:37:08 +01:00
Yuki Okushi
842612fcc0
Rollup merge of #66381 - Centril:66340, r=petrochenkov
find_deprecation: deprecation attr may be ill-formed meta.

Fixes #66340.

r? @petrochenkov
cc @pnkfelix
2019-11-17 13:36:15 +09:00
Mazdak Farrokhzad
91aadf0305 find_deprecation: deprecation attr may be ill-formed meta. 2019-11-15 13:24:06 +01:00
Guillaume Gomez
798e389e57 Update to use new librustc_error_codes library 2019-11-14 13:05:42 +01:00
Ross MacArthur
3ba8257253 support issue = "none" in unstable attributes
- Use `Option<NonZeroU32>` to represent issue numbers.
2019-11-11 19:33:30 +02:00
Mazdak Farrokhzad
4ae2728fa8 move syntax::parse -> librustc_parse
also move MACRO_ARGUMENTS -> librustc_parse
2019-11-10 03:57:18 +01:00
Mazdak Farrokhzad
5011ec7fed move attr meta grammar to parse::validate_atr + ast_validation 2019-11-09 02:04:24 +01:00
Nicholas Nethercote
eea6f23a0e Make doc comments cheaper with AttrKind.
`AttrKind` is a new type with two variants, `Normal` and `DocComment`. It's a
big performance win (over 10% in some cases) because `DocComment` lets doc
comments (which are common) be represented very cheaply.

`Attribute` gets some new helper methods to ease the transition:
- `has_name()`: check if the attribute name matches a single `Symbol`; for
  `DocComment` variants it succeeds if the symbol is `sym::doc`.
- `is_doc_comment()`: check if it has a `DocComment` kind.
- `{get,unwrap}_normal_item()`: extract the item from a `Normal` variant;
  panic otherwise.

Fixes #60935.
2019-11-06 23:05:07 +11:00
Nicholas Nethercote
69bc4aba78 Remove unnecessary Deref impl for Attribute.
This kind of thing just makes the code harder to read.
2019-11-06 23:01:02 +11:00
Nicholas Nethercote
ac6daed384 Remove many unnecessary trait derivations. 2019-10-21 20:59:18 +11:00
Mazdak Farrokhzad
7ec38a9ae3 attr: remove dep on ExtCtxt 2019-10-16 10:59:53 +02:00
Mazdak Farrokhzad
ae156a56d4 syntax::parse::sess -> syntax::sess 2019-10-15 09:41:58 +02:00
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