about summary refs log tree commit diff
path: root/src/test/parse-fail
AgeCommit message (Collapse)AuthorLines
2015-04-25`qquote-2.rs` -> `run-fail/qquote.rs`Tamir Duberstein-63/+0
Re-enables the test.
2015-04-25`qquote-1.rs` -> `compile-fail-fulldeps/qquote.rs`Tamir Duberstein-70/+0
Re-enables the test.
2015-04-23Auto merge of #24683 - P1start:help-suggestions, r=nrcbors-1/+3
This PR uses the inline error suggestions introduced in #24242 to modify a few existing `help` messages. The new errors look like this: foobar.rs:5:12: 5:25 error: expected a path on the left-hand side of `+`, not `&'static Copy` [E0178] foobar.rs:5 let x: &'static Copy + 'static; ^~~~~~~~~~~~~ foobar.rs:5:12: 5:35 help: try adding parentheses (per RFC 438): foobar.rs: let x: &'static (Copy + 'static); foobar.rs:2:13: 2:23 error: cast to unsized type: `&_` as `core::marker::Copy` foobar.rs:2 let x = &1 as Copy; ^~~~~~~~~~ foobar.rs:2:19: 2:23 help: try casting to a reference instead: foobar.rs: let x = &1 as &Copy; foobar.rs:7:24: 7:25 error: expected expression, found `;` foobar.rs:7 let x = box (1 + 1); ^ foobar.rs:7:13: 7:16 help: try using `box()` instead: foobar.rs: let x = box() (1 + 1); This also modifies compiletest to give the ability to directly test suggestions given by error messages.
2015-04-21Change a few error messages to give code suggestionsP1start-1/+3
PR #24242 added the ability to the compiler to directly give suggestions about how to modify code to fix an error. The new errors look like this: foobar.rs:5:12: 5:25 error: expected a path on the left-hand side of `+`, not `&'static Copy` [E0178] foobar.rs:5 let x: &'static Copy + 'static; ^~~~~~~~~~~~~ foobar.rs:5:12: 5:35 help: try adding parentheses (per RFC 438): foobar.rs: let x: &'static (Copy + 'static); foobar.rs:2:13: 2:23 error: cast to unsized type: `&_` as `core::marker::Copy` foobar.rs:2 let x = &1 as Copy; ^~~~~~~~~~ foobar.rs:2:19: 2:23 help: try casting to a reference instead: foobar.rs: let x = &1 as &Copy; foobar.rs:7:24: 7:25 error: expected expression, found `;` foobar.rs:7 let x = box (1 + 1); ^ foobar.rs:7:13: 7:16 help: try using `box()` instead: foobar.rs: let x = box() (1 + 1); This also modifies compiletest to give the ability to directly test suggestions given by error messages.
2015-04-18Return nonzero exit code if there are errors at a stop pointFlorian Hahn-1/+426
2015-04-15Add tests for "ident only path should have been covered"-ICEAndreas Martens-0/+32
2015-04-13Added a help span which informs the user about the escaping of curly braces ↵Manuel Hoffmann-0/+18
in a format string if a wrongly escaped one is detected in a string.
2015-04-04fixing some tests and temporarily disabling others to get Bitrig build ↵Dave Huseby-0/+1
working 100%
2015-04-03Add tests for parsing of patternsVadim Petrochenkov-0/+171
2015-04-02syntax: Rewrite parsing of patternsVadim Petrochenkov-6/+6
2015-03-31Lex binary and octal literals more eagerly.Huon Wilson-1/+36
Previously 0b12 was considered two tokens, 0b1 and 2, as 2 isn't a valid base 2 digit. This patch changes that to collapse them into one (and makes `0b12` etc. an error: 2 isn't a valid base 2 digit). This may break some macro invocations of macros with `tt` (or syntax extensions) that rely on adjacent digits being separate tokens and hence is a [breaking-change] The fix is to separate the tokens, e.g. `0b12` -> `0b1 2`. cc https://github.com/rust-lang/rfcs/pull/879
2015-03-27rollup merge of #23786: alexcrichton/less-quotesAlex Crichton-5/+0
Conflicts: src/test/auxiliary/static-function-pointer-aux.rs src/test/auxiliary/trait_default_method_xc_aux.rs src/test/run-pass/issue-4545.rs
2015-03-27Fix fallout of removing quotes in crate namesAlex Crichton-5/+0
2015-03-27Prevent ICEs when parsing invalid escapes, closes #23620Florian Hahn-1/+49
2015-03-24rustc: Add support for `extern crate foo as bar`Alex Crichton-16/+2
The compiler will now issue a warning for crates that have syntax of the form `extern crate "foo" as bar`, but it will still continue to accept this syntax. Additionally, the string `foo-bar` will match the crate name `foo_bar` to assist in the transition period as well. This patch will land hopefully in tandem with a Cargo patch that will start translating all crate names to have underscores instead of hyphens. cc #23533
2015-03-23rollup merge of #23506: alexcrichton/remove-some-deprecated-thingsAlex Crichton-17/+0
Conflicts: src/test/run-pass/deprecated-no-split-stack.rs
2015-03-18rustc: Remove some long deprecated features:Alex Crichton-17/+0
* no_split_stack was renamed to no_stack_check * deriving was renamed to derive * `use foo::mod` was renamed to `use foo::self`; * legacy lifetime definitions in closures have been replaced with `for` syntax * `fn foo() -> &A + B` has been deprecated for some time (needs parens) * Obsolete `for Sized?` syntax * Obsolete `Sized? Foo` syntax * Obsolete `|T| -> U` syntax
2015-03-18Require braces when a closure has an explicit return type. This is aNiko Matsakis-0/+16
[breaking-change]: instead of a closure like `|| -> i32 22`, prefer `|| -> i32 { 22 }`. Fixes #23420.
2015-03-17Rollup merge of #23385 - tamird:cleanup-whitespace, r=alexcrichtonManish Goregaokar-25/+1
r? @alexcrichton Conflicts: src/test/run-pass/test-fn-signature-verification-for-explicit-return-type.rs
2015-03-15Strip all leading/trailing newlinesTamir Duberstein-25/+1
2015-03-13syntax: use lookahead to distinguish inner and outer attributes, instead of ↵Eduard Burtescu-2/+2
passing the latter around.
2015-03-12Auto merge of #23265 - eddyb:meth-ast-refactor, r=nikomatsakisbors-1/+31
The end result is that common fields (id, name, attributes, etc.) are stored in now-structures `ImplItem` and `TraitItem`. The signature of a method is no longer duplicated between methods with a body (default/impl) and those without, they now share `MethodSig`. This is also a [breaking-change] because of minor bugfixes and changes to syntax extensions: * `pub fn` methods in a trait no longer parse - remove the `pub`, it has no meaning anymore * `MacResult::make_methods` is now `make_impl_items` and the return type has changed accordingly * `quote_method` is gone, because `P<ast::Method>` doesn't exist and it couldn't represent a full method anyways - could be replaced by `quote_impl_item`/`quote_trait_item` in the future, but I do hope we realize how silly that combinatorial macro expansion is and settle on a single `quote` macro + some type hints - or just no types at all (only token-trees) r? @nikomatsakis This is necessary (hopefully also sufficient) for associated constants.
2015-03-11syntax: gather common fields of impl & trait items into their respective types.Eduard Burtescu-1/+31
2015-03-11Change comment in parse-fail testGuillaume Gomez-2/+2
2015-03-10Remove proc keywordGuillaume Gomez-3/+3
2015-03-08Auto merge of #23145 - semarie:openbsd-5806, r=alexcrichtonbors-0/+1
follow freebsd due to last deprecation of `std::old_io::fs`
2015-03-07disable test for issue-5806 on openbsdSébastien Marie-0/+1
follow freebsd due to last deprecation of std::old_io::fs
2015-03-06syntax: Remove deprecated unicode escapesAlex Crichton-22/+0
These have been deprecated for quite some time, so we should be good to remove them now.
2015-03-05Remove integer suffixes where the types in compiled code are identical.Eduard Burtescu-4/+4
2015-03-04std: Deprecate std::old_io::fsAlex Crichton-11/+4
This commit deprecates the majority of std::old_io::fs in favor of std::fs and its new functionality. Some functions remain non-deprecated but are now behind a feature gate called `old_fs`. These functions will be deprecated once suitable replacements have been implemented. The compiler has been migrated to new `std::fs` and `std::path` APIs where appropriate as part of this change.
2015-02-27obsolete `|&:|` syntaxJorge Aparicio-0/+18
closes #22881
2015-02-24Rollup merge of #22720 - edwardw:enum-struct-ident-walk-into-a-bar, r=nick29581Manish Goregaokar-0/+44
Closes #22589 Closes #22647 Closes #22665 Closes #22712
2015-02-24Add tests for expect ident but find enum or struct panicEdward Wang-0/+44
Closes #22589 Closes #22647 Closes #22665 Closes #22712
2015-02-24Rollup merge of #22632 - nagisa:kill-show-string-with-fire!, r=alexcrichtonManish Goregaokar-3/+2
Toss the tomatoes! r? @aturon Fixes #22478. The underlying bug(?) behind that issue still exists though and there’s another issue that reports it.
2015-02-22Fix test falloutsFlavio Percoco-3/+5
2015-02-21Kill fmt::Show and fmt::String with fire!Simonas Kazlauskas-3/+2
Toss the tomatoes!
2015-02-18rollup merge of #22497: nikomatsakis/suffixesAlex Crichton-5/+5
Conflicts: src/librustc_trans/trans/tvec.rs
2015-02-16Move remaning compile-fail tests that are rejected by the parser to parse-failFlorian Hahn-5/+1635
2015-02-10rollup merge of #21918: ranma42/replace-beAlex Crichton-14/+0
Conflicts: src/test/compile-fail/reserved-be.rs src/test/compile-fail/reserved-become.rs src/test/parse-fail/reserved-be.rs
2015-02-06Move compile-fail tests that are rejected by the parser to parse-failFlorian Hahn-0/+2172