summary refs log tree commit diff
path: root/src/test/run-pass
AgeCommit message (Collapse)AuthorLines
2017-07-13Stabilize Command::envsSteven Fackler-2/+0
Closes #38526
2017-06-22Make the `next` variable mutable to allow for ref mut in for patterns.John Kåre Alsaker-0/+15
2017-06-22Create for-loop-unconstrained-element-type-i32-fallback.rsNiko Matsakis-0/+4
2017-06-22document purpose of testNiko Matsakis-0/+5
2017-06-22Added more testsJohn Kåre Alsaker-1/+17
2017-06-22Fix test formattingJohn Kåre Alsaker-4/+14
2017-06-22Fix formatting and add a test for destruction order of unbound valuesJohn Kåre Alsaker-0/+28
2017-06-22register the obligations from `wf::implied_bounds`Niko Matsakis-0/+40
Fixes #42552. Fixes #42545.
2017-06-22collector: apply param substs to closures cast to fn itemsAriel Ben-Yehuda-0/+7
Fixes #42718.
2017-06-12rustc_typeck: do not overlap a borrow of TypeckTables with method lookup.Eduard-Mihai Burtescu-0/+41
2017-06-12rustc: T: 'empty always holds forall T.Eduard-Mihai Burtescu-0/+32
2017-06-04Auto merge of #42265 - Zoxc:for-sugar, r=eddybbors-0/+21
Change for-loop desugar to not borrow the iterator during the loop This is enables the use of suspend points inside for-loops in movable generators. This is illegal in the current desugaring as `iter` is borrowed across the body.
2017-06-02compiletest: Force directive to be first complete word in header comment.kennytm-1/+2
Refactored some related code to take advantage of this change.
2017-06-02Introduce 'run-pass' header to 'ui' tests in compiletest. Fix issue #36516.kennytm-203/+0
The 'run-pass' header cause a 'ui' test to execute the result. It is used to test the lint output, at the same time ensure those lints won't cause the source code to become compile-fail. 12 run-pass/run-pass-fulldeps tests gained the header and are moved to ui/ui-fulldeps. After this move, no run-pass/run-pass-fulldeps tests should rely on the compiler's JSON message. This allows us to stop passing `--error-format json` in run-pass tests, thus fixing #36516.
2017-06-01Change for-loop desugar to not borrow the iterator during the loopJohn Kåre Alsaker-0/+21
2017-06-01Rollup merge of #42275 - scottmcm:try-trait, r=nikomatsakisCorey Farwell-10/+8
Lower `?` to `Try` instead of `Carrier` The easy parts of https://github.com/rust-lang/rfcs/pull/1859, whose FCP completed without further comments. Just the trait and the lowering -- neither the error message improvements nor the insta-stable impl for Option nor exhaustive docs. Based on a [github search](https://github.com/search?l=rust&p=1&q=question_mark_carrier&type=Code&utf8=%E2%9C%93), this will break the following: - https://github.com/pfpacket/rust-9p/blob/00206e34c680198a0ac7c2f066cc2954187d4fac/src/serialize.rs#L38 - https://github.com/peterdelevoryas/bufparse/blob/b1325898f4fc2c67658049196c12da82548af350/src/result.rs#L50 The other results appear to be files from libcore or its tests. I could also leave Carrier around after stage0 and `impl<T:Carrier> Try for T` if that would be better. r? @nikomatsakis Edit: Oh, and it might accidentally improve perf, based on https://github.com/rust-lang/rust/issues/37939#issuecomment-265803670, since `Try::into_result` for `Result` is an obvious no-op, unlike `Carrier::translate`.
2017-06-01Rollup merge of #42136 - petrochenkov:oldhard, r=nikomatsakisCorey Farwell-25/+0
Turn sufficiently old compatibility lints into hard errors It's been almost 7 months since https://github.com/rust-lang/rust/pull/36894 was merged, so it's time to take the next step. [breaking-change], needs crater run. PRs/issues submitted to affected crates: https://github.com/alexcrichton/ctest/pull/17 https://github.com/Sean1708/rusty-cheddar/pull/55 https://github.com/m-r-r/helianto/pull/3 https://github.com/azdle/virgil/pull/1 https://github.com/rust-locale/rust-locale/issues/24 https://github.com/mneumann/acyclic-network-rs/pull/1 https://github.com/reem/rust-typemap/pull/38 cc https://internals.rust-lang.org/t/moving-forward-on-forward-compatibility-lints/4204 cc https://github.com/rust-lang/rust/issues/34537 https://github.com/rust-lang/rust/issues/36887 Closes https://github.com/rust-lang/rust/issues/36886 Closes https://github.com/rust-lang/rust/issues/36888 Closes https://github.com/rust-lang/rust/issues/36890 Closes https://github.com/rust-lang/rust/issues/36891 Closes https://github.com/rust-lang/rust/issues/36892 r? @nikomatsakis
2017-05-31Parse macros named "default" correctly.Masaki Hara-0/+27
2017-05-30Turn sufficiently old compatibility lints into hard errorsVadim Petrochenkov-25/+0
2017-05-28Auto merge of #41917 - arielb1:mir-array, r=nagisabors-0/+79
Translate array drop glue using MIR I was a bit lazy here and used a usize-based index instead of a pointer iteration. Do you think this is important @eddyb? r? @eddyb
2017-05-28use Eq instead of Lt in loopAriel Ben-Yehuda-0/+43
2017-05-28move "ADT master drop flag" logic to `open_drop_for_adt_contents`Ariel Ben-Yehuda-0/+25
Fixes #41888.
2017-05-28translate array drop glue using MIRAriel Ben-Yehuda-0/+11
This fixes leakage on panic with arrays & slices. I am using a C-style for-loop instead of a pointer-based loop because that would be ugly-er to implement.
2017-05-27Rollup merge of #42251 - nikomatsakis:issue-42210-regr-unsized-tail, r=eddybMark Simulacrum-0/+29
extend `struct_tail` to operate over tuples Not 100% sure why this got exposed when it wasn't before, but this struct definitely seems wrong. Fixes #42110 r? @eddyb
2017-05-27Auto merge of #42162 - est31:closure-to-fn-coercion, r=aturonbors-5/+0
Stabilize non capturing closure to fn coercion Stabilisation PR for non capturing closure to fn coercion. closes #39817
2017-05-27Stabilize unions with `Copy` fields and no destructorVadim Petrochenkov-20/+0
2017-05-26extend `struct_tail` to operate over closuresNiko Matsakis-0/+29
2017-05-26Rollup merge of #42215 - callahad:remove-superfluous-semis, r=Mark-SimulacrumCorey Farwell-1/+1
Remove superfluous `;;` sequences Ran across a doubled `;;` in the docstring for `str::split`. Grep found a few more. :)
2017-05-26Auto merge of #42058 - froydnj:thiscall-support, r=nikomatsakisbors-0/+35
add thiscall calling convention support This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044.
2017-05-25Auto merge of #40847 - jseyfried:decl_macro, r=nrcbors-0/+274
Initial implementation of declarative macros 2.0 Implement declarative macros 2.0 (rust-lang/rfcs#1584) behind `#![feature(decl_macro)]`. Differences from `macro_rules!` include: - new syntax: `macro m(..) { .. }` instead of `macro_rules! m { (..) => { .. } }` - declarative macros are items: ```rust // crate A: pub mod foo { m!(); // use before definition; declaration order is irrelevant pub macro m() {} // `pub`, `pub(super)`, etc. work } fn main() { foo::m!(); // named like other items { use foo::m as n; n!(); } // imported like other items } pub use foo::m; // re-exported like other items // crate B: extern crate A; // no need for `#[macro_use]` A::foo::m!(); A::m!(); ``` - Racket-like hygiene for items, imports, methods, fields, type parameters, privacy, etc. - Intuitively, names in a macro definition are resolved in the macro definition's scope, not the scope in which the macro is used. - This [explaination](http://beautifulracket.com/explainer/hygiene.html) of hygiene for Racket applies here (except for the "Breaking Hygiene" section). I wrote a similar [explanation](https://github.com/jseyfried/rfcs/blob/hygiene/text/0000-hygiene.md) for Rust. - Generally speaking, if `fn f() { <body> }` resolves, `pub macro m() { <body> } ... m!()` also resolves, even if `m!()` is in a separate crate. - `::foo::bar` in a `macro` behaves like `$crate::foo::bar` in a `macro_rules!`, except it can access everything visible from the `macro` (thus more permissive). - See [`src/test/{run-pass, compile-fail}/hygiene`](https://github.com/rust-lang/rust/pull/40847/commits/afe7d89858fd72b983e24727d6f4058293153c19) for examples. Small example: ```rust mod foo { fn f() { println!("hello world"); } pub macro m() { f(); } } fn main() { foo::m!(); } ``` Limitations: - This does not address planned changes to matchers (`expr`,`ty`, etc.), c.f. #26361. - Lints (including stability and deprecation) and `unsafe` are not hygienic. - adding hygiene here will be mostly or entirely backwards compatible - Nested macro definitions (a `macro` inside another `macro`) don't always work correctly when invoked from external crates. - pending improvements in how we encode macro definitions in crate metadata - There is no way to "escape" hygiene without using a procedural macro. r? @nrc
2017-05-25Auto merge of #42052 - kennytm:fix-42007-ice-on-decode-lint-id, r=nikomatsakisbors-0/+33
Refactor: Move the mutable parts out of LintStore. Fix #42007. * #42007 happens because the `Session` `LintStore` is emptied when linting. * The `Session` `LintStore` is emptied because the checker (`Early`/`LateContext`) wants ownership. * The checker wants ownership because it wants to mutate the pass objects and lint levels. The ownership of the whole store is not essential, only the lint levels and pass objects need to be owned. Therefore, these parts are extracted out of the `LintStore` into a separate structure `LintSession`. The "check crates" methods can operate on `&mut LintSession` instead of `&mut LintStore`. This is a minor *breaking change* for lint writers since the `LintContext` trait is changed: the `mut_lints` and `level_stack` methods are removed. But no one outside of `librustc/lint/context.rs` is using these functions, so it should be safe.
2017-05-25Stabilize non capturing closure to fn coercionest31-5/+0
2017-05-25Lower `?` to `Try` instead of `Carrier`Scott McMurray-10/+8
The easy parts of RFC 1859. (Just the trait and the lowering, none of the error message improvements nor the insta-stable impl for Option.)
2017-05-25Auto merge of #41145 - matthewjasper:stabilize-relaxed-adts, r=petrochenkovbors-2/+0
Stabilize rfc 1506 - Clarified ADT Kinds Closes #35626 Documentation: - [ ] Reference rust-lang-nursery/reference#37 - [ ] Book? - [ ] Rust by example?
2017-05-25Ignore pretty.Jeffrey Seyfried-0/+16
2017-05-25Add tests.Jeffrey Seyfried-0/+258
2017-05-24Remove superfluous `;;` sequencesDan Callahan-1/+1
2017-05-24Rollup merge of #42134 - scottmcm:rangeinclusive-struct, r=aturonMark Simulacrum-7/+7
Make RangeInclusive just a two-field struct Not being an enum improves ergonomics and consistency, especially since NonEmpty variant wasn't prevented from being empty. It can still be iterable without an extra "done" bit by making the range have !(start <= end), which is even possible without changing the Step trait. Implements merged https://github.com/rust-lang/rfcs/pull/1980; tracking issue https://github.com/rust-lang/rust/issues/28237. This is definitely a breaking change to anything consuming `RangeInclusive` directly (not as an Iterator) or constructing it without using the sugar. Is there some change that would make sense before this so compilation failures could be compatibly fixed ahead of time? r? @aturon (as FCP proposer on the RFC)
2017-05-24add thiscall calling convention supportNathan Froyd-0/+35
This support is needed for bindgen to work well on 32-bit Windows, and also enables people to begin experimenting with C++ FFI support on that platform. Fixes #42044.
2017-05-23Stabilize in 1.19Matthew-7/+1378
2017-05-23Rollup merge of #42016 - pietroalbini:stabilize/loop_break_value, r=nikomatsakisCorey Farwell-2/+0
Stabilize the loop_break_value feature Tracking issue: #37339. Documentation PRs already sent to the various repositories.
2017-05-22Auto merge of #42147 - ↵bors-2/+1
withoutboats:run-pass-test-for-static-in-assoc-const-ty-refs, r=eddyb Remove 'static bound in assoc const test. Types do not have to be `'static` to be referenced in associated consts. Fixes #33573.
2017-05-21Remove 'static bound in assoc const test.Without Boats-2/+1
Types do not have to be `'static` to be referenced in associated consts.
2017-05-21Return a correct size_hint for degenerate inclusive rangesScott McMurray-7/+7
Fixes https://github.com/rust-lang/rust/issues/42135 Found while fixing run-pass/range_inclusive test failure.
2017-05-17Auto merge of #41911 - michaelwoerister:querify_trait_def, r=nikomatsakisbors-0/+33
Remove interior mutability from TraitDef by turning fields into queries This PR gets rid of anything `std::cell` in `TraitDef` by - moving the global list of trait impls from `TraitDef` into a query, - moving the list of trait impls relevent for some self-type from `TraitDef` into a query - moving the specialization graph of trait impls into a query, and - moving `TraitDef::object_safety` into a query. I really like how querifying things not only helps with incremental compilation and on-demand, but also just plain makes the code cleaner `:)` There are also some smaller fixes in the PR. Commits can be reviewed separately. r? @eddyb or @nikomatsakis
2017-05-17Stabilize the loop_break_value featurePietro Albini-2/+0
2017-05-17Refactor: Move the mutable parts out of LintStore. Fix #42007.kennytm-0/+33
* #42007 happens because the Session LintStore is emptied when linting. * The Session LintStore is emptied because the checker (Early/LateContext) wants ownership. * The checker wants ownership because it wants to mutate the pass objects and lint levels. The ownership of the whole store is not essential, only the lint levels and pass objects need to be owned. Therefore, these parts are extracted out of the LintStore into a separate structure `LintSession`. The "check crates" methods can operate on `&mut LintSession` instead of `&mut LintStore`. This is a minor BREAKING CHANGE for lint writers since the `LintContext` trait is changed: the `mut_lints` and `level_stack` methods are removed. But no one outside of `librustc/lint/context.rs` is using these functions, so it should be safe.
2017-05-16Rollup merge of #42017 - nikomatsakis:issue-41677, r=arielb1Mark Simulacrum-50/+0
avoid cycles in mir-dump, take 2 This fixes #41697, for real this time, but I'm not sure how best to add a regression test. I was considering maybe adding some flag so that the MIR dumping doesn't actually get written to files (e.g., overloading the directory flag so you can specify nil or something). cc @dwrensha @oli-obk
2017-05-16Rollup merge of #41937 - ↵Mark Simulacrum-0/+38
nikomatsakis:issue-41936-variance-coerce-unsized-cycle, r=eddyb use equality in the coerce-unsized check This seems both to be a safe, conservative choice, and it sidesteps the cycle in #41849. Note that, before I converted variance into proper queries, we were using a hybrid of subtyping and equality, due to the presence of a flag that forced invariance if variance had not yet been computed. (Also, Coerce Unsized is unstable.) Fixes #41936. r? @eddyb
2017-05-16Rollup merge of #42005 - jseyfried:fix_macro_regression, r=nrcMark Simulacrum-0/+30
Fix regression in `macro_rules!` name matching Fixes #41803. r? @nrc