about summary refs log tree commit diff
path: root/src/test/compile-fail
AgeCommit message (Collapse)AuthorLines
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+2
2013-08-19Issue #3678: Remove wrappers and call foreign functions directlyNiko Matsakis-5/+5
2013-08-18auto merge of #8556 : sfackler/rust/quote, r=alexcrichtonbors-5/+5
They previously required one called "ext_cx" to be in scope. Fixes part of #7727
2013-08-18auto merge of #8561 : kballard/rust/do-block-internal-err-msg, r=thestingerbors-41/+0
When using a `do` block to call an internal iterator, if you forgot to return a value from the body, it would tell you error: Do-block body must return bool, but returns () here. Perhaps you meant to write a `for`-loop? This advice no longer applies as `for` loops are now for external iterators. Delete this message outright and let it use the default error message error: mismatched types: expected `bool` but found `()` r? @thestinger
2013-08-18quote_*! macros take an ExtCtxSteven Fackler-5/+5
They previously required one called "ext_cx" to be in scope. Fixes part of #7727
2013-08-18auto merge of #8551 : huonw/rust/speling, r=alexcrichtonbors-2/+2
(This doesn't add/remove `u`s or change `ize` to `ise`, or anything like that.)
2013-08-17auto merge of #8547 : kballard/rust/trait-parse-err-msg, r=alexcrichtonbors-0/+13
When parsing a trait function, the function must end with either `;` or `{` (signifying a default implementation). The error message incorrectly stated that it must be `;` or `}`. Fixes #6610.
2013-08-16Remove obsolete error message regarding do-blocks with internal itersKevin Ballard-41/+0
When using a `do` block to call an internal iterator, if you forgot to return a value from the body, it would tell you error: Do-block body must return bool, but returns () here. Perhaps you meant to write a `for`-loop? This advice no longer applies as `for` loops are now for external iterators. Delete this message outright and let it use the default error message error: mismatched types: expected `bool` but found `()`
2013-08-16auto merge of #8534 : huonw/rust/tls-key-macro, r=alexcrichtonbors-1/+23
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that *have* to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-16doc: convert remaining uses of core:: to std::.Huon Wilson-2/+2
2013-08-16syntax: add a local_data_key macro that creates a key for access to the TLS.Huon Wilson-1/+23
This allows the internal implementation details of the TLS keys to be changed without requiring the update of all the users. (Or, applying changes that have to be applied for the keys to work correctly, e.g. forcing LLVM to not merge these constants.)
2013-08-15Fix error message when trait method ends with wrong tokenKevin Ballard-0/+13
When parsing a trait function, the function must end with either `;` or `{` (signifying a default implementation). The error message incorrectly stated that it must be `;` or `}`. Fixes #6610.
2013-08-15auto merge of #8485 : alexcrichton/rust/add-tests, r=catamorphismbors-0/+59
Closes #3907 Closes #5493 Closes #4464 Closes #4759 Closes #5666 Closes #5884 Closes #5926 Closes #6318 Closes #6557 Closes #6898 Closes #6919 Closes #7222
2013-08-15auto merge of #8483 : luqmana/rust/rexprs, r=catamorphismbors-0/+15
Fixes #8152.
2013-08-14rustc: Eliminate a derived error in check::_matchTim Chevalier-2/+29
2013-08-13auto merge of #8477 : catamorphism/rust/issue-4096, r=msullivanbors-0/+22
r? @msullivan ...e parameters In this case, it's likely to be that the user forgot the `self` type, so say so. Closes #4096
2013-08-13Add a bunch of tests for closed issuesAlex Crichton-0/+59
Closes #3907 Closes #5493 Closes #4464 Closes #4759 Closes #5666 Closes #5884 Closes #5926 Closes #6318 Closes #6557 Closes #6898 Closes #6919 Closes #7222
2013-08-13Add test for repeat expr in statics.Luqman Aden-0/+15
2013-08-12Forbid pub/priv where it has no effectAlex Crichton-7/+49
Closes #5495
2013-08-12rustc: Give a hint when a static method call has fewer than expected type ↵Tim Chevalier-0/+22
parameters In this case, it's likely to be that the user forgot the `self` type, so say so. Closes #4096
2013-08-12auto merge of #8418 : ↵bors-1/+73
pnkfelix/rust/fsk-issue3192-improve-parse-error-for-empty-struct-init, r=pcwalton,me Fix #3192. r? anyone There are 4 different new tests, to check some different scenarios for what the parse context is at the time of recovery, becasue our compile-fail infrastructure does not appear to handle verifying error-recovery situations. Differentiate between unit-like struct definition item and unit-like struct construction in the error message. ---- More generally, outlines a more generic strategy for parse error recovery: By committing to an expression/statement at set points in the parser, we can then do some look-ahead to catch common mistakes and skip over them. One detail about this strategy is that you want to avoid emitting the "helpful" message unless the input is reasonably close to the case of interest. (E.g. do not warn about a potential unit struct for an input of the form `let hmm = do foo { } { };`) To accomplish this, I added (partial) last_token tracking; used for `commit_stmt` support. The check_for_erroneous_unit_struct_expecting fn returns bool to signal whether it "made progress"; currently unused; this is meant for use to compose several such recovery checks together in a loop.
2013-08-11tests: Add new tests for borrowck/objects and update some existing testsNiko Matsakis-2/+178
2013-08-10Merge branch 'issue-8393-attributes-in-macros' of ↵Erick Tryzelaar-0/+40
https://github.com/nikomatsakis/rust into rollup
2013-08-10Merge branch 'vec-exh' of https://github.com/stepancheg/rust into rollupErick Tryzelaar-14/+30
2013-08-10Merge branch 'enum-method-privacy' of ↵Erick Tryzelaar-1/+9
https://github.com/michaelwoerister/rust into rollup Conflicts: src/libsyntax/opt_vec.rs
2013-08-09auto merge of #8296 : erickt/rust/remove-str-trailing-nulls, r=ericktbors-21/+0
This PR fixes #7235 and #3371, which removes trailing nulls from `str` types. Instead, it replaces the creation of c strings with a new type, `std::c_str::CString`, which wraps a malloced byte array, and respects: * No interior nulls * Ends with a trailing null
2013-08-09Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-11/+71
remove-str-trailing-nulls
2013-08-09auto merge of #8387 : brson/rust/nooldrt, r=brsonbors-35/+0
2013-08-09Remove the C++ runtime. SayonaraBrian Anderson-35/+0
2013-08-09Add parse-error recovery for erroneous `struct_id { }` form.Felix S. Klock II-1/+73
There are 4 different new tests, to check some different scenarios for what the parse context is at the time of recovery, becasue our compile-fail infrastructure does not appear to handle verifying error-recovery situations. Differentiate between unit-like struct definition item and unit-like struct construction in the error message. ---- More generally, outlines a more generic strategy for parse error recovery: By committing to an expression/statement at set points in the parser, we can then do some look-ahead to catch common mistakes and skip over them. One detail about this strategy is that you want to avoid emitting the "helpful" message unless the input is reasonably close to the case of interest. (E.g. do not warn about a potential unit struct for an input of the form `let hmm = do foo { } { };`) To accomplish this, I added (partial) last_token tracking; used for `commit_stmt` support. The check_for_erroneous_unit_struct_expecting fn returns bool to signal whether it "made progress"; currently unused; this is meant for use to compose several such recovery checks together in a loop.
2013-08-09auto merge of #8362 : sfackler/rust/env, r=alexcrichtonbors-11/+71
env! aborts compilation of the specified environment variable is not defined and takes an optional second argument containing a custom error message. option_env! creates an Option<&'static str> containing the value of the environment variable. There are no run-pass tests that check the behavior when the environment variable is defined since the test framework doesn't support setting environment variables at compile time as opposed to runtime. However, both env! and option_env! are used inside of rustc itself, which should act as a sufficient test. Fixes #2248.
2013-08-08Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-7/+158
remove-str-trailing-nulls
2013-08-08Allow attributes to appear as macro argumentsNiko Matsakis-0/+40
Fixes #8393
2013-08-08auto merge of #8385 : cmr/rust/big-rollup, r=alexcrichtonbors-7/+28
This is a fairly large rollup, but I've tested everything locally, and none of it should be platform-specific. r=alexcrichton (bdfdbdd) r=brson (d803c18) r=alexcrichton (a5041d0) r=bstrie (317412a) r=alexcrichton (135c85e) r=thestinger (8805baa) r=pcwalton (0661178) r=cmr (9397fe0) r=cmr (caa4135) r=cmr (6a21d93) r=cmr (4dc3379) r=cmr (0aa5154) r=cmr (18be261) r=thestinger (f10be03)
2013-08-08env! syntax extension changesSteven Fackler-11/+71
env! aborts compilation of the specified environment variable is not defined and takes an optional second argument containing a custom error message. option_env! creates an Option<&'static str> containing the value of the environment variable. There are no run-pass tests that check the behavior when the environment variable is defined since the test framework doesn't support setting environment variables at compile time as opposed to runtime. However, both env! and option_env! are used inside of rustc itself, which should act as a sufficient test. Close #2248
2013-08-07Fix falloutCorey Richardson-7/+7
2013-08-07Fix unit structs in cross-crate situtationsAlex Crichton-0/+21
2013-08-07Add initial support for a new formatting syntaxAlex Crichton-0/+130
The new macro is available under the name ifmt! (only an intermediate name)
2013-08-07Fix incorrect non-exhaustive matching for fixed length vecsStepan Koltsov-14/+30
Code like this is fixed now: ``` fn foo(p: [u8, ..4]) { match p { [a, b, c, d] => {} }; } ``` Invalid constructors are not reported as errors yet: ``` fn foo(p: [u8, ..4]) { match p { [_, _, _] => {} // this should be error [_, _, _, _, _, .._] => {} // and this _ => {} } } ``` Issue #8311 is partially fixed by this commit. Fixed-length arrays in let statement are not yet allowed: ``` let [a, b, c] = [1, 2, 3]; // still fails ```
2013-08-07Enable privacy check for enum methods.Michael Woerister-1/+9
2013-08-06Merge remote-tracking branch 'remotes/origin/master' into ↵Erick Tryzelaar-2/+2
remove-str-trailing-nulls
2013-08-05Updated std::Option, std::Either and std::ResultMarvin Löbel-2/+2
- Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead
2013-08-04Merge remote-tracking branch 'remotes/origin/master' into str-remove-nullErick Tryzelaar-6/+6
2013-08-04std: remove str::NullTerminatedStrErick Tryzelaar-21/+0
2013-08-03auto merge of #8264 : thestinger/rust/snapshot, r=Aatchbors-6/+6
2013-08-03remove obsolete `foreach` keywordDaniel Micay-6/+6
this has been replaced by `for`
2013-08-03auto merge of #8223 : davidhalperin/rust/master, r=Aatchbors-0/+24
Closes #7907 This is my first pull request so let me know if I've done anything wrong. I tried to pick off a nice easy one.
2013-08-03replace all remaining `for` with `foreach` or `do`Daniel Micay-104/+0
2013-08-02librustc: Disallow "unsafe" for external functionsPatrick Walton-1/+1
2013-08-02librustc: Introduce a new visitor type based on traits and port syntax to it.Patrick Walton-0/+3
This is preparation for removing `@fn`. This does *not* use default methods yet, because I don't know whether they work. If they do, a forthcoming PR will use them. This also changes the precedence of `as`.