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
Austin Bonander
9da428dad8
make Parser::parse_foreign_item() return a foreign item or error
...
closes #54441
2018-10-05 02:47:57 -07:00
Vadim Petrochenkov
a7cce470b6
Fix two UI tests with locale-dependent output
2018-10-05 11:37:48 +04:00
Vadim Petrochenkov
078fc52cbc
resolve: Prefer macro_rules definitions to in-module macro definitions in some cases
2018-10-03 16:12:39 +04:00
Eduard-Mihai Burtescu
fa2c246384
Stabilize crate_in_paths, extern_absolute_paths and extern_prelude on all editions.
2018-09-22 09:26:40 +03:00
bors
32dc5a0783
Auto merge of #54157 - euclio:structured-suggestion, r=estebank
...
use structured suggestion for "missing mut" label
Fixes #54133 for both NLL and non-NLL.
r? @estebank
I'm not super happy with the existing wording here, since it's now a suggestion. I wonder if the message would work better as something like "help: make binding mutable: `mut foo`"?
Also, are the `HELP` and `SUGGESTION` comments necessary?
2018-09-16 09:47:05 +00:00
Vadim Petrochenkov
beb3b5d22c
resolve: Introduce two sub-namespaces in macro namespace
2018-09-13 14:48:50 +03:00
Andy Russell
d871b8ad4a
use structured suggestion for "missing mut" label
...
Fixes #54133 .
2018-09-12 17:16:18 -04:00
Vadim Petrochenkov
2dce3779bb
resolve: More precise spans for ambiguous resolution errors
...
Add labels to ambiguous resolution errors
2018-09-08 14:15:11 +03:00
Vadim Petrochenkov
9beb5c3ef3
Add checks for expected macro output in restricted shadowing tests
2018-09-08 14:15:11 +03:00
Vadim Petrochenkov
e00993a1ab
Add test cases for possible restricted shadowing configurations
...
Whitelist `#[rustc_transparent_macro]` so it's not interpreted as a potential attribute macro
2018-09-08 14:15:11 +03:00
Vadim Petrochenkov
c057d579ab
resolve: Relax shadowing restriction on macro-expanded macros
...
... for both legacy and modern macros.
Fix previously introduced regressions, add tests.
2018-09-08 14:15:11 +03:00
Vadim Petrochenkov
f34ac26114
resolve: Model shadowing restriction for macro_rules after modern macros
...
This is a regression for legacy macros that will be fixed in the next commit
2018-09-08 14:15:10 +03:00
Vadim Petrochenkov
83a51deef5
resolve: Model resolve_legacy_scope after resolve_lexical_macro_path_segment
2018-09-08 14:15:10 +03:00
Vadim Petrochenkov
c56adf6413
cleanup: Add main functions to some UI tests
2018-08-31 18:56:15 +03:00
Vadim Petrochenkov
23e9a1def5
resolve: Consolidate error reporting for resolved macros in fn resolve_macro_to_def
2018-08-20 23:12:36 +03:00
bors
c8c587fe4e
Auto merge of #50911 - petrochenkov:macuse, r=alexcrichton
...
Stabilize `use_extern_macros`
Closes https://github.com/rust-lang/rust/issues/35896
2018-08-17 19:10:34 +00:00
Corey Farwell
5c7b837c4e
Rollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkor
...
Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018.
cc @varkor @petrochenkov @joshtriplett
2018-08-17 08:23:44 -07:00
Vadim Petrochenkov
a0958048b6
Stabilize use_extern_macros
2018-08-17 13:14:26 +03:00
kennytm
1cb13b296d
Rollup merge of #53412 - eddyb:stage-who, r=alexcrichton
...
syntax_ext: remove leftover span_err_if_not_stage0 macro.
I believe this is the right fix for #53380 , although I'm not sure what happened.
My guess is this copy of the macro was accidentally missed when others were removed?
cc @matthewjasper @varkor (please do not put this in a rollup, in case it fails)
2018-08-17 00:13:29 +08:00