summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2015-06-18Add a test for issue 26322Simonas Kazlauskas-0/+36
2015-06-17Clear cached landing pads before generating a call.Eli Friedman-0/+40
Using the wrong landing pad has obvious bad effects, like dropping a value twice. Testcase written by Alex Crichton. Fixes #25089.
2015-06-09collections: Make BinaryHeap panic safe in sift_up / sift_downUlrik Sverdrup-0/+108
Use a struct called Hole that keeps track of an invalid location in the vector and fills the hole on drop. I include a run-pass test that the current BinaryHeap fails, and the new one passes. Fixes #25842
2015-06-09std: Make abs() panic on overflow in debug modeAlex Crichton-0/+21
Debug overflow checks for arithmetic negation landed in #24500, at which time the `abs` method on signed integers was changed to using `wrapping_neg` to ensure that the function never panicked. This implied that `abs` of `INT_MIN` would return `INT_MIN`, another negative value. When this change was back-ported to beta, however, in #24708, the `wrapping_neg` function had not yet been backported, so the implementation was changed in #24785 to `!self + 1`. This change had the unintended side effect of enabling debug overflow checks for the `abs` function. Consequently, the current state of affairs is that the beta branch checks for overflow in debug mode for `abs` and the nightly branch does not. This commit alters the behavior of nightly to have `abs` always check for overflow in debug mode. This change is more consistent with the way the standard library treats overflow as well, and it is also not a breaking change as it's what the beta branch currently does (albeit if by accident). cc #25378
2015-05-16Make a test compatible with the beta channelBrian Anderson-2/+0
2015-05-15syntax: Unquoting some statements requires trailing semicolonsErick Tryzelaar-0/+6
2015-05-15Auto merge of #25400 - nrc:save-api, r=huonwbors-43/+96
Also start factoring out an API for compiler tools to use and fix a bug that was preventing DXR indexing Rust properly. r? @huonw
2015-05-15Auto merge of #25399 - kballard:crate-attributes-cfg_attr, r=alexcrichtonbors-0/+31
Stripping unconfigured items prior to collecting crate metadata means we can say things like `#![cfg_attr(foo, crate_type="lib")]`. Fixes #25347.
2015-05-14Auto merge of #25403 - Manishearth:rollup, r=Manishearthbors-2/+2
- Successful merges: #25354, #25381, #25391, #25395, #25397, #25398, #25401 - Failed merges:
2015-05-14Auto merge of #24920 - alexcrichton:duration, r=aturonbors-32/+32
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the currently-unstable `Duration` type. The API of the type has been scaled back to be more conservative and it also no longer supports negative durations. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md The inner `duration` module of the `time` module has now been hidden (as `Duration` is reexported) and the feature name for this type has changed from `std_misc` to `duration`. All APIs accepting durations have also been audited to take a more flavorful feature name instead of `std_misc`. Closes #24874
2015-05-14Move configuration 1 phase before crate metadata collectionKevin Ballard-0/+31
Stripping unconfigured items prior to collecting crate metadata means we can say things like `#![cfg_attr(foo, crate_type="lib")]`. Fixes #25347.
2015-05-14Rollup merge of #25398 - nham:E0066_E0069, r=huonwManish Goregaokar-2/+2
Adds explanations for E0053, E0066, E0069, E0251, E0252, E0255, E0256, E0368. cc #24407
2015-05-14save-analysis: fix a bracket counting bugNick Cameron-0/+12
2015-05-14save-analysis: update the smoke testNick Cameron-43/+84
2015-05-14Auto merge of #25338 - tamird:unignore-stage-tests, r=alexcrichtonbors-28/+0
We don't have any pending snapshot-requiring changes. Closes #20184. Works toward #3965.
2015-05-13Add error explanations for E0066 and E0069.Nick Hamann-2/+2
This also updates the error messages for both. For E0066, it removes mention of "managed heap", which was removed in 8a91d33. For E0069, I just tweaked the wording to make it a bit more explicit.
2015-05-13std: Redesign Duration, implementing RFC 1040Alex Crichton-32/+32
This commit is an implementation of [RFC 1040][rfc] which is a redesign of the currently-unstable `Duration` type. The API of the type has been scaled back to be more conservative and it also no longer supports negative durations. [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1040-duration-reform.md The inner `duration` module of the `time` module has now been hidden (as `Duration` is reexported) and the feature name for this type has changed from `std_misc` to `duration`. All APIs accepting durations have also been audited to take a more flavorful feature name instead of `std_misc`. Closes #24874
2015-05-13Fix ICE that occurs when an associated const is ambiguous.Sean Patrick Santos-74/+106
Also change several error messages to refer to "items" rather than "methods", since associated items that require resolution during type checking are not always methods.
2015-05-13Unignore some tests in stage1Tamir Duberstein-26/+0
We don't have any pending snapshot-requiring changes. Tests which continue to be ignored are those that are broken by codegen changes.
2015-05-13Allow `T::C` syntax in match patterns to refer to trait-assosociated constants.Sean Patrick Santos-0/+4
2015-05-13Remove errant lineTamir Duberstein-2/+0
2015-05-13Auto merge of #25344 - arielb1:fresh-float, r=nikomatsakisbors-0/+74
There is no subtyping relationship between the types (or their non-freshened variants), so they can not be merged. Fixes #22645 Fixes #24352 Fixes #23825 Should fix #25235 (no test in issue). Should fix #19976 (test is outdated).
2015-05-13Auto merge of #25318 - nrc:for-expn, r=sfacklerbors-0/+37
r? @sfackler
2015-05-13Auto merge of #25024 - nrc:mulit-decor, r=sfacklerbors-16/+117
2015-05-13RebasingNick Cameron-18/+10
2015-05-13Merge branch 'master' into mulit-decorNick Cameron-16/+216
2015-05-13RebasingNick Cameron-2/+2
2015-05-13Tests for custom coercionsNick Cameron-0/+91
2015-05-13Fix a bunch of bugsNick Cameron-9/+54
* segfault due to not copying drop flag when coercing * fat pointer casts * segfault due to not checking drop flag properly * debuginfo for DST smart pointers * unreachable code in drop glue
2015-05-13eddyb's changes for DST coercionsNick Cameron-23/+9
+ lots of rebasing
2015-05-12Create a FreshFloatTy separate from FreshIntTyAriel Ben-Yehuda-0/+74
There is no subtyping relationship between the types (or their non-freshened variants), so they can not be merged. Fixes #22645 Fixes #24352 Fixes #23825 Should fix #25235 (no test in issue). Should fix #19976 (test is outdated).
2015-05-12Rollup merge of #25329 - jooert:tests, r=alexcrichtonManish Goregaokar-0/+41
2015-05-12Auto merge of #25300 - kballard:core-slice-overflow, r=Gankrobors-0/+60
core::slice was originally written to tolerate overflow (notably, with slices of zero-sized elements), but it was never updated to use wrapping arithmetic when overflow traps were added. Also correctly handle the case of calling .nth() on an Iter with a zero-sized element type. The iterator was assuming that the pointer value of the returned reference was meaningful, but that's not true for zero-sized elements. Fixes #25016.
2015-05-12Auto merge of #25171 - quantheory:associated_time_long_paths, r=nikomatsakisbors-0/+55
It is currently broken to use syntax such as `<T as Foo>::U::static_method()` where `<T as Foo>::U` is an associated type. I was able to fix this and simplify the parser a bit at the same time. This also fixes the corresponding issue with associated types (#22139), but that's somewhat irrelevant because #22519 is still open, so this syntax still causes an error in type checking. Similarly, although this fix applies to associated consts, #25046 forbids associated constants from using type parameters or `Self`, while #19559 means that associated types have to always have one of those two. Therefore, I think that you can't use an associated const from an associated type anyway.
2015-05-12Add regression test for #20413Johannes Oertel-0/+25
Closes #20413.
2015-05-12Add regression test for #18075Johannes Oertel-0/+16
Closes #18075.
2015-05-12Auto merge of #24818 - tbelaire:double-import, r=nrcbors-0/+27
This isn't quite right, but it's interesting.
2015-05-12Auto merge of #23424 - arielb1:ambiguous-project, r=nikomatsakisbors-0/+20
r? @nikomatsakis
2015-05-12TestsNick Cameron-0/+37
2015-05-12Merge branch 'master' intoNick Cameron-314/+1300
2015-05-11Auto merge of #25225 - bluss:doc-search-assoc-items, r=alexcrichtonbors-0/+1
Rustdoc fixes for associated items This is related to isssue #22442 and solves it partly. This solves the search index links of associated types and constants, so that they link to the trait page. Also add an Associated Constants section if constants are present.
2015-05-11Avoid returning a slice with a null pointer from Iter.as_slice()Kevin Ballard-3/+29
core::slice::Iter.ptr can be null when iterating a slice of zero-sized elements, but the pointer value used for the slice itself cannot. Handle this case by always returning a dummy pointer for slices of zero-sized elements.
2015-05-11Handle overflow properly in core::sliceKevin Ballard-0/+34
core::slice was originally written to tolerate overflow (notably, with slices of zero-sized elements), but it was never updated to use wrapping arithmetic when overflow traps were added. Also correctly handle the case of calling .nth() on an Iter with a zero-sized element type. The iterator was assuming that the pointer value of the returned reference was meaningful, but that's not true for zero-sized elements. Fixes #25016.
2015-05-11Auto merge of #25085 - carols10cents:remove-old-tilde, r=steveklabnikbors-16/+12
There were still some mentions of `~[T]` and `~T`, mostly in comments and debugging statements. I tried to do my best to preserve meaning, but I might have gotten some wrong-- I'm happy to fix anything :)
2015-05-10Rollup merge of #25252 - inrustwetrust:crate-type-attribute, r=alexcrichtonManish Goregaokar-0/+14
Fixes the problem in #16974 with unhelpful error messages when accidentally using the wrong syntax for the `crate_type="lib"` attribute. The attribute syntax error now shows up instead of "main function not found".
2015-05-10Upgraded warning for invalid crate_type attribute syntax to an errorinrustwetrust-0/+14
If the user intended to set the crate_type to "lib" but accidentally used incorrect syntax such as `#![crate_type(lib)]`, the compilation would fail with "main function not found". This made it hard to locate the source of the problem, since the failure would cause the warning about the incorrect attribute not to be shown.
2015-05-09Remove auxiliary files not used since eb4d39eCarol Nichols-40/+0
2015-05-09Remove auxiliary file not used since 17da4c7Carol Nichols-27/+0
2015-05-09Remove auxiliary files not used since 812637eCarol Nichols-164/+0
2015-05-09Rollup merge of #25216 - barosl:no-more-task, r=ManishearthManish Goregaokar-31/+31
I've found that there are still huge amounts of occurrences of `task`s in the documentation. This PR tries to eliminate all of them in favor of `thread`.