about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-08-20Apply review commentsGuillaume Gomez-2/+2
2020-08-19Clean up E0759 explanationGuillaume Gomez-10/+4
2020-08-11Auto merge of #75383 - Dylan-DPC:rollup-6hi36zn, r=Dylan-DPCbors-392/+919
Rollup of 10 pull requests Successful merges: - #75098 (Clippy pointer cast lint experiment) - #75249 (Only add a border for the rust logo) - #75315 (Avoid deleting temporary files on error) - #75316 (Don't try to use wasm intrinsics on vectors) - #75337 (instance: only polymorphize upvar substs) - #75339 (evaluate required_consts when pushing stack frame in Miri engine) - #75363 (Use existing `infcx` when emitting trait impl diagnostic) - #75366 (Add help button) - #75369 (Move to intra-doc links in /library/core/src/borrow.rs) - #75379 (Use intra-doc links in /library/core/src/cmp.rs) Failed merges: r? @ghost
2020-08-11Rollup merge of #75366 - GuillaumeGomez:help-button, r=jyn514Dylan DPC-11/+27
Add help button Part of #75197. Here is a screenshot of the result: ![Screenshot from 2020-08-10 16-53-20](https://user-images.githubusercontent.com/3050060/89796547-14112a00-db2a-11ea-9f25-57b30ab68f9b.png) r? @jyn514
2020-08-11Rollup merge of #75363 - Aaron1011:fix/diag-infcx, r=lcnrDylan DPC-5/+104
Use existing `infcx` when emitting trait impl diagnostic Fixes #75361 Fixes #74918 Previously, we were creating a new `InferCtxt`, which caused an ICE when used with type variables from the existing `InferCtxt`
2020-08-11Rollup merge of #75339 - RalfJung:eval-required, r=oli-obkDylan DPC-225/+302
evaluate required_consts when pushing stack frame in Miri engine [Just like codegen](https://github.com/rust-lang/rust/pull/70820/files#diff-32c57af5c8e23eb048f55d1e955e5cd5R194), Miri needs to make sure all `required_consts` evaluate successfully, to catch post-monomorphization errors. While at it I also moved the const_eval error reporting logic into rustc_mir::const_eval::error; there is no reason it should be in `rustc_middle`. I kept this in a separate commit for easier reviewing. Helps with https://github.com/rust-lang/miri/issues/1382. I will add a test on the Miri side (done now: https://github.com/rust-lang/miri/pull/1504). r? @oli-obk
2020-08-11Rollup merge of #75337 - davidtwco:polymorphization-75255-fixes, r=eddybDylan DPC-88/+33
instance: only polymorphize upvar substs This PR restricts the substitution polymorphization added in #75255 to only apply to the tupled upvar substitution, rather than all substitutions, fixing a bunch of regressions when polymorphization is enabled. Due to an oversight on my part, when landing #75260 and #75255, some tests started failing when polymorphization was enabled that I didn't notice until after landing - this PR fixes the regressions from #75255. #75336 has been filed to make sure that we don't forget to try make this change again in future, as it does enable some optimisations. r? @lcnr
2020-08-11Rollup merge of #75316 - alexcrichton:fix-wasm-simd, r=oli-obkDylan DPC-24/+31
Don't try to use wasm intrinsics on vectors This commit fixes an issue with #74695 where the fptosi and fptoui specializations on wasm were accidentally used on vector types by the `simd_cast` intrinsic. This issue showed up as broken CI for the stdsimd crate. Here this commit simply skips the specialization on vector kinds flowing into `fpto{s,u}i`.
2020-08-11Rollup merge of #75315 - Mark-Simulacrum:save-temps, r=ecstatic-morseDylan DPC-24/+53
Avoid deleting temporary files on error Previously if the compiler error'd, fatally, then temporary directories which should be preserved by -Csave-temps would be deleted due to fatal compiler errors being implemented as panics. cc @infinity0 (Hopefully) fixes #75275, but I haven't tested
2020-08-11Rollup merge of #75249 - GuillaumeGomez:rust-logo-border, r=ManishearthDylan DPC-7/+13
Only add a border for the rust logo ![Screenshot from 2020-08-07 11-22-51](https://user-images.githubusercontent.com/3050060/89631113-9dadc700-d8a0-11ea-8063-ad40207decaa.png) ![Screenshot from 2020-08-07 11-19-47](https://user-images.githubusercontent.com/3050060/89631114-9e465d80-d8a0-11ea-96ba-1d6926c8e7a9.png) ![Screenshot from 2020-08-07 11-19-41](https://user-images.githubusercontent.com/3050060/89631117-9edef400-d8a0-11ea-9c66-0df3d8c1ac2d.png) I didn't add a border for the light theme though, as I felt it as unnecessary. r? @Manishearth
2020-08-11Rollup merge of #75098 - Ryan1729:clippy-pointer-cast-lint-experiment, r=oli-obkDylan DPC-8/+356
Clippy pointer cast lint experiment This PR is an experiment about exposing more parts of `rustc_typeck` for use in `clippy`. In particular, the code that checks where a cast is valid or not was exposed, which necessitated exposing [`FnCtxt`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html), and figuring out how to create an instance of that type inside `clippy`. This was prompted by [this clippy issue](https://github.com/rust-lang/rust-clippy/issues/2064). r? @oli-obk
2020-08-10Auto merge of #74005 - estebank:type-ascription-redux, r=petrochenkovbors-146/+225
Clean up errors in typeck and resolve * Tweak ordering of suggestions * Do not suggest similarly named enclosing item * Point at item definition in foreign crates * Add missing primary label CC #34255.
2020-08-10Auto merge of #75349 - nnethercote:tweak-confusable-idents-checking, ↵bors-65/+43
r=petrochenkov Tweak confusable idents checking The confusable idents checking does some sub-optimal things with symbols. r? @petrochenkov cc @crlf0710
2020-08-10Auto merge of #75127 - jyn514:impl-trait, r=pnkfelixbors-105/+126
Fix async-std by special-casing rustdoc in typeck https://github.com/rust-lang/rust/issues/75100
2020-08-10Add missing primary labelEsteban Küber-7/+11
2020-08-10Point at item definition in foreign cratesEsteban Küber-12/+56
2020-08-10Do not suggest similarly named enclosing itemEsteban Küber-54/+41
2020-08-10Tweak ordering of suggestionsEsteban Küber-87/+131
Modify logic to make it easier to follow and recover labels that would otherwise be lost.
2020-08-10Auto merge of #74936 - GuillaumeGomez:const-rustc_const_unstable, r=jyn514bors-5/+32
Don't print "const" keyword on non-nightly build if rustc_const_unstable is used on the item Fixes #74579.
2020-08-10Auto merge of #74953 - JulianKnodt:master, r=lcnrbors-75/+190
Remove restriction on type parameters preceding consts w/ feature const-generics Removed the restriction on type parameters preceding const parameters when the feature const-generics is enabled. Builds on #74676, which deals with unsorted generic parameters. This just lifts the check in lowering the AST to HIR that permits consts and types to be reordered with respect to each other. Lifetimes still must precede both This change is not intended for min-const-generics, and is gated behind the `#![feature(const_generics)]`. One thing is that it also permits type parameters without a default to come after consts, which I expected to not work, and was hoping to get more guidance on whether that should be permitted or how to prevent it otherwise. I did not go through the RFC process for this pull request because there was prior work to get this feature added. In the previous PR that was cited, work was done to enable this change. r? @lcnr
2020-08-10Add test for rustc_const_unstable on methodsGuillaume Gomez-0/+9
2020-08-10Add help buttonGuillaume Gomez-11/+27
2020-08-10Auto merge of #75357 - RalfJung:miri, r=RalfJungbors-8/+8
update Miri Fixes https://github.com/rust-lang/rust/issues/75274 Cc @rust-lang/miri r? @ghost
2020-08-10Use existing `infcx` when emitting trait impl diagnosticAaron Hill-5/+104
Fixes #75361 Fixes #74918 Previously, we were creating a new `InferCtxt`, which caused an ICE when used with type variables from the existing `InferCtxt`
2020-08-10add test for unused erroneous const in CTFERalf Jung-0/+63
2020-08-10update MiriRalf Jung-8/+8
2020-08-10Convert `Eq` impl to check Ord::Equalkadmin-2/+8
2020-08-10Auto merge of #75204 - cuviper:freebsd11, r=Mark-Simulacrumbors-25/+11
Upgrade the FreeBSD toolchain to version 11.4 FreeBSD 10 reached its end-of-life in October 2018, and that toolchain caused issues in the LLVM 11 upgrade (#73526) that are resolved with the toolchain from FreeBSD 11. Closes #72390.
2020-08-10Auto merge of #74410 - mati865:mingw-no-self-contained-when-cross-compiling, ↵bors-1/+3
r=petrochenkov MinGW: disable self-contained mode when cross compiling When cross compiling users have to provide own linker and libraries anyway. Using rust provided MinGW crt objects is harmful here and has no benefits. cc https://github.com/rust-lang/rust/issues/68887
2020-08-10Auto merge of #75351 - JohnTitor:rollup-q9udsyx, r=JohnTitorbors-38/+104
Rollup of 8 pull requests Successful merges: - #74200 (Std panicking unsafe block in unsafe fn) - #75286 (Add additional case for Path starts with) - #75318 (Resolve `char` as a primitive even if there is a module in scope) - #75320 (Detect likely `for foo of bar` JS syntax) - #75328 (Cleanup E0749) - #75344 (Rename "Important traits" to "Notable traits") - #75348 (Move to intra-doc links in library/core/src/time.rs) - #75350 (Do not ICE when lowering invalid extern fn with bodies) Failed merges: r? @ghost
2020-08-10Rollup merge of #75350 - estebank:foreign-fn-with-body-ice, r=davidtwcoYuki Okushi-1/+27
Do not ICE when lowering invalid extern fn with bodies Fix #75283.
2020-08-10Rollup merge of #75344 - camelid:rename-important-to-notable-traits, ↵Yuki Okushi-21/+21
r=Manishearth Rename "Important traits" to "Notable traits" Fixes #75245. --- * Rename it in the UI * Rename the CSS classes
2020-08-10Rollup merge of #75328 - GuillaumeGomez:cleanup-e0749, r=Dylan-DPCYuki Okushi-5/+20
Cleanup E0749 r? @pickfire
2020-08-10Rollup merge of #75320 - estebank:js-for-i-of-x, r=davidtwcoYuki Okushi-7/+25
Detect likely `for foo of bar` JS syntax Fix #75311.
2020-08-10Rollup merge of #75318 - jyn514:primitive, r=manishearthYuki Okushi-4/+11
Resolve `char` as a primitive even if there is a module in scope Closes https://github.com/rust-lang/rust/issues/58699. r? @Manishearth
2020-08-09Do not ICE when lowering invalid extern fn with bodiesEsteban Küber-1/+27
Fix #75283.
2020-08-09Auto merge of #75345 - Aaron1011:fix/no-std-hygiene, r=petrochenkovbors-163/+233
Remove normalization of `Span` debug output in proc-macro tests Fixes #74800 The definition of `is_x86_feature_detected!` (and similar macros) depends on the platform - it is produced by a `cfg_if!` invocation on x86, and a plain `#[cfg]` on other platforms. Since it is part of the prelude, we will end up importing different hygiene information depending on the platform. This previously required us to avoid printing raw `SyntaxContext` ids in any tests that uses the standard library, since the captured output will be platform-dependent. Previously, we replaced all `SyntaxContext` ids with "#CTXT", and the raw `Span` lo/hi bytes with "LO..HI". This commit adds `#![no_std]` and `extern crate std` to all proc-macro tests that print spans. This suppresses the prelude import, while still using lang items from `std` (which gives us a buildable binary). With this apporach, we will only load hygiene information for things which we explicitly import. This lets us re-add `-Z unpretty=expanded,hygiene`, since its output can now be made stable across all platforms. Additionally, we use `-Z span-debug` in more places, which lets us avoid the "LO..HI" normalization hack.
2020-08-10Remove `CowBoxSymStr`.Nicholas Nethercote-61/+23
`CowBoxSymStr` is a type that either holds a `SymbolStr` (which is much the same as a `Symbol`), or an owned string. When computing skeletons, a `SymbolStr` is stored if the skeleton is the same as the original string, otherwise an owned string is stored. So, basically, `CowBoxSymStr` is a type for string interning. But we already have one of those: `Symbol` itself. This PR removes `CowBoxSymStr`, using `Symbol` instead. A good thing about this is that it avoids storing `SymbolStr` values in `skeleton_map`, something that is discouraged. The PR also inlines and removes the `calc_skeleton()` function because that simplifies the code.
2020-08-10Fix symbol ordering for confusable idents detection.Nicholas Nethercote-4/+20
Confusable idents detection uses a type `BTreeMap<Symbol, Span>`. This is highly dubious given that `Symbol` doesn't guarantee a meaningful order. (In practice, it currently gives an order that mostly matches source code order.) As a result, changes in `Symbol` representation make the `lint-confusable-idents.rs` test fail, because this error message: > identifier pair considered confusable between `s` and `s` is changed to this: > identifier pair considered confusable between `s` and `s` and the corresponding span pointers get swapped erroneously, leading to an incorrect "previous identifier" label. This commit sorts the relevant symbols by span before doing the checking, which ensures that the ident that appears first in the code will be mentioned first in the message. The commit also extends the test slightly to be more thorough.
2020-08-09Auto merge of #75278 - cuviper:indexmap, r=Mark-Simulacrumbors-191/+138
Upgrade indexmap and use it more First this upgrades `indexmap` to 1.5.1, which is now based on `hashbrown::raw::RawTable`. This means it shares a lot of the same performance characteristics for insert, lookup, etc., while keeping items in insertion order. Then across various rustc crates, this replaces a lot of `Vec`+`HashMap` pairs with a single `IndexMap` or `IndexSet`. Closes #60608. r? @eddyb
2020-08-09rustc_span: note the perf loss seen from IndexSet in symbol::InternerJosh Stone-0/+4
2020-08-09rustc_typeck: use IndexSet in InteriorVisitorJosh Stone-19/+14
2020-08-09rustc_typeck: use IndexSet in UniquePredicatesJosh Stone-9/+5
2020-08-09rustc_span: use IndexSet in SpanInternerJosh Stone-12/+5
2020-08-09rustc_mir_build: use IndexMap in TestKind::SwitchIntJosh Stone-23/+17
2020-08-09rustc_mir: use IndexSet in PlaceholderIndicesJosh Stone-8/+7
2020-08-09rustc_mir: use IndexMap in BorrowSetJosh Stone-43/+52
2020-08-09rustc_middle: use IndexSet in OnDiskCacheJosh Stone-17/+5
2020-08-09rustc_metadata: use IndexSet in EncodeContextJosh Stone-17/+5
2020-08-09rustc_data_structures: use IndexSet in TransitiveRelationJosh Stone-26/+13