about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2015-04-26Auto merge of #24829 - jooert:fix22673, r=pnkfelixbors-0/+16
2015-04-26Auto merge of #24828 - jooert:fix23253, r=pnkfelixbors-0/+16
r? @alexcrichton
2015-04-26Auto merge of #24807 - luqmana:nullable-enum-opt-dst-raw-pointers, r=jakub-bors-0/+24
Fixes #23433.
2015-04-26Auto merge of #23085 - goffrie:interpolating-quote, r=huonwbors-223/+68
This changes the `ToTokens` implementations for expressions, statements, etc. with almost-trivial ones that produce `Interpolated(*Nt(...))` pseudo-tokens. In this way, quasiquote now works the same way as macros do: already-parsed AST fragments are used as-is, not reparsed. The `ToSource` trait is removed. Quasiquote no longer involves pretty-printing at all, which removes the need for the `encode_with_hygiene` hack. All associated machinery is removed. New `Nonterminal`s are added: NtArm, NtImplItem, and NtTraitItem. These are just for quasiquote, not macros. `ToTokens` is no longer implemented for `Arg` (although this could be added again) and `Generics` (which I don't think makes sense). This breaks any compiler extensions that relied on the ability of `ToTokens` to turn AST fragments back into inspectable token trees. For this reason, this closes #16987. As such, this is a [breaking-change]. Fixes #16472. Fixes #15962. Fixes #17397. Fixes #16617.
2015-04-26Auto merge of #24367 - ebfull:fix_ice_cat_expr, r=pnkfelixbors-0/+68
An actual typeck error is the cause of many failed compilations but an unrelated bug is being reported instead. It is triggered because a typeck error is presumably not yet identified during compiler execution, which would normally bypass an invariant in the presence of other errors. In this particular situation, we delay the reporting of the bug until abort_if_errors(). Closes #23827, closes #24356, closes #23041, closes #22897, closes #23966, closes #24013, and closes #23729 **There is at least one situation where this bug may still be genuinely triggered (#23437).**
2015-04-26Remove FakeExtCtxt from qquote tests.Geoffry Song-56/+30
Instead create an ExtCtxt structure.
2015-04-25Remove remaining tests for hygiene-encoded identifiers.Geoffry Song-126/+0
Such things no longer exist.
2015-04-25Interpolate AST nodes in quasiquote.Geoffry Song-41/+38
This changes the `ToTokens` implementations for expressions, statements, etc. with almost-trivial ones that produce `Interpolated(*Nt(...))` pseudo-tokens. In this way, quasiquote now works the same way as macros do: already-parsed AST fragments are used as-is, not reparsed. The `ToSource` trait is removed. Quasiquote no longer involves pretty-printing at all, which removes the need for the `encode_with_hygiene` hack. All associated machinery is removed. A new `Nonterminal` is added, NtArm, which the parser now interpolates. This is just for quasiquote, not macros (although it could be in the future). `ToTokens` is no longer implemented for `Arg` (although this could be added again) and `Generics` (which I don't think makes sense). This breaks any compiler extensions that relied on the ability of `ToTokens` to turn AST fragments back into inspectable token trees. For this reason, this closes #16987. As such, this is a [breaking-change]. Fixes #16472. Fixes #15962. Fixes #17397. Fixes #16617.
2015-04-25Auto merge of #24718 - tamird:fix-quote-tests, r=alexcrichtonbors-193/+144
Sniped from @rprichard's work in #24537. r? @alexcrichton
2015-04-26Add regression test for #22673.Johannes Oertel-0/+16
2015-04-26Add regression test for #23253.Johannes Oertel-0/+16
2015-04-25Auto merge of #24547 - bombless:comma, r=pnkfelixbors-0/+466
Closes #20616 It breaks code such as <https://github.com/rust-lang/rust/blob/c64feb63418fd05bd6e5adc6f9ad763aa6a594b1/src/librustc_typeck/check/method/suggest.rs#L367>, so this is a [breaking-change], you have to add missing comma after the last lifetime arguement now.
2015-04-25`qquote-2.rs` -> `run-fail/qquote.rs`Tamir Duberstein-63/+57
Re-enables the test.
2015-04-25`qquote-1.rs` -> `compile-fail-fulldeps/qquote.rs`Tamir Duberstein-70/+55
Re-enables the test.
2015-04-25Unrot and re-enable `run-pass-fulldeps/qquote.rs`Tamir Duberstein-60/+32
2015-04-25librustc_trans: Don't ICE on unsized type behind raw pointer in nullable ↵Luqman Aden-0/+24
pointer opt.
2015-04-25Auto merge of #24783 - jooert:unittestguidelines, r=alexcrichtonbors-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest (see #23870, #24030 and http://users.rust-lang.org/t/guidelines-naming-of-unit-test-module/1078 for previous discussions). r? @alexcrichton
2015-04-25Fix #20616York Xiang-0/+466
2015-04-24Rollup merge of #24751 - lstat:feature-gate-22820-dups, r=brsonSteve Klabnik-48/+0
As part of the audit for #22820 the following duplicate feature gate tests were removed: * `box_patterns` * `simd_ffi` These tests for `box_patterns` and `simd_ffi` were added in #23578, however there were existing tests in #20723 and #21233 respectively. r? @nrc
2015-04-24Rollup merge of #24749 - lstat:feature-gate-22820, r=nrcSteve Klabnik-0/+140
As part of the audit for #22820 the following feature gate tests have been added: * `negate_unsigned` * `on_unimplemented` * `optin_builtin_traits` * `plugin` * `rustc_attrs` * `rustc_diagnostic_macros` * `slice_patterns` In addition some feature gate error message typos fixed.
2015-04-24Auto merge of #24553 - nikomatsakis:issue-22779-overconstrained-impl, r=pnkfelixbors-1/+81
Rather than storing the relations between free-regions in a global table, introduce a `FreeRegionMap` data structure. regionck computes the `FreeRegionMap` for each fn and stores the result into the tcx so that borrowck can use it (this could perhaps be refactored to have borrowck recompute the map, but it's a bid tedious to recompute due to the interaction of closures and free fns). The main reason to do this is because of #22779 -- using a global table was incorrect because when validating impl method signatures, we want to use the free region relationships from the *trait*, not the impl. Fixes #22779.
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-24Split up tests, reduce coverageSean Bowe-12/+49
2015-04-24Remove duplicate feature gate testsLuke Gallagher-48/+0
As part of the audit for #22820 the following duplicate feature gate tests were removed: * `box_patterns` * `simd_ffi` These tests for `box_patterns` and `simd_ffi` were added in #23578, however there were existing tests in #20723 and #21233 respectively.
2015-04-24Add feature gate testsLuke Gallagher-0/+23
As part of the audit for #22820 the following feature gate tests have been added: * `rustc_diagnostic_macros` /cc #19624
2015-04-24Add feature gate testsLuke Gallagher-0/+117
As part of the audit for #22820 the following feature gate tests have been added: * `negate_unsigned` * `on_unimplemented` * `optin_builtin_traits` * `plugin` * `rustc_attrs` * `slice_patterns`
2015-04-23Auto merge of #24537 - rprichard:fix-parallel-check, r=alexcrichtonbors-29/+30
This required fixing the `pretty-rpass-full` tests to have the same `$$(CSREQ$(1)_T_$(2)_H_$(3))` dependencies as the `rpass-full` and `cfail-full` tests. It also required fixing the `run-make/simd-ffi` test to use unique names for its output files.
2015-04-22Replace ignore-android with ignore-cross-compile in rustdoc testsRyan Prichard-19/+19
The problem is that rustdoc searches for external crates using the host triple, not the target triple. It's actually unclear to me whether this is correct behavior or not, but it is necessary to get cross-compiled tests working.
2015-04-22Ignore cross-compilation in some fulldeps tests.Ryan Prichard-9/+9
These tests fail, in general, for cross-compilation, because they require the rustc crates to exist for the target, and they don't. We can't compile them for the target unless we also compile LLVM for the target (we don't). Android is a subset of cross-compilation. The other fulldeps tests, on the other hand, work fine for cross-compilation, and in fact, are verifying that rustc correctly searches for a host plugin crate, not a target plugin crate.
2015-04-22Fix run-make/simd-ffi to work with parallel make check.Ryan Prichard-1/+2
2015-04-23Auto merge of #24683 - P1start:help-suggestions, r=nrcbors-3/+45
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-23Rollup merge of #24688 - SimonSapin:fmt-write-char, r=alexcrichtonManish Goregaokar-1/+3
… added in #24661.
2015-04-22Add a test for std::fmt::Write::write_charSimon Sapin-1/+3
2015-04-21Test fixes and rebase conflicts, round 1Alex Crichton-2/+0
2015-04-21rollup merge of #24636: alexcrichton/remove-deprecatedAlex Crichton-491/+214
Conflicts: src/libcore/result.rs
2015-04-21rollup merge of #24541: alexcrichton/issue-24538Alex Crichton-3/+3
This is an implementation of [RFC 1030][rfc] which adds these traits to the prelude and additionally removes all inherent `into_iter` methods on collections in favor of the trait implementation (which is now accessible by default). [rfc]: https://github.com/rust-lang/rfcs/pull/1030 This is technically a breaking change due to the prelude additions and removal of inherent methods, but it is expected that essentially no code breaks in practice. [breaking-change] Closes #24538
2015-04-21std: Bring back f32::from_str_radix as an unstable APIAlex Crichton-25/+9
This API was exercised in a few tests and mirrors the `from_str_radix` functionality of the integer types.
2015-04-21rollup merge of #24651: tamird/old-referencesAlex Crichton-31/+11
r? @alexcrichton
2015-04-21rollup merge of #24563: kwantam/rfc_1054Alex Crichton-3/+1
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to str.words() throughout codebase. Closes #15628
2015-04-21rollup merge of #24439: alexcrichton/fix-archive-assemblerAlex Crichton-0/+72
When linking an archive statically to an rlib, the compiler will extract all contents of the archive and add them all to the rlib being generated. The current method of extraction is to run `ar x`, dumping all files into a temporary directory. Object archives, however, are allowed to have multiple entries with the same file name, so there is no method for them to extract their contents into a directory in a lossless fashion. This commit adds iterator support to the `ArchiveRO` structure which hooks into LLVM's support for reading object archives. This iterator is then used to inspect each object in turn and extract it to a unique location for later assembly.
2015-04-21rollup merge of #24162: pnkfelix/fsk-detect-duplicate-loop-labelsAlex Crichton-3/+288
Check for duplicate loop labels in function bodies. See also: http://internals.rust-lang.org/t/psa-rejecting-duplicate-loop-labels/1833 The change, which we are putting in as future-proofing in preparation for future potential additions to the language (namely labeling arbitrary blocks and using those labels in borrow expressions), means that code like this will start emitting warnings: ```rust fn main() { { 'a: loop { break; } } { 'a: loop { break; } } } ``` To make the above code compile without warnings, write this instead: ```rust fn main() { { 'a: loop { break; } } { 'b: loop { break; } } } ``` Since this change is only introducing a new warnings, this change is non-breaking. Fix #21633
2015-04-21implement rfc 1054: split_whitespace() fn, deprecate words()kwantam-3/+1
For now, words() is left in (but deprecated), and Words is a type alias for struct SplitWhitespace. Also cleaned up references to s.words() throughout codebase. Closes #15628
2015-04-21test: Fix fallout in testsAlex Crichton-466/+205
2015-04-21rustc: Handle duplicate names merging archivesAlex Crichton-0/+72
When linking an archive statically to an rlib, the compiler will extract all contents of the archive and add them all to the rlib being generated. The current method of extraction is to run `ar x`, dumping all files into a temporary directory. Object archives, however, are allowed to have multiple entries with the same file name, so there is no method for them to extract their contents into a directory in a lossless fashion. This commit adds iterator support to the `ArchiveRO` structure which hooks into LLVM's support for reading object archives. This iterator is then used to inspect each object in turn and extract it to a unique location for later assembly.
2015-04-21add notes clarifying introduction of warnings for a pair of run-pass tests.Felix S. Klock II-0/+13
2015-04-21Tests for shadowing between lifetimes and loop labels within function bodies.Felix S. Klock II-3/+275
2015-04-21Remove references to `old_{path,io}`Tamir Duberstein-31/+11
2015-04-21Auto merge of #24620 - pczarn:model-lexer-issues, r=cmrbors-35/+0
Fixes #15679 Fixes #15878 Fixes #15882 Closes #15883
2015-04-21Model lexer: Fix remaining issuesPiotr Czarnecki-35/+0
2015-04-21Change a few error messages to give code suggestionsP1start-3/+45
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.