summary refs log tree commit diff
path: root/src/test/ui/macros
AgeCommit message (Collapse)AuthorLines
2018-03-16Update testsJohn Kåre Alsaker-1/+4
2018-03-14update testsGuillaume Gomez-5/+4
2018-02-26Fix rebaseVadim Petrochenkov-13/+13
2018-02-26Update UI testsVadim Petrochenkov-2/+2
2018-02-26Update UI testsVadim Petrochenkov-53/+53
2018-02-26Auto merge of #48337 - GuillaumeGomez:rustc-explain, r=estebankbors-0/+5
Rustc explain Fixes #48041. To make the review easier, I separated tests update to code update. Also, I used this script to generate new ui tests stderr: ```python from os import listdir from os.path import isdir, isfile, join PATH = "src/test/ui" def do_something(path): files = [join(path, f) for f in listdir(path)] for f in files: if isdir(f): do_something(f) continue if not isfile(f) or not f.endswith(".stderr"): continue x = open(f, "r") content = x.read().strip() if "error[E" not in content: continue errors = dict() for y in content.splitlines(): if y.startswith("error[E"): errors[y[6:11]] = True errors = sorted(errors.keys()) if len(errors) < 1: print("weird... {}".format(f)) continue if len(errors) > 1: content += "\n\nYou've got a few errors: {}".format(", ".join(errors)) content += "\nIf you want more information on an error, try using \"rustc --explain {}\"".format(errors[0]) else: content += "\n\nIf you want more information on this error, try using \"rustc --explain {}\"".format(errors[0]) content += "\n" x = open(f, "w") x.write(content) do_something(PATH) ```
2018-02-25Update ui testsGuillaume Gomez-0/+5
2018-02-17Move macro-at-most-once-rep-ambig test to ui testMark Mansi-0/+133
2018-02-01Minimize weird spans involving macro contextEsteban Küber-0/+36
Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without mergin them.
2018-01-18Rollup merge of #47481 - estebank:unused-args, r=arielb1kennytm-39/+30
Point at unused arguments for format string Avoid overlapping spans by only pointing at the arguments that are not being used in the argument string. Enable libsyntax to have diagnostics with multiple primary spans by accepting `Into<MultiSpan>` instead of `Span`. Partially addresses #41850.
2018-01-16Add secondary span pointing at the statement (error span)Esteban Küber-15/+25
2018-01-15Point at unused arguments for format stringEsteban Küber-45/+26
Avoid overlapping spans by only pointing at the arguments that are not being used in the argument string. Enable libsyntax to have diagnostics with multiple primary spans by accepting `Into<MultiSpan>` instead of `Span`.
2018-01-15Don't include bang in macro replacement suggestionRyan Cumming-2/+2
When we suggest the replacement for a macro we include the "!" in the suggested replacement but the span only contains the name of the macro itself. Using that replacement would cause a duplicate "!" in the resulting code. I originally tried to extend the span to be replaced by 1 byte in rust-lang/rust#47424. However, @zackmdavis pointed out that there can be whitespace between the macro name and the bang. Instead, just remove the bang from the suggested replacement. Fixes #47418
2018-01-04Do not use casting for suggestion to add type to numeric literalEsteban Küber-4/+4
2018-01-03Provide suggestion when trying to use method on numeric literalEsteban Küber-7/+47
2017-12-10Update ui tests' line numbers.Tommy Ip-2/+2
2017-12-10Add must-compile-successfully comment to appropriate ui tests.Tommy Ip-0/+1
2017-11-26mention nightly in -Z external-macro-backtrace noteAlex Burka-4/+4
2017-11-24Merge cfail and ui tests into ui testsOliver Schneider-41/+42
2017-11-20address review commentsAlex Burka-4/+4
2017-11-19use -Z flag instead of env varAlex Burka-4/+4
2017-11-19update UI testsAlex Burka-4/+4
2017-11-11Auto merge of #45807 - tommyip:format_err, r=estebankbors-1/+1
Make positional argument error in format! clearer r? @estebank Fixes #44954
2017-11-09Allow a trailing comma in assert_eq/ne macroKonrad Borowski-42/+0
2017-11-06Update tests for new format! error messageTommy Ip-1/+1
2017-09-03Fix testbjorn3-1/+0
2017-09-02Fix tidy errorbjorn3-1/+1
2017-09-02Better trace-macro and less span_err_fatalbjorn3-39/+10
2017-09-02Dont abort on first macro errorbjorn3-0/+136
2017-07-26Rollup merge of #43447 - estebank:import-span, r=nikomatsakisMark Simulacrum-1/+1
Point at path segment on module not found Point at the correct path segment on a import statement where a module doesn't exist. New output: ```rust error[E0432]: unresolved import `std::bar` --> <anon>:1:10 | 1 | use std::bar::{foo1, foo2}; | ^^^ Could not find `bar` in `std` ``` instead of: ```rust error[E0432]: unresolved import `std::bar::foo1` --> <anon>:1:16 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` error[E0432]: unresolved import `std::bar::foo2` --> <anon>:1:22 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` ``` Fix #43040.
2017-07-25Point at path segment on module not foundEsteban Küber-1/+1
Point at the correct path segment on a import statement where a module doesn't exist. New output: ```rust error[E0432]: unresolved import `std::bar` --> <anon>:1:10 | 1 | use std::bar::{foo1, foo2}; | ^^^ Could not find `bar` in `std` ``` instead of: ```rust error[E0432]: unresolved import `std::bar::foo1` --> <anon>:1:16 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` error[E0432]: unresolved import `std::bar::foo2` --> <anon>:1:22 | 1 | use std::bar::{foo1, foo2}; | ^^^^ Could not find `bar` in `std` ```
2017-07-21More testsPerry Fraser-0/+80
2017-07-18Change the error message for multiple unused print paramsPerry Fraser-16/+5
2017-07-17Change some helps to suggestionsOliver Schneider-8/+4
2017-07-17Move some tests from compile-fail to uiOliver Schneider-0/+64
2017-07-07Fold E0613 into E0609boreeas-2/+2
Resolves #42945
2017-07-02Revert "Change error count messages"Ariel Ben-Yehuda-5/+5
This reverts commit 5558c64f33446225739c1153b43d2e309bb4f50e.
2017-06-15Add E0613Guillaume Gomez-2/+2
2017-06-15Add E0612Guillaume Gomez-2/+2
2017-06-12Add E0610Guillaume Gomez-2/+2
2017-06-11Add E0609Guillaume Gomez-2/+2
2017-05-29Auto merge of #42264 - GuillaumeGomez:new-error-codes, r=Susurrusbors-2/+2
New error codes Part of #42229.
2017-05-27Add new error codes and update testsGuillaume Gomez-2/+2
2017-05-27Auto merge of #42103 - jorendorff:master, r=estebankbors-2/+5
trace_macro: Show both the macro call and its expansion. #42072. See #42072 for the initial motivation behind this. The change is not the minimal fix, but I want this behavior almost every time I use `trace_macros`.
2017-05-24Change error count messagesMichael Kohl-5/+5
See #33525 for details.
2017-05-19trace_macro: Show both the macro call and its expansion. #42072.Jason Orendorff-2/+5
2017-05-06Group "macro expansion" notes per call spanEsteban Küber-10/+7
2017-05-05Use diagnostics for trace_macro instead of printlnEsteban Küber-0/+27
2017-03-29Refactor how spans are combined in the parser.Jeffrey Seyfried-4/+1
2017-02-06improve error message when two-arg assert_eq! receives a trailing commaZack M. Davis-0/+38
Previously, `assert_eq!(left, right,)` (respectively, `assert_ne!(left, right,)`; note the trailing comma) would result in a confusing "requires at least a format string argument" error. In reality, a format string is optional, but the trailing comma puts us into the "match a token tree of zero or more tokens" branch of the macro (in order to support the optional format string), and passing the empty token tree into `format_args!` results in the confusing error. If instead we match a token tree of one or more tokens, we get a much more sensible "unexpected end of macro invocation" error. While we're here, fix up a stray space before a comma in the match guards. Resolves #39369.