about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-02-01Box the biggest ast::ItemKind variantsDániel Buga-54/+94
2021-02-01Auto merge of #81591 - RalfJung:miri, r=RalfJungbors-7/+9
update Miri Fixes https://github.com/rust-lang/rust/issues/81551 Cc `@rust-lang/miri` r? `@ghost`
2021-01-31Rollup merge of #81566 - osa1:issue71202, r=jonas-schievinkJonas Schievink-0/+33
Add a test for #71202 Closes #71202 --- Note that the test normally generates this warning: ``` warning: cannot use constants which depend on generic parameters in types --> test.rs:10:5 | 10 | / const ITEM_IS_COPY: [(); 1 - { 11 | | trait NotCopy { 12 | | const VALUE: bool = false; 13 | | } ... | 26 | | <IsCopy<T>>::VALUE 27 | | } as usize] = []; | |_____________________^ | = note: `#[warn(const_evaluatable_unchecked)]` on by default = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #76200 <https://github.com/rust-lang/rust/issues/76200> ``` I added `allow(const_evaluatable_unchecked)`, but maybe we just don't want to add a test for this as the program is not really valid?
2021-01-31Rollup merge of #81480 - b-naber:nested_fields_suggestion, r=estebankJonas Schievink-0/+165
Add suggestion for nested fields Closes https://github.com/rust-lang/rust/issues/81220 r? ```@estebank```
2021-01-31Rollup merge of #80404 - JulianKnodt:arr_ref, r=oli-obkJonas Schievink-95/+52
Remove const_in_array_repeat Fixes #80371. Fixes #81315. Fixes #80767. Fixes #75682. I thought there might be some issue with `Repeats(_, 0)`, but if you increase the items in the array it still ICEs. I'm not sure if this is the best fix but it does fix the given issue.
2021-01-31Rollup merge of #80092 - sexxi-goose:restrict_precision, r=nikomatsakisJonas Schievink-0/+964
2229: Fix issues with move closures and mutability This PR fixes two issues when feature `capture_disjoint_fields` is used. 1. Can't mutate using a mutable reference 2. Move closures try to move value out through a reference. To do so, we 1. Compute the mutability of the capture and store it as part of the `CapturedPlace` that is written in TypeckResults 2. Restrict capture precision. Note this is temporary for now, to allow the feature to be used with move closures and ByValue captures and might change depending on discussions with the lang team. - No Derefs are captured for ByValue captures, since that will result in value behind a reference getting moved. - No projections are applied to raw pointers since these require unsafe blocks. We capture them completely. r? `````@nikomatsakis`````
2021-01-31update MiriRalf Jung-7/+9
2021-01-31Auto merge of #81578 - jonas-schievink:rollup-yhiyowl, r=jonas-schievinkbors-22/+96
Rollup of 18 pull requests Successful merges: - #78044 (Implement io::Seek for io::Empty) - #79285 (Stabilize Arc::{increment,decrement}_strong_count) - #80053 (stabilise `cargo test -- --include-ignored`) - #80279 (Implement missing `AsMut<str>` for `str`) - #80470 (Stabilize by-value `[T; N]` iterator `core::array::IntoIter`) - #80945 (Add Box::downcast() for dyn Any + Send + Sync) - #81048 (Stabilize `core::slice::fill_with`) - #81198 (Remove requirement that forces symmetric and transitive PartialEq impls to exist) - #81422 (Account for existing `_` field pattern when suggesting `..`) - #81472 (Clone entire `TokenCursor` when collecting tokens) - #81484 (Optimize decimal formatting of 128-bit integers) - #81491 (Balance sidebar `Deref` cycle check with main content) - #81509 (Add a regression test for ICE of bad_placeholder_type) - #81547 (Edit rustc_typeck top-level docs) - #81550 (Replace predecessor with range in collections documentation) - #81558 (Fix ascii art text wrapping in mobile) - #81562 (Clarify that InPlaceIterable guarantees extend to all advancing iterator methods.) - #81563 (Improve docblock readability on small screen) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-01-31Rollup merge of #81563 - pickfire:patch-6, r=GuillaumeGomezJonas Schievink-0/+4
Improve docblock readability on small screen Before ![image](https://user-images.githubusercontent.com/4687791/106363174-f77bdf00-6361-11eb-898f-d480b8460ab3.png) After ![image](https://user-images.githubusercontent.com/4687791/106363259-6bb68280-6362-11eb-85a1-ef9262681dd7.png) Too much space is wasted on the left side. I wanted to make that 0 but it breaks some part with error symbols. 0 ![image](https://user-images.githubusercontent.com/4687791/106363287-90aaf580-6362-11eb-88c1-62a8313988a7.png) After ![image](https://user-images.githubusercontent.com/4687791/106363276-825cd980-6362-11eb-86eb-6f4611b4ab99.png)
2021-01-31Rollup merge of #81558 - pickfire:patch-5, r=GuillaumeGomezJonas Schievink-1/+2
Fix ascii art text wrapping in mobile Fix #81377 Before ![image](https://user-images.githubusercontent.com/4687791/106362405-a1a53800-635d-11eb-87b9-2f40bbd023bf.png) ![image](https://user-images.githubusercontent.com/4687791/106362410-aa960980-635d-11eb-96ee-979251b213a3.png) ![image](https://user-images.githubusercontent.com/4687791/106362562-80911700-635e-11eb-97ee-b19a6ea2fc6d.png) After ![image](https://user-images.githubusercontent.com/4687791/106362428-b4b80800-635d-11eb-8d5b-e4f51f5501ee.png) ![image](https://user-images.githubusercontent.com/4687791/106362433-bbdf1600-635d-11eb-96af-7043c74b3a0a.png) ![image](https://user-images.githubusercontent.com/4687791/106362570-8f77c980-635e-11eb-928d-ef1d26c13136.png) Note the second image is scrolled to the back (right), I added some padding for the text block (not the code block) to make it more comfortable to read since the last character is stuck to the last character.
2021-01-31Rollup merge of #81509 - 0yoyoyo:fix-issue-72685-ice-drop-in-place, r=estebankJonas Schievink-10/+22
Add a regression test for ICE of bad_placeholder_type Add a regression test for #72685. Check the error message is output instead of ICE.
2021-01-31Rollup merge of #81491 - jryans:rustdoc-deref-ice-81395, r=GuillaumeGomezJonas Schievink-7/+26
Balance sidebar `Deref` cycle check with main content The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense that the main content code path checks for cycles _before_ descending, while the sidebar checks _after_. Checking _before_ is correct, so this changes the sidebar path to match the main content path. Fixes #81395 r? ```@GuillaumeGomez```
2021-01-31Rollup merge of #81472 - Aaron1011:fix/revert-cursor-clone, r=petrochenkovJonas Schievink-0/+40
Clone entire `TokenCursor` when collecting tokens Reverts PR #80830 Fixes taiki-e/pin-project#312 We can have an arbitrary number of `None`-delimited group frames pushed on the stack due to proc-macro invocations, which can legally be exited. Attempting to account for this would add a lot of complexity for a tiny performance gain, so let's just use the original strategy.
2021-01-31Rollup merge of #81422 - estebank:dotdot_sugg, r=davidtwcoJonas Schievink-2/+2
Account for existing `_` field pattern when suggesting `..` Follow up to #80017.
2021-01-31Rollup merge of #80470 - SimonSapin:array-intoiter-type, r=m-ou-seJonas Schievink-2/+0
Stabilize by-value `[T; N]` iterator `core::array::IntoIter` Tracking issue: https://github.com/rust-lang/rust/issues/65798 This is unblocked now that `min_const_generics` has been stabilized in https://github.com/rust-lang/rust/pull/79135. This PR does *not* include the corresponding `IntoIterator` impl, which is https://github.com/rust-lang/rust/pull/65819. Instead, an iterator can be constructed through the `new` method. `new` would become unnecessary when `IntoIterator` is implemented and might be deprecated then, although it will stay stable.
2021-01-30Auto merge of #81560 - flip1995:clippyup, r=Manishearthbors-453/+6060
Update Clippy r? `@Manishearth` Biweekly Clippy update (2 days late)
2021-01-30Remove const_in_array_rep_exprkadmin-101/+20
2021-01-30add suggestion for nested fieldsb-naber-0/+165
2021-01-30Add a test for #71202Ömer Sinan Ağacan-0/+33
Closes #71202
2021-01-31Remove extra trailing spacesIvan Tham-1/+1
2021-01-31Fix docblock short code missing end whitespacesIvan Tham-0/+3
2021-01-31Improve docblock readability on small screenIvan Tham-0/+4
2021-01-30Merge commit '95c0459217d1661edfa794c8bb122452b92fb485' into clippyupflip1995-453/+6060
2021-01-31Fix ascii art text wrapping in mobileIvan Tham-3/+1
Fix #81377
2021-01-30Revert "Auto merge of #81489 - nikic:x86-64-dist-update, r=Mark-Simulacrum"Nikita Popov-19/+12
This reverts commit cb6787ae82d388045cdf6b5dc73787d828d91feb, reversing changes made to 0248c6f178ab3a4d2ec702b7d418ff8375ab0515.
2021-01-30Balance sidebar `Deref` cycle check with main contentJ. Ryan Stinnett-7/+26
The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense that the main content code path checks for cycles _before_ descending, while the sidebar checks _after_. Checking _before_ is correct, so this changes the sidebar path to match the main content path.
2021-01-30Auto merge of #81545 - JohnTitor:rollup-zlt3tn6, r=JohnTitorbors-36/+253
Rollup of 16 pull requests Successful merges: - #79023 (Add `core::stream::Stream`) - #80562 (Consider Scalar to be a bool only if its unsigned) - #80886 (Stabilize raw ref macros) - #80959 (Stabilize `unsigned_abs`) - #81291 (Support FRU pattern with `[feature(capture_disjoint_fields)]`) - #81409 (Slight simplification of chars().count()) - #81468 (cfg(version): treat nightlies as complete) - #81473 (Warn write-only fields) - #81495 (rustdoc: Remove unnecessary optional) - #81499 (Updated Vec::splice documentation) - #81501 (update rustfmt to v1.4.34) - #81505 (`fn cold_path` doesn't need to be pub) - #81512 (Add missing variants in match binding) - #81515 (Fix typo in pat.rs) - #81519 (Don't print error output from rustup when detecting default build triple) - #81520 (Don't clone LLVM submodule when download-ci-llvm is set) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-01-30Add a regression test0yoyoyo-10/+22
2021-01-30Auto merge of #81521 - nikic:update-dist-various, r=Mark-Simulacrumbors-22/+20
Update dist-various to Ubuntu 20.04 This updates the dist-various-1 and dist-various-2 images to Ubuntu 20.04. This requires some adjustments: * `DEBIAN_FRONTEND=noninteractive` required for apt install. * `team-gcc-argm-embedded` PPA does not support focal. However, we can simply use the distro-provided `gcc-arm-none-eabi`. Per the comment, the PPA was only used to get a newer version. * rumprun has to be updated to avoid a linker error. * We need to build rumrun with `NOGCCERROR`, which disables use of `-Werror` and allows building with a newer compiler. * We need to install `libtinfo5`, which appears to be a dependency of the clang used during the fuchsia build. * We need to switch to `g++-8` rather than `g++-7`, as at least `g++-7-arm-linux-gnueabi` is not available on focal. * We need to upgrade to GCC 6.5 for the Solaris build, as GCC 6.4 does not support the newer libisl version. r? `@Mark-Simulacrum`
2021-01-30Rollup merge of #81520 - jyn514:rustc2, r=Mark-SimulacrumYuki Okushi-1/+1
Don't clone LLVM submodule when download-ci-llvm is set Previously, `downloading_llvm` would check `self.build` while it was still an empty string, and think it was always false. This fixes the check. This addresses the worst part of https://github.com/rust-lang/rust/issues/76653. There are still some large submodules being downloaded (in particular, `rustc-by-example` is 146 MB, and all the submodules combined are 311 MB), but this is a lot better than the whopping 1.4 GB before.
2021-01-30Rollup merge of #81519 - jyn514:rustup-toolchain, r=Mark-SimulacrumYuki Okushi-1/+2
Don't print error output from rustup when detecting default build triple Before, it could print this error if no toolchain was configured: ``` error: no default toolchain configured error: backtrace: error: stack backtrace: 0: error_chain::backtrace::imp::InternalBacktrace::new 1: rustup::config::Cfg::toolchain_for_dir 2: rustup_init::run_rustup_inner 3: rustup_init::main 4: std::rt::lang_start::{{closure}} 5: main 6: __libc_start_main 7: _start ```
2021-01-30Rollup merge of #81512 - GuillaumeGomez:cleanup-fixme-rustdoc, r=bugadaniYuki Okushi-2/+1
Add missing variants in match binding cc `````@bugadani````` `````@CraftSpider````` r? `````@camelid`````
2021-01-30Rollup merge of #81501 - calebcartwright:update-rustfmt, r=sanxiynYuki Okushi-5/+5
update rustfmt to v1.4.34 Short summary: Various formatting fixes (several const generic related) and introduction of `imports_granularity` config option Long summary copied from changelog: #### Changed - `merge_imports` configuration has been deprecated in favor of the new `imports_granularity` option. Any existing usage of `merge_imports` will be automatically mapped to the corresponding value on `imports_granularity` with a warning message printed to encourage users to update their config files. #### Added - New `imports_granularity` option has been added which succeeds `merge_imports`. This new option supports several additional variants which allow users to merge imports at different levels (crate or module), and even flatten imports to have a single use statement per item. ([PR rust-lang/rustfmt#4634](https://github.com/rust-lang/rustfmt/pull/4634), [PR rust-lang/rustfmt#4639](https://github.com/rust-lang/rustfmt/pull/4639)) See the section on the configuration site for more information https://rust-lang.github.io/rustfmt/?version=v1.4.33&search=#imports_granularity #### Fixed - Fix erroneous removal of `const` keyword on const trait impl ([rust-lang/rustfmt#4084](https://github.com/rust-lang/rustfmt/issues/4084)) - Fix incorrect span usage wit const generics in supertraits ([rust-lang/rustfmt#4204](https://github.com/rust-lang/rustfmt/issues/4204)) - Use correct span for const generic params ([rust-lang/rustfmt#4263](https://github.com/rust-lang/rustfmt/issues/4263)) - Correct span on const generics to include type bounds ([rust-lang/rustfmt#4310](https://github.com/rust-lang/rustfmt/issues/4310)) - Idempotence issue on blocks containing only empty statements ([rust-lang/rustfmt#4627](https://github.com/rust-lang/rustfmt/issues/4627) and [#3868](https://github.com/rust-lang/rustfmt/issues/3868)) - Fix issue with semicolon placement on required functions that have a trailing comment that ends in a line-style comment before the semicolon ([rust-lang/rustfmt#4646](https://github.com/rust-lang/rustfmt/issues/4646)) - Avoid shared interned cfg_if symbol since rustfmt can re-initialize the rustc_ast globals on multiple inputs ([rust-lang/rustfmt#4656](https://github.com/rust-lang/rustfmt/issues/4656)) - Don't insert trailing comma on (base-less) rest in struct literals within macros ([rust-lang/rustfmt#4675](https://github.com/rust-lang/rustfmt/issues/4675))
2021-01-30Rollup merge of #81495 - camelid:rustdoc-output_format-optional, ↵Yuki Okushi-13/+21
r=GuillaumeGomez rustdoc: Remove unnecessary optional Previously, the HTML output format was represented by both `Some(OutputFormat::Html)` and `None` so there's no need to have an optional. Instead, `OutputFormat::Html` is explicitly the default and we no longer have a "tri-state enum". r? `````@GuillaumeGomez`````
2021-01-30Rollup merge of #81473 - sanxiyn:write-only-field, r=oli-obkYuki Okushi-0/+47
Warn write-only fields cc `@Boscop's` example in #49256.
2021-01-30Rollup merge of #81468 - est31:cfg_version, r=petrochenkovYuki Okushi-0/+94
cfg(version): treat nightlies as complete This PR makes cfg(version) treat the nightlies for version 1.n.0 as 1.n.0, even though that nightly version might not have all stabilizations and features of the released 1.n.0. This is done for greater convenience for people who want to test a newly stabilized feature on nightly, or in other words, give newly stabilized features as many eyeballs as possible. For users who wish to pin nightlies, this commit adds a -Z assume-incomplete-release option that they can enable if they run into any issues due to this change. Implements the suggestion in https://github.com/rust-lang/rust/issues/64796#issuecomment-640851454
2021-01-30Rollup merge of #81291 - ↵Yuki Okushi-0/+57
sexxi-goose:fix-struct-update-functional-record-update-syntax-error, r=nikomatsakis Support FRU pattern with `[feature(capture_disjoint_fields)]` In case of a functional record update syntax for creating a structure, `ExprUseVisitor` to only detect the precise use of some of the field in the `..x` part of the syntax. However, when we start building MIR, we 1. First, build the place for `x` 2. and then, add precise field projections so that only some parts of `x` end up getting read. When `capture_disjoint_fields` is enabled, and FRU is used within a closure `x` won't be completely captured, and therefore the first step will fail. This PR updates `mir_build` to create a place builder in the first step and then create place from the builder only after applying the field projection. Closes https://github.com/rust-lang/project-rfc-2229/issues/32 r? ``````@nikomatsakis``````
2021-01-30Rollup merge of #80886 - RalfJung:stable-raw-ref-macros, r=m-ou-seYuki Okushi-14/+12
Stabilize raw ref macros This stabilizes `raw_ref_macros` (https://github.com/rust-lang/rust/issues/73394), which is possible now that https://github.com/rust-lang/rust/issues/74355 is fixed. However, as I already said in https://github.com/rust-lang/rust/issues/73394#issuecomment-751342185, I am not particularly happy with the current names of the macros. So I propose we also change them, which means I am proposing to stabilize the following in `core::ptr`: ```rust pub macro const_addr_of($e:expr) { &raw const $e } pub macro mut_addr_of($e:expr) { &raw mut $e } ``` The macro name change means we need another round of FCP. Cc `````@rust-lang/libs````` Fixes #73394
2021-01-30Rollup merge of #80562 - nagisa:nagisa/bools-are-unsigned, r=eddybYuki Okushi-0/+13
Consider Scalar to be a bool only if its unsigned This seems right, given that conceptually bools are unsigned, but the implications of this change may have more action at distance that I'm not sure how to exhaustively consider. For instance there are a number of cases where code attaches range metadata if `scalar.is_bool()` holds. Supposedly it would no longer be attached to the `repr(i8)` enums? Though I'm not sure why booleans are being special-cased here in the first place... Fixes #80556 cc `@eddyb`
2021-01-30Auto merge of #81489 - nikic:x86-64-dist-update, r=Mark-Simulacrumbors-12/+19
Update Python and Clang on x86 dist images LLVM 12 no longer builds with Python 2, so install Python 3 in preparation for the upgrade (#81451). However, Clang 10 does not build with Python 3, so we need update to Clang 11 as well, which supports both. Unfortunately, doing so results in errors while linking the libLLVM.so into other binaries: > __morestack: invalid needed version 2 This is fixed by using LLD instead. Possibly this is due to a binutils linker bug, but updating to the latest binutils version does not fix it. r? `@Mark-Simulacrum` cc `@cuviper`
2021-01-30Auto merge of #81398 - bugadani:rustdoc-perf, r=GuillaumeGomezbors-512/+520
rustdoc tweaking * Reuse memory * simplify `next_def_id`, avoid multiple hashing and unnecessary lookups * remove `all_fake_def_ids`, use the global map instead (probably not a good step toward parallelization, though...) * convert `add_deref_target` to iterative implementation * use `ArrayVec` where we know the max number of elements * minor touchups here and there * avoid building temporary vectors that get appended to other vectors At most places I may or may not be doing the compiler's job is this PR.
2021-01-30rustdoc tweakingbors-512/+520
* Reuse memory * simplify `next_def_id`, avoid multiple hashing and unnecessary lookups * remove `all_fake_def_ids`, use the global map instead (probably not a good step toward parallelization, though...) * convert `add_deref_target` to iterative implementation * use `ArrayVec` where we know the max number of elements * minor touchups here and there * avoid building temporary vectors that get appended to other vectors At most places I may or may not be doing the compiler's job is this PR.
2021-01-30Consider Scalar to be a bool only if its unsignedSimonas Kazlauskas-0/+13
This seems right, given that conceptually bools are unsigned, but the implications of this change may have more action at distance that I'm not sure how to exhaustively consider. For instance there are a number of cases where code attaches range metadata if `scalar.is_bool()` holds. Supposedly it would no longer be attached to the `repr(i8)` enums? Though I'm not sure why booleans are being special-cased here in the first place... Fixes #80556
2021-01-29update MiriRalf Jung-7/+7
2021-01-29Fix incorrect use mut diagnosticsAman Arora-37/+70
2021-01-29Fix unused 'mut' warning for capture's root variableAman Arora-17/+46
2021-01-29Test for restricting capture precisionAman Arora-0/+657
2021-01-29Test cases for handling mutable referencesAman Arora-0/+245
2021-01-29Update dist-various to Ubuntu 20.04Nikita Popov-22/+20
This updates the dist-various-1 and dist-various-2 images to Ubuntu 20.04. This requires some adjustments: * `DEBIAN_FRONTEND=noninteractive` required for apt install. * `team-gcc-argm-embedded` PPA does not support focal. However, we can simply use the distro-provided `gcc-arm-none-eabi`. Per the comment, the PPA was only used to get a newer version. * rumprun has to be updated to avoid a linker error. * We need to build rumrun with `NOGCCERROR`, which disables use of `-Werror` and allows building with a newer compiler. * We need to install `libtinfo5`, which appears to be a dependency of the clang used during the fuchsia build. * We need to switch to `g++-8` rather than `g++-7`, as at least `g++-7-arm-linux-gnueabi` is not available on focal. * We need to upgrade to GCC 6.5 for the Solaris build, as GCC 6.4 does not support the newer libisl version.
2021-01-29Don't clone LLVM submodule when download-ci-llvm is setJoshua Nelson-1/+1
Previously, `downloading_llvm` would check `self.build` while it was still an empty string, and think it was always false. This fixes the check.