about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
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-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.
2015-04-20Make stability attributes an error. #22830Brian Anderson-7/+3
2015-04-20Auto merge of #22117 - fhahn:fail-on-errors, r=nikomatsakisbors-1/+430
At the moment, when compilation is stopped at a stop point (like `-Z parse-only`), `rustc` does not return an nonzero exit code even if there are errors (expect fatal ones, that cause it to panic immediately). As an example, compiling `src/test/compile-fail/doc-before-semi.rs` with `-Z parse-only` raises an error, but exists with 0. Note that I could not use `sess.abort_if_errors()` in the macro, because `sess` is passed by value and move at some point.
2015-04-20Auto merge of #24586 - richo:test-16745, r=jakub-bors-0/+20
closes #16745
2015-04-19Lint non-snake-case crate namesP1start-0/+31
Passing a non-snake-case name to #![crate_name] or --crate-name will now yield a warning from the `non_snake_case` lint.
2015-04-19test: Add an assertion to the #16745 testcaseRicho Healey-6/+7
2015-04-18test: Add testcase for #16745Richo Healey-0/+19
2015-04-18Rather than storing the relations between free-regions in a globalNiko Matsakis-1/+81
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-18Return nonzero exit code if there are errors at a stop pointFlorian Hahn-1/+430
2015-04-18Auto merge of #24428 - kwantam:deprecate_unicode_fns, r=alexcrichtonbors-2/+5
This patch 1. renames libunicode to librustc_unicode, 2. deprecates several pieces of libunicode (see below), and 3. removes references to deprecated functions from librustc_driver and libsyntax. This may change pretty-printed output from these modules in cases involving wide or combining characters used in filenames, identifiers, etc. The following functions are marked deprecated: 1. char.width() and str.width(): --> use unicode-width crate 2. str.graphemes() and str.grapheme_indices(): --> use unicode-segmentation crate 3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(), char.compose(), char.decompose_canonical(), char.decompose_compatible(), char.canonical_combining_class(): --> use unicode-normalization crate
2015-04-18Auto merge of #23985 - erickt:derive-cleanup, r=ericktbors-1/+1
This extracts some of the minor cleanup patches from #23905.
2015-04-17std: Add Default/IntoIterator/ToOwned to the preludeAlex 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-17Auto merge of #24500 - pnkfelix:oflo-checked-neg, r=nikomatsakisbors-0/+19
Add conditional overflow-checking to signed negate operator. I argue this can land independently of #24420 , because one can write the implementation of `wrapped_neg()` inline if necessary (as illustrated in two cases on this PR). This needs to go into beta channel.
2015-04-17Auto merge of #24461 - nikomatsakis:issue-22077-unused-lifetimes, r=aturonbors-0/+59
This makes it illegal to have unconstrained lifetimes that appear in an associated type definition. Arguably, we should prohibit all unconstrained lifetimes -- but it would break various macros. It'd be good to evaluate how large a break change it would be. But this seems like the minimal change we need to do to establish soundness, so we should land it regardless. Another variant would be to prohibit all lifetimes that appear in any impl item, not just associated types. I don't think that's necessary for soundness -- associated types are different because they can be projected -- but it would feel a bit more consistent and "obviously" safe. I'll experiment with that in the meantime. r? @aturon Fixes #22077.
2015-04-17Auto merge of #24475 - arielb1:i24363-hacky-hack, r=pnkfelixbors-0/+16
Fix #24363
2015-04-17Augment the constrainted parameter check to ensure that all regionsNiko Matsakis-0/+59
which get mentioned in an associated type are constrained. Arguably we should just require that all regions are constrained, but that is more of a breaking change.
2015-04-17unit test for checked overflow during signed negation.Felix S. Klock II-0/+19
2015-04-17Rollup merge of #24475 - arielb1:i24363-hacky-hack, r=pnkfelixManish Goregaokar-0/+16
Fix #24363
2015-04-17Rollup merge of #24430 - laumann:trace-macros-flag, r=pnkfelixManish Goregaokar-0/+24
This is the second attempt at turning the trace_macros macro into a compiler flag. See #22619
2015-04-17Auto merge of #24422 - pnkfelix:typeck-highlevel-before-bodies, r=nikomatsakisbors-54/+346
typeck: Do high-level structural/signature checks before function body checks. This avoids various ICEs, e.g. premature calls to cat_expr that yield the dreaded "cat_expr Errd" ICE. However, it also means that some early error feedback is now not provided. This may be for the best, because the error feedback were were providing in some of those cases were false positives -- it was spurious feedback and a distraction from the real problem. So it is not 100% clear whether we actually want to put this change in or not. I think its a net win, but others might disagree. (Kudos to @arielb1 for suggesting this modification.)
2015-04-17Auto merge of #24420 - pnkfelix:oflo-api, r=alexcrichtonbors-0/+236
Fill in missing parts of Integer overflow API See todo list at #22020