about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-10-03Rollup merge of #64998 - spastorino:filter-rls-on-tidy, r=petrochenkovMazdak Farrokhzad-0/+3
Filter out RLS output directories on tidy runs Closes #64957 r? @petrochenkov
2019-10-03Rollup merge of #64993 - mathstuf:backtrace-status-eq, r=withoutboatsMazdak Farrokhzad-1/+1
BacktraceStatus: add Eq impl See discussion on #53487. --- Is adding `Copy` too ambitious? It's a "status", so I don't forsee any non-POD data that might go in there, but it would restrict future variants more than `Eq` does. Cc: @withoutboats @abonander
2019-10-03Rollup merge of #64975 - crgl:clone-from-linked-list, r=blussMazdak Farrokhzad-0/+56
Implement Clone::clone_from for LinkedList See #28481. This represents a substantial speedup when the list sizes are comparable, and shouldn't ever be significantly worse. Technically split_off is doing an unnecessary search, but the code is hopefully cleaner as a result. I'm happy to rework anything that needs to be changed as well!
2019-10-03Rollup merge of #64959 - davidtwco:issue-64252-self-type-help, ↵Mazdak Farrokhzad-8/+93
r=Centril,estebank syntax: improve parameter without type suggestions Fixes #64252. This PR improves the suggestions provided when function parameters do not have types: - A new suggestion is added for arbitrary self types, which suggests adding `self: ` before the type. - Existing suggestions are now provided when a `<` is found where a `:` was expected (previously only `,` and `)` or trait items), this gives suggestions in the case where the unnamed parameter type is generic in a free function. - The suggestion that a type name be provided (e.g. `fn foo(HashMap<u32>)` -> `fn foo(HashMap: TypeName<u32>)`) will no longer occur when a `<` was found instead of `:`. - The ident will not be used for recovery when a `<` was found instead of `:`. r? @Centril cc @estebank @yoshuawuyts
2019-10-03Rollup merge of #64931 - estebank:missing-param-ref, r=matthewjasper,CentrilMazdak Farrokhzad-25/+30
Reword E0392 slightly Make it clearer that a type or lifetime argument not being used can be fixed by referencing it in a struct's fields, not just using `PhathomData`. CC #53589.
2019-10-03Rollup merge of #63678 - Aaron1011:fix/hrtb-leak, r=nikomatsakisMazdak Farrokhzad-30/+172
Improve HRTB error span when -Zno-leak-check is used As described in #57374, NLL currently produces unhelpful higher-ranked trait bound (HRTB) errors when '-Zno-leak-check' is enabled. This PR tackles one half of this issue - making the error message point at the proper span. The error message itself is still the very generic "higher-ranked subtype error", but this can be improved in a follow-up PR. The root cause of the bad spans lies in how NLL attempts to compute the 'blamed' region, for which it will retrieve a span for. Consider the following code, which (correctly) does not compile: ```rust let my_val: u8 = 25; let a: &u8 = &my_val; let b = a; let c = b; let d: &'static u8 = c; ``` This will cause NLL to generate the following subtype constraints: d :< c c :< b b <: a Since normal Rust lifetimes are covariant, this results in the following region constraints (I'm using 'd to denote the lifetime of 'd', 'c to denote the lifetime of 'c, etc.): 'c: 'd 'b: 'c 'a: 'b From this, we can derive that 'a: 'd holds, which implies that 'a: 'static must hold. However, this is not the case, since 'a refers to 'my_val', which does not outlive the current function. When NLL attempts to infer regions for this code, it will see that the region 'a has grown 'too large' - it will be inferred to outlive 'static, despite the fact that is not declared as outliving 'static We can find the region responsible, 'd, by starting at the *end* of the 'constraint chain' we generated above. This works because for normal (non-higher-ranked) lifetimes, we generally build up a 'chain' of lifetime constraints *away* from the original variable/lifetime. That is, our original lifetime 'a is required to outlive progressively more regions. If it ends up living for too long, we can look at the 'end' of this chain to determine the 'most recent' usage that caused the lifetime to grow too large. However, this logic does not work correctly when higher-ranked trait bounds (HRTBs) come into play. This is because HRTBs have *contravariance* with respect to their bound regions. For example, this code snippet compiles: ```rust let a: for<'a> fn(&'a ()) = |_| {}; let b: fn(&'static ()) = a; ``` Here, we require that 'a' is a subtype of 'b'. Because of contravariance, we end up with the region constraint 'static: 'a, *not* 'a: 'static This means that our 'constraint chains' grow in the opposite direction of 'normal lifetime' constraint chains. As we introduce subtypes, our lifetime ends up being outlived by other lifetimes, rather than outliving other lifetimes. Therefore, starting at the end of the 'constraint chain' will cause us to 'blame' a lifetime close to the original definition of a variable, instead of close to where the bad lifetime constraint is introduced. This PR improves how we select the region to blame for 'too large' universal lifetimes, when bound lifetimes are involved. If the region we're checking is a 'placeholder' region (e.g. the region 'a' in for<'a>, or the implicit region in fn(&())), we start traversing the constraint chain from the beginning, rather than the end. There are two (maybe more) different ways we generate region constraints for NLL: requirements generated from trait queries, and requirements generated from MIR subtype constraints. While the former always use explicit placeholder regions, the latter is more tricky. In order to implement contravariance for HRTBs, TypeRelating replaces placeholder regions with existential regions. This requires us to keep track of whether or not an existential region was originally a placeholder region. When we look for a region to blame, we check if our starting region is either a placeholder region or is an existential region created from a placeholder region. If so, we start iterating from the beginning of the constraint chain, rather than the end.
2019-10-02Revert changes to `src/test/ui/reify-intrinsic.stderr`Aaron Hill-2/+2
For some reason, I'm getting different output for this locally.
2019-10-02review commentsEsteban Küber-11/+8
2019-10-02fix example (le sigh)Niko Matsakis-2/+2
2019-10-02add unsize slice-str coercionNiko Matsakis-0/+11
2019-10-02review commentEsteban Küber-21/+21
2019-10-02fix typoFelix S Klock II-1/+1
2019-10-02Do not mark unitinitialized locals as requiring storageMatthew Jasper-17/+140
2019-10-02Regression tests for issue 64655.Felix S. Klock II-0/+145
2019-10-02Fix missing calls to drop on unwind with lto=fat; issue 64655.Felix S. Klock II-13/+38
2019-10-02Make lifetimes in constants live at the point of useMatthew Jasper-27/+58
2019-10-02Calculate liveness for the same locals with and without -ZpoloniusMatthew Jasper-501/+84
This fixes some test differences and also avoids overflow in issue-38591.rs.
2019-10-02Set RUST_BACKTRACE=0 in tests that include a backtrace in stderrAaron Hill-4/+8
This removes the implicit dependency on the environment variables set when running `./x.py test`
2019-10-02Add test for LinkedList clone_fromCharles Gleason-0/+43
2019-10-02avoid using `skip_binder` and instead look for bound vars properlyNiko Matsakis-12/+25
2019-10-02Avoid ICE on ReFree region from malformed codeEsteban Küber-2/+32
2019-10-02s/`async` fn/`async fn`/Niko Matsakis-8/+8
2019-10-02Always inline `mem::{size_of,align_of}` in debug buildsLzu Tao-2/+2
Those two are const fn and do not have any arguments. Inlining helps reducing generated code size in debug builds.
2019-10-02document `shallow_resolve`Niko Matsakis-0/+11
2019-10-02document `ret_coercion` and `ret_coercion_span`Niko Matsakis-0/+12
2019-10-02improve comments on `GeneratorKind` and `AsyncGeneratorKind`Niko Matsakis-3/+5
2019-10-02correct coercion commentsNiko Matsakis-3/+3
2019-10-02Do not ICE when dereferencing non-Copy raw pointerEsteban Küber-5/+41
2019-10-02WIP fix testsNiko Matsakis-187/+221
2019-10-02Compare primary with value instead of dropping itAnthonyMikh-1/+2
2019-10-02Rollup merge of #64997 - rust-lang:nitpick-slp, r=jonas-schievinkMazdak Farrokhzad-1/+1
rustc book: nitpick SLP vectorization SLP vectorization (in general and as implemented in LLVM) is not limited to loops.
2019-10-02Rollup merge of #64995 - GuillaumeGomez:libtest-rustdoc-warning, ↵Mazdak Farrokhzad-1/+1
r=Mark-Simulacrum Remove rustdoc warning Removes this warning: ```bash Finished release [optimized] target(s) in 2.62s Documenting core v0.0.0 (/home/imperio/rust/rust/src/libcore) Finished release [optimized] target(s) in 15.23s Documenting std v0.0.0 (/home/imperio/rust/rust/src/libstd) Finished release [optimized] target(s) in 17.30s Documenting proc_macro v0.0.0 (/home/imperio/rust/rust/src/libproc_macro) Finished release [optimized] target(s) in 2.36s Documenting test v0.0.0 (/home/imperio/rust/rust/src/libtest) warning: `[0]` cannot be resolved, ignoring it... --> src/libtest/lib.rs:1112:41 | 1112 | /// supplied channel. Requires argv[0] to exist and point to the binary | ^ cannot be resolved, ignoring | = note: `#[warn(intra_doc_link_resolution_failure)]` on by default = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]` Finished release [optimized] target(s) in 1.64s Build completed successfully in 0:02:07 ```
2019-10-02Rollup merge of #64991 - wesleywiser:fix_too_eager_const_prop, r=oli-obkMazdak Farrokhzad-29/+28
[const-prop] Correctly handle locals that can't be propagated `const_prop()` now handles writing the Rvalue into the Place in the stack frame for us. So if we're not supposed to propagate that value, we need to clear it. r? @oli-obk Fixes #64970
2019-10-02Rollup merge of #64989 - sinkuu:fix_ice_64964, r=davidtwcoMazdak Farrokhzad-9/+37
Fix ICE #64964 Fixes #64964, which is an ICE with `await`ing in a method + incr-comp.
2019-10-02Rollup merge of #64980 - ecstatic-morse:better-rustc-peek, r=oli-obkMazdak Farrokhzad-130/+237
Enable support for `IndirectlyMutableLocals` in `rustc_peek` This PR allows `rustc_peek` tests to be written for the `IndirectlyMutableLocals` analysis implemented in #64470. See any of the tests in [`test/ui/mir-dataflow`](https://github.com/rust-lang/rust/blob/master/src/test/ui/mir-dataflow/inits-1.rs) for an example. Included in this PR is a major rewrite of the `rustc_peek` module. This was motivated by the differences between the `IndirectlyMutableLocals` analysis and the initialized places ones. To properly test `IndirectlyMutableLocals`, we must pass locals by-value to `rustc_peek`, since any local that is not `Freeze` will be marked as indirectly mutable as soon as a reference to it is taken. Unfortunately, `UnsafeCell` is not `Copy`, so we can only do one `rustc_peek` on each value with interior mutability inside a test. I'm not sure how to deal with this restriction; perhaps I need to special case borrows preceding a call to `rustc_peek` in the analysis itself? `rustc_peek` also assumed that the analysis was done on move paths and that its transfer function only needed to be applied at assignment statements. This PR removes both of those restrictions by adding a trait, `RustcPeekAt`, that controls how the peeked at `Place` maps to the current dataflow state and using a dataflow cursor to retrieve the state itself. Finally, this PR adds a test which demonstrates some unsoundness in the `IndirectlyMutableLocals` analysis by converting a reference to a `Freeze` field to a reference to a `!Freeze` field by offsetting a pointer (or in this case transmuting a pointer to a ZST field with the same address as a `!Freeze` field). This does not represent a hole in the language proper, since this analysis is only used to validate `const` bodies, in which the unsound code will only compile with `-Zunleash-the-miri-inside-of-you`. Nevertheless, this should get fixed. r? @oli-obk
2019-10-02Rollup merge of #64973 - ecstatic-morse:fix-debuginfo-test, r=alexcrichtonMazdak Farrokhzad-2/+2
Fix typo while setting `compile-flags` in test This test is meant to check for an ICE when generating debug info, but didn't actually pass `-g` due to the typo. I also removed the `FIXME`, since this needs to actually be built (not just checked) to trigger the ICE.
2019-10-02Rollup merge of #64967 - ecstatic-morse:issue-64945, r=oli-obkMazdak Farrokhzad-16/+93
Don't mark borrows of zero-sized arrays as indirectly mutable Resolves #64945 r? @oli-obk
2019-10-02Rollup merge of #64961 - rust-lang:spastorino-patch-1, r=oli-obkMazdak Farrokhzad-1/+2
Make comment about dummy type a bit more clear
2019-10-02Rollup merge of #64948 - GuillaumeGomez:improve-sidebar-styling, ↵Mazdak Farrokhzad-4/+4
r=Mark-Simulacrum Improve sidebar styling to make its integration easier Part of https://github.com/rust-lang/docs.rs/issues/417 Setting the height was an error: forcing the element bottom to be at the bottom allows to change to top of the sidebar. r? @Mark-Simulacrum
2019-10-02Rollup merge of #64922 - spastorino:make-place-builder, r=nikomatsakisMazdak Farrokhzad-30/+114
Use PlaceBuilder to avoid a lot of slice -> vec -> slice convertions r? @oli-obk
2019-10-02Rollup merge of #64914 - pnkfelix:issue-64453-regression-test, r=nikomatsakisMazdak Farrokhzad-0/+58
regression test for 64453 borrow check error. Fix #64453
2019-10-02Rollup merge of #64850 - Mark-Simulacrum:dedup-dep-node, r=michaelwoeristerMazdak Farrokhzad-22/+18
Remove inlines from DepNode code
2019-10-02Rollup merge of #64581 - ztlpn:fix-ok-wrapping-unreachable-code, r=CentrilMazdak Farrokhzad-13/+161
Fix unreachable_code warnings for try{} block ok-wrapped expressions Fixes #54165 and fixes #63324.
2019-10-02Use zipped iterators in clone_from for LinkedListCharles Gleason-2/+2
2019-10-02Replace mentions of IRC with DiscordBO41-3/+5
2019-10-02Update llvm-project submoduleAlex Crichton-0/+0
Bring in rust-lang/llvm-project#24 which brings in some wasm improvements related to the bulk-memory proposal
2019-10-02WIP rebase for `shallow_resolve` callNiko Matsakis-1/+1
2019-10-02WIP tidy hir/lowering/expr.rsNiko Matsakis-4/+6
2019-10-02extract expected return type from `-> impl Future` obligationNiko Matsakis-3/+158
2019-10-02improved debug outputNiko Matsakis-0/+6