about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2019-07-06Auto merge of #61988 - Centril:there-is-only-loop, r=matthewjasperbors-117/+230
[let_chains, 3/6] And then there was only Loop Here we remove `hir::ExprKind::While`. Instead, we desugar: `'label: while $cond $body` into: ```rust 'label: loop { match DropTemps($cond) { true => $body, _ => break, } } ``` Per https://github.com/rust-lang/rust/issues/53667#issuecomment-471583239. This is a follow up to https://github.com/rust-lang/rust/pull/59288 which did the same for `if` expressions. r? @matthewjasper
2019-07-06--bless --compare-mode=nllMazdak Farrokhzad-17/+17
2019-07-06Bless mir-opt/while-storage.rs.Mazdak Farrokhzad-24/+21
2019-07-06while_{let_}loops/change_{break,continue}: typeck_tables_of clean.Mazdak Farrokhzad-4/+4
2019-07-06Make WhileTrue into an EarlyLintPass lint.Mazdak Farrokhzad-28/+97
2019-07-06Make sure while-exprs require 'cond: bool' exactly.Mazdak Farrokhzad-1/+43
2019-07-06Adjust incremental test while_loops.rsMazdak Farrokhzad-2/+2
2019-07-06while desugars to loop so 'a: while break 'a {} in ctfe doesn't work yet.Mazdak Farrokhzad-3/+11
2019-07-06Enforce 'cond: bool' in while-expr + improve reachability diags.Mazdak Farrokhzad-23/+19
2019-07-06min_const_fn: change error message due to changed desugaring.Mazdak Farrokhzad-18/+19
2019-07-06Rollup merge of #62377 - wesleywiser:fix_62375, r=alexcrichtonMazdak Farrokhzad-0/+22
Add test for ICE #62375 Fixes #62375
2019-07-06Rollup merge of #62245 - RalfJung:miri-extra-fn, r=eddyb,zackmdavisMazdak Farrokhzad-37/+88
Miri engine: support extra function (pointer) values We want to add basic support for `dlsym` in Miri (needed to run the latest version of `getrandom`). For that to work, `dlsym` needs to return *something* that can be stored in a function pointer and later called. So we add a new `ExtraFnVal` type to the `Machine` trait, and enable Miri's memory to associate allocation IDs with such values, so that `create_fn_alloc` and `get_fn` can work on *both* `Instance` (this is used for "normal" function pointers) and `ExtraFnVal`. Cc @oli-obk
2019-07-05Rollup merge of #62380 - eddyb:x64-sysv-regs, r=nagisaMazdak Farrokhzad-0/+105
rustc_target: avoid negative register counts in the SysV x86_64 ABI. Because `needed_{int,sse}` and `{int,sse}_regs` were only used with integer literals, they were inferred to `i32` and `{int,sse}_regs` could therefore be negative. There was a check which prevented that, but *only* for aggregate arguments, not scalars. Fixes #62350. r? @nagisa or @rkruppe
2019-07-05Rollup merge of #62369 - JohnTitor:remove-compile-pass, r=petrochenkovMazdak Farrokhzad-5/+5
Remove `compile-pass` from compiletest This is a part of #62277. Removes `compile-pass` from compiletest (and modify some tests' annotations). r? @Centril
2019-07-05Rollup merge of #62193 - matthewjasper:dynamic-drop-async, r=CentrilMazdak Farrokhzad-0/+328
Create async version of the dynamic-drop test Some of the tests in dynamic-drop have been cut: * The tests that are just simpler versions of other tests - these tests are already fairly slow due to all of the unwinding and async functions have more control flow paths than normal functions. * The union test - it's for an unstable feature that has an RFC to remove it. * The generator test - there aren't async generators yet. * The tests that show values being leaked - these can be added once the issue is fixed. r? @Centril cc #62121 @cramertj
2019-07-05Rollup merge of #62133 - petrochenkov:norustc, r=eddybMazdak Farrokhzad-161/+185
Feature gate `rustc` attributes harder Fixes https://github.com/rust-lang/rust/issues/62116
2019-07-05Rollup merge of #61545 - flip1995:internal_lints, r=oli-obkMazdak Farrokhzad-15/+100
Implement another internal lints cc #49509 This adds ~~two~~ one internal lint~~s~~: 1. LINT_PASS_IMPL_WITHOUT_MACRO: Make sure, that the `{declare,impl}_lint_pass` macro is used to implement lint passes. cc #59669 2. ~~USAGE_OF_TYCTXT_AND_SPAN_ARGS: item 2 on the list in #49509~~ ~~With 2. I wasn't sure, if this lint should be applied everywhere. That means a careful review of 0955835 would be great. Also 73fb9b4 allows this lint on some functions. Should I also apply this lint there?~~ TODO (not directly relevant for review): - [ ] https://github.com/rust-lang/rust/pull/59316#discussion_r280186517 (not sure yet, if this works or how to query for `rustc_private`, since it's not in [`Features`](https://doc.rust-lang.org/nightly/nightly-rustc/syntax/feature_gate/struct.Features.html) :thinking: cc @eddyb) - [x] https://github.com/rust-lang/rust/pull/61735#discussion_r292389870 - [x] Check explicitly for the `{declare,impl}_lint_pass!` macros r? @oli-obk
2019-07-06Fix test annotationYuki Okushi-1/+1
2019-07-06Remove compile-pass from compiletestYuki Okushi-4/+4
Also change annotations in some tests
2019-07-05Rollup merge of #62388 - rust-lang:fix-loop-break-mir-generation, r=eddybMazdak Farrokhzad-0/+24
Break out of the correct number of scopes in loops We were incorrectly breaking out of one too many drop scopes when generating MIR for loops and breakable blocks, resulting in use after free and associated borrow checker warnings. This wasn't noticed because the scope that we're breaking out of twice is only used for temporaries that are created for adjustments applied to the loop. Since loops generally propagate coercions to the `break` expressions, the only case we see this is when the type of the loop is a smart pointer to a trait object. Closes #62312
2019-07-05Rollup merge of #62383 - Aaron1011:fix/async-error-span, r=varkorMazdak Farrokhzad-0/+32
Improve error span for async type inference error Fixes #62382 Previously, we would point at the spawn of the 'await' expression, instead of the actual expression with an unknown type.
2019-07-05Rollup merge of #62324 - Centril:reduce-await-macro-reliance, r=cramertjMazdak Farrokhzad-30/+30
Reduce reliance on `await!(...)` macro Only the last commit is new. r? @cramertj
2019-07-05Rollup merge of #62292 - Centril:split-async-closures, r=cramertjMazdak Farrokhzad-76/+206
Move `async || ...` closures into `#![feature(async_closure)]` The `async || expr` syntax is moved out from `#![feature(async_await)]` into its own gate `#![feature(async_closure)]`. New tracking issue: https://github.com/rust-lang/rust/issues/62290 Closes https://github.com/rust-lang/rust/issues/62214. cc https://github.com/rust-lang/rust/issues/62149 r? @varkor
2019-07-05Rollup merge of #62150 - alex:mem-uninit-refactor, r=RalfJungMazdak Farrokhzad-14/+2
Implement mem::{zeroed,uninitialized} in terms of MaybeUninit. Refs #62061 r? @oli-obk
2019-07-05rustc_target: avoid negative register counts in the SysV x86_64 ABI.Eduard-Mihai Burtescu-0/+105
2019-07-04Permit use of mem::uninitialized via allow(deprecated)Mark Rousskov-9/+23
2019-07-04Break out of the correct number of scopes in loopsMatthew Jasper-0/+24
We were incorrectly breaking out of one too many drop scopes when generating MIR for loops and breakable blocks, resulting in use after free and associated borrow checker warnings. This wasn't noticed because the scope that we're breaking out of twice is only used for temporaries that are created for adjustments applied to the loop. Since loops generally propagate coercions to the `break` expressions, the only case we see this is when the type of the loop is a smart pointer to a trait object.
2019-07-04Create async version of the dynamic-drop testMatthew Jasper-0/+328
2019-07-04Improve error span for async type inference errorAaron Hill-0/+32
Fixes #62382 Previously, we would point at the spawn of the 'await' expression, instead of the actual expression with an unknown type.
2019-07-04Add test for ICE #62375Wesley Wiser-0/+22
Fixes #62375
2019-07-04Implement mem::{zeroed,uninitialized} in terms of MaybeUninit.Alex Gaynor-14/+2
Refs #62061
2019-07-04improve validity error range printing for singleton rangesRalf Jung-2/+2
2019-07-04turns out that dangling pointer branch is dead code; remove it and improve ↵Ralf Jung-37/+88
the error that actually gets shown a bit
2019-07-04Rollup merge of #62317 - JohnTitor:move-tests-to-build-pass, r=CentrilMazdak Farrokhzad-716/+716
Migrate `compile-pass` annotations to `build-pass` This is a part of #62277. As a first step, the `compile-pass` tests are migrated to `build-pass`. r? @cramertj cc @Centril
2019-07-04Rollup merge of #62258 - petrochenkov:idclean, r=CentrilMazdak Farrokhzad-53/+21
syntax: Unsupport `foo! bar { ... }` macros in the parser Their support in expansion was removed in https://github.com/rust-lang/rust/pull/61606. Also un-reserve `macro_rules` as a macro name, there's no ambiguity between `macro_rules` definitions and macro calls (it also wasn't reserved correctly). cc https://github.com/rust-lang-nursery/wg-grammar/issues/51
2019-07-04Rollup merge of #62240 - arielb1:resolve-wf-fields, r=pnkfelixMazdak Farrokhzad-0/+21
wfcheck: resolve the type-vars in `AdtField` types Normalization can leave some type-vars unresolved in its return type. Make sure to resolve them so we have an infcx-independent type that can be used with `needs_drop`. Fixes #61402. Closes #62212 - this PR fixes the root cause.
2019-07-04Reduce reliance on feature(await_macro).Mazdak Farrokhzad-30/+30
2019-07-03Adjust tests wrt. 'async_closure' feature gate.Mazdak Farrokhzad-76/+206
2019-07-03Rollup merge of #62255 - Centril:slice-patterns-change-issue, r=varkorMark Rousskov-6/+6
Switch tracking issue for `#![feature(slice_patterns)]` Switches the tracking issue for `#![feature(slice_patterns)]` to a fresh one in https://github.com/rust-lang/rust/issues/62254 due to new RFCs. Closes https://github.com/rust-lang/rust/issues/23121. r? @varkor
2019-07-03Rollup merge of #62183 - alexcrichton:fix-tests, r=nikomatsakisMark Rousskov-0/+26
std: Move a process test out of libstd This commit moves a test out of libstd which is causing deadlocks on musl on CI. Looks like the recent update in musl versions brings in some internal updates to musl which makes `setgid` and `setuid` invalid to call after a `fork` in a multithreaded program. The issue seen here is that the child thread was attempting to grab a lock held by a nonexistent thread, meaning that the child process simply deadlocked causing the whole test to deadlock. This commit moves the test to its own file with no threads which should work.
2019-07-03Auto merge of #61775 - ↵bors-48/+686
nikomatsakis:issue-56238-multiple-lifetimes-async-fn-region-solver, r=MatthewJasper generalize impl trait to permit multiple lifetime bounds Generalizes the region solver to support "pick constraints". These have the form: ``` pick R0 from [R1..Rn] ``` where `R1..Rn` are called the "option regions". The idea is that `R0` must be equal to *some* region in the set `R1..Rn`. These constraints are then used to handle cases like this: ```rust fn foo<'a, 'b>(...) -> impl Trait<'a, 'b> { .. } ``` The problem here is that every region R in the hidden type must be equal to *either* `'a` *or* `'b` (or `'static`) -- in the past, the only kinds of constraints we had were outlives constraints, and since `'a` and `'b` are unrelated, there was no outlives constraint we could issue that would enforce that (`R: 'a` and `R: 'b` are both too strict, for example). But now we can issue a pick constraint: `pick R from ['a, 'b]`. In general, solving pick constraints is tricky. We integrate them into the solver as follows. In general, during the propagation phase, we are monotonically growing a set of inference regions. To handle a case like `pick R from [O...]`, where `O...` represents the option regions, we do the following: - Look for all the *lower bounds* of the region R -- that is, every region LB such that `R: LB` must hold. - Look for all the *upper bounds* of the region R -- that is, every region UB such that `UB: R` must hold. - Let the *viable options* be each option region O such that `UB: O` and `O: LB` for each UB, LB bound. - Find the *minimal viable option* M, where `O: M` holds for every option region O. If there is such a *minimal viable option*, then we make `R: M`. (This may in turn influence other bits of inference.) If there is no minimal viable option, either because all options were eliminated or because none of the remaining options are minimal, we do nothing. Ultimately, if the pick constraint is not satisfied, an error is reported. For this logic, we currently require that the option regions O are always lifetime parameters. To determine the bounds, we walk the various outlives edges that were otherwise introduced. r? @matthewjasper cc @cramertj Fixes #56238 TODO: - [ ] Error messages include region variable info sometimes, how to fix? - [ ] Tests for bare `existential type` and other impl Trait usage
2019-07-03Migrate compile-pass annotations to build-passYuki Okushi-716/+716
2019-07-02Auto merge of #61268 - michaelwoerister:stabilize-pgo, r=alexcrichtonbors-11/+11
Stabilize support for Profile-guided Optimization This PR makes profile-guided optimization available via the `-C profile-generate` / `-C profile-use` pair of commandline flags and adds end-user documentation for the feature to the [rustc book](https://doc.rust-lang.org/rustc/). The PR thus ticks the last two remaining checkboxes of the [stabilization tracking issue](https://github.com/rust-lang/rust/issues/59913). From the tracking issue: > Profile-guided optimization (PGO) is a common optimization technique for ahead-of-time compilers. It works by collecting data about a program's typical execution (e.g. probability of branches taken, typical runtime values of variables, etc) and then uses this information during program optimization for things like inlining decisions, machine code layout, or indirect call promotion. If you are curious about how this can be used, there is a rendered version of the documentation this PR adds available [here]( https://github.com/michaelwoerister/rust/blob/stabilize-pgo/src/doc/rustc/src/profile-guided-optimization.md). r? @alexcrichton cc @rust-lang/compiler
2019-07-02fix ICE with delay-span-bugNiko Matsakis-0/+33
2019-07-02address nitsNiko Matsakis-6/+6
2019-07-02Update src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-no-fg.rsNiko Matsakis-1/+1
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02Update src/test/ui/async-await/multiple-lifetimes/elided.rsNiko Matsakis-1/+1
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02Update src/test/ui/async-await/multiple-lifetimes/fn-ptr.rsNiko Matsakis-1/+1
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02Update src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-one.rsNiko Matsakis-1/+1
Co-Authored-By: matthewjasper <mjjasper1@gmail.com>
2019-07-02introduce more tests covering `async fn` surfaceNiko Matsakis-4/+239