summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2017-06-01Fix regression in `macro_rules!` name matching.Jeffrey Seyfried-0/+30
2017-05-24Auto merge of #42182 - nikomatsakis:beta, r=brsonbors-10/+127
Beta backports Backports of: - #41913 (or some of it) - #41937 - #41716 - #41563
2017-05-23do not fetch variance for items when equatingNiko Matsakis-0/+43
Fixes #41849. Problem was that evaluating the constant expression required evaluating a trait, which would equate types, which would request variance information, which it would then discard. However, computing the variance information would require determining the type of a field, which would evaluate the constant expression. (This problem will potentially arise *later* as we move to more sophisticated constants, however, where we need to check subtyping. We can tackle that when we come to it.)
2017-05-23use equality in the coerce-unsized checkNiko Matsakis-0/+38
This seems both to be a safe, conservative choice, and it sidesteps the cycle in #41936. Fixes #41936.
2017-05-23correct various error messages that changedNiko Matsakis-10/+9
The new messages seem universally better. I think these result because we recognize that we are in an invariant context more often.
2017-05-23add a WF obligation if a type variable appears in bivariant positionNiko Matsakis-0/+37
2017-05-23Fix regression on `include!(line!())`.Jeffrey Seyfried-0/+13
2017-05-22try to fix lvalue ops for realAriel Ben-Yehuda-0/+78
Hopefully this is the last PR needed. Fixes #41726. Fixes #41742. Fixes #41774.
2017-05-22refactor the handling of lvalue opsAriel Ben-Yehuda-0/+20
Fixes #41604.
2017-05-10Added test for #41479 from @eddyb.Cameron Hart-0/+18
2017-05-10typeck: resolve type vars before calling `try_index_step`Ariel Ben-Yehuda-0/+26
`try_index_step` does not resolve type variables by itself and would fail otherwise. Also harden the failure path in `confirm` to cause less confusing errors.
2017-04-24Feature gate in test.Without Boats-0/+2
2017-04-24Style.Without Boats-3/+3
2017-04-24Add compile-fail test.Without Boats-0/+26
2017-04-23rustc_const_eval: support all unit enum variants.Eduard-Mihai Burtescu-9/+108
2017-04-23rustc: make the const-eval cache polymorphic.Eduard-Mihai Burtescu-6/+0
2017-04-23Auto merge of #41437 - cuviper:remove-unstable-deprecated, r=alexcrichtonbors-37/+27
Remove items that are unstable and deprecated This removes unstable items that have been deprecated for more than one cycle. - Since 1.16.0, `#![feature(enumset)]` - All of `mod collections::enum_set` - Since 1.15.0, `#![feature(borrow_state)]` - `cell::BorrowState` - `RefCell::borrow_state()` - Since 1.15.0, `#![feature(is_unique)]` - `Rc::is_unique()` (made private like `Arc::is_unique()`) - Since 1.15.0, `#![feature(rc_would_unwrap)]` - `Rc::would_wrap()` - Since 1.13.0, `#![feature(binary_heap_extras)]` - `BinaryHeap::push_pop()` - `BinaryHeap::replace()` - Since 1.12.0, `#![feature(as_unsafe_cell)]` - `Cell::as_unsafe_cell()` - `RefCell::as_unsafe_cell()` - Since 1.12.0, `#![feature(map_entry_recover_keys)]` - `btree_map::OccupiedEntry::remove_pair()` - `hash_map::OccupiedEntry::remove_pair()` - Since 1.11.0, `#![feature(float_extras)]` - `Float::nan()` - `Float::infinity()` - `Float::neg_infinity()` - `Float::neg_zero()` - `Float::zero()` - `Float::one()` - `Float::integer_decode()` - `f32::integer_decode()` - `f32::ldexp()` - `f32::frexp()` - `f32::next_after()` - `f64::integer_decode()` - `f64::ldexp()` - `f64::frexp()` - `f64::next_after()` - Since 1.11.0, `#![feature(zero_one)]` - `num::Zero` - `num::One`
2017-04-22Auto merge of #41469 - arielb1:rustc-spring-cleaning, r=eddybbors-1/+2
Performance audit, Spring 2017 Fix up some quite important performance "surprises" I've found running callgrind on rustc.
2017-04-22remove cleanup branches to the resume blockAriel Ben-Yehuda-1/+2
This improves LLVM performance by 10% lost during the shimmir transition.
2017-04-22Auto merge of #41431 - GuillaumeGomez:hoedown-default, r=aturonbors-64/+0
Re-enable hoedown by default r? @rust-lang/docs cc @aturon
2017-04-22Auto merge of #41464 - frewsxcv:rollup, r=frewsxcvbors-0/+72
Rollup of 3 pull requests - Successful merges: #41077, #41355, #41450 - Failed merges:
2017-04-22Rollup merge of #41077 - petrochenkov:boundparen, r=nikomatsakisCorey Farwell-0/+72
syntax: Support parentheses around trait bounds An implementation for https://github.com/rust-lang/rust/issues/39318#issuecomment-290956826 r? @nikomatsakis
2017-04-22Auto merge of #39999 - bitshifter:struct_align, r=eddybbors-3/+328
Implementation of repr struct alignment RFC 1358. The main changes around rustc::ty::Layout::struct: * Added abi_align field which stores abi alignment before repr align is applied * align field contains transitive repr alignment * Added padding vec which stores padding required after fields The main user of this information is rustc_trans::adt::struct_llfields which determines the LLVM fields to be used by LLVM, including padding fields. A possible future optimisation would be to put the padding Vec in an Option, since it will be unused unless you are using repr align.
2017-04-22Re-enable hoedown by defaultGuillaume Gomez-64/+0
2017-04-21Rollup merge of #41435 - estebank:issue-33884, r=nikomatsakisCorey Farwell-0/+39
Add test for issue 33884 Fix #33884. r=nikomatsakis
2017-04-21Rollup merge of #41432 - abonander:issue_41211, r=jseyfriedCorey Farwell-0/+45
Don't panic if an attribute macro fails to resolve at crate root Adds temporary regression test; this ideally should work as-is (#41430) Closes #41211 r? @jseyfried
2017-04-21Rollup merge of #37658 - GuillaumeGomez:ref_suggestion, r=nikomatsakis,eddybCorey Farwell-13/+8
Ref suggestion
2017-04-21Update ui testGuillaume Gomez-10/+5
2017-04-21Fix issue with single question mark or parenVadim Petrochenkov-0/+13
2017-04-21syntax: Support parentheses around trait boundsVadim Petrochenkov-0/+59
2017-04-21Create a new method to run coercion inside probeGuillaume Gomez-6/+2
2017-04-21Auto merge of #41349 - eddyb:ty-contents, r=nikomatsakisbors-2/+10
rustc: replace TypeContents with two independent properties (is_freeze / needs_drop). `InteriorUnsafe` / `interior_unsafe` was replaced with a private lang-item `Freeze` auto trait in libcore. `OwnsDtor` / `needs_drop` was replaced with a specialized traversal that *doesn't* avoid caching results in case of a cycle, as the only cycles left can only occur in erroneous "types with infinite sizes", references and raw pointers not having destructors. Also, `Copy` is now checked at every step of the recursion. r? @nikomatsakis
2017-04-21Update #[no_core] users with the "freeze" lang item.Eduard-Mihai Burtescu-2/+10
2017-04-21Update testsGuillaume Gomez-1/+5
2017-04-20Remove float_extrasJosh Stone-5/+3
[unstable, deprecated since 1.11.0]
2017-04-20Remove num::{Zero,One}Josh Stone-12/+23
[unstable, deprecated since 1.11.0]
2017-04-20Remove BinaryHeap::{push_pop,replace}Josh Stone-2/+0
[unstable, deprecated since 1.13.0]
2017-04-20Remove EnumSetJosh Stone-18/+1
[unstable, deprecated since 1.16.0]
2017-04-20Reduce visual clutter of multiline start when possibleEsteban Küber-111/+86
When a span starts on a line with nothing but whitespace to the left, and there are no other annotations in that line, simplify the visual representation of the span. Go from: ```rust error[E0072]: recursive type `A` has infinite size --> file2.rs:1:1 | 1 | struct A { | _^ starting here... 2 | | a: A, 3 | | } | |_^ ...ending here: recursive type has infinite size | ``` To: ```rust error[E0072]: recursive type `A` has infinite size --> file2.rs:1:1 | 1 | / struct A { 2 | | a: A, 3 | | } | |_^ recursive type has infinite size ``` Remove `starting here...`/`...ending here` labels from all multiline diagnostics.
2017-04-20Add test for issue 33884Esteban Küber-0/+39
Fix #33884
2017-04-20Don't panic if an attribute macro fails to resolve at crate rootAustin Bonander-0/+45
Adds temporary regression test; this ideally should work as-is (#41430) Closes #41211
2017-04-21Added feature gate, updated error messages and tests.Cameron Hart-3/+23
2017-04-21Implementation of repr struct alignment RFC 1358.Cameron Hart-3/+308
The main changes around rustc::ty::Layout::struct and rustc_trans:adt: * Added primitive_align field which stores alignment before repr align * Always emit field padding when generating the LLVM struct fields * Added methods for adjusting field indexes from the layout index to the LLVM struct field index The main user of this information is rustc_trans::adt::struct_llfields which determines the LLVM fields to be used by LLVM, including padding fields.
2017-04-20Rollup merge of #41378 - eddyb:byval-is-not-like-sret, r=arielb1Corey Farwell-0/+23
rustc_trans: do not treat byval as using up registers. Perhaps not that well-documented, `byval` pointer arguments *are not* the same as pointer arguments used by pass-by-ref, but rather the pointer is only used by LLVM to pass the *contents* on the stack. Fixes #41375.
2017-04-20Rollup merge of #41377 - nikomatsakis:issue-41298-ICE-inference, r=eddybCorey Farwell-0/+16
Fix ICE building gluon_vm The problem was due to various places we were failing to propagate obligations. I think I got them mostly correct, but I didn't get around to writing test cases for each case. r? @eddyb or @arielb1
2017-04-20Rollup merge of #41214 - estebank:less-multiline, r=petrochenkovCorey Farwell-3/+48
Add a way to get shorter spans until `char` for pointing at defs ```rust error[E0072]: recursive type `X` has infinite size --> file.rs:10:1 | 10 | struct X { | ^^^^^^^^ recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable ``` vs ```rust error[E0072]: recursive type `X` has infinite size --> file.rs:10:1 | 10 | struct X { | _^ starting here... 11 | | x: X, 12 | | } | |_^ ...ending here: recursive type has infinite size | = help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable ``` Re: #35965, #38246. Follow up to #38328. r? @jonathandturner
2017-04-19propagate obligations during overlap checkNiko Matsakis-0/+16
2017-04-19Auto merge of #41325 - eddyb:isolate-snapshots-for-good, r=arielb1bors-0/+4
Ban registering obligations during InferCtxt snapshots. Back in #33852, a flag was added to `InferCtxt` to prevent rolling back a snapshot if obligations were added to some `FulfillmentContext` during the snapshot, to prevent leaking fresh inference variables (created during that snapshot, so their indices would get reused) in obligations, which could ICE or worse. But that isn't enough in the long run, as type-checking ends up relying on success implying that eager side-effects are fine, and while stray obligations *do* get caught nowadays, those errors prevent, e.g. the speculative coercions from #37658, which *have to* be rolled back *even* if they succeed. We can't just allow those obligations to stay around though, because we end up, again, in ICEs or worse. Instead, this PR modifies `lookup_method_in_trait_adjusted` to return `InferOk` containing the obligations that `Autoderef::finalize_as_infer_ok` can propagate to deref coercions. As there shouldn't be *anything* left that registers obligations during snapshots, it's completely banned. r? @nikomatsakis @arielb1
2017-04-19Auto merge of #41236 - cengizIO:master, r=nikomatsakisbors-30/+47
Move E0101 and E0102 logic into new E0282 mechanism #40013 Hello there! ## What's this? Previously, me and @nikomatsakis worked on error messages of uninferred locals. (#38812) This aims to build up on that by moving certain type checks from `writeback`. With this, `E0101` and `E0102` errors are getting obsoleted and no longer thrown. They're replaced with customized versions of `E0282`s instead. ## Sample Error Messages #### `E0101` is getting converted into: ```rust error[E0282]: type annotations needed --> test.rs:2:14 | 2 | let x = |_| {}; | ^ consider giving this closure parameter a type error: aborting due to previous error ``` #### `E0102` is getting converted into: ```rust error[E0282]: type annotations needed --> test.rs:2:9 | 2 | let x = []; | ^ | | | consider giving `x` a type | cannot infer type for `[_; 0]` error: aborting due to previous error ``` ## Annoyances - I think we need to change our way of type name resolving in relevant places, because that `[_; 0]` looks horrible IMHO. - I'm not terribly happy with the note ordering of errors. So please do point to code that might help me accomplish this. ## Tests Tests of `E0101` and `E0102` are getting converted from `compile-fail` to `ui` tests. ## Documentation Please help me with documentation update. There are some confusing places that needed an update but I'm not sure if I did the right ones. Please do comment on messages, layouts and other details. ## Appreciation Huge thanks goes to @nikomatsakis for being a patient and humble mentor along this long journey. 🍻
2017-04-19rustc_trans: do not treat byval as using up registers.Eduard-Mihai Burtescu-0/+23