about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2020-10-31Auto merge of #76257 - JulianKnodt:i75777, r=Dylan-DPCbors-0/+60
Add regression test This adds a regression test for #75777, effectively closing it since it is solved on nightly and beta. Closes #75777
2020-10-30Auto merge of #78182 - LeSeulArtichaut:ty-visitor-contolflow, r=lcnr,oli-obkbors-4/+6
TypeVisitor: use `std::ops::ControlFlow` instead of `bool` Implements MCP rust-lang/compiler-team#374. Blocked on FCP in rust-lang/compiler-team#374. r? `@lcnr` cc `@jonas-schievink`
2020-10-30Remove implicit `Continue` typeLeSeulArtichaut-1/+1
2020-10-30Use `ControlFlow::is{break,continue}`LeSeulArtichaut-2/+2
2020-10-30TypeVisitor: use `ControlFlow` in clippyLeSeulArtichaut-4/+6
2020-10-30Auto merge of #78562 - JohnTitor:rollup-otg906u, r=JohnTitorbors-21/+33
Rollup of 8 pull requests Successful merges: - #77334 (Reorder benches const variable) - #77888 (Simplify a nested bool match) - #77921 (f64: Refactor collapsible_if) - #78523 (Revert invalid `fn` return type parsing change) - #78524 (Avoid BorrowMutError with RUSTC_LOG=debug) - #78545 (Make anonymous binders start at 0) - #78554 (Improve wording of `core::ptr::drop_in_place` docs) - #78556 (Link to pass docs from NRVO module docs) Failed merges: - #78424 (Fix some more clippy warnings) r? `@ghost`
2020-10-30Rollup merge of #78545 - jackh726:anonymous, r=oli-obkYuki Okushi-16/+16
Make anonymous binders start at 0 A few changes to some test outputs, but these actually look *more* correct to me.
2020-10-30Rollup merge of #78524 - tmiasko:source-files-borrow, r=Aaron1011Yuki Okushi-1/+7
Avoid BorrowMutError with RUSTC_LOG=debug ```console $ touch empty.rs $ env RUSTC_LOG=debug rustc +stage1 --crate-type=lib empty.rs ``` Fails with a `BorrowMutError` because source map files are already borrowed while `features_query` attempts to format a log message containing a span. Release the borrow before the query to avoid the issue.
2020-10-30Rollup merge of #78523 - estebank:fix-return-type-parse-regression, r=dtolnayYuki Okushi-4/+10
Revert invalid `fn` return type parsing change Revert one of the changes in #78379. Fix #78507.
2020-10-30Add regression testkadmin-0/+60
2020-10-30Auto merge of #78393 - SNCPlay42:match-if-guard, r=tmandrybors-1/+20
Always record reference to binding in match if guards When encountering a binding from a `match` pattern in its `if` guard when computing a generator's interior types, we must always record the type of a reference to the binding because of how `if` guards are lowered to MIR. This was missed in #75213 because the binding in that test case was autorefed and we recorded that adjusted type anyway. Fixes #78366
2020-10-30Auto merge of #78432 - sexxi-goose:fix-77993-take3, r=nikomatsakisbors-0/+45
Handle type errors in closure/generator upvar_tys Fixes #77993
2020-10-30Auto merge of #78540 - RalfJung:miri, r=RalfJungbors-7/+7
update Miri Cc `@rust-lang/miri` r? `@ghost`
2020-10-29Make anonymous binders start at 0Jack Huey-16/+16
2020-10-29update MiriRalf Jung-7/+7
2020-10-29Rollup merge of #78505 - ebroto:clippyup, r=oli-obkJonas Schievink-672/+2832
Update Clippy - temporary_cstring_as_ptr deprecation In #75671 `clippy::temporary_cstr_as_ptr` was removed instead of being deprecated. This will trigger an error (unknown lint) for users that refer to that lint to e.g. allow it, instead of a more informative warning. This update should fix that for nightly users. r? @oli-obk
2020-10-29Rollup merge of #78493 - ehuss:update-cargo, r=ehussJonas Schievink-0/+0
Update cargo 8 commits in dd83ae55c871d94f060524656abab62ec40b4c40..becb4c282b8f37469efb8f5beda45a5501f9d367 2020-10-20 19:31:26 +0000 to 2020-10-28 16:41:55 +0000 - List available packages if providing `--package` with an empty value (rust-lang/cargo#8808) - Add a future-compatibility warning on allowed feature name characters. (rust-lang/cargo#8814) - New namespaced features implementation. (rust-lang/cargo#8799) - Remove redundant "For example, " (rust-lang/cargo#8810) - Document platform-specific build-dependencies (rust-lang/cargo#8809) - Remove some unused code. (rust-lang/cargo#8807) - Some minor clippy fixes. (rust-lang/cargo#8804) - Update TOML website links. (rust-lang/cargo#8803)
2020-10-29Rollup merge of #78431 - Rustin-Liu:rustin-patch-lint, r=estebankJonas Schievink-4/+4
Prefer new associated numeric consts in float error messages Fix https://github.com/rust-lang/rust/issues/78382
2020-10-29Rollup merge of #78422 - estebank:fix-78372, r=pnkfelixJonas Schievink-0/+76
Do not ICE on invalid input Fix #78372.
2020-10-29Add regression testEsteban Küber-0/+6
2020-10-29Revert invalid `fn` return type parsing changeEsteban Küber-4/+4
Fix #78507.
2020-10-29Auto merge of #78506 - cuviper:ubuntu-lts, r=pietroalbinibors-2/+4
ci: update x86_64-gnu and x86_64-gnu-debug to ubuntu:20.04 The former `ubuntu:19.10` reached EOL in July, 2020, whereas `ubuntu:20.04` is an LTS release supported until 2025. These are non-dist CI images, so the impact should be low.
2020-10-29Auto merge of #78486 - pietroalbini:manifest-artifacts, r=Mark-Simulacrumbors-22/+125
Include non-rustup artifacts in the manifest This PR fixes https://github.com/rust-lang/promote-release/issues/22 by including all the files we ship in the generated manifests, even the ones that are not installable through rustup. In practice this adds the following "artifacts": * `source-code`: the tarball containing the full source code used to build the release (`rustc-{channel}-src.tar.xz`) * `installer-msi`: the MSI installer for Windows systems (`rust-{channel}-{target}.msi`) * `installer-pkg`: the PKG installer for macOS systems (`rust-{channel}-{target}.pkg`) These files are included in a new `artifacts` table of the manifest, like so: ```toml [[artifacts.installer-msi.target.aarch64-pc-windows-msvc]] url = "https://example.com/2020-10-28/rust-nightly-aarch64-pc-windows-msvc.msi" hash-sha256 = "6b41d5b829d20834c5d93628d008ec618f8914ee79303363bd13a86fd5f305dd" [[artifacts.installer-msi.target.i686-pc-windows-gnu]] url = "https://example.com/2020-10-28/rust-nightly-i686-pc-windows-gnu.msi" hash-sha256 = "83f020de6e180c155add9fce1cea2ac6e5f744edbd6dc1581e24de8f56b2ca7a" [[artifacts.installer-msi.target.i686-pc-windows-msvc]] url = "https://example.com/2020-10-28/rust-nightly-i686-pc-windows-msvc.msi" hash-sha256 = "dbc80c24e9d5df01616c6f216114b4351f51a94218e2368b5cebe4165b270702" [[artifacts.installer-msi.target.x86_64-pc-windows-gnu]] url = "https://example.com/2020-10-28/rust-nightly-x86_64-pc-windows-gnu.msi" hash-sha256 = "8196eca3f02d72d4c8776ad4fcc72897125e2cf6404ae933e31c07e197e3c9fa" [[artifacts.installer-msi.target.x86_64-pc-windows-msvc]] url = "https://example.com/2020-10-28/rust-nightly-x86_64-pc-windows-msvc.msi" hash-sha256 = "b2e7fd6463790732fcf9c726b9448068712341943199cb40fc11d1138b8a207b" [[artifacts.installer-pkg.target.aarch64-apple-darwin]] url = "https://example.com/2020-10-28/rust-nightly-aarch64-apple-darwin.pkg" hash-sha256 = "70421c191752fb33886f8033b029e634bcc993b72308cef52a38405840e91f5c" [[artifacts.installer-pkg.target.x86_64-apple-darwin]] url = "https://example.com/2020-10-28/rust-nightly-x86_64-apple-darwin.pkg" hash-sha256 = "ebd7a5acb61e82d85e855146cc9bd856f32228ee7f40dd94c659b00614ed4f1f" [[artifacts.source-code.target."*"]] url = "https://example.com/2020-10-28/rustc-nightly-src.tar.gz" hash-sha256 = "5fcc487ee4c15c689de8ddf7daac7ff6a65c80498197b9aea58622dc2b3bca10" [[artifacts.source-code.target."*"]] url = "https://example.com/2020-10-28/rustc-nightly-src.tar.xz" hash-sha256 = "0c618ef0ec5f64da1801e9d0df6c755f6ed1a8780ec5c8ee75e55614be51d42c" ``` Each artifact can be available for multiple targets, and each target can have multiple versions of the same file (for example, a `gz`-compressed one and a `xz`-compressed one). In the future rustup might add functionality to let users retrieve the artifacts, but that's not needed to land this PR, and whether to do the implementation is up to the rustup maintainers. r? `@kinnison` cc `@Mark-Simulacrum`
2020-10-29Auto merge of #78512 - JohnTitor:rollup-a7qwjah, r=JohnTitorbors-71/+469
Rollup of 11 pull requests Successful merges: - #77213 (rustdoc options to set default theme (and other settings)) - #78224 (min_const_generics: allow ty param in repeat expr) - #78428 (MinConstGenerics UI test for invalid values for bool & char) - #78460 (Adjust turbofish help message for const generics) - #78470 (Clean up intra-doc links in `std::path`) - #78475 (fix a comment in validity check) - #78478 (Add const generics tests for supertraits + dyn traits.) - #78487 (Fix typo "compiltest") - #78491 (Inline NonZeroN::from(n)) - #78492 (Update books) - #78494 (Fix typos) Failed merges: r? `@ghost`
2020-10-29Rollup merge of #78492 - ehuss:update-books, r=ehussYuki Okushi-0/+0
Update books ## nomicon 7 commits in 6e57e64501f61873ab80cb78a07180a22751a5d6..69333eddb1de92fd17e272ce4677cc983d3bd71d 2020-09-14 11:40:23 -0400 to 2020-10-17 15:44:12 -0700 - Tweak GHA config (rust-lang-nursery/nomicon#240) - Fix link for `[T]` (rust-lang-nursery/nomicon#239) - Update casts.md (rust-lang-nursery/nomicon#232) - [WIP] Add more links (rust-lang-nursery/nomicon#180) - Data Race definition should be more precise (rust-lang-nursery/nomicon#219) - Update the diagnostic of `error[E0597]` in dropck.md (rust-lang-nursery/nomicon#157) - fix typo in Lifetimes mutable reference aliasing section (rust-lang-nursery/nomicon#225) ## reference 3 commits in 1b78182e71709169dc0f1c3acdc4541b6860e1c4..10c16caebe475d0d11bec0531b95d7697856c13c 2020-10-11 13:53:47 -0700 to 2020-10-25 20:51:26 -0700 - Add `unsafe` for `mod` and `extern`. (rust-lang-nursery/reference#898) - mention how unions interact with dropping (rust-lang-nursery/reference#897) - Add `move_ref_pattern` docs (rust-lang-nursery/reference#881) ## book 2 commits in 451a1e30f2dd137aa04e142414eafb8d05f87f84..13e1c05420bca86ecc79e4ba5b6d02de9bd53c62 2020-10-05 09:11:18 -0500 to 2020-10-20 14:57:32 -0500 - Referencing to Appendix B (rust-lang/book#2481) - Use GITHUB_PATH instead of add-path (rust-lang/book#2477) ## rust-by-example 2 commits in 152475937a8d8a1f508d8eeb57db79139bc803d9..99eafee0cb14e6ec641bf02a69d7b30f6058349a 2020-10-09 09:29:50 -0300 to 2020-10-21 14:21:55 -0300 - Formatting footer items. (rust-lang/rust-by-example#1385) - Add partial moves example for `move_ref_pattern` stabilization (rust-lang/rust-by-example#1377) ## edition-guide 3 commits in 81f16863014de60b53de401d71ff904d163ee030..7bc9b7a5e800f79df62947cb7d566fd2fbaf19fe 2020-08-27 13:56:31 -0700 to 2020-10-23 18:31:23 -0500 - A few small updates. (rust-lang/edition-guide#221) - Clarify the limitation of ? in main and tests (rust-lang/edition-guide#219) - Update deprecated GitHub Actions commands. (rust-lang/edition-guide#220)
2020-10-29Rollup merge of #78487 - rust-lang:GuillaumeGomez-patch-1, r=steveklabnikYuki Okushi-1/+1
Fix typo "compiltest" Part of #70898.
2020-10-29Rollup merge of #78478 - hameerabbasi:const-generics-supertraits, r=lcnrYuki Okushi-0/+85
Add const generics tests for supertraits + dyn traits. Partially addresses #78433
2020-10-29Rollup merge of #78460 - varkor:turbofish-string-generic, r=lcnrYuki Okushi-25/+25
Adjust turbofish help message for const generics Types are no longer special. (This message arguably only makes sense with `min_const_generics` or more, but we'll be there soon.) r? @lcnr
2020-10-29Rollup merge of #78428 - JulianKnodt:invalid_patterns, r=lcnrYuki Okushi-0/+105
MinConstGenerics UI test for invalid values for bool & char This adds a test for `feature(min_const_generics)` with some invalid values for bools and chars and ensures that they do not ICE and error with understandable messages. r? @lcnr
2020-10-29Rollup merge of #78224 - lcnr:repeat-expr, r=varkorYuki Okushi-20/+144
min_const_generics: allow ty param in repeat expr implements https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/repeat.20expressions Even with `min_const_generics` active, now keeps resulting in future compat warnings instead of hard errors. Const parameters, for example `[0; N + 1]`, still result in hard errors during resolve. ```rust #![allow(dead_code)] fn foo<T>() { [0; std::mem::size_of::<*mut T>()]; } struct Foo<T>(T); impl<T> Foo<T> { const ASSOC: usize = 4; fn test() { [0; Self::ASSOC]; } } ``` r? @varkor cc @petrochenkov
2020-10-29Rollup merge of #77213 - ijackson:wip-rustdoc-settings, r=jyn514,GuillaumeGomezYuki Okushi-25/+109
rustdoc options to set default theme (and other settings) Hi. This is the MR I promised in #77024 It is a little more general than I envisaged there. Once I had found the settings-handling machinery it seemed foolish to add this feature just for the theme. Closes #77024
2020-10-29Auto merge of #78430 - Nadrieril:taking-constructors-seriously2, r=varkorbors-6/+6
Clarify main code paths in exhaustiveness checking This PR massively clarifies the main code paths of exhaustiveness checking, by using the `Constructor` enum to a fuller extent. I've been itching to write it for more than a year, but the complexity of matching consts had prevented me. Behold a massive simplification :D. This in particular removes a fair amount of duplication between various parts, localizes code into methods of relevant types when applicable, makes some implicit assumptions explicit, and overall improves legibility a lot (or so I hope). Additionally, after my changes undoing #76918 turned out to be a noticeable perf gain. As usual I tried my best to make the commits self-contained and easy to follow. I've also tried to keep the code well-commented, but I tend to forget how complex this file is; I'm happy to clarify things as needed. My measurements show good perf improvements on the two match-heavy benchmarks (-18.0% on `unicode_normalization-check`! :D); I'd like a perf run to check the overall impact. r? `@varkor` `@rustbot` modify labels: +A-exhaustiveness-checking
2020-10-28ci: update x86_64-gnu and x86_64-gnu-debug to ubuntu:20.04Josh Stone-2/+4
The former `ubuntu:19.10` reached EOL in July, 2020, whereas `ubuntu:20.04` is an LTS release supported until 2025. These are non-dist CI images, so the impact should be low.
2020-10-29Test building of libraries with rustc logging enabledTomasz Miąsko-1/+2
2020-10-29Add support for rustc-env and unset-rustc-env for aux-buildsTomasz Miąsko-0/+5
2020-10-28Merge commit '645ef505da378b6f810b1567806d1bcc2856395f' into clippyupEduardo Broto-672/+2832
2020-10-28rustdoc: Use Vec::into_iter() rather than drain()Ian Jackson-2/+2
This allows removing a `mut` which is nicer. Suggested-by: @jyn514 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-28Add a comment about non-panicking of splitn().next().unwrap()Ian Jackson-0/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-28rustdoc: Fix some nitsIan Jackson-4/+4
* Remove a needless comma in the Rust code * Replace double spaces after full stops with single spaces Requested-by: @GuillaumeGomez Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-28Update cargoEric Huss-0/+0
2020-10-28rustdoc: Provide a --default-theme THEME optionIan Jackson-0/+21
This is a fairly simple special case of --default-eetting. We must set both "theme" and "use-system-theme". Providing it separately enables us to document a way to set the theme without expoosing the individual settings keywords, which are quite complex. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-28rustdoc: Provide a general --default-setting SETTING[=VALUE] optionIan Jackson-2/+26
We just plumb through what the user tells us. This is flagged as unstable, mostly because I don't understand the compatibility rules that rustdoc obeys for local storage data, and how error handling of invalid data works. We collect() the needed HashMap from Vec of Vecs of (key, value) pairs, so that there is a nice place to add new more-specific options. It would have been possible to use Extend::extend but doing it this way ensures that all the used inputs are (and will stay) right next to each other. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-28rustdoc: Provide a way to set the default settings from Rust codeIan Jackson-2/+39
rustdoc has various user-configurable preferences. These are recorded in web Local Storage (where available). But we want to provide a way to configure the default default, including for when web storage is not available. getSettingValue is the function responsible for looking up these settings. Here we make it fall back some in-DOM data, which ultimately comes from RenderOptions.default_settings. Using HTML data atrtributes is fairly convenient here, dsspite the need to transform between snake and kebab case to avoid the DOM converting kebab case to camel case (!) We cache the element and dataset lookup in a global variable, to ensure that getSettingValue remains fast. The DOM representation has to be in an element which precedes the inclusion of storage.js. That means it has to be in the <head> and we should not use an empty <div> as the container (although most browsers will accept that). An empty <script> element provides a convenient and harmless container object. <meta> would be another possibility but runs a greater risk of having unwanted behaviours on weird browsers. We trust the RenderOptions not to contain unhelpful setting names, which don't fit nicely into an HTML attribute. It's awkward to quote dataset keys. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-28Update booksEric Huss-0/+0
2020-10-28rustdoc: js: Use getSettingValue for all rustdoc-* valuesIan Jackson-24/+25
Currently, storage.js and main.js have many open-coded calls to getCurrentValue for "rustdoc-" values, but these are settings and should be handled by getSettingValue. So make getSettingValue part of storage.js (where everyone can call it) and use it everywhere. No functional change yet. We are going to make getSettingValue do something more sophisticated in a moment. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2020-10-28Auto merge of #78409 - pietroalbini:build-manifest-checksum-cache, ↵bors-50/+106
r=Mark-Simulacrum Add checksums cache to build-manifest During the release process we're currently calculating the SHA256 of each file three times: 1. In `build-manifest`, to fill the `hash = "f00"` keys of the manifests. 2. In `promote-release`, to generate the `.sha256` files. 3. In `promote-release`, to generate the `.asc` GPG signatures. Calculations 1. and 2. could be merged into a single one if there was a way for `build-manifest` to pass the checksums it generated over to `promote-release`. Unfortunately calculation 3. can't be merged as GPG requires extra metadata to be hashed. This PR adds support for merging 1. and 2. by creating the `BUILD_MANIFEST_CHECKSUM_CACHE` environment variable, which points to a JSON file storing a cache of all the calculated checksums. `build-manifest` will load it at startup and avoid generating existing checksums, and it will dump its internal checksums cache into it when it exits successfully. This PR also allows to run `build-manifest` multiple times without the need to wait for checksums to be calculated in the following invocations. The speedup will allow to work torwards a fix for https://github.com/rust-lang/promote-release/issues/15 without impacting the release process duration nor our storage costs. This PR can be reviewed commit-by-commit. r? `@Mark-Simulacrum`
2020-10-28Fix typo "compiltest"Guillaume Gomez-1/+1
2020-10-28build-manifest: include artifacts in a new tablePietro Albini-22/+125
This commit adds to the generated manifest all files we ship that are not rustup components, namely: * Source code tarballs (rustc-{channel}-src.tar.xz) * Windows installers (rust-{channel}-{target}.msi) * macOS installers (rust-{channel}-{target}.pkg) Those files are included in a new "artifacts" table of the manifest, to avoid interfering with existing rustup installations.
2020-10-28Assert in every case.Hameer Abbasi-19/+22
2020-10-28Extend test to cover dyn methods/functions.Hameer Abbasi-20/+44