about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2016-05-31add a series of tests for changes to structsNiko Matsakis-0/+326
These tests reveal that the edges are in some cases too strict.
2016-05-30Rollup merge of #33926 - jseyfried:fix_derive_span, r=nrcManish Goregaokar-0/+14
Fix the span of generated `#[derive_*]` attributes Fixes #33571. r? @nrc
2016-05-28Auto merge of #33821 - sanxiyn:cfg-test, r=nikomatsakisbors-0/+18
Do not inject test harness for --cfg test Fix #33670.
2016-05-28Rollup merge of #33852 - arielb1:autoderef-iterator, r=eddybManish Goregaokar-4/+25
refactor autoderef to avoid prematurely registering obligations Refactor `FnCtxt::autoderef` to use an external iterator and to not register any obligation from the main autoderef loop, but rather to register them after (and if) the loop successfully completes. Fixes #24819 Fixes #25801 Fixes #27631 Fixes #31258 Fixes #31964 Fixes #32320 Fixes #33515 Fixes #33755 r? @eddyb
2016-05-28Rollup merge of #33820 - jonathandturner:format_readability_updates, ↵Manish Goregaokar-31/+80
r=nikomatsakis Increase spacing in error format for readability. Two small tweaks that seem to help readability quite a bit: * Add spacing header<->snippet, but use the |> on the side for visual consistency * Fix #33819 * Fix #33763 * Move format-sensitive test (issue-26480 in cfail) to ui test r? @nikomatsakis
2016-05-28Add testJeffrey Seyfried-0/+14
2016-05-27Auto merge of #33706 - jseyfried:refactor_cfg, r=nrcbors-1/+7
Perform `cfg` attribute processing during macro expansion and fix bugs This PR refactors `cfg` attribute processing and fixes bugs. More specifically: - It merges gated feature checking for stmt/expr attributes, `cfg_attr` processing, and `cfg` processing into a single fold. - This allows feature gated `cfg` variables to be used in `cfg_attr` on unconfigured items. All other feature gated attributes can already be used on unconfigured items. - It performs `cfg` attribute processing during macro expansion instead of after expansion so that macro-expanded items are configured the same as ordinary items. In particular, to match their non-expanded counterparts, - macro-expanded unconfigured macro invocations are no longer expanded, - macro-expanded unconfigured macro definitions are no longer usable, and - feature gated `cfg` variables on macro-expanded macro definitions/invocations are now errors. This is a [breaking-change]. For example, the following would break: ```rust macro_rules! m { () => { #[cfg(attr)] macro_rules! foo { () => {} } foo!(); // This will be an error macro_rules! bar { () => { fn f() {} } } #[cfg(attr)] bar!(); // This will no longer be expanded ... fn g() { f(); } // ... so that `f` will be unresolved. #[cfg(target_thread_local)] // This will be a gated feature error macro_rules! baz { () => {} } } } m!(); ``` r? @nrc
2016-05-27Test that unconfigured macro-expanded macro invocations are not expanded.Jeffrey Seyfried-0/+3
2016-05-27Auto merge of #33900 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-0/+260
Rollup of 10 pull requests - Successful merges: #33753, #33815, #33829, #33858, #33865, #33866, #33870, #33874, #33891, #33898 - Failed merges:
2016-05-27Rollup merge of #33870 - jseyfried:ice-issue-33569, r=pnkfelixGuillaume Gomez-0/+18
Fix ICE on parsing a bad metavariable in a macro definition Fixes #33569, fixes #33728. r? @pnkfelix
2016-05-27Rollup merge of #33866 - GuillaumeGomez:err-codes, r=jonathandturnerGuillaume Gomez-0/+240
Add new error code tests r? @steveklabnik
2016-05-27Rollup merge of #33753 - mmatyas:armtestfix, r=alexcrichtonGuillaume Gomez-0/+2
Fix `asm-misplaced-option` on ARM/AArch64 This fixes rust-lang/rust#33737. Of course, since we don't run `make check` for ARM cross builds, you probably won't notice it.
2016-05-27Rollup merge of #33639 - petrochenkov:dotdot, r=nmatsakisManish Goregaokar-16/+508
cc https://github.com/rust-lang/rust/issues/33627 r? @nikomatsakis plugin-[breaking-change] cc https://github.com/rust-lang/rust/issues/31645 @Manishearth
2016-05-27Test that a feature gated cfg variable in a `cfg_attr` on an unconfigured ↵Jeffrey Seyfried-1/+4
item is allowed
2016-05-26Auto merge of #33783 - michaelwoerister:collector-cleanup-2, r=nikomatsakisbors-0/+4
trans::collector: Remove some redundant calls to erase_regions(). r? @Aatch
2016-05-26Auto merge of #33766 - jseyfried:cleanup_expansion, r=nrcbors-2/+5
Cleanup macro expansion and improve diagnostics Cleanup macro expansion and improve diagnostics. Fixes #33709. r? @nrc
2016-05-26Auto merge of #33872 - nagisa:undef-is-llvm-for-sigsegv, r=eddybbors-4/+33
Fix handling of FFI arguments r? @eddyb @nikomatsakis or whoever else. cc @alexcrichton @rust-lang/core The strategy employed here was to essentially change code we generate from ```llvm %s = alloca %S ; potentially smaller than argument, but never larger %1 = bitcast %S* %s to { i64, i64 }* store { i64, i64 } %0, { i64, i64 }* %1, align 4 ``` to ```llvm %1 = alloca { i64, i64 } ; the copy of argument itself store { i64, i64 } %0, { i64, i64 }* %1, align 4 %s = bitcast { i64, i64 }* %1 to %S* ; potentially truncate by casting to a pointer of smaller type. ```
2016-05-26Fix stores codegen passSimonas Kazlauskas-4/+4
2016-05-26Address review commentsVadim Petrochenkov-203/+343
2016-05-26Implement `..` in tuple (struct) patternsVadim Petrochenkov-16/+368
2016-05-26Fix ICE on failure to parse token treeJeffrey Seyfried-0/+18
2016-05-25Auto merge of #33732 - nikomatsakis:incr-comp-empty-cgu, r=mwbors-2/+0
always make at least one codegen-unit this allows us to remove the dummy `foo` fn r? @michaelwoerister
2016-05-26Add a regression testSimonas Kazlauskas-0/+29
2016-05-25Auto merge of #33667 - pnkfelix:fixes-to-mir-dataflow, r=arielb1bors-0/+280
Fixes to mir dataflow Fixes to mir dataflow This collects a bunch of changes to `rustc_borrowck::borrowck::dataflow` (which others have pointed out should probably migrate to some crate that isn't tied to the borrow-checker -- but I have not attempted that here, especially since there are competing approaches to dataflow that we should also evaluate). These changes: 1. Provide a family of related analyses: MovingOutStatements (which is what the old AST-based dataflo computed), as well as MaybeInitialized, MaybeUninitalized, and DefinitelyInitialized. * (The last two are actually inverses of each other; we should pick one and drop the other.) 2. Fix bugs in the pre-existing analysis implementation, which was untested and thus some obvious bugs went unnoticed, which brings us to the third point: 3. Add a unit test infrastructure for the MIR dataflow analysis. * The tests work by adding a new intrinsic that is able to query the analysis state for a particular expression (technically, a particular L-value). * See the examples in compile-fail/mir-dataflow/inits-1.rs and compile-fail/mir-dataflow/uninits-1.rs * These tests are only checking the results for MaybeInitialized, MaybeUninitalized, and DefinitelyInitialized; I am not sure if it will be feasible to generalize this testing strategy to the MovingOutStatements dataflow operator.
2016-05-25catch attempts to leak obligations out of snapshotsAriel Ben-Yehuda-2/+3
2016-05-25Auto merge of #33713 - LeoTestard:macro-rules-invalid-lhs, r=pnkfelixbors-1/+37
Make sure that macros that didn't pass LHS checking are not expanded. This avoid duplicate errors for things like invalid fragment specifiers, or parsing errors for ambiguous macros.
2016-05-25Add new error code testsggomez-0/+240
2016-05-25Auto merge of #33602 - eddyb:no-trans--check, r=michaelwoeristerbors-1/+1
Save metadata even with -Z no-trans (e.g. for multi-crate cargo check). Removes the item symbol map in metadata, as we can now generate them in a deterministic manner. The `-Z no-trans` change lets the LLVM passes and linking run, but with just metadata and no code. It fails while trying to link a binary because there's no `main` function, which is correct but not good UX. There's also no way to easily throw away all of the artifacts to rebuild with actual code generation. We might want `cargo check` to do that using cargo-internal information and then it would just work. cc @alexcrichton @nikomatsakis @Aatch @michaelwoerister
2016-05-24Auto merge of #33615 - GuillaumeGomez:field_static_method, r=pnkfelixbors-2/+29
Don't suggest using fields in a static method Fixes #33613. cc @LeoTestard
2016-05-25trans: move exported_symbol to Instance::symbol_name.Eduard Burtescu-1/+1
2016-05-24placate tidy in compile-fail test.Felix S. Klock II-1/+1
2016-05-25refactor autoderef to avoid registering obligationsAriel Ben-Yehuda-2/+22
Refactor `FnCtxt::autoderef` to use an external iterator and to not register any obligation from the main autoderef loop, but rather to register them after (and if) the loop successfully completes. Fixes #24819 Fixes #25801 Fixes #27631 Fixes #31258 Fixes #31964 Fixes #32320 Fixes #33515 Fixes #33755
2016-05-24Satisfy tidyJonathan Turner-1/+10
2016-05-24Back to single line between errors. Add header space to secondary filesJonathan Turner-3/+0
2016-05-24Move issue-26480 cfail to ui test. Fix #33763Jonathan Turner-31/+63
2016-05-24Rollup merge of #33781 - GuillaumeGomez:err-codes, r=steveklabnikGuillaume Gomez-0/+228
Add new error code tests r? @steveklabnik
2016-05-24Make sure that macros that didn't pass LHS checking are not expanded.Leo Testard-1/+37
This avoids duplicate errors for things like invalid fragment specifiers, or parsing errors for ambiguous macros. Fixes #29231.
2016-05-24Fix asm-misplaced-option on ARM/AArch64Mátyás Mustoha-0/+2
2016-05-23Fix #33819 and update ui testJonathan Turner-0/+11
2016-05-24Do not inject test harness for --cfg testSeo Sanghyeon-0/+18
2016-05-23Auto merge of #33735 - jseyfried:concat_idents_in_ty_positions, r=nrcbors-3/+6
Allow `concat_idents!` in type positions as well as in expression positions This allows the `concat_idents!` macro in type positions as well as in expression positions. r? @nrc
2016-05-23trans::collector: Remove some redundant calls to erase_regions().Michael Woerister-0/+4
2016-05-22Auto merge of #31457 - lambda:rtabort-use-libc-abort, r=alexcrichtonbors-2/+1
Use libc::abort, not intrinsics::abort, in rtabort! intrinsics::abort compiles down to an illegal instruction, which on Unix-like platforms causes the process to be killed with SIGILL. A more appropriate way to kill the process would be SIGABRT; this indicates better that the runtime has explicitly aborted, rather than some kind of compiler bug or architecture mismatch that SIGILL might indicate. For rtassert!, replace this with libc::abort. libc::abort raises SIGABRT, but is defined to do so in such a way that it will terminate the process even if SIGABRT is currently masked or caught by a signal handler that returns. On non-Unix platforms, retain the existing behavior. On Windows we prefer to avoid depending on the C runtime, and we need a fallback for any other platforms that may be defined. An alternative on Windows would be to call TerminateProcess, but this seems less essential than switching to using SIGABRT on Unix-like platforms, where it is common for the process-killing signal to be printed out or logged. This is a [breaking-change] for any code that depends on the exact signal raised to abort a process via rtabort! cc #31273 cc #31333
2016-05-23Use libc::abort, not intrinsics::abort, in rtabort!Brian Campbell-2/+1
intrinsics::abort compiles down to an illegal instruction, which on Unix-like platforms causes the process to be killed with SIGILL. A more appropriate way to kill the process would be SIGABRT; this indicates better that the runtime has explicitly aborted, rather than some kind of compiler bug or architecture mismatch that SIGILL might indicate. For rtassert!, replace this with libc::abort. libc::abort raises SIGABRT, but is defined to do so in such a way that it will terminate the process even if SIGABRT is currently masked or caught by a signal handler that returns. On non-Unix platforms, retain the existing behavior. On Windows we prefer to avoid depending on the C runtime, and we need a fallback for any other platforms that may be defined. An alternative on Windows would be to call TerminateProcess, but this seems less essential than switching to using SIGABRT on Unix-like platforms, where it is common for the process-killing signal to be printed out or logged. This is a [breaking-change] for any code that depends on the exact signal raised to abort a process via rtabort! cc #31273 cc #31333
2016-05-23Don't suggest using fields in a static methodggomez-2/+29
2016-05-22Add new error code testsggomez-0/+228
2016-05-21Test diagnosticsJeffrey Seyfried-2/+5
2016-05-21Auto merge of #33768 - Manishearth:rollup, r=Manishearthbors-6/+19
Rollup of 7 pull requests - Successful merges: #33578, #33679, #33743, #33746, #33747, #33750, #33757 - Failed merges:
2016-05-21Rollup merge of #33679 - Manishearth:rustdoc-readmore-impls, r=alexcrichtonManish Goregaokar-6/+19
rustdoc: Add doc snippets for trait impls, with a read more link The read more link only appears if the documentation is more than one line long. ![screenshot from 2016-05-17 06 54 14](https://cloud.githubusercontent.com/assets/1617736/15308544/4c2ba0ce-1bfc-11e6-9add-29de8dc7ac6e.png) It currently does not appear on non-defaulted methods, since you can document them directly. I could make it so that default documentation gets forwarded if regular docs don't exist. Fixes #33672 r? @alexcrichton cc @steveklabnik
2016-05-20Auto merge of #33625 - alexcrichton:rustbuild-moar-tests, r=aturonbors-0/+63
rustbuild: Touch up some test suites This adds in some missing test suites, primarily a few pretty suites. It also starts optimizing tests by default as the current test suite does, but also recognizes `--disable-optimize-tests`. Currently the optimization of tests isn't recognized by crate tests because Cargo doesn't support the ability to compile an unoptimized test suite against an optimized library. Perhaps a feature to add, though!