211 Commits

Author SHA1 Message Date
Vadim Petrochenkov
941653b528 Address review comments + Fix rebase 2019-07-07 13:04:07 +03:00
Vadim Petrochenkov
0817fc6c6c Support deprecation checking for macros 2019-07-07 13:04:07 +03:00
Vadim Petrochenkov
d9ee97e896 resolve: Use standard stability diagnostics for macros 2019-07-07 13:04:07 +03:00
Vadim Petrochenkov
73dec4a804 resolve: Check stability for local macros as well 2019-07-07 13:04:07 +03:00
Vadim Petrochenkov
22d6d8ac76 #[rustc_transparent_macro] -> #[rustc_macro_transparency = ...] 2019-07-06 16:59:08 +03:00
Yuki Okushi
c004451a20 Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
Vadim Petrochenkov
8edbbacbca syntax: Remove SyntaxExtension::DeclMacro
It's a less powerful duplicate of `SyntaxExtension::NormalTT`
2019-06-10 21:33:31 +03:00
Mazdak Farrokhzad
73c6563ce0 Fix typo in comment. 2019-06-09 04:16:34 +02:00
Mazdak Farrokhzad
a4b9a03362 Fix inaccurate comments in '?' Kleene operator tests. 2019-06-09 04:16:34 +02:00
Mazdak Farrokhzad
1e793c71b5 Update tests since ? macro op is supported on 2015. 2019-06-09 04:16:34 +02:00
Mazdak Farrokhzad
6b71fba9c1
Rollup merge of #61669 - petrochenkov:tokderef2, r=oli-obk
syntax: Remove `Deref` impl from `Token`

Follow up to https://github.com/rust-lang/rust/pull/61541

r? @oli-obk
2019-06-09 00:20:38 +02:00
Vadim Petrochenkov
ea4ad555d7 Introduce #[rustc_dummy] attribute and use it in tests
Unlike other built-in attributes, this attribute accepts any input
2019-06-08 23:55:25 +03:00
Vadim Petrochenkov
ffe23475cb syntax: Keep full Tokens for macro_rules separators 2019-06-08 20:36:20 +03:00
Esteban Küber
24160171e4 Tweak macro parse errors when reaching EOF during macro call parse
- Add detail on origin of current parser when reaching EOF and stop
  saying "found <eof>" and point at the end of macro calls
- Handle empty `cfg_attr` attribute
- Reword empty `derive` attribute error
2019-05-24 11:49:33 -07:00
Mark Mansi
5a9de557b3 add ui tests 2019-05-22 12:20:43 -05:00
Vadim Petrochenkov
3f064cae3d Move literal parsing code into a separate file
Remove some dead code
2019-05-11 16:03:16 +03:00
bors
96d565be01 Auto merge of #60039 - rasendubi:assert-trailing-junk, r=alexcrichton
Make assert! ensure the macro is parsed completely

Fixes https://github.com/rust-lang/rust/issues/60024
2019-04-29 14:50:17 +00:00
Esteban Küber
0e505d427a Add guard for missing comma in macro call suggestion 2019-04-24 16:45:29 -07:00
Alexey Shmalko
f29e9a5cb8
Handle common assert! misuses 2019-04-25 02:06:38 +03:00
varkor
7f0f0e31ec Remove double trailing newlines 2019-04-22 16:57:01 +01:00
Matthew Jasper
8eef102270 update tests for migrate mode by default 2019-04-22 08:40:08 +01:00
Andy Russell
b6f148c8bd
hide --explain hint if error has no extended info 2019-04-18 13:29:28 -04:00
Alexey Shmalko
dfc0861085
Make assert! ensure the macro is parsed completely 2019-04-17 15:30:15 +03:00
Mazdak Farrokhzad
abfca1e155
Rollup merge of #59858 - mark-i-m:dup-matcher-bindings-3, r=Centril
Make duplicate matcher bindings a hard error

r? @Centril

Closes #57742
2019-04-14 00:23:44 +02:00
Mazdak Farrokhzad
ca9f04e41e
Rollup merge of #59862 - estebank:tweak-unstable-diag, r=petrochenkov
Tweak unstable diagnostic output
2019-04-12 20:36:15 +02:00
Mark Mansi
e149dc02a4 remove warn 2019-04-11 15:09:43 -05:00
Esteban Küber
146d040f0b Reword tracking issue note 2019-04-11 11:42:06 -07:00
Mark Mansi
d7f5c50a33 make duplicate matcher bindings a hard error 2019-04-10 21:29:17 -05:00
Esteban Küber
3ab97062cf Tweak unstable diagnostic output 2019-04-10 18:10:30 -07:00
Andy Russell
bbdeafc13c
clarify what the item is in "not a module" error 2019-04-10 12:55:21 -04:00
Mazdak Farrokhzad
fb8396da84
Rollup merge of #59574 - JohnTitor:distinguish-error-vs-warning, r=Centril
Distinguish message for external macros depending on error level

