about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-07-15Auto merge of #62670 - estebank:extern-fn-with-body, r=petrochenkovbors-0/+29
Detect `fn` with a body in an `extern` block Fix #62109.
2019-07-14Auto merge of #62643 - estebank:parse-recovery-type-errs, r=petrochenkovbors-59/+38
Do not emit type errors after parse error in last statement of block When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-14Auto merge of #62638 - estebank:issue-62554, r=petrochenkovbors-3/+38
Use snippet instead of pprinting statement Fix #62554.
2019-07-13review commentEsteban Küber-1/+1
2019-07-14Auto merge of #62331 - wesleywiser:fix_early_return_leak, r=matthewjasperbors-0/+91
Fix leak when early returning out of `box` syntax Fixes #62289 r? @matthewjasper
2019-07-13Detect `fn` with a body in an `extern` blockEsteban Küber-0/+29
2019-07-13Auto merge of #62584 - eddyb:circular-math-is-hard, r=pnkfelixbors-0/+64
rustc_codegen_ssa: fix range check in codegen_get_discr. Fixes #61696, see https://github.com/rust-lang/rust/issues/61696#issuecomment-505473018 for more details. In short, I had wanted to use `x - a <= b - a` to check whether `x` is in `a..=b` (as it's 1 comparison instead of 2 *and* `b - a` is guaranteed to fit in the same data type, while `b` itself might not), but I ended up with `x - a + c <= b - a + c` instead, because `x - a + c` was the final value needed. That latter comparison is equivalent to checking that `x` is in `(a - c)..=b`, i.e. it also includes `(a - c)..a`, not just `a..=b`, so if `c` is not `0`, it will cause false positives. This presented itself as the non-niche ("dataful") variant sometimes being treated like a niche variant, in the presence of uninhabited variants (which made `c`, aka the index of the first niche variant, arbitrarily large). r? @nagisa, @rkruppe or @oli-obk
2019-07-13Auto merge of #62659 - Centril:rollup-90oz643, r=Centrilbors-3/+58
Rollup of 5 pull requests Successful merges: - #62577 (Add an AtomicCell abstraction) - #62585 (Make struct_tail normalize when possible) - #62604 (Handle errors during error recovery gracefully) - #62636 (rustbuild: Improve assert about building tools once) - #62651 (Make some rustc macros more hygienic) Failed merges: r? @ghost
2019-07-13Rollup merge of #62651 - matthewjasper:rustc-macro-hygiene, r=petrochenkovMazdak Farrokhzad-3/+3
Make some rustc macros more hygienic
2019-07-13Rollup merge of #62604 - estebank:unemitted-err-ice, r=pnkfelixMazdak Farrokhzad-0/+20
Handle errors during error recovery gracefully Fix #62546.
2019-07-13Rollup merge of #62585 - ↵Mazdak Farrokhzad-0/+35
pnkfelix:issue-60431-make-struct-tail-normalize-when-possible, r=eddyb Make struct_tail normalize when possible As noted in commit message: this replaces the existing methods to extract the struct tail(s) with new entry points that make the handling of normalization explicit. Most of the places that call `struct_tail` are during codegen, post type-checking, and therefore they can get away with using `tcx.normalize_erasing_regions` (this is the entry point `struct_tail_erasing_lifetimes`) For other cases that may arise, one can use the core method, which is parameterized over the normalization `Ty -> Ty` closure (`struct_tail_with_normalize`). Or one can use the trivial entry point that does not normalization (`struct_tail_without_normalization`) ---- I spent a little while trying to make a test that exposed the bug via `impl Trait` rather than a projection, but I failed to find something that tripped up the current nightly `rustc`. * I have *not* spent any time trying to make tests that trip up the other places where `struct_tail` was previously being called. While I do think the task of making such tests could be worthwhile, I am simply running out of time. (Its also possible that the layout code is always the first point called, and thus it may be pointless to try to come up with such tests.) I also spent a little time discussing with @eddyb where this code should live. They suggested moving `struct_tail` and its sibling `struct_lockstep_tails` to the `LayoutCx`. But in the interest of time, I have left that refactoring (which may be questionable at this point) to a follow-up task. ---- Fix #60431
2019-07-13Auto merge of #62468 - rust-lang:mutable-overloaded-operators, r=estebankbors-75/+97
Improve diagnostics for invalid mutation through overloaded operators Closes #58864 Closes #52941 Closes #57839
2019-07-13Make `newtype_index` hygienic and use allow_internal_unstableMatthew Jasper-3/+3
2019-07-12Do not emit type errors after parse error in last statement of blockEsteban Küber-59/+38
When recovering from a parse error inside a block, do not emit type errors generating on that block's recovered return expression. Fix #57383.
2019-07-12add testsEsteban Küber-0/+35
2019-07-12Use snippet instead of pprinting statementEsteban Küber-3/+3
2019-07-12Rollup merge of #62623 - ↵Mazdak Farrokhzad-13/+96
pnkfelix:issue-62614-downgrade-indirect-structural-match-lint-to-allow, r=zackmdavis downgrade indirect_structural_match lint to allow This is a short-term band-aid for the regression aspect of #62614.
2019-07-12Rollup merge of #62608 - delan:async-unsafe-fn-tests, r=CentrilMazdak Farrokhzad-2/+118
`async unsafe fn` tests - cc #62121 r? @Centril
2019-07-12Rollup merge of #62607 - estebank:this-mem-is-out-of-control, r=petrochenkovMazdak Farrokhzad-0/+13
Correctly break out of recovery loop Fix #61858.
2019-07-12Rollup merge of #62578 - JohnTitor:add-test-for-49919, r=alexcrichtonMazdak Farrokhzad-0/+16
Add test for #49919 Closes #49919
2019-07-12Rollup merge of #62568 - lzutao:replace_may_dangle, r=matthewjasperMazdak Farrokhzad-119/+28
Replace unsafe_destructor_blind_to_params with may_dangle This PR will completely remove support for `#[unsafe_destructor_blind_to_params]` attribute, which is deprecated in #38970 by `[may_dangle]` unsafe attribute. Closes #34761
2019-07-12Rollup merge of #62453 - zackmdavis:single_path, r=estebankMazdak Farrokhzad-1/+43
in which we suggest anonymizing single-use lifetimes in paths Following @nikomatsakis's [October 2017 comment](https://github.com/rust-lang/rust/issues/44752#issuecomment-340885834). ![path_anon_suggest](https://user-images.githubusercontent.com/1076988/60761598-e2619180-a000-11e9-9144-1bdf8eb848e3.png) r? @estebank cc @eddyb (you were saying something about running single-use-lifetimes against the tree the other week?)
2019-07-12Rollup merge of #62274 - eddyb:const-false-unwind, r=pnkfelixMazdak Farrokhzad-26/+56
rustc_mir: follow FalseUnwind's real_target edge in qualify_consts. As far as I can tell, this was accidentally omitted from #47802. Fixes #62272. r? @matthewjasper or @nikomatsakis
2019-07-12Rollup merge of #61535 - ↵Mazdak Farrokhzad-0/+36
ohadravid:test-generic-with-default-assiociated-type-re-rebalance-coherence, r=nikomatsakis Coherence test when a generic type param has a default value from an associated type A followup on #61400. Before `re_rebalance_coherence`, this fails to compile (even though it should be accepted). `re_rebalance_coherence` had no direct test for this, and I wanted to (a) make sure it doesn't regress in the future and (b) get it on record that this is actually the intended behavior.
2019-07-12add test caseEsteban Küber-0/+13
2019-07-12rustc_codegen_ssa: fix range check in codegen_get_discr.Eduard-Mihai Burtescu-0/+64
2019-07-12Change `indirect_structural_match` lint to allow-by-default.Felix S. Klock II-0/+59
This is a way to address the regression aspect of rust-lang/rust#62614 in the short term without actually fixing the bug. (My thinking is that the bug that this lint detects has gone undetected for this long, it can wait a bit longer until I or someone else has a chance to put in a proper fix that accounts for rust-lang/rust#62614.)
2019-07-12Turn `indirect_structural_match` lint on explicitly in ui tests.Felix S. Klock II-13/+37
2019-07-12Regression test for issue 60431.Felix S. Klock II-0/+35
2019-07-12test `unsafe fn` and `async unsafe fn` calls in `unsafe { async || }`Delan Azabani-2/+25
2019-07-12remove redundant async_closure test in async-await.rsDelan Azabani-7/+1
2019-07-12test E0133 when calling free/impl `async unsafe fn` in `async fn`Delan Azabani-1/+22
2019-07-12remove unused #![feature(async_closure)]Delan Azabani-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-07-12test `unsafe fn` and `async unsafe fn` calls in `async` in `unsafe`Delan Azabani-0/+26
2019-07-12test E0133 when calling free/impl `async unsafe fn` in safe codeDelan Azabani-0/+35
2019-07-12align async-await.rs and await-macro.rs with one anotherDelan Azabani-3/+20
2019-07-11Fix leak when early returning out of `box` syntaxWesley Wiser-0/+91
Fixes #62289
2019-07-11Handle errors during error recovery gracefullyEsteban Küber-0/+20
2019-07-11Remove feature gate `dropck_parametricity` completelyLzu Tao-94/+13
Therefore we also remove `#[unsafe_destructor_blind_to_params]` attribute completly.
2019-07-11Replace unsafe_destructor_blind_to_params with may_dangleLzu Tao-31/+21
2019-07-11Auto merge of #62503 - pnkfelix:dont-recur-infiitely-from-print-def-path, ↵bors-0/+16
r=eddyb Dont recur infinitely from print_def_path Fix #61711
2019-07-11rustc_mir: follow FalseUnwind's real_target edge in qualify_consts.Eduard-Mihai Burtescu-26/+56
2019-07-11pretty-print: Do not lose the `$crate` printing flag in `print_tt`Vadim Petrochenkov-10/+28
2019-07-11Rollup merge of #62519 - pnkfelix:add-test-for-30786, r=pnkfelixMazdak Farrokhzad-0/+140
Regression test for HRTB bug (issue 30786). Close #30786.
2019-07-11Rollup merge of #62476 - petrochenkov:expref, r=matthewjasperMazdak Farrokhzad-71/+309
Continue refactoring macro expansion and resolution This PR continues the work started in https://github.com/rust-lang/rust/pull/62042. It contains a set of more or less related refactorings with the general goal of making things simpler and more orthogonal. Along the way most of the issues uncovered in https://github.com/rust-lang/rust/pull/62086 are fixed. The PR is better read in per-commit fashion with whitespace changes ignored. I tried to leave some more detailed commit messages describing the motivation behind the individual changes. Fixes https://github.com/rust-lang/rust/issues/44692 Fixes https://github.com/rust-lang/rust/issues/52363 Unblocks https://github.com/rust-lang/rust/pull/62086 r? @matthewjasper
2019-07-11Rollup merge of #62270 - agnxy:move-async-test, r=Centril,tmandryMazdak Farrokhzad-66/+10
Move async-await tests from run-pass to ui fix #62236 r? @Centril
2019-07-11Add test for #49919Yuki Okushi-0/+16
2019-07-10Auto merge of #62561 - Centril:rollup-5pxj3bo, r=Centrilbors-10/+47
Rollup of 5 pull requests Successful merges: - #62275 (rustc_mir: treat DropAndReplace as Drop + Assign in qualify_consts.) - #62465 (Sometimes generate storage statements for temporaries with type `!`) - #62481 (Use `fold` in `Iterator::last` default implementation) - #62493 (#62357: doc(ptr): add example for {read,write}_unaligned) - #62532 (Some more cleanups to syntax::print) Failed merges: r? @ghost
2019-07-11Add a regression test for #44692Vadim Petrochenkov-1/+128
Add a test for the issue resolved by removing `resolve_macro_path` Add a test making sure that extern prelude entries introduced from an opaque macro are not visible anywhere, even it that macro Fix test output after rebase
2019-07-11Fix failing testsVadim Petrochenkov-2/+2