about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2020-10-23Account for possible boxable `impl Future` in semicolon removal suggestionsEsteban Küber-32/+152
2020-10-23Suggest semicolon removal on prior match armEsteban Küber-1/+93
2020-10-23Tweak "use `.await`" suggestionEsteban Küber-53/+55
2020-10-23Auto merge of #78270 - JohnTitor:rollup-bldrjh5, r=JohnTitorbors-110/+522
Rollup of 17 pull requests Successful merges: - #77268 (Link to "Contributing to Rust" rather than "Getting Started".) - #77339 (Implement TryFrom between NonZero types.) - #77488 (Mark `repr128` as `incomplete_features`) - #77890 (Fixing escaping to ensure generation of welformed json.) - #77918 (Cleanup network tests) - #77920 (Avoid extraneous space between visibility kw and ident for statics) - #77969 (Doc formating consistency between slice sort and sort_unstable, and big O notation consistency) - #78098 (Clean up and improve some docs) - #78116 (Make inline const work in range patterns) - #78153 (Sync LLVM submodule if it has been initialized) - #78163 (Clean up lib docs) - #78169 (Update cargo) - #78231 (Make closures inherit the parent function's target features) - #78235 (Explain where the closure return type was inferred) - #78255 (Reduce diagram mess in 'match arms have incompatible types' error) - #78263 (Add regression test of issue-77668) - #78265 (Add some inference-related regression tests about incorrect diagnostics) Failed merges: r? `@ghost`
2020-10-23Rollup merge of #78265 - JohnTitor:type-iference-diag-test, r=lcnrYuki Okushi-0/+78
Add some inference-related regression tests about incorrect diagnostics Closes #71732 Closes #72616
2020-10-23Rollup merge of #78263 - JohnTitor:mir-opt-ice-test, r=lcnrYuki Okushi-0/+4
Add regression test of issue-77668 Closes #77668
2020-10-23Rollup merge of #78255 - dtolnay:match, r=lcnrYuki Okushi-15/+53
Reduce diagram mess in 'match arms have incompatible types' error I noticed this wild diagram in https://twitter.com/a_hoverbear/status/1318960787105353728 which I think does not benefit from the big outer vertical span. This PR shrinks the outer span to cover just the `match` keyword and scrutinee expression *if* at least one of the highlighted match arms involved in the error is multiline. **Before:** <pre> <b>error[E0308]: `match` arms have incompatible types</b> <b>--&gt;</b> src/topology/builder.rs:141:35 <b>|</b> <b>120 |</b> let transform = match transform { <b>| _________________________-</b> <b>121 | |</b> Transform::Function(t) =&gt; { <b>| _|_______________________________________-</b> <b>122 | | |</b> filter_event_type(input_rx, input_type).compat().flat_map(|v| { <b>123 | | |</b> futures::stream::iter(match v { <b>124 | | |</b> Err(e) =&gt; { <b>... | |</b> <b>139 | | |</b> .compat(); <b>140 | | |</b> } <b>| |_|_____________- this is found to be of type `()`</b> <b>141 | |</b> Transform::Task(t) =&gt; t <b>| _|___________________________________^</b> <b>142 | | |</b> .transform(filter_event_type(input_rx, input_type)) <b>143 | | |</b> .forward(output) <b>144 | | |</b> .map(|_| debug!("Finished")) <b>145 | | |</b> .compat(), <b>| |_|_________________________^ expected `()`, found struct `futures::compat::Compat01As03`</b> <b>146 | |</b> }; <b>| |_________- `match` arms have incompatible types</b> <b>|</b> <b>= note:</b> expected type `<b>()</b>` found struct `<b>futures::compat::Compat01As03&lt;futures::Map&lt;futures::stream::Forward&lt;std::boxed::Box&lt;dyn futures::Stream&lt;Error = (), Item = event::Event&gt; + std::marker::Send&gt;, topology::fanout::Fanout&gt;, [closure@src/topology/builder.rs:144:22: 144:44]&gt;&gt;</b>` </pre> **After:** <pre> <b>error[E0308]: `match` arms have incompatible types</b> <b>--&gt;</b> src/topology/builder.rs:141:35 <b>|</b> <b>120 |</b> let transform = match transform { <b>| --------------- `match` arms have incompatible types</b> <b>121 |</b> Transform::Function(t) =&gt; { <b>| _________________________________________-</b> <b>122 | |</b> filter_event_type(input_rx, input_type).compat().flat_map(|v| { <b>123 | |</b> futures::stream::iter(match v { <b>124 | |</b> Err(e) =&gt; { <b>... |</b> <b>139 | |</b> .compat(); <b>140 | |</b> } <b>| |_______________- this is found to be of type `()`</b> <b>141 |</b> Transform::Task(t) =&gt; t <b>| _____________________________________^</b> <b>142 | |</b> .transform(filter_event_type(input_rx, input_type)) <b>143 | |</b> .forward(output) <b>144 | |</b> .map(|_| debug!("Finished")) <b>145 | |</b> .compat(), <b>| |___________________________^ expected `()`, found struct `futures::compat::Compat01As03`</b> <b>|</b> <b>= note:</b> expected type `<b>()</b>` found struct `<b>futures::compat::Compat01As03&lt;futures::Map&lt;futures::stream::Forward&lt;std::boxed::Box&lt;dyn futures::Stream&lt;Error = (), Item = event::Event&gt; + std::marker::Send&gt;, topology::fanout::Fanout&gt;, [closure@src/topology/builder.rs:144:22: 144:44]&gt;&gt;</b>` </pre> FYI @Hoverbear
2020-10-23Rollup merge of #78235 - Aaron1011:closure-ret-infer, r=varkorYuki Okushi-0/+65
Explain where the closure return type was inferred Fixes #78193
2020-10-23Rollup merge of #78231 - LeSeulArtichaut:closure-target_feature, r=nikomatsakisYuki Okushi-1/+27
Make closures inherit the parent function's target features r? @ghost Closes #73631
2020-10-23Rollup merge of #78169 - ehuss:update-cargo, r=ehussYuki Okushi-1/+14
Update cargo 3 commits in 79b397d72c557eb6444a2ba0dc00a211a226a35a..dd83ae55c871d94f060524656abab62ec40b4c40 2020-10-15 14:41:21 +0000 to 2020-10-20 19:31:26 +0000 - Support glob patterns for package/target selection (rust-lang/cargo#8752) - Update env_logger requirement from 0.7.0 to 0.8.1 (rust-lang/cargo#8795) - Fix man page links inside `option` blocks. (rust-lang/cargo#8793)
2020-10-23Rollup merge of #78163 - camelid:fixup-lib-docs, r=m-ou-seYuki Okushi-9/+10
Clean up lib docs Cherry-picked out of #78094.
2020-10-23Rollup merge of #78153 - est31:downloaded_llvm_maybe_sync, r=Mark-SimulacrumYuki Okushi-1/+6
Sync LLVM submodule if it has been initialized Since having enabled the download-ci-llvm option, and having rebased on top of #76864, I've noticed that I had to update the llvm-project submodule manually if it was checked out. Orignally, the submodule update logic was introduced to reduce the friction for contributors to manage the submodules, or in other words, to prevent getting PRs that have unwanted submodule rollbacks because the contributors didn't run git submodule update. This commit adds logic to ensure there is no inadvertent LLVM submodule rollback in a PR if download-ci-llvm (or llvm-config) is enabled. It will detect whether the llvm-project submodule is initialized, and if so, update it in any case. If it is not initialized, behaviour is kept to not do any update/initialization. An alternative to the chosen implementation would be to not pass the --init command line arg to `git submodule update` for the src/llvm-project submodule. This would show a confusing error message however on all builds with an uninitialized repo. We could pass the --silent param, but we still want it to print something if it is initialized and has to update something. So we just do a manual check for whether the submodule is initialized.
2020-10-23Rollup merge of #78116 - spastorino:inline-const-in-range-pat, r=petrochenkovYuki Okushi-14/+61
Make inline const work in range patterns Fixes #78108 which is a follow up of https://github.com/rust-lang/rust/pull/77124 r? @petrochenkov
2020-10-23Rollup merge of #78098 - camelid:fixup-docs, r=steveklabnikYuki Okushi-32/+58
Clean up and improve some docs * compiler docs * Don't format list as part of a code block * Clean up some other formatting * rustdoc book * Update CommonMark spec version to latest (0.28 -> 0.29) * Clean up some various wording and formatting
2020-10-23Rollup merge of #77969 - ryan-scott-dev:bigo-notation-consistency, r=m-ou-seYuki Okushi-18/+18
Doc formating consistency between slice sort and sort_unstable, and big O notation consistency Updated documentation for slice sorting methods to be consistent between stable and unstable versions, which just ended up being minor formatting differences. I also went through and updated any doc comments with big O notation to be consistent with #74010 by italicizing them rather than having them in a code block.
2020-10-23Rollup merge of #77920 - ayazhafiz:i/mut-ident-spacing, r=jyn514Yuki Okushi-1/+13
Avoid extraneous space between visibility kw and ident for statics Today, given a static like `static mut FOO: usize = 1`, rustdoc would emit `static mut FOO: usize = 1`, as it emits both the mutability kw with a space and reserves a space after the mutability kw. This patch fixes that misformatting. This patch also adds some tests for emit of other statics, as I could not find an existing test devoted to statics.
2020-10-23Rollup merge of #77918 - wcampbell0x2a:cleanup-network-tests, r=m-ou-seYuki Okushi-12/+5
Cleanup network tests Some cleanup for network related tests
2020-10-23Rollup merge of #77890 - gilescope:welformed-json-output-from-libtest, r=KodrAusYuki Okushi-4/+10
Fixing escaping to ensure generation of welformed json. doc tests' json name have a filename in them. When json test output is asked for on windows currently produces invalid json. Tracking issue for json test output: #49359
2020-10-23Rollup merge of #77488 - varkor:repr128-incomplete_features, r=jonas-schievinkYuki Okushi-0/+52
Mark `repr128` as `incomplete_features` As mentioned in https://github.com/rust-lang/rust/issues/56071 and noticed in https://github.com/rust-lang/rust/issues/77457, `repr(u128)` and `repr(i128)` do not work properly due to lack of LLVM support. We should thus warn users trying to use the feature that they may encounter ICEs when using it. Closes https://github.com/rust-lang/rust/issues/77457.
2020-10-23Rollup merge of #77339 - ↵Yuki Okushi-0/+46
fusion-engineering-forks:tryfrom-nonzero-to-nonzero, r=dtolnay Implement TryFrom between NonZero types. This will instantly be stable, as trait implementations for stable types and traits can not be `#[unstable]`. Closes #77258. @rustbot modify labels: +T-libs
2020-10-23Rollup merge of #77268 - follower:patch-3, r=jyn514Yuki Okushi-2/+2
Link to "Contributing to Rust" rather than "Getting Started". Change to link to "Contributing to Rust" chapter of `rustc` Dev Guide, primarily on the basis that: * The GitHub "first contribution" Issue "pop-up" says "Be sure to review the [contributing guidelines] and [code of conduct]" and links to this file. * The "Bug Report" section _seems_ to restrict itself to if "a compiler error message [told] you to come here". * The previous content of `CONTRIBUTING.md` now lives in the "Contributing to Rust" chapter. When/if the guide/"Getting Started" section gets revised to not be `rustc`-specific, the choice of linked chapter could be updated. In the meantime this prevents leading first time contributors into a confusing cul de sac. _[I wasn't planning to make a PR for this until discussion in #77215 concluded but the discovery that the "first issue" pop-up also links to this document IMO makes it a higher priority to make the link useful sooner rather than later.]_ Related issues: * https://github.com/rust-lang/rust/issues/77215 * https://github.com/rust-lang/rustc-dev-guide/issues/775#issuecomment-699063082
2020-10-23Add regression test for issue-71732Yuki Okushi-0/+36
2020-10-23Make it regression test of issue-77668Yuki Okushi-0/+4
2020-10-23Add a regression test for issue-72616Yuki Okushi-0/+42
2020-10-22Reduce diagram mess in 'match arms have incompatible types' errorDavid Tolnay-28/+38
2020-10-22Add test of incompatible match arm types with multiline armDavid Tolnay-1/+29
2020-10-22Clean up lib docsCamelid-9/+10
2020-10-22Bless testsSantiago Pastorino-2/+2
2020-10-22Add ..= const { .. } missing tests and sort them properlySantiago Pastorino-3/+8
2020-10-22Make inline const work for half open rangesSantiago Pastorino-9/+19
2020-10-22Make inline const work in range patternsSantiago Pastorino-6/+38
2020-10-22Rename parse_const_expr to parse_const_blockSantiago Pastorino-3/+3
2020-10-22Explain where the closure return type was inferredAaron Hill-0/+65
Fixes #78193
2020-10-22Auto merge of #77720 - matthewjasper:fix-trait-ices, r=nikomatsakisbors-86/+141
Fix trait solving ICEs - Selection candidates that are known to be applicable are preferred over candidates that are not. - Don't ICE if a projection/object candidate is no longer applicable (this can happen due to cycles in normalization) - Normalize supertraits when finding trait object candidates Closes #77653 Closes #77656 r? `@nikomatsakis`
2020-10-22Fixup: add missing trailing newlineLeSeulArtichaut-1/+1
2020-10-22Auto merge of #77871 - Julian-Wollersberger:less-query-context, r=oli-obkbors-174/+216
Make fewer types generic over QueryContext While trying to refactor `rustc_query_system::query::QueryContext` to make it dyn-safe, I noticed some smaller things: * QueryConfig doesn't need to be generic over QueryContext * ~~The `kind` field on QueryJobId is unused~~ * Some unnecessary where clauses * Many types in `job.rs` where generic over `QueryContext` but only needed `QueryContext::Query`. If handle_cycle_error() could be refactored to not take `error: CycleError<CTX::Query>`, all those bounds could be removed as well. Changing `find_cycle_in_stack()` in job.rs to not take a `tcx` argument is the only functional change here. Everything else is just updating type signatures. (aka compile-error driven development ^^) ~~Currently there is a weird bug where memory usage suddenly skyrockets when running UI tests. I'll investigate that tomorrow. A perf run probably won't make sense before that is fixed.~~ EDIT: `kind` actually is used by `Eq`, and re-adding it fixed the memory issue.
2020-10-22Fix clippy testsvarkor-0/+3
2020-10-22Make closures inherit the parent function's target featuresLeSeulArtichaut-1/+27
2020-10-22Normalize when finding trait object candidatesMatthew Jasper-66/+107
2020-10-22Auto merge of #78134 - bugadani:arena-nodrop, r=lcnrbors-13/+11
Use `DroplessArena` where we know the type doesn't need drop This PR uses a single `DroplessArena` in resolve instead of three separate `TypedArena`s. `DroplessArena` checks that the type indeed doesn't need drop, so in case the types change, this will result in visible failures.
2020-10-22Auto merge of #78131 - SimonSapin:ar, r=Mark-Simulacrumbors-3/+16
Package more llvm-* tools in the rust-dev component, for run-make-fulldeps tests Fixes https://github.com/rust-lang/rust/issues/78110
2020-10-22Auto merge of #78212 - JohnTitor:rollup-j5r6xuy, r=JohnTitorbors-93/+411
Rollup of 10 pull requests Successful merges: - #77420 (Unify const-checking structured errors for `&mut` and `&raw mut`) - #77554 (Support signed integers and `char` in v0 mangling) - #77976 (Mark inout asm! operands as used in liveness pass) - #78009 (Haiku: explicitly set CMAKE_SYSTEM_NAME when cross-compiling) - #78084 (Greatly improve display for small mobile devices screens) - #78155 (Fix two small issues in compiler/rustc_lint/src/types.rs) - #78156 (Fixed build failure of `rustfmt`) - #78172 (Add test case for #77062) - #78188 (Add tracking issue number for pin_static_ref) - #78200 (Add `ControlFlow::is_{break,continue}` methods) Failed merges: r? `@ghost`
2020-10-21Clean up and improve some docsCamelid-32/+58
* compiler docs * Don't format list as part of a code block * Clean up some other formatting * rustdoc book * Update CommonMark spec version to latest (0.28 -> 0.29) * Clean up some various wording and formatting
2020-10-22Rollup merge of #78200 - LeSeulArtichaut:controlflow-is-meth, r=scottmcmYuki Okushi-0/+14
Add `ControlFlow::is_{break,continue}` methods r? @scottmcm cc #75744
2020-10-22Rollup merge of #78188 - fusion-engineering-forks:static-ref-tracking-issue, ↵Yuki Okushi-2/+2
r=withoutboats Add tracking issue number for pin_static_ref Forgot to add a tracking issue in #77726. Opened #78186 as tracking issue.
2020-10-22Rollup merge of #78172 - wesleywiser:close_77062, r=oli-obkYuki Okushi-0/+5
Add test case for #77062 Closes #77062
2020-10-22Rollup merge of #78156 - bishtpawan:bugfix/rustfmt-no-longer-builds, r=lcnrYuki Okushi-6/+8
Fixed build failure of `rustfmt` Fixes #78079 r? @eddyb cc @bjorn3
2020-10-22Rollup merge of #78155 - est31:rustc_lint_types_refactor, r=davidtwcoYuki Okushi-17/+18
Fix two small issues in compiler/rustc_lint/src/types.rs Two small improvements of `compiler/rustc_lint/src/types.rs`
2020-10-22Rollup merge of #78084 - GuillaumeGomez:improve-mobile-display, r=jyn514,Nemo157Yuki Okushi-0/+35
Greatly improve display for small mobile devices screens Fixes #78014. The biggest change being the "search bar". Instead of having everything on one line, I decided to move the search input on its own: ![Screenshot from 2020-10-18 21-54-26](https://user-images.githubusercontent.com/3050060/96378530-c863a800-118c-11eb-8e82-a43fce312b5b.png) Another change is that now, we "break words" in the listing so that they don't grow too big: ![Screenshot from 2020-10-18 21-57-17](https://user-images.githubusercontent.com/3050060/96378555-ffd25480-118c-11eb-8a71-8f116c7edd93.png) r? @jyn514
2020-10-22Rollup merge of #78009 - nielx:fix/CMAKE_SYSTEM_NAME, r=Mark-SimulacrumYuki Okushi-0/+2
Haiku: explicitly set CMAKE_SYSTEM_NAME when cross-compiling This resolves issues where the cross-build of LLVM fails because it tries to link to the host's system libraries instead of the target's system libraries.