summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2016-08-01Add regression test.Jeffrey Seyfried-0/+23
2016-08-01Just pass in NodeId to FunctionContext::new instead of looking it up.Luqman Aden-0/+43
2016-07-26tyencode: Make sure that projection bounds are handled in stable order.Michael Woerister-0/+66
2016-07-03Auto merge of #34530 - alexcrichton:stabilize-1.11, r=aturonbors-5/+0
std: Stabilize APIs for the 1.11.0 release Although the set of APIs being stabilized this release is relatively small, the trains keep going! Listed below are the APIs in the standard library which have either transitioned from unstable to stable or those from unstable to deprecated. Stable * `BTreeMap::{append, split_off}` * `BTreeSet::{append, split_off}` * `Cell::get_mut` * `RefCell::get_mut` * `BinaryHeap::append` * `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past libstd stabilizations * `Iterator::sum` * `Iterator::product` Deprecated * `{f32, f64}::next_after` * `{f32, f64}::integer_decode` * `{f32, f64}::ldexp` * `{f32, f64}::frexp` * `num::One` * `num::Zero` Added APIs (all unstable) * `iter::Sum` * `iter::Product` * `iter::Step` - a few methods were added to accomodate deprecation of One/Zero Removed APIs * `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is unstable Closes #27739 Closes #27752 Closes #32526 Closes #33444 Closes #34152 cc #34529 (new tracking issue)
2016-07-03std: Stabilize APIs for the 1.11.0 releaseAlex Crichton-5/+0
Although the set of APIs being stabilized this release is relatively small, the trains keep going! Listed below are the APIs in the standard library which have either transitioned from unstable to stable or those from unstable to deprecated. Stable * `BTreeMap::{append, split_off}` * `BTreeSet::{append, split_off}` * `Cell::get_mut` * `RefCell::get_mut` * `BinaryHeap::append` * `{f32, f64}::{to_degrees, to_radians}` - libcore stabilizations mirroring past libstd stabilizations * `Iterator::sum` * `Iterator::product` Deprecated * `{f32, f64}::next_after` * `{f32, f64}::integer_decode` * `{f32, f64}::ldexp` * `{f32, f64}::frexp` * `num::One` * `num::Zero` Added APIs (all unstable) * `iter::Sum` * `iter::Product` * `iter::Step` - a few methods were added to accomodate deprecation of One/Zero Removed APIs * `From<Range<T>> for RangeInclusive<T>` - everything about `RangeInclusive` is unstable Closes #27739 Closes #27752 Closes #32526 Closes #33444 Closes #34152 cc #34529 (new tracking issue)
2016-07-02Auto merge of #34580 - eddyb:two-steps-forward-one-step-backwards, r=nagisabors-0/+43
Revert "Remove the return_address intrinsic." This reverts commit b30134dbc3c29cf62a4518090e1389ff26918c19. Servo might want this merged if they don't merge servo/servo#11872 soon. cc @pnkfelix @jdm
2016-07-02fail obligations that depend on erroring obligationsAriel Ben-Yehuda-0/+20
Fix a bug where an obligation that depend on an erroring obligation would be regarded as successful, leading to global cache pollution and random lossage. Fixes #33723. Fixes #34503.
2016-06-30Revert "Remove the return_address intrinsic."Eduard Burtescu-0/+43
This reverts commit b30134dbc3c29cf62a4518090e1389ff26918c19.
2016-06-27Auto merge of #34424 - jseyfried:breaking_batch, r=Manishearthbors-0/+39
Batch up libsyntax breaking changes Batch of the following syntax-[breaking-change] changes: - #34213: Add a variant `Macro` to `TraitItemKind` - #34368: Merge the variant `QPath` of `PatKind` into the variant `PatKind::Path` - #34385: Move `syntax::ast::TokenTree` into a new module `syntax::tokenstream` - #33943: - Remove the type parameter from `visit::Visitor` - Remove `attr::WithAttrs` -- use `attr::HasAttrs` instead. - Change `fold_tt`/`fold_tts` to take token trees by value and avoid wrapping token trees in `Rc`. - Remove the field `ctxt` of `ast::Mac_` - Remove inherent method `attrs()` of types -- use the method `attrs` of `HasAttrs` instead. - #34316: - Remove `ast::Decl`/`ast::DeclKind` and add variants `Local` and `Item` to `StmtKind`. - Move the node id for statements from the `StmtKind` variants to a field of `Stmt` (making `Stmt` a struct instead of an alias for `Spanned<StmtKind>`) - Rename `ast::ExprKind::Again` to `Continue`. - #34339: Generalize and abstract `ThinAttributes` to `ThinVec<Attribute>` - Use `.into()` in convert between `Vec<Attribute>` and `ThinVec<Attribute>` - Use autoderef instead of `.as_attr_slice()` - #34436: Remove the optional expression from `ast::Block` and instead use a `StmtKind::Expr` at the end of the statement list. - #34403: Move errors into a separate crate (unlikely to cause breakage)
2016-06-26Auto merge of #34419 - eddyb:virtually-inexistent, r=Aatchbors-0/+28
Don't translate vtable methods with Self: Sized bounds. Fixes #34416.
2016-06-27Remove the return_address intrinsic.Eduard Burtescu-43/+0
2016-06-25Rollup merge of #34213 - josephDunne:trait_item_macros, r=jseyfriedJeffrey Seyfried-0/+39
**syntax-[breaking-change]** cc #31645 New `TraitItemKind::Macro` variant This change adds support for macro expansion inside trait items by adding the new `TraitItemKind::Macro` and associated parsing code.
2016-06-23Auto merge of #34077 - durka:patch-23, r=alexcrichtonbors-0/+23
upgrade thread_local! invocation syntax Allows declaring multiple statics in one macro invocation, and supports attaching attributes to the generated items. In particular, `#![forbid(missing_docs, unused)]` is now tenable on a crate/module containing thread locals. For an example see [here](https://is.gd/aVFZZF). This change is fully backwards compatible as far as I can tell. cc @frankmcsherry
2016-06-22Auto merge of #34374 - jseyfried:fix_hygiene_bug, r=nrcbors-0/+116
Fix macro hygiene regression The regression was caused by #32923, which is currently in beta. The following is an example of regressed code: ```rust fn main() { let x = 0; macro_rules! foo { () => { println!("{}", x); // prints `0` on stable and after this PR, prints `1` on beta and nightly } } let x = 1; foo!(); } ``` For code to regress, the following is necessary (but not sufficient): - There must be a local variable before a macro in a block, and the macro must use the variable. - There must be a second local variable with the same name after the macro. - The macro must be invoked in a statement position after the second local variable. For example, if the `let x = 0;` from the breaking example were commented out, it would (correctly) not compile on beta/nightly. If the semicolon were removed from `foo!();`, it would (correctly) print `0` on beta and nightly. r? @nrc
2016-06-23Don't translate vtable methods with Self: Sized bounds.Eduard Burtescu-0/+28
2016-06-22upgrade thread_local! invocation syntaxAlex Burka-0/+23
Allows declaring multiple statics in one macro invocation, and supports attaching attributes to the generated items.
2016-06-22More hygiene testsJeffrey Seyfried-3/+75
2016-06-22Auto merge of #34408 - Manishearth:rollup, r=Manishearthbors-0/+40
Rollup of 7 pull requests - Successful merges: #34190, #34363, #34367, #34383, #34387, #34394, #34404 - Failed merges:
2016-06-22Rollup merge of #34394 - oli-obk:const_cast_false_positive, r=eddybManish Goregaokar-0/+15
don't warn on casting byte strs to slices r? @durka
2016-06-21Fix overflow error in thread::sleepGuillaume Gomez-0/+25
2016-06-21don't warn on casting byte strs to slicesOliver Schneider-0/+15
2016-06-21Add message argument to `assert_eq` macroMitsunori Komatsu-0/+3
2016-06-20Add more hygiene testsJeffrey Seyfried-0/+23
2016-06-20Add regression testJeffrey Seyfried-0/+21
2016-06-18Add test case for #30276Steven Allen-0/+14
Make sure that treating a DST tuple constructor as a function doesn't ICE. Closes #30276
2016-06-13Correct broken testChris Tomlinson-0/+23
2016-06-13Add support for macro expansion inside trait itemsJoseph Dunne-0/+39
2016-06-10Add testsVadim Petrochenkov-0/+18
2016-06-08Auto merge of #32202 - arielb1:slice-patterns, r=nikomatsakisbors-50/+183
Implement RFC495 semantics for slice patterns non-MIR translation is still not supported for these and will happily ICE. This is a [breaking-change] for many uses of slice_patterns. [RFC 495 text](https://github.com/rust-lang/rfcs/blob/master/text/0495-array-pattern-changes.md)
2016-06-09handle string literals correctly in match checkingAriel Ben-Yehuda-0/+23
The root of the problem is that a string literal pattern is essentially of the form `&LITERAL`, in a single block, while match checking wants to split that. To fix that, I added a type field to the patterns in match checking, which allows us to distinguish between a full and split pattern. That file is ugly and needs to be cleaned. However, `trans::_match` calls it, so I think we should delay the cleanup until we kill that. Fixes #30240
2016-06-09implement RFC495 semantics for slice patternsAriel Ben-Yehuda-50/+142
non-MIR translation is still not supported for these and will happily ICE. This is a [breaking-change] for many uses of slice_patterns.
2016-06-09trans: don't misuse C_nil for ZSTs other than ().Eduard Burtescu-0/+15
2016-06-08fix translation of unsized types and arraysAriel Ben-Yehuda-0/+18
2016-06-07Auto merge of #34128 - eddyb:mir-trans-fixes, r=luqmanabors-6/+20
[MIR] Fix MIR trans edge cases that showed up on crater. These fixes cover all of the [regressions found by crater](https://gist.github.com/nikomatsakis/88ce89ed06ef7f7f19bfd1e221d7f7ec) (for #34096). Two of them were `Pair` edge cases (ZSTs and constants) causing LLVM assertions, the other one was causing stack overflows in debug scripts compiled in debug mode, due to the `fn_ret_cast` `alloca` ending up in a loop.
2016-06-07Auto merge of #34012 - eddyb:tick-erased, r=nikomatsakisbors-1/+1
rustc: add ReErased to be used by trait selection, MIR and trans. `ReErased` replaces `ReStatic` (i.e. `'static`) for erasing regions. Using a distinct lifetime helps prevent accidental mix-ups between the two. It also allows cleaner type printing (see test changes), including in symbol names: ```rust str..pattern..CharSearcher$LT$$u27$static$GT$::drop.30560::h840c2f2afc03bbea // before str..pattern..CharSearcher::drop.30561::h6bd31d2af614377a // after ``` Not that we should be producing symbols this way, but it's still better.
2016-06-07trans: don't forget to cast Pair constants of the wrong type.Eduard Burtescu-6/+8
2016-06-07trans: use Pair for ignored nil pairs instead of Immediate.Eduard Burtescu-0/+12
2016-06-06Auto merge of #34006 - eddyb:mir-const-fixes, r=nikomatsakisbors-0/+26
[MIR] Fix double-rounding of float constants and ignore NaN sign in tests. Fixes #32805 by handling f32 and f64 separately in rustc_const_eval. Also removes `#[rustc_no_mir]` from a couple libstd tests by ignoring NaN sign. Turns out that runtime evaluation of `0.0 / 0.0` produces a NaN with the sign bit set, whereas LLVM constant folds it to a NaN with the sign bit unset, which we were testing for.
2016-06-06Rollup merge of #34048 - shepmaster:corrected-issue-number, r=steveklabnikEduard-Mihai Burtescu-0/+0
Correct issue number in test
2016-06-05rustc_const_eval: work around double rounding.Eduard Burtescu-0/+26
2016-06-05trans: update Luqmana's patch for generalized pair handling.Eduard Burtescu-4/+14
2016-06-05[MIR] Handle call return values that need to be casted properly.Luqman Aden-0/+24
2016-06-05Enable the overflow-related tests for MIRJames Miller-2/+0
2016-06-05rustc: add ReErased to be used by trait selection, MIR and trans.Eduard Burtescu-1/+1
2016-06-04Auto merge of #33622 - arielb1:elaborate-drops, r=nikomatsakisbors-0/+156
[MIR] non-zeroing drop This enables non-zeroing drop through stack flags for MIR. Fixes #30380. Fixes #5016.
2016-06-04Auto merge of #33816 - nikomatsakis:projection-cache-2, r=arielb1bors-17/+92
Projection cache and better warnings for #32330 This PR does three things: - it lays the groundwork for the more precise subtyping rules discussed in #32330, but does not enable them; - it issues warnings when the result of a leak-check or subtyping check relies on a late-bound region which will late become early-bound when #32330 is fixed; - it introduces a cache for projection in the inference context. I'm not 100% happy with the approach taken by the cache here, but it seems like a step in the right direction. It results in big wins on some test cases, but not as big as previous versions -- I think because it is caching the `Vec<Obligation>` (whereas before I just returned the normalized type with an empty vector). However, that change was needed to fix an ICE in @alexcrichton's future-rs module (I haven't fully tracked the cause of that ICE yet). Also, because trans/the collector use a fresh inference context for every call to `fulfill_obligation`, they don't profit nearly as much from this cache as they ought to. Still, here are the results from the future-rs `retry.rs`: ``` 06:26 <nmatsakis> time: 6.246; rss: 44MB item-bodies checking 06:26 <nmatsakis> time: 54.783; rss: 63MB translation item collection 06:26 <nmatsakis> time: 140.086; rss: 86MB translation 06:26 <nmatsakis> time: 0.361; rss: 46MB item-bodies checking 06:26 <nmatsakis> time: 5.299; rss: 63MB translation item collection 06:26 <nmatsakis> time: 12.140; rss: 86MB translation ``` ~~Another example is the example from #31849. For that, I get 34s to run item-bodies without any cache. The version of the cache included here takes 2s to run item-bodies type-checking. An alternative version which doesn't track nested obligations takes 0.2s, but that version ICEs on @alexcrichton's future-rs (and may well be incorrect, I've not fully convinced myself of that). So, a definite win, but I think there's definitely room for further progress.~~ Pushed a modified version which improves performance of the case from #31849: ``` lunch-box. time rustc --stage0 ~/tmp/issue-31849.rs -Z no-trans real 0m33.539s user 0m32.932s sys 0m0.570s lunch-box. time rustc --stage2 ~/tmp/issue-31849.rs -Z no-trans real 0m0.195s user 0m0.154s sys 0m0.042s ``` Some sort of cache is also needed for unblocking further work on lazy normalization, since that will lean even more heavily on the cache, and will also require cycle detection. r? @arielb1
2016-06-04fix translation of terminators in MSVC cleanup blocksAriel Ben-Yehuda-17/+73
MSVC requires unwinding code to be split to a tree of *funclets*, where each funclet can only branch to itself or to to its parent. Luckily, the code we generates matches this pattern. Recover that structure in an analyze pass and translate according to that.
2016-06-03Auto merge of #33803 - WiSaGaN:feature/rename-main-thread, r=alexcrichtonbors-1/+1
Rename main thread from "<main>" to "main". Fix issue #33789 We may need to discuss whether this counts as a breaking change since code may check the main thread name against "\<main\>". Discussion is in #33789
2016-06-03implement drop elaborationAriel Ben-Yehuda-0/+100
Fixes #30380
2016-06-03Auto merge of #33861 - Amanieu:lock_elision_fix, r=alexcrichtonbors-0/+100
Make sure Mutex and RwLock can't be re-locked on the same thread Fixes #33770 r? @alexcrichton