summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2015-12-02Disable the null check elimination passBjörn Steinbrink-0/+24
This pass causes mis-optimizations in some cases and is probably no longer really important for us, so let's disable it for now. Fixes #30081
2015-11-21backport: Fix hygiene regression in patternsVadim Petrochenkov-0/+45
2015-11-04Move test file to run-fail, since it does an unwrapNiko Matsakis-0/+2
2015-11-04Don't "double check" var-sub-var constraints, which are handled inNiko Matsakis-0/+26
expansion already by growing the RHS to be bigger than LHS (all the way to `'static` if necessary). This is needed because contraction doesn't handle givens. Fixes #28934.
2015-11-04Regression test for #29048. Fixes #29048.Niko Matsakis-0/+21
2015-10-28The `source_did` may not be local, so don't unwrap theNiko Matsakis-0/+26
`as_local_node_id`, instead just compare against `Some(id)`. Fixes #29161.
2015-10-27Auto merge of #28833 - jryans:borrowck-linear-errors, r=pnkfelixbors-0/+28
Change error reporting of conflicting loans to stop earlier after printing an error for a given borrow, instead of proceeding to error on possibly every issued loan. This keeps us down to O(n) errors (for n problem lines), instead of O(n^2) errors in some cases. Fixes #27485.
2015-10-27Auto merge of #26421 - nham:fix_21546, r=pnkfelixbors-15/+65
Fixes #21546.
2015-10-27Auto merge of #26848 - oli-obk:const_fn_const_eval, r=pnkfelixbors-25/+59
this has the funky side-effect of also allowing constant evaluation of function calls to functions that are not `const fn` as long as `check_const` didn't mark that function `NOT_CONST` It's still not possible to call a normal function from a `const fn`, but let statements' initialization value can get const evaluated (this caused the fallout in the overflowing tests) we can now do this: ```rust const fn add(x: usize, y: usize) -> usize { x + y } const ARR: [i32; add(1, 2)] = [5, 6, 7]; ``` also added a test for destructuring in const fn args ```rust const fn i((a, b): (u32, u32)) -> u32 { a + b } //~ ERROR: E0022 ``` This is a **[breaking change]**, since it turns some runtime panics into compile-time errors. This statement is true for ANY improvement to the const evaluator.
2015-10-27Auto merge of #29327 - sanxiyn:argument, r=nrcbors-2/+45
Fix #24114.
2015-10-27Auto merge of #29325 - alexcrichton:revert-trait-accessibility, r=nrcbors-11/+12
These commits revert https://github.com/rust-lang/rust/pull/28504 and add a regression test pointed out by @petrochenkov, it's not immediately clear with the regression that the accessibility check should be removed, so for now preserve the behavior on stable by default. r? @nrc
2015-10-26Auto merge of #29274 - thepowersgang:issues-29107-const-unsafe-fn-order, ↵bors-3/+3
r=nikomatsakis This PR switches the implemented ordering from `unsafe const fn` (as was in the original RFC) to `const unsafe fn` (which is what the lang team decided on)
2015-10-26Auto merge of #29287 - Ryman:fn_nopat, r=alexcrichtonbors-0/+16
Previously, if you copied a signature from a trait definition such as: ```rust fn foo<'a>(&'a Bar) -> bool {} ``` and moved it into an `impl`, there would be an error message: "unexpected token `'a`" Adding to the error message that a pattern is expected should help users to find the actual problem with using a lifetime here.
2015-10-26test: Add regression test for "source trait is private"Alex Crichton-0/+52
2015-10-26Revert "Remove unnecessary trait accessibility check."Alex Crichton-27/+0
This reverts commit f4f95eb3a9f2c3c38679db84aabbb7cdb46d2641.
2015-10-26Revert "Add UFCS privacy test."Alex Crichton-24/+0
This reverts commit b3e1aca40f889a565bfa2607b82b80fe7cbcefea.
2015-10-27Distinguish argument from local variableSeo Sanghyeon-2/+45
2015-10-26Auto merge of #29312 - apasel422:issue-21410, r=alexcrichtonbors-0/+51
Closes #21410. Closes #24972.
2015-10-25Add tests for #21410 and #24972Andrew Paseltiner-0/+51
Closes #21410. Closes #24972.
2015-10-25Auto merge of #29284 - apasel422:tests, r=alexcrichtonbors-0/+203
Closes #22781. Closes #23891. Closes #24956. Closes #25145. Closes #25693. Closes #26095. Closes #26459. Closes #27320. Closes #27895.
2015-10-25Auto merge of #29254 - alexcrichton:stabilize-1.5, r=brsonbors-2/+2
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-25std: Stabilize library APIs for 1.5Alex Crichton-2/+2
This commit stabilizes and deprecates library APIs whose FCP has closed in the last cycle, specifically: Stabilized APIs: * `fs::canonicalize` * `Path::{metadata, symlink_metadata, canonicalize, read_link, read_dir, exists, is_file, is_dir}` - all moved to inherent methods from the `PathExt` trait. * `Formatter::fill` * `Formatter::width` * `Formatter::precision` * `Formatter::sign_plus` * `Formatter::sign_minus` * `Formatter::alternate` * `Formatter::sign_aware_zero_pad` * `string::ParseError` * `Utf8Error::valid_up_to` * `Iterator::{cmp, partial_cmp, eq, ne, lt, le, gt, ge}` * `<[T]>::split_{first,last}{,_mut}` * `Condvar::wait_timeout` - note that `wait_timeout_ms` is not yet deprecated but will be once 1.5 is released. * `str::{R,}MatchIndices` * `str::{r,}match_indices` * `char::from_u32_unchecked` * `VecDeque::insert` * `VecDeque::shrink_to_fit` * `VecDeque::as_slices` * `VecDeque::as_mut_slices` * `VecDeque::swap_remove_front` - (renamed from `swap_front_remove`) * `VecDeque::swap_remove_back` - (renamed from `swap_back_remove`) * `Vec::resize` * `str::slice_mut_unchecked` * `FileTypeExt` * `FileTypeExt::{is_block_device, is_char_device, is_fifo, is_socket}` * `BinaryHeap::from` - `from_vec` deprecated in favor of this * `BinaryHeap::into_vec` - plus a `Into` impl * `BinaryHeap::into_sorted_vec` Deprecated APIs * `slice::ref_slice` * `slice::mut_ref_slice` * `iter::{range_inclusive, RangeInclusive}` * `std::dynamic_lib` Closes #27706 Closes #27725 cc #27726 (align not stabilized yet) Closes #27734 Closes #27737 Closes #27742 Closes #27743 Closes #27772 Closes #27774 Closes #27777 Closes #27781 cc #27788 (a few remaining methods though) Closes #27790 Closes #27793 Closes #27796 Closes #27810 cc #28147 (not all parts stabilized)
2015-10-25Auto merge of #29281 - skeleten:issue-28189, r=steveklabnikbors-0/+15
Closes #28189
2015-10-25Add testsAndrew Paseltiner-0/+203
Closes #22781. Closes #23891. Closes #24956. Closes #25145. Closes #25693. Closes #26095. Closes #26459. Closes #27320. Closes #27895.
2015-10-25Auto merge of #29273 - Manishearth:regression, r=alexcrichtonbors-0/+17
None
2015-10-25Auto merge of #29261 - apasel422:issue-22403, r=alexcrichtonbors-0/+15
Closes #22403. r? @pnkfelix
2015-10-25Switch to 'const unsafe fn' ordering (rust-lang/rust#29107)John Hodge-3/+3
2015-10-25libsyntax: better error for lifetimes in patternsKevin Butler-0/+16
Previously, if you copied a signature from a trait definition such as: ``` fn foo<'a>(&'a Bar) -> bool {} ``` and moved it into an `impl`, there would be an error message: "unexpected token `'a`" Adding to the error message that a pattern is expected should help users to find the actual problem with using a lifetime here.
2015-10-24Auto merge of #29151 - wthrowe:linker-output-ICE, r=alexcrichtonbors-0/+60
I suspect this won't work on Windows, but let's be optimistic and try it before disabling.
2015-10-24adding test for #28189skeleten-0/+15
2015-10-24Add regression test for #26886Manish Goregaokar-0/+17
(fixes #26886)
2015-10-24Auto merge of #29259 - arielb1:supertrait-self-2, r=eddybbors-0/+33
…being it This is a [breaking-change]:lang, but the broken code does not make much sense. Fixes #26056 r? @eddyb
2015-10-23Add test for #22403Andrew Paseltiner-0/+15
Closes #22403.
2015-10-24object_safety: check whether a supertrait contains Self even without being itAriel Ben-Yehuda-0/+33
This is a [breaking-change]:lang, but the broken code does not make much sense. Fixes #26056
2015-10-23Add a regression test for #29122 (fixed in #29134)William Throwe-0/+60
2015-10-23Auto merge of #29241 - nikomatsakis:issue-28871, r=arielb1bors-0/+33
Give preference to projections from where-clauses over those from trait definitions. This makes #28871 work again, though I think there's more to fix in this general area. r? @arielb1 cc @brson (fixes regression)
2015-10-23Auto merge of #29243 - skeleten:issue-29184, r=alexcrichtonbors-0/+13
Fixes #29184 This adds an error message for the use of the reserved `typeof` keyword, instead of reporting an ICE. Also adds a `compile-fail` test. I chose to add a `span_err` instead of removing to parser code, as to preserve the reservation of `typeof`.
2015-10-23add main fn to testNiko Matsakis-0/+2
2015-10-23Add error message for using `typeof` instead of an ICE.skeleten-0/+13
This adds error E0516 fixing a type pointed out by @jonas-schievink
2015-10-22Warn when creating a module and a struct that both have the same name.Nick Hamann-15/+65
Currently it is possible to do the following: - define a module named `Foo` and then a unit or tuple struct also named `Foo` - define any struct named `Foo` and then a module named `Foo` This commit introduces a warning for both of these cases.
2015-10-22distinguish projections from the env/obj-types vs those fromNiko Matsakis-0/+31
trait definitions, and give prefence to the former. This is consistent with what we do for selection. It also works around a limitation that was leading to #28871.
2015-10-22Auto merge of #29210 - arielb1:suggest-overflow, r=eddybbors-0/+32
This prevents a stack-overflow when the module graph was cyclic. Fixes #29181 r? @eddyb
2015-10-21don't revisit modules while finding traits in suggestAriel Ben-Yehuda-0/+32
Fixes #29181
2015-10-21Add test for #28936Andrew Paseltiner-0/+36
Closes #28936.
2015-10-21Auto merge of #29186 - pnkfelix:fsk-fix-issue-29166, r=alexcrichtonbors-0/+30
Add dropck unsafe escape hatch (UGEH) to vec::IntoIter. Fix #29166
2015-10-21Auto merge of #29171 - nrc:servo-dxr, r=@arielb1bors-1/+1
2015-10-21save-analysis: don't recompute crate nameNick Cameron-1/+1
2015-10-20Auto merge of #29148 - petrochenkov:noshow, r=alexcrichtonbors-7/+11
Closes https://github.com/rust-lang/rust/issues/29145 [breaking-change], needs a crater run.
2015-10-20Add dropck unsafe escape hatch (UGEH) to vec::IntoIter.Felix S. Klock II-0/+30
Fix #29166
2015-10-20Auto merge of #27723 - mystor:vecdeque_drain_range, r=blussbors-1/+2
This is a WIP PR for my implementation of drain over the VecDeque data structure supporting ranges. It brings the VecDeque drain implementation in line with Vec's. Tests haven't been written for the new function yet.