summary refs log tree commit diff
path: root/src/test/parse-fail
AgeCommit message (Collapse)AuthorLines
2015-07-31Fix `impl A .. {}`Seo Sanghyeon-3/+18
2015-07-29Replace illegal with invalid in most diagnosticsSimonas Kazlauskas-31/+31
2015-07-27Turn on `box(PLACE) expr` deprecation warning post-snapshot.Eduard Burtescu-0/+1
2015-07-23Update suggestion from parenthesized-box-expr-message to reflect new output ↵Felix S. Klock II-2/+2
spacing.
2015-07-18Fix doc comment parsing in macros.Lee Jeffery-0/+38
2015-07-13Tell unicode escapes can’t be used as bytes earlier/moreSimonas Kazlauskas-3/+5
2015-07-10Improve incomplete unicode escape reportingSimonas Kazlauskas-1/+1
This improves diagnostic messages when \u escape is used incorrectly and { is missing. Instead of saying “unknown character escape: u”, it will now report that unicode escape sequence is incomplete and suggest what the correct syntax is.
2015-07-01Add netbsd amd64 supportAlex Newman-0/+1
2015-06-13Use `assert_eq!` instead of `assert!` in testspetrochenkov-2/+2
2015-06-12ignore-test cleanupSteve Klabnik-234/+0
Most of these are old, but some specific messages for specific tests: * trait-contravariant-self.rs: failed due to a soundess hole: https://github.com/rust-lang/rust/commit/05e3248a7974f55b64f75a2483b37ff8c001a4ff * process-detatch: https://github.com/rust-lang/rust/commit/15966c3c1f99810ac81053769651776a67181dae says "this test is being ignored until signals are implemented" That's not happening for a long time, and when it is, we'll write tests for it. * deep-vector{,2}.rs: "too big for our poor macro infrastructure", and has been ignored over a year. * borrowck-nested-calls.rs's FIXME #6268 was closed in favor of rust-lang/rfcs#811 * issue-15167.rs works properly now * issue-9737.rs works properly now * match-var-hygiene.rs works properly now Addresses a chunk of #3965
2015-06-09Exise 'unsafe pointer' in favor of 'raw pointer'Steve Klabnik-4/+4
Using two terms for one thing is confusing, these are called 'raw pointers' today.
2015-05-16Clarify the error message for malformed `extern crate` statementsP1start-1/+12
Closes #25468.
2015-04-27Auto merge of #23606 - quantheory:associated_const, r=nikomatsakisbors-6/+58
Closes #17841. The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough. There is still some significant functionality missing from this commit: - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~ - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet. - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865. - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~ Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
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-23Get associated consts working in match patterns.Sean Patrick Santos-0/+34
2015-04-23Functional changes for associated constants. Cross-crate usage of associated ↵Sean Patrick Santos-6/+24
constants is not yet working.
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