about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-08-12Auto merge of #75436 - JohnTitor:rollup-ss0lxds, r=JohnTitorbors-32/+104
Rollup of 9 pull requests Successful merges: - #74521 (older toolchains not valid anymore) - #74960 (Fix regionck failure when converting Index to IndexMut) - #75234 (Update asm! documentation in unstable book) - #75368 (Move to doc links inside the prelude) - #75371 (Move to doc links inside std/time.rs) - #75394 (Add a function to `TyCtxt` for computing an `Allocation` for a `static` item's initializer) - #75395 (Switch to intra-doc links in library/std/src/os/*/fs.rs) - #75422 (Accept more safety comments) - #75424 (fix wrong word in documentation) Failed merges: r? @ghost
2020-08-12Rollup merge of #75422 - poliorcetics:tidy-accept-more-safety-comments, ↵Yuki Okushi-1/+1
r=Mark-Simulacrum Accept more safety comments This accepts more `// SAFETY:` comments from `tidy`. This is done after the current behaviour of requiring text one the same line (because spaces are stripped so the last space never pass if there is no text on the same line) bit me once more in #75066 This could potentially accept empty `// SAFETY:` comments but `tidy` is an internal tool used only here so my reasoning is reviews will catch those.
2020-08-12Rollup merge of #75394 - oli-obk:get_static, r=RalfJungYuki Okushi-17/+28
Add a function to `TyCtxt` for computing an `Allocation` for a `static` item's initializer r? @RalfJung miri-side: https://github.com/rust-lang/miri/issues/1507 split out of https://github.com/rust-lang/rust/pull/74949#discussion_r468100991 to make that PR leaner
2020-08-12Rollup merge of #75234 - Amanieu:asm_unstable_book, r=nikomatsakisYuki Okushi-1/+13
Update asm! documentation in unstable book - Update the list of supported architectures. - Clarify issues with LLVM's use of reserved registers.
2020-08-12Rollup merge of #74960 - nbdd0121:typeck, r=nikomatsakisYuki Okushi-13/+62
Fix regionck failure when converting Index to IndexMut Fixes #74933 Consider an overloaded index expression `base[index]`. Without knowing whether it will be mutated, this will initially be desugared into `<U as Index<T>>::index(&base, index)` for some `U` and `T`. Let `V` be the `expr_ty_adjusted` of `index`. If this expression ends up being used in any mutable context (or used in a function call with `&mut self` receiver before #72280), we will need to fix it up. The current code will rewrite it to `<U as IndexMut<V>>::index_mut(&mut base, index)`. In most cases this is fine as `V` will be equal to `T`, however this is not always true when `V/T` are references, as they may have different region. This issue is quite subtle before #72280 as this code path is only used to fixup function receivers, but after #72280 we've made this a common path. The solution is basically just rewrite it to `<U as IndexMut<T>>::index_mut(&mut base, index)`. `T` can retrieved in the fixup path using `node_substs`.
2020-08-12Auto merge of #75427 - Xanewok:update-rls, r=Dylan-DPCbors-18/+5
Update RLS and Rustfmt Closes #74811 Closes #74812 r? @calebcartwright
2020-08-12Auto merge of #75405 - flip1995:clippyup, r=Manishearthbors-619/+2700
Update Clippy Biweekly Clippy update (2 days late, since I wanted to wait for https://github.com/rust-lang/rust/pull/75098) r? @Manishearth
2020-08-12Update RLS and RustfmtIgor Matuszewski-18/+5
2020-08-11Auto merge of #74802 - Mark-Simulacrum:reland-74069, r=nnethercotebors-7/+51
Reland #74069 Investigation in #74716 has concluded that this PR is indeed not a regression (and in fact the rollup itself is not either). This reverts the revert in #74611. r? @nnethercote cc @eddyb
2020-08-11Accept more safety comments (notably those that are on multiple lines ↵Alexis Bourget-1/+1
without text after SAFETY:)
2020-08-11Rollup merge of #75408 - mati865:update-ci-comment, r=pietroalbiniTyler Mandry-5/+7
Update MinGW comments in ci.yml
2020-08-11Rollup merge of #75403 - giraffate:update_comment_in_fn, r=ecstatic-morseTyler Mandry-1/+1
Update comment for function `rustc::lint::builtin` -> `rustc_session::lint::builtin`
2020-08-11Rollup merge of #75393 - GuillaumeGomez:fix-help-shortcut, r=pickfireTyler Mandry-3/+1
Fully handle "?" shortcut Fixes #75386. cc @runiq
2020-08-11Rollup merge of #75378 - petrochenkov:isident, r=Mark-SimulacrumTyler Mandry-26/+41
Introduce `rustc_lexer::is_ident` and use it in couple of places Implements the suggestion from https://github.com/rust-lang/rust/pull/74537#issuecomment-662261979.
2020-08-11Fully handle "?" shortcutGuillaume Gomez-3/+1
2020-08-11Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyupflip1995-619/+2700
2020-08-11Auto merge of #73656 - oli-obk:deaggregate-is-cleanup, r=wesleywiserbors-357/+793
move Deaggregate pass to post_borrowck_cleanup Reopen of #71946 Only the second commit is from this PR, the other commit is a bugfix that's in the process of getting merged. I'll rebase once that's done In #70073 MIR pass handling got reorganized, but with the goal of not changing behavior (except for disabling some optimizations on opt-level = 0). But there we realized that the Deaggregator pass, while conceptually more of a "cleanup" pass (and one that should be run before optimizations), was run in the middle of the optimization chain. Likely this is an accident of history, so I suggest we try and clean that up by making it a proper cleanup pass. This does change mir-opt output, because deaggregation now runs before const-prop instead of after. r? @wesleywiser @rust-lang/wg-mir-opt cc @RalfJung
2020-08-11move Deaggregate pass to post_borrowck_cleanupRalf Jung-357/+793
2020-08-11Update MinGW comments in ci.ymlMateusz Mikuła-5/+7
2020-08-11Update comment for functionTakayuki Nakata-1/+1
`rustc::lint::builtin` -> `rustc_session::lint::builtin`
2020-08-11Auto merge of #5891 - flip1995:rustup, r=flip1995bors-0/+7
Rustup r? @ghost Sync back rust-lang/rust#75098 changelog: none
2020-08-11Add a function to `TyCtxt` for computing an `Allocation` for a `static` ↵Oliver Scherer-17/+28
item's initializer
2020-08-11Rollup merge of #75360 - pickfire:patch-4, r=GuillaumeGomezYuki Okushi-1/+11
Add sample fix for E0749 Even though the description is clear but the solution may not be as straightforward. Adding a suggested fix from documentation side. r? @GuillaumeGomez However, this suggestion should be shown in rustc itself for easy fix, the documentation should also reflect on the changes in rustc. Currently, ``` error[E0749]: negative impls cannot have any items --> test.rs:6:5 | 6 | type Foo = i32; // error! | ^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0749`. ``` rustc should tell the user to remove it.
2020-08-11Rollup merge of #75359 - lcnr:unused-delims-trim, r=oli-obkYuki Okushi-24/+26
unused_delims: trim expr improves rustfix output.
2020-08-11Rollup merge of #75353 - estebank:tiny, r=jyn514Yuki Okushi-3/+3
Tiny cleanup, remove unnecessary `unwrap` Remove unnecessary `unwrap`.
2020-08-11Rollup merge of #75352 - estebank:incorrect-tuple-struct-pat, r=oli-obkYuki Okushi-10/+14
Tweak conditions for E0026 and E0769 When we have a tuple struct used with struct we don't want to suggest using the (valid) struct syntax with numeric field names. Instead we want to suggest the expected syntax. Given ```rust fn main() { match MyOption::MySome(42) { MyOption::MySome { x: 42 } => (), _ => (), } } ``` We now emit E0769 "tuple variant `MyOption::MySome` written as struct variant" instead of E0026 "variant `MyOption::MySome` does not have a field named `x`".
2020-08-11Rollup merge of #75347 - fusion-engineering-forks:rustdoc-nat-sort, ↵Yuki Okushi-29/+63
r=GuillaumeGomez Rustdoc: Fix natural ordering to look at all numbers. The old implementation only looks at numbers at the end, but not in other places in a name: `u8` and `u16` got sorted properly, but `u8_bla` and `u16_bla` did not. ![image](https://user-images.githubusercontent.com/783247/89740226-28e8b180-da87-11ea-885d-77a7c8a6ba00.png)
2020-08-11Rollup merge of #75338 - RalfJung:const-eval-stack-size-check, r=oli-obkYuki Okushi-5/+10
move stack size check to const_eval machine This is consistent with how we enforce the step limit. In particular, we do not want this limit checked for Miri-the-tool.
2020-08-11Rollup merge of #75333 - davidtwco:polymorphization-75260-fixes, r=lcnrYuki Okushi-4/+24
polymorphize: constrain unevaluated const handling This PR constrains the support added for handling unevaluated consts in polymorphization (introduced in #75260) by: - Skipping associated constants as this causes cycle errors. - Skipping promoted constants when they contain `Self` as this ensures `T` is used in constants of the form `<Self as Foo<T>>`. 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 #75260. r? @lcnr
2020-08-11Rollup merge of #75226 - pnadon:miri-undef-uninit, r=RalfJungYuki Okushi-37/+37
Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - `src/librustc_codegen_llvm/consts.rs` - `src/librustc_middle/mir/interpret/` - `src/librustc_middle/ty/print/pretty.rs` - `src/librustc_mir/` - `src/tools/clippy/clippy_lints/src/consts.rs` Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193
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-10run cargo dev update-lintsMatthias Krüger-1/+1
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-11Feature gate is always presentMark Rousskov-17/+17
2020-08-11Introduce `rustc_lexer::is_ident` and use it in couple of placesVadim Petrochenkov-9/+24
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.