fixes #57716

(I picked you because assigned to this issue.)
r? @estebank
2019-03-31 16:10:38 +02:00
Yuki OKUSHI
45c82abf13 Distinguish depending on error level
Remove unnecessary comment
2019-03-31 07:51:31 +09:00
Mazdak Farrokhzad
f9262afa4d
Rollup merge of #59394 - mark-i-m:dup-matcher-bindings-2, r=Centril
warn -> deny duplicate match bindings

This is the next step of https://github.com/rust-lang/rust/issues/57742

r? @Centril

- [x] Decide whether to go to deny-by-default or hard error.
     - My preference is to make this deny-by-default, rather than going straight to a hard error. The CI should fail because I haven't updated the ui test yet. I'll update it when we decide which to do.
- [x] Update [test](c25d6b8344/src/test/ui/macros/macro-multiple-matcher-bindings.rs)
- [ ] ~Crater run~ see https://github.com/rust-lang/rust/pull/59394#issuecomment-477817351
2019-03-29 02:40:48 +01:00
mark
9f14e146ed deny duplicate matcher bindings by default 2019-03-28 14:27:16 -05:00
Andy Russell
695dfe7dff
compiletest: make path normalization smarter 2019-03-25 01:06:45 -04:00
Mazdak Farrokhzad
8ebe2acb7b
Rollup merge of #59116 - estebank:comma-sugg, r=petrochenkov
Be more discerning on when to attempt suggesting a comma in a macro invocation

Fix #58796.
2019-03-19 15:16:55 +01:00
Esteban Küber
b9d12edd6c Be more discerning on when to attempt suggesting a comma in a macro invocation 2019-03-11 15:07:07 -07:00
Vadim Petrochenkov
fa72a81bea Update tests 2019-03-11 23:10:26 +03:00
Mazdak Farrokhzad
2f58c2cfc0
Rollup merge of #58075 - asettouf:master, r=varkor
Fix for issue  #58050

Hi,

a quick PR to mention in the compiler error message that `?` is a macro operator, as according to issue #58050

It passed `python x.py test src/tools/tidy`  locally, as well as the recommendation to run `/x.py test src/test/ui --stage 1 --bless`.

Let me know if anything else is needed.
2019-02-27 13:32:16 +01:00
Adonis
c1f3d1520e Changing error message to reflect changes with the 2018 edition
Signed-off-by: Adonis <adonis.settouf@gmail.com>

Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>

Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>

Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>

Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>

Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>

Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>

Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr

Co-Authored-By: asettouf <adonis.settouf@gmail.com>

Update src/test/ui/macros/macro-at-most-once-rep-2015-ques-rep.stderr

Co-Authored-By: asettouf <adonis.settouf@gmail.com>

Stabilize split_ascii_whitespace

Tracking issue FCP to merge: https://github.com/rust-lang/rust/issues/48656#issuecomment-442372750

fix stabilization order of uniform_paths.

hir: add HirId to main Hir nodes

Fix `std::os::fortanix_sgx::usercalls::raw::UsercallNrs`

Fixes https://github.com/fortanix/rust-sgx/issues/88

Update src/libsyntax/ext/tt/quoted.rs

Co-Authored-By: asettouf <adonis.settouf@gmail.com>

Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit 751f05bd155e2c55d4177fe8211df634faf3a644, reversing
changes made to 545a3e62b0cb473108869a61b271bc589afb49da.
2019-02-26 19:22:29 +01:00
Vadim Petrochenkov
eccc19996b Stabilize unrestricted_attribute_tokens 2019-02-25 23:21:54 +03:00
Vadim Petrochenkov
8e1b5d897a Restrict value in key-value attributes to literals 2019-02-25 22:40:38 +03:00
Mark Mansi
c25d6b8344 update test 2019-02-07 12:17:27 -06:00
Mark Mansi
802b256283 Make it an incompatibility lint for now 2019-02-07 12:17:27 -06:00
mark
3e790a7c30 add a test 2019-02-07 12:15:32 -06:00
mark
1d94cc2a22 fix existing tests 2019-02-07 12:15:31 -06:00
Andy Russell
5e67021172
add typo suggestion to unknown attribute error 2019-01-27 21:56:50 -05:00
Vadim Petrochenkov
41c65992c5 Implement basic input validation for built-in attributes 2019-01-13 14:17:19 +03:00
Andy Russell
020e1f5b60
don't unwrap unexpected tokens in format!
Fixes #57512.
2019-01-11 13:00:44 -05:00
Andy Russell
0a6fb84738
make panictry! private to libsyntax
This commit completely removes usage of the `panictry!` macro from
outside libsyntax. The macro causes parse errors to be fatal, so using
it in libsyntax_ext caused parse failures *within* a syntax extension to
be fatal, which is probably not intended.

Furthermore, this commit adds spans to diagnostics emitted by empty
extensions if they were missing, à la #56491.
2019-01-02 11:02:30 -05:00