summary refs log tree commit diff
path: root/src/test/ui/macros
AgeCommit message (Collapse)AuthorLines
2018-10-04resolve: Prefer `macro_rules` definitions to in-module macro definitions in ↵Vadim Petrochenkov-0/+83
some cases
2018-09-21Stabilize crate_in_paths, extern_absolute_paths and extern_prelude on all ↵Eduard-Mihai Burtescu-0/+8
editions.
2018-09-16Auto merge of #54157 - euclio:structured-suggestion, r=estebankbors-1/+1
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-13resolve: Introduce two sub-namespaces in macro namespaceVadim Petrochenkov-21/+14
2018-09-12use structured suggestion for "missing mut" labelAndy Russell-1/+1
Fixes #54133.
2018-09-08resolve: More precise spans for ambiguous resolution errorsVadim Petrochenkov-34/+16
Add labels to ambiguous resolution errors
2018-09-08Add checks for expected macro output in restricted shadowing testsVadim Petrochenkov-116/+132
2018-09-08Add test cases for possible restricted shadowing configurationsVadim Petrochenkov-0/+876
Whitelist `#[rustc_transparent_macro]` so it's not interpreted as a potential attribute macro
2018-09-08resolve: Relax shadowing restriction on macro-expanded macrosVadim Petrochenkov-26/+42
... for both legacy and modern macros. Fix previously introduced regressions, add tests.
2018-09-08resolve: Model shadowing restriction for macro_rules after modern macrosVadim Petrochenkov-2/+26
This is a regression for legacy macros that will be fixed in the next commit
2018-09-08resolve: Model `resolve_legacy_scope` after `resolve_lexical_macro_path_segment`Vadim Petrochenkov-5/+16
2018-08-31cleanup: Add main functions to some UI testsVadim Petrochenkov-14/+8
2018-08-20resolve: Consolidate error reporting for resolved macros in `fn ↵Vadim Petrochenkov-2/+2
resolve_macro_to_def`
2018-08-17Auto merge of #50911 - petrochenkov:macuse, r=alexcrichtonbors-66/+17
Stabilize `use_extern_macros` Closes https://github.com/rust-lang/rust/issues/35896
2018-08-17Rollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkorCorey Farwell-5/+5
Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018. cc @varkor @petrochenkov @joshtriplett
2018-08-17Stabilize `use_extern_macros`Vadim Petrochenkov-66/+17
2018-08-17Rollup merge of #53412 - eddyb:stage-who, r=alexcrichtonkennytm-16/+15
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-16Auto merge of #53256 - ollie27:writeln, r=KodrAusbors-0/+53
Don't accept non-string literals for the format string in writeln This is to improve diagnostics. `println` and `eprintln` were already fixed by #52394. Fixes #30143
2018-08-16tests: prefer edition: directives to compile-flags:--edition.Eduard-Mihai Burtescu-5/+5
2018-08-16Auto merge of #53293 - petrochenkov:gramattr2, r=alexcrichtonbors-8/+7
syntax: Enforce attribute grammar in the parser Also fix feature-gating for `unrestricted_attribute_tokens` that was introduced in https://github.com/rust-lang/rust/pull/53270, but was actually broken. cc https://github.com/rust-lang/rust/pull/50911
2018-08-16Revert "Ignore test that fails on stage1"Eduard-Mihai Burtescu-16/+15
This reverts commit 0e43e6fef251732f5268738eee9c258668ec7942.
2018-08-14Ignore test that fails on stage1Matthew Jasper-15/+16
2018-08-15syntax: Enforce attribute grammar in the parserVadim Petrochenkov-8/+7
2018-08-14Fixed 'no such file or directory' mismatch between Windows and Linux.David Wood-15/+18
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+2381
2018-08-10Don't accept none str literals for the format string in writelnOliver Middleton-0/+53
2018-08-07Suggest comma when missing in macro callEsteban Küber-4/+36
When missing a comma in a macro call, suggest it, regardless of position. When a macro call doesn't match any of the patterns, check if the call's token stream could be missing a comma between two idents, and if so, create a new token stream containing the comma and try to match against the macro patterns. If successful, emit the suggestion.
2018-08-06Point at correct span when missing comma in `println`Esteban Küber-7/+19
2018-08-06Suggest comma when writing `println!("{}" a);`Esteban Küber-0/+24
2018-08-01Switch to bootstrapping from 1.29 betaMark Rousskov-4/+1
2018-07-31Use suggestions for shell format argumentsEsteban Küber-5/+24
2018-07-26Rollup merge of #52649 - estebank:fmt-span, r=oli-obkMark Rousskov-13/+43
Point spans to inner elements of format strings - Point at missing positional specifiers in string literal ``` error: invalid reference to positional arguments 3, 4 and 5 (there are 3 arguments) --> $DIR/ifmt-bad-arg.rs:34:38 | LL | format!("{name} {value} {} {} {} {} {} {}", 0, name=1, value=2); | ^^ ^^ ^^ | = note: positional arguments are zero-based ``` - Point at named formatting specifier in string literal ``` error: there is no argument named `foo` --> $DIR/ifmt-bad-arg.rs:37:17 | LL | format!("{} {foo} {} {bar} {}", 1, 2, 3); | ^^^^^ ``` - Update label for formatting string in "multiple unused formatting arguments" to be more correct ``` error: multiple unused formatting arguments --> $DIR/ifmt-bad-arg.rs:42:17 | LL | format!("", 1, 2); //~ ERROR: multiple unused formatting arguments | -- ^ ^ | | | multiple missing formatting specifiers ``` - When using `printf` string formatting, provide a structured suggestion instead of a note ``` error: multiple unused formatting arguments --> $DIR/format-foreign.rs:12:30 | LL | println!("%.*3$s %s!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments | -------------- ^^^^^^^^ ^^^^^^^ ^ | | | multiple missing formatting specifiers | = note: printf formatting not supported; see the documentation for `std::fmt` help: format specifiers in Rust are written using `{}` | LL | println!("{:.2$} {}!/n", "Hello,", "World", 4); //~ ERROR multiple unused formatting arguments | ^^^^^^ ^^ ```
2018-07-24Add span label for format str missing specifierEsteban Küber-5/+9
2018-07-24Use suggestions for `printf` formatEsteban Küber-7/+33
2018-07-24Reword missing formatting arguments labelEsteban Küber-4/+4
2018-07-23Allow by default, fix testsmark-2/+18
2018-07-23Implement 2015 vs 2018 `?` kleene op + testmark-133/+376
2018-07-23Only point at inside of string literals if they're actually string literalsEsteban Küber-2/+2
2018-07-22Point at internal span in format stringEsteban Küber-2/+2
2018-07-22Auto merge of #52394 - estebank:println, r=oli-obkbors-35/+74
Improve suggestion for missing fmt str in println Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal. Fix #52347.
2018-07-21Suggest space separated format str literalEsteban Küber-2/+2
2018-07-20Update tests for new NLL mutability errorsMatthew Jasper-1/+1
2018-07-19rework printlnEsteban Küber-4/+4
2018-07-19review comments: modify note wording and change `println`Esteban Küber-5/+32
- Don't print the newline on its own to avoid the possibility of printing it out of order due to `stdout` locking. - Modify wording of `concat!()` with non-literals to not mislead into believing that only `&str` literals are accepted. - Add test for `concat!()` with non-literals.
2018-07-19Improve suggestion for missing fmt str in printlnEsteban Küber-35/+47
Avoid using `concat!(fmt, "\n")` to improve the diagnostics being emitted when the first `println!()` argument isn't a formatting string literal.
2018-07-11suggest on new snippetcsmoe-4/+2
2018-07-06suggests with whole macro callcsmoe-1/+7
2018-07-03Suggestion for printcsmoe-1/+1
2018-06-19NLL: Updates to diagnostic output in `test/ui`.Felix S. Klock II-0/+2
2018-06-07Revert "Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov"Pietro Albini-44/+66
This reverts commit d6ba1b9b021c408fcad60ee52acf8af5e1b2eb00, reversing changes made to 8de5353f75dcde04abe947e0560dc5edd861cf3a.