about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
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-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-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-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-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-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
2015-04-17Fix test for 32-bit targets.Felix S. Klock II-2/+2
(The cast from the 64-bit value to isize was using the lower 32-bits, which led to it being treated as a large positive value rather than a smallish negative one. The fix was to use the same bits for the upper- and lower- 32 bits.)
2015-04-16deprecate Unicode functions that will be moved to crates.iokwantam-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-16rustdoc: Inline methods inhereted through DerefAlex Crichton-0/+113
Whenever a type implements Deref, rustdoc will now add a section to the "methods available" sections for "Methods from Deref<Target=Foo>", listing all the inherent methods of the type `Foo`. Closes #19190
2015-04-16Auto merge of #24448 - alexcrichton:issue-24445, r=huonwbors-0/+53
One of the parameters to the magical "register a thread-local destructor" function is called `__dso_handle` and largely just passed along (this seems to be what other implementations do). Currently we pass the *value* of this symbol, but apparently the correct piece of information to pass is the *address* of the symbol. In a PIE binary the symbol actually contains an address to itself which is why we've gotten away with what we're doing as long as we have. In a non-PIE binary the symbol contains the address `NULL`, causing a segfault in the runtime library if it keeps going. Closes #24445
2015-04-16Remove `&` from redirected outputThomas Jespersen-1/+1
This seems to fix the test
2015-04-16Auto merge of #24437 - fhahn:issue-24434, r=alexcrichtonbors-0/+16
closes #24434 This PR changes executes `syntax::config::strip_unconfigured_items` before `syntax::feature_gate::check_crate_macros(sess.codemap()`. As far as I know, `strip_unconfigured_items` should be independent of `check_crate_macros`.
2015-04-16Auto merge of #24423 - tbelaire:include_bytes, r=alexcrichtonbors-0/+40
This is a little bit tricky, since with include_str!, we know that we are including utf-8 content, so it's safe to store the source as a String in a FileMap. We don't know that for include_bytes!, but I don't think we actually need to track the contents anyways, so I'm passing "". new_filemap does check for the zero length content, and it should be reasonable, howeven I'm not sure if it would be better to pass None instead of Some(Rc::new("")) as the src component of a FileMap. Fixes bug #24348
2015-04-16Auto merge of #23682 - tamird:DRY-is-empty, r=alexcrichtonbors-11/+11
r? @alexcrichton
2015-04-15syntax: Change deriving methods to take a `&mut FnMut(P<Item>)`Erick Tryzelaar-1/+1
This allows #[derive(...)]` to create more than one impl
2015-04-16Auto merge of #24485 - brson:is, r=alexcrichtonbors-9/+23
It was an oversight that this was not done in the great int upheaval. [breaking-change]
2015-04-15Forbid is/us suffixes. Fixes #22496Brian Anderson-9/+23
It was an oversight that this was not done in the great int upheaval. [breaking-change]
2015-04-15Auto merge of #24481 - steveklabnik:rollup, r=steveklabnikbors-1/+33
- Successful merges: #24425, #24435, #24438, #24440, #24449, #24457, #24460, #24465, #24467, #24468, #24471, #24476, #24480 - Failed merges:
2015-04-15Rollup merge of #24460 - bytewiseand:master, r=alexcrichtonSteve Klabnik-0/+32
Closes #24197 Closes #24375 These ICEs are fixed on nightly.
2015-04-15Auto merge of #24330 - pnkfelix:issue-24267, r=nikomatsakisbors-0/+29
Extend rustc::middle::dataflow to allow filtering kills from flow-exits. Fix borrowck analysis so that it will not treat a break that pops through an assignment ```rust x = { ... break; ... } ``` as a kill of the "moved-out" bit for `x`. Fix #24267. [breaking-change], but really, its only breaking code that was already buggy.
2015-04-15Make sure to disambiguate obtained out from expected outputThomas Jespersen-2/+2
2015-04-15Use node_ty instead of expr_ty in binary expr fixupAriel Ben-Yehuda-0/+16
2015-04-15Regression test.Felix S. Klock II-0/+29
2015-04-15std: Fix thread_local! in non-PIE binariesAlex Crichton-0/+53
One of the parameters to the magical "register a thread-local destructor" function is called `__dso_handle` and largely just passed along (this seems to be what other implementations do). Currently we pass the *value* of this symbol, but apparently the correct piece of information to pass is the *address* of the symbol. In a PIE binary the symbol actually contains an address to itself which is why we've gotten away with what we're doing as long as we have. In a non-PIE binary the symbol contains the address `NULL`, causing a segfault in the runtime library if it keeps going. Closes #24445
2015-04-15Added a test for include_bytes! dep infoTheo Belaire-0/+40
This tests that both include_str! and include_bytes! mark their input file as a dependancy, and it's correctly outputted when you run `rustc --emit dep-info`.
2015-04-15Add tests for "ident only path should have been covered"-ICEAndreas Martens-0/+32
2015-04-15Fix some typos.Ms2ger-1/+1
2015-04-14Negative case of `len()` -> `is_empty()`Tamir Duberstein-5/+5
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`