about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-06-21Address review comments from #98259Joshua Nelson-8/+8
It got merged so fast I didn't have time to make changes xD
2022-06-19Greatly improve error reporting for futures and generators in ↵Joshua Nelson-60/+296
`note_obligation_cause_code` Most futures don't go through this code path, because they're caught by `maybe_note_obligation_cause_for_async_await`. But all generators do, and `maybe_note` is imperfect and doesn't catch all futures. Improve the error message for those it misses. At some point, we may want to consider unifying this with the code for `maybe_note_async_await`, so that `async_await` notes all parent constraints, and `note_obligation` can point to yield points. But both functions are quite complicated, and it's not clear to me how to combine them; this seems like a good incremental improvement.
2022-06-18Auto merge of #98216 - JohnTitor:rollup-jlcmu5d, r=JohnTitorbors-82/+155
Rollup of 5 pull requests Successful merges: - #97803 (Impl Termination for Infallible and then make the Result impls of Termination more generic) - #97828 (Allow configuring where artifacts are downloaded from) - #98150 (Emscripten target: replace -g4 with -g, and -g3 with --profiling-funcs) - #98195 (Fix rustdoc json primitive handling) - #98205 (Remove a possible unnecessary assignment) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-18Rollup merge of #98195 - GuillaumeGomez:rustdoc-json-primitive, r=notriddleYuki Okushi-3/+20
Fix rustdoc json primitive handling Fixes https://github.com/rust-lang/rust/issues/98006. cc `@matthiaskrgr`
2022-06-18Rollup merge of #97828 - ferrocene:pa-config-artifacts, r=jyn514Yuki Okushi-73/+132
Allow configuring where artifacts are downloaded from Bootstrap has support for downloading prebuilt LLVM and rustc artifacts to speed up local builds, but that currently works only for users working on `rust-lang/rust`. Forks of the repository (for example Ferrocene) might have different URLs to download artifacts from, or might use a different email address on merge commits, breaking both LLVM and rustc artifact downloads. This PR refactors bootstrap to load the download URLs and other constants from `src/stage0.json`, allowing downstream forks to tweak those values. It also future-proofs the download code to easily allow forks to add their own custom protocols (like `s3://`). This PR is best reviewed commit-by-commit.
2022-06-18Rollup merge of #97803 - Gankra:term, r=dtolnayYuki Okushi-6/+3
Impl Termination for Infallible and then make the Result impls of Termination more generic This allows things like `Result<ExitCode, E>` to 'just work'
2022-06-18Auto merge of #97652 - RalfJung:cenum_impl_drop_cast, r=nagisabors-1/+16
make cenum_impl_drop_cast deny-by-default Also make it show up as future breakage diagnostic. In https://github.com/rust-lang/rust/pull/96862 we are proposing to change behavior of those drops *again*, so this looks like a good opportunity to increase our pressure on getting them out of the ecosystem. Looking at the [tracking issue](https://github.com/rust-lang/rust/issues/73333), so far nobody spoke up in favor of this (accidental) feature. Cc https://github.com/rust-lang/rust/issues/73333 `@oli-obk`
2022-06-17Auto merge of #98081 - gco:no_static_libcpp, r=jyn514bors-1/+2
Do not try to statically link libstdc++ on Solaris Fixes #97260
2022-06-17bless new test result, it's a regression but seemingly a compiler bugAria Beingessner-6/+3
2022-06-17Auto merge of #97892 - klensy:fix-spaces, r=oli-obkbors-729/+729
diagnostics: remove trailing spaces Remove few occurrences of trailing spaces and drive by fix of needless alloc of const string.
2022-06-17Add regression test for #98006Guillaume Gomez-0/+17
2022-06-17Auto merge of #98193 - Dylan-DPC:rollup-5gihjij, r=Dylan-DPCbors-73/+162
Rollup of 5 pull requests Successful merges: - #95392 (std: Stabilize feature try_reserve_2 ) - #97798 (Hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown) - #97844 (Windows: No panic if function not (yet) available) - #98013 (Subtype FRU fields first in `type_changing_struct_update`) - #98191 (Remove the rest of unnecessary `to_string`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-17Fix rustdoc handling of primitive documentationGuillaume Gomez-3/+3
2022-06-17Rollup merge of #98191 - TaKO8Ki:remove-rest-of-unnecessary-to-string, ↵Dylan DPC-1/+1
r=Dylan-DPC Remove the rest of unnecessary `to_string` I removed most of unnecessary `to_string` in #98043. This patch removes the rest of them I missed.
2022-06-17Rollup merge of #98013 - compiler-errors:guide-inference-2, r=lcnrDylan DPC-17/+35
Subtype FRU fields first in `type_changing_struct_update` So this fixes a subtle bug that `type_changing_struct_update` introduced, where it'll no longer coerce the base expr correctly. I actually think this code is easier to understand now, too. r? `@lcnr` since you reviewed the last one
2022-06-17Rollup merge of #97798 - ↵Dylan DPC-55/+126
WaffleLapkin:allow_for_suggestions_that_are_quite_far_away_from_each_other, r=estebank Hide irrelevant lines in suggestions to allow for suggestions that are far from each other to be shown This is an attempt to fix suggestions one part of which is 6 lines or more far from the first. I've noticed "the problem" (of not showing some parts of the suggestion) here: https://github.com/rust-lang/rust/pull/97759#discussion_r889689230. I'm not sure about the implementation (this big closure is just bad and makes already complicated code even more so), but I want to at least discuss the result. Here is an example of how this changes the output: Before: ```text help: consider enclosing expression in a block | 3 ~ 'l: { match () { () => break 'l, 4 | 5 | 6 | 7 | 8 | ... ``` After: ```text help: consider enclosing expression in a block | 3 ~ 'l: { match () { () => break 'l, 4 | ... 31| 32~ } }; | ``` r? `@estebank` `@rustbot` label +A-diagnostics +A-suggestion-diagnostics
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-2/+0
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-17remove the rest of unnecessary `to_string`Takayuki Maeda-1/+1
2022-06-17Auto merge of #98160 - nnethercote:mv-finish-out-of-Encoder, r=bjorn3bors-4/+4
Move `finish` out of the `Encoder` trait. This simplifies things, but requires making `CacheEncoder` non-generic. (This was previously merged as commit 4 in #94732 and then was reverted in #97905 because it caused a perf regression.) r? `@ghost`
2022-06-17Subtype FRU fields first in type_changing_struct_updateMichael Goulet-17/+35
2022-06-17Rollup merge of #98166 - GuillaumeGomez:regression-test-98009, r=matthiaskrgrYuki Okushi-0/+38
Add rustdoc-json regression test for #98009 Fixes #98009. There was apparently nothing to be done... cc `@matthiaskrgr` r? `@notriddle`
2022-06-17Rollup merge of #97377 - ChayimFriedman2:issue-91800, r=estebankYuki Okushi-0/+98
Do not suggest adding semicolon/changing delimiters for macros in item position that originates in macros Fixes #91800.
2022-06-16Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyupflip1995-1913/+4140
2022-06-16bless clippy ui testsMaybe Waffle-21/+102
2022-06-16--bless uiMaybe Waffle-34/+24
2022-06-16bless clippy testsklensy-96/+96
2022-06-16Add rustdonc-json regression test for #98009Guillaume Gomez-0/+38
2022-06-16bless rustdoc-ui testsklensy-11/+11
2022-06-16 fix one more case of trailing spaceklensy-139/+139
2022-06-16diagnostics: fix trailing spaceklensy-483/+483
2022-06-16Auto merge of #97842 - notriddle:notriddle/tuple-docs, r=jsha,GuillaumeGomezbors-11/+131
Improve the tuple and unit trait docs * Reduce duplicate impls; show only the `(T,)` and include a sentence saying that there exists ones up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`. Here's the new version: * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html> * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.unit.html>
2022-06-16Auto merge of #98161 - matthiaskrgr:rollup-8csenk9, r=matthiaskrgrbors-63/+402
Rollup of 4 pull requests Successful merges: - #97757 (Support lint expectations for `--force-warn` lints (RFC 2383)) - #98125 (Entry and_modify doc) - #98137 (debuginfo: Fix NatVis for Rc and Arc with unsized pointees.) - #98147 (Make #[cfg(bootstrap)] not error in proc macros on later stages ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-16Rollup merge of #98147 - est31:bootstrap_cfg_flag, r=Mark-SimulacrumMatthias Krüger-3/+9
Make #[cfg(bootstrap)] not error in proc macros on later stages As was discovered in https://github.com/rust-lang/rust/pull/93628#issuecomment-1154697627, adding #[cfg(bootstrap)] to a rust-internal proc macro crate would yield an unexpected cfg name error, at least on later stages wher the bootstrap cfg arg wasn't set. rustc already passes arguments to mark bootstrap as expected, however the means of delivery through the RUSTFLAGS env var is unable to reach proc macro crates, as described in the issue linked in the code this commit touches. This wouldn't be an issue for cfg args that get passed through RUSTFLAGS, as they would never become *active* either, so any usage of one of these flags in a proc macro's code would legitimately yield a lint warning. But since dc30258, rust takes extra measures to pass --cfg=bootstrap even in proc macros, by passing it via the wrapper. Thus, we need to send the flags to mark bootstrap as expected also from the wrapper, so that #[cfg(bootstrap)] also works from proc macros. I want to thank `Urgau` and `jplatte` for helping me find the cause of this. :heart:
2022-06-16Rollup merge of #98137 - michaelwoerister:fix-unsized-rc-arc-natvis, ↵Matthias Krüger-56/+214
r=wesleywiser debuginfo: Fix NatVis for Rc and Arc with unsized pointees. Currently, the NatVis for `Rc<T>` and `Arc<T>` does not support unsized `T`. For both `Rc<T>` and `Rc<dyn SomeTrait>` the visualizers fail: ```txt [Reference count] : -> must be used on pointers and . on structures [Weak reference count] : -> must be used on pointers and . on structures ``` This PR fixes the visualizers. For slices we can even give show the elements, so one now gets something like: ```txt slice_rc : { len=3 } [Length] : 3 [Reference count] : 41 [Weak reference count] : 2 [0] : 1 [1] : 2 [2] : 3 ``` r? `@wesleywiser`
2022-06-16Rollup merge of #97757 - xFrednet:rfc-2383-expect-with-force-warn, ↵Matthias Krüger-4/+179
r=wesleywiser,flip1995 Support lint expectations for `--force-warn` lints (RFC 2383) Rustc has a `--force-warn` flag, which overrides lint level attributes and forces the diagnostics to always be warn. This means, that for lint expectations, the diagnostic can't be suppressed as usual. This also means that the expectation would not be fulfilled, even if a lint had been triggered in the expected scope. This PR now also tracks the expectation ID in the `ForceWarn` level. I've also made some minor adjustments, to possibly catch more bugs and make the whole implementation more robust. This will probably conflict with https://github.com/rust-lang/rust/pull/97718. That PR should ideally be reviewed and merged first. The conflict itself will be trivial to fix. --- r? `@wesleywiser` cc: `@flip1995` since you've helped with the initial review and also discussed this topic with me. :upside_down_face: Follow-up of: https://github.com/rust-lang/rust/pull/87835 Issue: https://github.com/rust-lang/rust/issues/85549 Yeah, and that's it.
2022-06-16Move `finish` out of the `Encoder` trait.Nicholas Nethercote-4/+4
This simplifies things, but requires making `CacheEncoder` non-generic. (This was previously merged as commit 4 in #94732 and then was reverted in #97905 because it caused a perf regression.)
2022-06-16Support lint expectations for `--force-warn` lints (RFC 2383)xFrednet-4/+179
2022-06-16Auto merge of #98108 - SpriteOvO:doc_auto_cfg-feature-rmv-fix, ↵bors-12/+40
r=notriddle,GuillaumeGomez Rustdoc: Fix stab disappearing and exclude cfg "doc" and "doctest" Fixes #98065 Context: https://github.com/rust-lang/rust/issues/43781#issuecomment-1154226733 r? `@GuillaumeGomez`
2022-06-16Do not suggest adding semicolon/changing delimiters for macros in item ↵Chayim Refael Friedman-0/+98
position that originates in macros
2022-06-16Auto merge of #98103 - exrook:btreemap-alloc, r=Amanieubors-8/+8
BTreeMap: Support custom allocators (v1.5) Related: https://github.com/rust-lang/wg-allocators/issues/7 https://github.com/TimDiekmann/alloc-wg Blocked on: ~~#77187~~ ~~#78459~~ ~~#95036~~ previous: #77438
2022-06-15The type of the slice length field is architecture dependentWesley Wiser-4/+4
2022-06-16Rollup merge of #98135 - JohnTitor:issue-93022-93775, r=compiler-errorsYuki Okushi-0/+29
Add regression test for #93775 Closes #93775, also closes #93022 as it should have the same root cause r? ```@compiler-errors``` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-16Rollup merge of #98119 - EdwinRy:path-parenthesized-type-error, r=estebankYuki Okushi-20/+35
Refactor path segment parameter error This PR attempts to rewrite the error handling for an unexpected parenthesised type parameters to: - Use provided data instead of re-parsing the whole span - Add a multipart suggestion to reflect on the changes with an underline - Remove the unnecessary "if" nesting
2022-06-16Rollup merge of #98092 - GuillaumeGomez:fix-sidebar-items-expand-collapse, ↵Yuki Okushi-4/+27
r=notriddle Fix sidebar items expand collapse The collapse/expand event was not working for the items in the source code viewer sidebar (talking about these items: ![Screenshot from 2022-06-14 11-21-58](https://user-images.githubusercontent.com/3050060/173543346-af056928-e921-458f-b918-60f6fd0ecbde.png) ). This PR fixes it and adds a GUI test to prevent another regression. r? ```@notriddle```
2022-06-16Rollup merge of #98053 - GuillaumeGomez:fix-generic-impl-json-ice, r=notriddleYuki Okushi-10/+67
Fix generic impl rustdoc json output Fixes #97986. The problem in case of generic trait impl is that the trait's items are the same for all the types afterward. But since they're the same, it's safe for rustdoc-json to just ignore them. A little representation of what's going on: ```rust trait T { fn f(); // <- defid 0 } impl<Y> T for Y { fn f() {} // <- defid 1 } struct S; // <- defid 1 (since it matches `impl<Y> T for Y` ``` cc ```@Urgau``` r? ```@CraftSpider```
2022-06-16Rollup merge of #97964 - WaffleLapkin:fix_borrow_par_suggestions, ↵Yuki Okushi-60/+449
r=compiler-errors Fix suggestions for `&a: T` parameters I've accidentally discovered that we have broken suggestions for `&a: T` parameters: ```rust fn f(&mut bar: u32) {} fn main() { let _ = |&mut a| (); } ``` ```text error[E0308]: mismatched types --> ./t.rs:1:6 | 1 | fn f(&mut bar: u32) {} | ^^^^^^^^----- | | | | | expected due to this | expected `u32`, found `&mut _` | help: did you mean `bar`: `&u32` | = note: expected type `u32` found mutable reference `&mut _` error[E0308]: mismatched types --> ./t.rs:4:23 | 4 | let _: fn(u32) = |&mut a| (); | ^^^^^-- | | | | | expected due to this | expected `u32`, found `&mut _` | help: did you mean `a`: `&u32` | = note: expected type `u32` found mutable reference `&mut _` ``` It's hard to see, but 1. The help span is overlapping with "expected" spans 2. It suggests `fn f( &u32) {}` (no `mut` and lost parameter name) and `|&u32 ()` (no closing `|` and lost parameter name) I've tried to fix this. r? ``@compiler-errors``
2022-06-16Make #[cfg(bootstrap)] not error in proc macros on later stagesest31-3/+9
As was discovered in https://github.com/rust-lang/rust/pull/93628#issuecomment-1154697627 , adding #[cfg(bootstrap)] to a rust-internal proc macro crate would yield an unexpected cfg name error, at least on later stages wher the bootstrap cfg arg wasn't set. rustc already passes arguments to mark bootstrap as expected, however the means of delivery through the RUSTFLAGS env var is unable to reach proc macro crates, as described in the issue linked in the code this commit touches. This wouldn't be an issue for cfg args that get passed through RUSTFLAGS, as they would never become *active* either, so any usage of one of these flags in a proc macro's code would legitimately yield a lint warning. But since dc302587e2cf5105a3a864319d7e7bcb434bba20, rust takes extra measures to pass --cfg=bootstrap even in proc macros, by passing it via the wrapper. Thus, we need to send the flags to mark bootstrap as expected also from the wrapper, so that #[cfg(bootstrap)] also works from proc macros. I want to thank Urgau and jplatte for helping me find the cause of this. ❤️
2022-06-15Auto merge of #97665 - c410-f3r:assert-compiler, r=oli-obkbors-15/+379
[RFC 2011] Minimal initial implementation Tracking issue: #44838 Third step of #96496 Implementation has ~290 LOC with the bare minimum to be in a functional state. Currently only searches for binary operations to mimic what `assert_eq!` and `assert_ne!` already do. r? `@oli-obk`
2022-06-16Exclude cfg "doc" and "doctest" from feature `doc_auto_cfg`Sprite-11/+19
2022-06-16Fix `cfg(not)` and `cfg(all)` causing Rustdoc stab to disappearSprite-7/+27