Commit Graph

170 Commits

Author SHA1 Message Date
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
bors
35a64f8bbf Auto merge of #57140 - estebank:str-err, r=varkor
Tweaks to format string diagnostics

Add label spans and fix incorrect spans.

Fix #55155, fix #55350.
2018-12-29 07:28:15 +00:00
Vadim Petrochenkov
bc16edeb28 Fix rebase and more CI failures 2018-12-27 15:51:37 +03:00
Vadim Petrochenkov
37af04ff8d Address review comments and CI failures 2018-12-27 15:51:37 +03:00
Vadim Petrochenkov
fff01ccfa8 Do not abort compilation if expansion produces errors
Fix a number of uncovered deficiencies in diagnostics
2018-12-27 15:51:36 +03:00
Esteban Küber
5e952e3479 Add span label to unused string formatting argument
Fix #55350.
2018-12-26 20:36:02 -08:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Guillaume Gomez
dec7b19516
Rollup merge of #56491 - euclio:assert-error, r=estebank
emit error with span for empty asserts

Fixes #55547.
2018-12-10 22:01:57 +01:00
Andy Russell
a367cec6e3
emit error with span for empty asserts
Fixes #55547.
2018-12-04 10:22:48 -05:00
Oliver Scherer
690439bb45 Update ui tests 2018-12-04 10:06:05 +01:00
Oliver Scherer
61efc3b71b Update tests 2018-12-04 10:06:05 +01:00
Mark Mansi
5d7717360c fix test 2018-11-27 18:21:10 -06:00
Mark Mansi
aeede9eb46 fix test 2018-11-27 13:13:11 -06:00
Mark Mansi
e97edad935 update tests 2018-11-27 13:13:11 -06:00
bors
10e2c729ea Auto merge of #55402 - estebank:macro-eof-2, r=nikomatsakis
Point at end of macro arm when encountering EOF

Fix #52866.
2018-11-27 12:31:45 +00:00
Vadim Petrochenkov
6f13708299 resolve: Suggest crate:: for resolving ambiguities when appropriate
More precise spans for ambiguities from macros
2018-11-27 00:34:25 +03:00
Esteban Küber
d011313d84 Reword EOF in macro arm message 2018-11-23 15:49:31 -08:00
Esteban Küber
c45871ba02 Keep label on moved spans and point at macro invocation on parse error 2018-11-23 15:37:31 -08:00
Esteban Küber
76449d86c0 Point at macro arm when it doesn't expand to an expression 2018-11-23 15:37:31 -08:00
Esteban Küber
e5cd1edfa1 Reword incorrect macro invocation primary label 2018-11-23 15:37:31 -08:00
Esteban Küber
34bd86a3fd Add label when replacing primary DUMMY_SP in macro expansion 2018-11-23 15:37:31 -08:00
Esteban Küber
ea9ccb6046 Point at end of macro arm when encountering EOF
Fix #52866
2018-11-23 15:37:31 -08:00
Vadim Petrochenkov
4fc3c13e32 resolve: Avoid sentence breaks in diagnostics 2018-11-18 13:58:36 +03:00
Vadim Petrochenkov
cfd762954b resolve: Tweak some articles in ambiguity diagnostics 2018-11-18 13:57:03 +03:00
Vadim Petrochenkov
4c5d822a8b resolve: Check resolution consistency for import paths and multi-segment macro paths 2018-11-18 13:55:58 +03:00
Vadim Petrochenkov
f0ea1c6f1e resolve: Improve diagnostics for resolution ambiguities 2018-11-18 13:51:40 +03:00
Felix S. Klock II
a2e090624e Removed #[rustc_error] from tests that are all // compile-pass.
I also added `// skip-codegen` to each one, to address potential concerns
that this change would otherwise slow down our test suite spending time
generating code for files that are really just meant to be checks of
compiler diagnostics.

(However, I will say: My preference is to not use `// skip-codegen` if
one can avoid it. We can use all the testing of how we drive LLVM that
we can get...)

(Updated post rebase.)
2018-11-07 13:09:52 +01:00
Alex Burka
9dd2c89066 enforce unused-must-use lint in macros 2018-11-01 03:32:45 +00:00
Vadim Petrochenkov
acdbd0643c resolve: More precise spans for privacy errors 2018-10-28 02:56:12 +03:00
kennytm
e897fe711e
Rollup merge of #55301 - estebank:macro-allowed, r=petrochenkov
List allowed tokens after macro fragments

Fix #34069.
2018-10-26 23:06:33 +08:00
kennytm
eb74711b54
Rollup merge of #55298 - estebank:macro-def, r=pnkfelix
Point at macro definition when no rules expect token

Fix #35150.
2018-10-26 23:06:30 +08:00
kennytm
c6cd57dd86
Rollup merge of #55292 - estebank:macro-eof, r=pnkfelix
Macro diagnostics tweaks

Fix #30128, fix #10951 by adding an appropriate span to the diagnostic.
Fix #26288 by suggesting adding semicolon to macro call.
2018-10-26 23:06:28 +08:00
Esteban Küber
2cfd790177 List allowed tokens after macro fragments 2018-10-25 11:08:58 -07:00
Esteban Küber
f8818cbf8f Fix incorrect semicolon suggestion 2018-10-24 12:52:24 -07:00
Esteban Küber
1ab45ec7e3 Point to macro def span instead of whole body 2018-10-24 11:34:23 -07:00
Esteban Küber
8227a938a4 Point at macro definition when no rules expect token 2018-10-23 21:44:46 -07:00
Vadim Petrochenkov
0f625ac48d Add extern crate items to extern prelude 2018-10-24 00:14:50 +03:00
Esteban Küber
ad144ac3c1 Modify invalid macro in expression context diagnostic 2018-10-23 10:07:34 -07:00
Esteban Küber
8544db0faa Add macro call span when lacking any other span in diagnostic 2018-10-23 10:07:11 -07:00
Eric Huss
09f42dd902 Add missing lifetime fragment specifier to error message.
A very minor issue, `lifetime` was missing from the error list.
I left `literal` in the list, even though it is unstable. It looks like it may stabilize soon anyways.
2018-10-12 17:51:48 -07:00
holmgr
05bb22d9e8 Remove incorrect span for second label inner macro invocation 2018-10-10 19:39:16 +02:00
bors
5a6f122126 Auto merge of #54813 - petrochenkov:uilocale, r=alexcrichton
Fix two UI tests with locale-dependent output

Closes https://github.com/rust-lang/rust/issues/54719
2018-10-07 11:10:39 +00:00