about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-09-30Fix typo in docsDylan MacKenzie-1/+1
2019-09-30Auto merge of #64778 - csmoe:index, r=eddybbors-203/+231
Introduce librustc_index crate Closes #50592
2019-09-30Auto merge of #64600 - scottmcm:no-slice-tryfold-unroll, r=blussbors-68/+1
Remove manual unrolling from slice::Iter(Mut)::try_fold While this definitely helps sometimes (particularly for trivial closures), it's also a pessimization sometimes, so it's better to leave this to (hypothetical) future LLVM improvements instead of forcing this on everyone. I think it's better for the advice to be that sometimes you need to unroll manually than you sometimes need to not-unroll manually (like #64545). --- For context see https://github.com/rust-lang/rust/pull/64572#issuecomment-532961046
2019-09-30Auto merge of #64904 - ollie27:rustdoc_logo, r=Mark-Simulacrumbors-1/+1
rustdoc: Fix default logo filename This was a typo made in #64443. It's the reason the logo is missing on the [nightly docs](https://doc.rust-lang.org/nightly/std/). r? @Mark-Simulacrum
2019-09-30Auto merge of #64881 - RalfJung:miri, r=RalfJungbors-5/+10
bump Miri Fixes https://github.com/rust-lang/rust/issues/64798
2019-09-29Auto merge of #64673 - Mark-Simulacrum:opt-match-ck, r=oli-obkbors-2/+16
Optimize try_eval_bits to avoid layout queries This specifically targets match checking, but is possibly more widely useful as well. In code with large, single-value match statements, we were previously spending a lot of time running layout_of for the primitive types (integers, chars) -- which is essentially useless. This optimizes the code to avoid those query calls by directly obtaining the size for these types, when possible. It may be worth considering adding a `size_of` query in the future which might be far faster, especially if specialized for "const" cases -- match arms being the most obvious example. It's possibly such a function would benefit from *not* being a query as well, since it's trivially evaluatable from the sty for many cases whereas a query needs to hash the input and such.
2019-09-29Optimize try_eval_bits to avoid layout queriesMark Rousskov-2/+16
This specifically targets match checking, but is possibly more widely useful as well. In code with large, single-value match statements, we were previously spending a lot of time running layout_of for the primitive types (integers, chars) -- which is essentially useless. This optimizes the code to avoid those query calls by directly obtaining the size for these types, when possible. It may be worth considering adding a `size_of` query in the future which might be far faster, especially if specialized for "const" cases -- match arms being the most obvious example. It's possibly such a function would benefit from *not* being a query as well, since it's trivially evaluatable from the sty for many cases whereas a query needs to hash the input and such.
2019-09-29rustdoc: Fix default logo filenameOliver Middleton-1/+1
2019-09-29Rollup merge of #64894 - Centril:fix-64682, r=petrochenkovMazdak Farrokhzad-127/+391
syntax: fix dropping of attribute on first param of non-method assocated fn Fixes #64682. The general idea is that we bake parsing of `self` into `parse_param_general` and then we just use standard list parsing. Overall, this simplifies the parsing and makes it more consistent. r? @petrochenkov cc @c410-f3r
2019-09-29Rollup merge of #64858 - skinny121:str-const-generics, r=varkorMazdak Farrokhzad-26/+116
Add support for relating slices in `super_relate_consts` This allows passing strings as generic arguments. Fixes #63773 Fixes #60813 r? @varkor
2019-09-29Rollup merge of #64825 - estebank:match-unit, r=CentrilMazdak Farrokhzad-50/+180
Point at enclosing match when expecting `()` in arm When encountering code like the following: ```rust fn main() { match 3 { 4 => 1, 3 => { println!("Yep it maches."); 2 } _ => 2 } println!("Bye!") } ``` point at the enclosing `match` expression and suggest ignoring the returned value: ``` error[E0308]: mismatched types --> $DIR/match-needing-semi.rs:8:13 | LL | / match 3 { LL | | 4 => 1, LL | | 3 => { LL | | 2 | | ^ expected (), found integer LL | | } LL | | _ => 2 LL | | } | | -- help: consider using a semicolon here | |_____| | expected this to be `()` | = note: expected type `()` found type `{integer} ``` Fix #40799.
2019-09-29Rollup merge of #64735 - GuillaumeGomez:long-err-explanation-E0533, r=CentrilMazdak Farrokhzad-4/+67
Add long error explanation for E0533 Part of https://github.com/rust-lang/rust/issues/61137
2019-09-29Rollup merge of #64691 - estebank:unexpected-variant, r=CentrilMazdak Farrokhzad-24/+126
Point at definition when misusing ADT When given `struct Foo(usize)` and using it as `Foo {}` or `Foo`, point at `Foo`'s definition in the error.
2019-09-29bump MiriRalf Jung-5/+10
2019-09-29remove indexed_vec re-export from rustc_data_structurescsmoe-163/+164
2019-09-29remove bit_set re-export from rustc_data_structurescsmoe-42/+49
2019-09-29move bit_set into rustc_indexcsmoe-2/+3
2019-09-29move index_vec into rustc_indexcsmoe-1/+8
2019-09-29init librustc_index cratecsmoe-0/+12
2019-09-29Auto merge of #64158 - tmandry:libtest-panic-abort, r=alexcrichtonbors-118/+438
panic=abort support in libtest Add experimental support for tests compiled with panic=abort. Enabled with `-Z panic_abort_tests`. r? @alexcrichton cc @cramertj
2019-09-29syntax: fix #64682.Mazdak Farrokhzad-127/+391
Fuse parsing of `self` into `parse_param_general`.
2019-09-29Auto merge of #64546 - weiznich:bugfix/rfc-2451-rerebalance-tests, ↵bors-17/+531
r=nikomatsakis Bugfix/rfc 2451 rerebalance tests r? @nikomatsakis Fixes #64412 Depends/Contains on #64414 cc #55437 and #63599
2019-09-29Auto merge of #64886 - Centril:rollup-30dqh8j, r=Centrilbors-909/+560
Rollup of 5 pull requests Successful merges: - #63492 (Remove redundancy from the implementation of C variadics.) - #64589 (Differentiate AArch64 bare-metal targets between hf and non-hf.) - #64799 (Fix double panic when printing query stack during an ICE) - #64824 (No StableHasherResult everywhere) - #64884 (Add pkg-config to dependency list if building for Linux on Linux) Failed merges: r? @ghost
2019-09-29Rollup merge of #64824 - Mark-Simulacrum:no-stable-hasher-result-everywhere, ↵Mazdak Farrokhzad-472/+191
r=michaelwoerister No StableHasherResult everywhere This removes the generic parameter on `StableHasher`, instead moving it to the call to `finish`. This has the side-effect of making all `HashStable` impls nicer, since we no longer need the verbose `<W: StableHasherResult>` that previously existed -- often forcing line wrapping. This is done for two reasons: * we should avoid false "generic" dependency on the result of StableHasher * we don't need to codegen two/three copies of all the HashStable impls when they're transitively used to produce a fingerprint, u64, or u128. I haven't measured, but this might actually make our artifacts somewhat smaller too. * Easier to understand/read/write code -- the result of the stable hasher is irrelevant when writing a hash impl.
2019-09-29Rollup merge of #64799 - Aaron1011:fix/double-panic, r=Mark-SimulacrumMazdak Farrokhzad-3/+7
Fix double panic when printing query stack during an ICE On the latest nightly, any call to `bug` or `span_bug` will result in two panics - the first one as a normal result of calling `bug` / `span_bug`, and the second as a result of trying to print the query stack from the panic handler. This is caused by the query-printing code attempting to acquire a lock on `HandlerInnder`, which is still being held by `bug`. This PR moves the actual panic out of `HandlerInner`, into `Handler`. This allows us to release the lock on `HandlerInner` before triggering the panic, ensuring that the panic handler will be able to acquire the lock if necessary.
2019-09-29Rollup merge of #64589 - andre-richter:aarch64_bare_metal, r=AmanieuMazdak Farrokhzad-2/+40
Differentiate AArch64 bare-metal targets between hf and non-hf. CC @parched, kindly request you to review. ~~Note: This change breaks code that uses the target `aarch64-unknown-none` for the sake of clearer naming as discussed in the links posted below. A search on github reveals that code using `aarch64-unknown-none` is almost exclusively forked from our embedded WG's OS tutorials repo at https://github.com/rust-embedded/rust-raspi3-OS-tutorials, for which the target was originally created.~~ ~~I will adapt this repo to the new target name asap once this PR would go upstream. The minor annoyance for the forks to break temporarily should be acceptable for the sake of introducing a better differentiation now before it is too late. Also, the break would only happen upon updating the toolchain, giving the user a good hint at what has happened.~~ ---------- Patch commit message: Following up on [1] and [2], this PR adds differntiation for aarch64 bare-metal targets between versions with and without floating point enabled. This streamlines the target naming with other existing ARM targets and provides the user clear indication if he is getting float or non-float for his bare-metal target. [1] https://github.com/rust-lang/rust/pull/60135#issuecomment-485851356 [2] https://github.com/rust-embedded/wg/issues/230 Closes: rust-embedded/wg#230
2019-09-29Rollup merge of #63492 - eddyb:cvarargs, r=nagisa,matthewjasperMazdak Farrokhzad-432/+322
Remove redundancy from the implementation of C variadics. This cleanup was first described in https://github.com/rust-lang/rust/issues/44930#issuecomment-497163539: * AST doesn't track `c_variadic: bool` anymore, relying solely on a trailing `CVarArgs` type in fn signatures * HIR doesn't have a `CVarArgs` anymore, relying solely on `c_variadic: bool` * same for `ty::FnSig` (see tests for diagnostics improvements from that) * `{hir,mir}::Body` have one extra argument than the signature when `c_variadic == true` * `rustc_typeck` and `rustc_mir::{build,borrowck}` need to give that argument the right type (which no longer uses a lifetime parameter, but a function-internal scope) * `rustc_target::abi::call` doesn't need special hacks anymore (since it never sees the `VaListImpl` now, it's all inside the body) r? @nagisa / @rkruppe cc @dlrobertson @oli-obk
2019-09-29Auto merge of #64470 - ecstatic-morse:split-promotion-and-validation, ↵bors-290/+2009
r=eddyb,oli-obk Implement dataflow-based const validation This PR adds a separate, dataflow-enabled pass that checks the bodies of `const`s, `static`s and `const fn`s for [const safety](https://github.com/rust-rfcs/const-eval/blob/master/const.md). This is based on my work in #63860, which tried to integrate into the existing pass in [`qualify_consts.rs`](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/qualify_consts.rs). However, the resulting pass was even more unwieldy than the original. Unlike its predecessor, this PR is designed to be combined with #63812 to replace the existing pass completely. The new checker lives in [`librustc_mir/transform/check_consts`](https://github.com/ecstatic-morse/rust/tree/split-promotion-and-validation/src/librustc_mir/transform/check_consts). [`qualifs.rs`](https://github.com/ecstatic-morse/rust/blob/split-promotion-and-validation/src/librustc_mir/transform/check_consts/qualifs.rs) contains small modifications to the existing `Qualif` trait and its implementors, but is mostly unchanged except for the removal of `IsNotPromotable` and `IsNotImplicitlyPromotable`, which are only necessary for promotion. [`resolver.rs`](https://github.com/ecstatic-morse/rust/blob/split-promotion-and-validation/src/librustc_mir/transform/check_consts/resolver.rs) contains the dataflow analysis used to propagate qualifs between locals. Finally, [`validation.rs`](https://github.com/ecstatic-morse/rust/blob/split-promotion-and-validation/src/librustc_mir/transform/check_consts/validation.rs) contains a refactored version of the existing [`Visitor`](https://github.com/rust-lang/rust/blob/ca3766e2e58f462a20922e42c821a37eaf0e13db/src/librustc_mir/transform/qualify_consts.rs#L1024) in `qualfy_consts.rs`. All errors have been associated with a `struct` to make [comparison with the existing pass](https://github.com/ecstatic-morse/rust/blob/1c19f2d540ca0a964900449d79a5d5181b43146d/src/librustc_mir/transform/qualify_consts.rs#L1006) simple. The existing validation logic in [`qualify_consts`](https://github.com/rust-lang/rust/blob/master/src/librustc_mir/transform/qualify_consts.rs) has been modified to allow it to run in parallel with the new validator. If [`use_new_validator`](https://github.com/rust-lang/rust/pull/64470/files#diff-c2552a106550d05b69d5e07612f0f812R950) is not set, the old validation will be responsible for actually generating the errors, but those errors can be compared with the ones from the new validator.
2019-09-28Put panic=abort test support behind -Z panic_abort_testsTyler Mandry-15/+45
2019-09-28Add test for libtest panic=abort modeTyler Mandry-0/+65
2019-09-28Spawn one subprocess per unit test when panic=abortTyler Mandry-100/+304
2019-09-28Support run-fail ui testsTyler Mandry-4/+25
2019-09-28Rollup merge of #64880 - llogiq:slice-docs, r=CentrilMazdak Farrokhzad-1/+1
Slice docs: fix typo With #64703, I introduced a typo. Here is the fix. Sorry for the inconvenience.
2019-09-28Rollup merge of #64876 - vertexclique:vcq/fix-fn-name-intrinsic-op-unsafety, ↵Mazdak Farrokhzad-4/+4
r=varkor Fix typo in intrinsics op safety Title pretty much sums up.
2019-09-28Rollup merge of #64875 - ehuss:async-await-reserved, r=estebankMazdak Farrokhzad-61/+61
Upgrade async/await to "used" keywords. AFAIK, this only affects error messages, removing the word "reserved". Closes #64853
2019-09-28Rollup merge of #64852 - Baranowski:param_note_52082, r=estebankMazdak Farrokhzad-26/+188
Print ParamTy span when accessing a field (#52082)
2019-09-28Rollup merge of #64837 - nliberg:patch-2, r=CentrilMazdak Farrokhzad-6/+6
Improve wording in documentation of MaybeUninit Changes > variables are properly initialized **at** their respective type into > variables are properly initialized **as** their respective type
2019-09-28Rollup merge of #64793 - immunant:format_spans, r=matthewjasperMazdak Farrokhzad-12/+9
Fix format macro expansions spans to be macro-generated New Exprs generated as part of the format macro expansion should get the macro expansion span with an expansion context, rather than the span of the format string which does not.
2019-09-28Rollup merge of #64763 - GuillaumeGomez:long-err-explanation-E0734, r=estebankMazdak Farrokhzad-32/+59
Add E0734 and its long explanation Part of https://github.com/rust-lang/rust/issues/61137
2019-09-28Rollup merge of #64678 - tomtau:fix/no-std-error, r=matthewjasperMazdak Farrokhzad-18/+50
added more context for duplicate lang item errors (fixes #60561) Some more information about #60561 -- these errors are pretty common when one works in restrictive environments with `no_std` or customized `std`, but they don't provide much context for debugging, as any transitive dependency could have brought in `std` crate. With that, currently, one needs to use something like `cargo tree` and investigate transitive dependencies one by one. It'll be more helpful to know at least the crate that uses `std` (which `cargo tree` doesn't show) to pin down this investigation when debugging. I'm not sure what the best way to get this context is inside rustc internals (I'm new to them). I found that `all_crate_nums` query returns the crates in some dependency order, so printing out the name of the preceding crate seems to do the trick. But I welcome suggestions if this can be done in a better way.
2019-09-28Rollup merge of #64387 - nathanwhit:redundant-semi-fix, r=varkorMazdak Farrokhzad-3/+64
Fix redundant semicolon lint interaction with proc macro attributes Fixes #63967 and fixes #63947, both of which were caused by the lint's changes to the parser interacting poorly with proc macro attributes and causing span information to be lost r? @varkor
2019-09-28Rollup merge of #64131 - shivan1b:deterministic-fxhashmap, r=Mark-SimulacrumMazdak Farrokhzad-0/+178
data_structures: Add deterministic FxHashMap and FxHashSet wrappers StableMap A wrapper for FxHashMap that allows to `insert`, `remove`, `get`, `get_mut` and convert a hashmap into a sorted vector using the method `into_sorted_vector` but no iteration support. StableSet A wrapper for FxHashSet that allows to `insert`, `remove`, `get` and convert a hashset into a sorted vector using the method `into_sorted_vector` but no iteration support. Addresses issue #63713
2019-09-29Add a couple more test cases, including non-ascii strings.ben-3/+16
2019-09-28Slice docs: fix typoAndre Bogus-1/+1
2019-09-28clean upEsteban Küber-16/+15
2019-09-28review commentsEsteban Küber-22/+28
2019-09-28Point at enclosing match when expecting `()` in armEsteban Küber-33/+158
When encountering code like the following: ```rust fn main() { match 3 { 4 => 1, 3 => { println!("Yep it maches."); 2 } _ => 2 } println!("Bye!") } ``` point at the enclosing `match` expression and suggest ignoring the returned value: ``` error[E0308]: mismatched types --> $DIR/match-needing-semi.rs:8:13 | LL | / match 3 { LL | | 4 => 1, LL | | 3 => { LL | | 2 | | ^ expected (), found integer LL | | } LL | | _ => 2 LL | | } | | -- help: consider using a semicolon here | |_____| | expected this to be `()` | = note: expected type `()` found type `{integer} ``` Fix #40799.
2019-09-28Fix typo in intrinsics op safetyMahmut Bulut-4/+4
2019-09-28Upgrade async/await to "used" keywords.Eric Huss-61/+61
2019-09-28Auto merge of #64419 - wesleywiser:const_prop_use_ecx, r=oli-obkbors-254/+425
Deduplicate some code between miri and const prop r? @oli-obk