about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-10-07Remap hidden types from typeck before storing them in the TypeckResultOli Scherer-18/+42
2022-10-07Move ReverseMapper logic onto OpaqueHiddenTypeOli Scherer-233/+247
2022-10-07Remove some dead codeOli Scherer-25/+1
2022-10-07Unconditionally encode hidden types in typeck resultsOli Scherer-47/+43
2022-10-07Auto merge of #101632 - camsteffen:refactor-infer-err, r=lcnrbors-3021/+2831
Remove `TypeckResults` from `InferCtxt` `InferCtxt` currently has `in_progress_typeck_results` which is only used for some diagnostics during typeck. It adds a lifetime which propagates through a lot of code. This PR moves that field into a new helper struct `TypeErrCtxt`.
2022-10-07Change InferCtxtBuilder from enter to buildCameron Steffen-2200/+1984
2022-10-07Remove a reference from InheritedCameron Steffen-13/+13
2022-10-07Remove TypeckResults from InferCtxtCameron Steffen-280/+240
2022-10-07Introduce TypeErrCtxtCameron Steffen-568/+634
TypeErrCtxt optionally has a TypeckResults so that InferCtxt doesn't need to.
2022-10-07Auto merge of #102025 - chenyukang:fix-102002, r=jyn514bors-2/+10
Delete the stage1 and stage0-sysroot directories when using download-rustc Fixes #102002
2022-10-07Auto merge of #102767 - matthiaskrgr:rollup-vcbt81v, r=matthiaskrgrbors-30/+53
Rollup of 6 pull requests Successful merges: - #102577 (Warn about Visual Studio Code branding confusion) - #102720 (do not reverse the expected type and found type for ObligationCauseCo…) - #102744 (rustdoc: remove unused CSS `.content .item-list`) - #102747 (rustdoc: remove unused CSS `.docblock a:not(.srclink)`) - #102748 (Disable compressed debug sections on i586-gnu) - #102761 (let-else: test else block with non-never uninhabited type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-07Rollup merge of #102761 - est31:let_else_uninhabited_test, r=compiler-errorsMatthias Krüger-1/+23
let-else: test else block with non-never uninhabited type let else currently does not allow uninhabited types for the `else` block that aren't `!`. One can maybe think about relaxing this in the future, but if it is done, it should be an explicit choice and not an unexpected side effect of e.g. a refactor. Thus, I'm extending a test that will fail if the behaviour changes.
2022-10-07Rollup merge of #102748 - cuviper:i586-gnu-uncompress, r=pietroalbiniMatthias Krüger-1/+5
Disable compressed debug sections on i586-gnu Compressed debug is enabled by default for gas (assembly) on Linux/x86 targets, and we started building our own in #102530, but that made our `compiler_builtins` incompatible with binutils < 2.32. Add an explicit option to disable that in our crosstool-ng config. Fixes #102703.
2022-10-07Rollup merge of #102747 - notriddle:notriddle/docblock-a-not-srclink, ↵Matthias Krüger-2/+3
r=GuillaumeGomez rustdoc: remove unused CSS `.docblock a:not(.srclink)` This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480, because the list of impl items could be nested below `docblock`. https://github.com/rust-lang/rust/blob/c7312fbae4979c6d4fdfbd1f55a71cd47d82a480/src/librustdoc/html/render.rs#L3841-L3845 Now that rustdoc toggles have been switched to `<details>`, there shouldn't be any need to put things inside docblock containers just to give them disclosure toggles.
2022-10-07Rollup merge of #102744 - notriddle:notriddle/content-item-list, ↵Matthias Krüger-15/+10
r=GuillaumeGomez rustdoc: remove unused CSS `.content .item-list` When these rules were added in 4fd061c426902b0904c65e64a3780b21f9ab3afb (yeah, that's the very first commit of rustdoc_ng), `.item-list` was a `<ul>`, and this would override the default style for that tag. In c1b1d6804bfce1aee3a95b3cbff3eaeb15bad9a4, it was changed to use a `<div>` tag, so these rules are both no-ops.
2022-10-07Rollup merge of #102720 - lyming2007:issue-102397-fix, r=compiler-errorsMatthias Krüger-9/+9
do not reverse the expected type and found type for ObligationCauseCo… …de of IfExpressionWithNoElse this will fix #102397
2022-10-07Rollup merge of #102577 - kornelski:non-code-visual-studio, r=wesleywiserMatthias Krüger-2/+3
Warn about Visual Studio Code branding confusion VS Code is a popular companion for Rust, but Microsoft's branding is confusing, and users [may not understand](https://users.rust-lang.org/t/complie-error-when-i-run-rustc/82127) they also need the *other* VS.
2022-10-07Auto merge of #101988 - petrochenkov:flavor2, r=lqdbors-438/+569
rustc_target: Refactor internal linker flavors In accordance with the design from https://github.com/rust-lang/rust/pull/96827#issuecomment-1208441595 `lld_flavor` and `linker_is_gnu` fields are removed from internal target specs, but still parsed from JSON specs using compatibility layer introduced in https://github.com/rust-lang/rust/pull/100552. r? `@lqd`
2022-10-07let-else: test else block with non-never uninhabited typeest31-1/+23
2022-10-06Auto merge of #102729 - flip1995:clippyup, r=Manishearthbors-4359/+10165
Update Clippy r? `@Manishearth`
2022-10-06Warn about Visual Studio Code branding confusionKornel-2/+3
2022-10-06Auto merge of #102741 - matthiaskrgr:rollup-63no5tz, r=matthiaskrgrbors-169/+500
Rollup of 5 pull requests Successful merges: - #98496 (make `compare_const_impl` a query and use it in `instance.rs`) - #102680 (Fix overconstrained Send impls in btree internals) - #102718 (Fix `opaque_hidden_inferred_bound` lint ICE) - #102725 (Remove `-Ztime`) - #102736 (Migrate search input color to CSS variable) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-06Disable compressed debug sections on i586-gnuJosh Stone-1/+5
Compressed debug is enabled by default for gas (assembly) on Linux/x86 targets, and we started building our own in #102530, but that made our `compiler_builtins` incompatible with binutils < 2.32. Add an explicit option to disable that in our crosstool-ng config. Fixes #102703.
2022-10-06rustdoc: remove unused CSS `.docblock a:not(.srclink)`Michael Howell-2/+3
This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480, because the list of impl items could be nested below `docblock`. https://github.com/rust-lang/rust/blob/c7312fbae4979c6d4fdfbd1f55a71cd47d82a480/src/librustdoc/html/render.rs#L3841-L3845 Now that rustdoc toggles have been switched to `<details>`, there shouldn't be any need to put things inside docblock containers just to give them disclosure toggles.
2022-10-06rustdoc: remove unused HTML `class="item-list"`Michael Howell-10/+10
Since 50f662e99ec372a3c9558876d4164e8665859217, there is no CSS or JS targeting this class.
2022-10-06rustdoc: remove unused CSS `.content .item-list`Michael Howell-5/+0
When these rules were added in 4fd061c426902b0904c65e64a3780b21f9ab3afb (yeah, that's the very first commit of rustdoc_ng), `.item-list` was a `<ul>`, and this would override the default style for that tag. In c1b1d6804bfce1aee3a95b3cbff3eaeb15bad9a4, it was changed to use a `<div>` tag, so these rules are both no-ops.
2022-10-06Merge commit '8f1ebdd18bdecc621f16baaf779898cc08cc2766' into clippyupPhilipp Krones-69/+20
2022-10-06Auto merge of #9593 - Andy-Python-Programmer:master, r=llogiqbors-1/+5
lint::unsafe_removed_from_name: fix false positive result when allowed changelog: [`unsafe_removed_from_name`] Fix allowing on imports produces a false positive on `useless_attribute`. Fixes: #9197 Signed-off-by: Andy-Python-Programmer <andypythonappdeveloper@gmail.com>
2022-10-06Rollup merge of #102736 - GuillaumeGomez:search-input-color, r=notriddleMatthias Krüger-8/+4
Migrate search input color to CSS variable Part of https://github.com/rust-lang/rust/pull/98460. No UI changes. r? `@notriddle`
2022-10-06Rollup merge of #102725 - nnethercote:rm-Z-time, r=davidtwcoMatthias Krüger-74/+56
Remove `-Ztime` Because it has a lot of overlap with `-Ztime-passes` but is generally less useful. Plus some related cleanups. Best reviewed one commit at a time. r? `@davidtwco`
2022-10-06Rollup merge of #102718 - compiler-errors:opaque-bound-lint-ice, r=fee1-deadMatthias Krüger-14/+50
Fix `opaque_hidden_inferred_bound` lint ICE Fixes #102705
2022-10-06Rollup merge of #102680 - dtolnay:btreesend, r=thomccMatthias Krüger-3/+300
Fix overconstrained Send impls in btree internals Fixes https://github.com/dtolnay/async-trait/issues/215. Minimal repro: ```rust use std::collections::btree_map::Iter; fn require_send<T: Send>(_: T) {} fn main() { require_send(async { let _iter = None::<Iter<(), &()>>; async {}.await; }); } ``` ```console error: higher-ranked lifetime error --> src/main.rs:6:5 | 6 | / require_send(async { 7 | | let _iter = None::<Iter<(), &()>>; 8 | | async {}.await; 9 | | }); | |______^ | = note: could not prove `impl Future<Output = ()>: Send` ``` Not-quite-so-minimal repro: ```rust use std::collections::BTreeMap; use std::future::Future; fn spawn<T: Future + Send>(_: T) {} async fn f() { let map = BTreeMap::<u32, Box<dyn Send + Sync>>::new(); for _ in &map { async {}.await; } } fn main() { spawn(f()); } ``` ```console error: higher-ranked lifetime error --> src/main.rs:14:5 | 14 | spawn(f()); | ^^^^^^^^^^ | = note: could not prove `impl Future<Output = ()>: Send` ``` I am not familiar with the btree internals, but it seems clear to me that the `async fn f` above should return a Send future. Using HashMap instead of BTreeMap in that code makes it already return a Send future. The _"higher-ranked lifetime error"_ message may be a regression in Rust 1.63. Using older compilers the error message was more detailed: ```console error: implementation of `Send` is not general enough --> src/main.rs:14:5 | 14 | spawn(f()); | ^^^^^ implementation of `Send` is not general enough | = note: `Send` would have to be implemented for the type `alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Immut<'0>, u32, Box<(dyn Send + Sync + '1)>, alloc::collections::btree::node::marker::LeafOrInternal>`, for any two lifetimes `'0` and `'1`... = note: ...but `Send` is actually implemented for the type `alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Immut<'2>, u32, Box<dyn Send + Sync>, alloc::collections::btree::node::marker::LeafOrInternal>`, for some specific lifetime `'2` error: implementation of `Send` is not general enough --> src/main.rs:14:5 | 14 | spawn(f()); | ^^^^^ implementation of `Send` is not general enough | = note: `Send` would have to be implemented for the type `alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Immut<'0>, u32, Box<(dyn Send + Sync + '1)>, alloc::collections::btree::node::marker::Leaf>`, for any two lifetimes `'0` and `'1`... = note: ...but `Send` is actually implemented for the type `alloc::collections::btree::node::NodeRef<alloc::collections::btree::node::marker::Immut<'2>, u32, Box<dyn Send + Sync>, alloc::collections::btree::node::marker::Leaf>`, for some specific lifetime `'2` ```
2022-10-06Rollup merge of #98496 - BoxyUwU:instancers_bad_equality, r=lcnrMatthias Krüger-70/+90
make `compare_const_impl` a query and use it in `instance.rs` Fixes #88365 the bug in #88365 was caused by some `instance.rs` code using the `PartialEq` impl on `Ty` to check that the type of the associated const in an impl is the same as the type of the associated const in the trait definition. This was wrong for two reasons: - the check typeck does is that the impl type is a subtype of the trait definition's type (see `mismatched_impl_ty_2.rs` which [was ICEing](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=f6d60ebe6745011f0d52ab2bc712025d) before this PR on stable) - it assumes that if two types are equal then the `PartialEq` impl will reflect that which isnt true for higher ranked types or type level constants when `feature(generic_const_exprs)` is enabled (see `mismatched_impl_ty_3.rs` for higher ranked types which was [ICEing on stable](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=d7af131a655ed515b035624626c62c71)) r? `@lcnr`
2022-10-06Auto merge of #9599 - nyurik:inline-crash, r=flip1995bors-56/+15
Add a temporary workaround for multiline formart arg inlining per suggestion in https://github.com/rust-lang/rust/pull/102729#discussion_r988990080 workaround for an internal crash when handling multi-line format argument inlining. changelog: none (no point for changelog because it is still a new lint being introduced)
2022-10-06Add a temporary workaround for multiline formart arg inliningYuri Astrakhan-56/+15
per suggestion in https://github.com/rust-lang/rust/pull/102729#discussion_r988990080 workaround for an internal crash when handling multi-line format argument inlining.
2022-10-06Auto merge of #9598 - nyurik:fix-comment, r=Alexendoobors-13/+1
lint: fix a few comments minor cleanup per `@Alexendoo` [comment](https://github.com/rust-lang/rust-clippy/pull/9586#discussion_r988991976) changelog: none
2022-10-06lint: fix a few commentsYuri Astrakhan-13/+1
2022-10-06Auto merge of #99497 - vladimir-ea:stdlib_os_api_watchos, r=thomccbors-0/+235
Standard library OS support for Apple WatchOS This PR was split from https://github.com/rust-lang/rust/pull/98101
2022-10-06Migrate search input color to CSS variableGuillaume Gomez-8/+4
2022-10-06rustc_target: Refactor internal linker flavorsVadim Petrochenkov-438/+569
In accordance with the design from https://github.com/rust-lang/rust/pull/96827#issuecomment-1208441595
2022-10-06Auto merge of #102707 - ↵bors-41/+124
fmease:rustdoc-render-more-cross-crate-hrtbs-properly, r=GuillaumeGomez rustdoc: render more cross-crate HRTBs properly Follow-up to #102439. Render the `for<>` parameter lists of cross-crate higher-rank trait bounds (in where-clauses and in `impl Trait`). I've added a new field `bound_params` to `clean::WherePredicate::EqPredicate` (mirroring its sibling variant `BoundPredicate`). However, I had to box the existing fields since `EqPredicate` used to be the largest variant (128 bytes on 64-bit systems) and it would only have gotten bigger). Not sure if you like that approach. As an alternative, I could pass the uncleaned `ty::Predicate` alongside the cleaned `WherePredicate` to the various re-sugaring methods (similar to what `clean::AutoTraitFinder::param_env_to_generics` does). I haven't yet added the HTML & JSON rendering code for the newly added `bound_params` field since I am waiting for your opinion. Those two rendering code paths should actually be unreachable in practice given we re-sugar all(?) equality predicates to associated type bindings (and arbitrary equality predicates are not part of the Rust surface language at the time of this writing). If you agree with storing `bound_params` in `EqPredicate`, I think I can use it to greatly simplify the `clean::auto_trait` module (by also using `simplify::merge_bounds`). Maybe I can do that in any case though. `@rustbot` label T-rustdoc A-cross-crate-reexports r? `@GuillaumeGomez`
2022-10-06Update Cargo.lockPhilipp Krones-11/+7
2022-10-06Merge commit 'ac0e10aa68325235069a842f47499852b2dee79e' into clippyupPhilipp Krones-4346/+10205
2022-10-06Auto merge of #9596 - flip1995:rustup, r=flip1995bors-284/+276
Rustup r? `@ghost` changelog: none
2022-10-06Bump nightly version -> 2022-10-06Philipp Krones-1/+1
2022-10-06Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-4391/+10248
2022-10-06reviewsBoxy-41/+41
2022-10-06Auto merge of #102726 - matthiaskrgr:rollup-2ghn38b, r=matthiaskrgrbors-502/+903
Rollup of 5 pull requests Successful merges: - #102672 (rustdoc: remove unused CSS class `in-band`) - #102693 (Revert "Use getentropy when possible on all Apple platforms") - #102694 (Suggest calling method if fn does not exist) - #102708 (Suggest `==` to wrong assign expr) - #102710 (Add test for issue 82633) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-06Rollup merge of #102710 - Rageking8:add-test-for-issue-82633, r=estebankMatthias Krüger-0/+173
Add test for issue 82633 Fixes #82633 r? `@estebank` The current stderr looks slightly different from [source](https://github.com/rust-lang/rust/pull/83915/files#diff-8c64c576ccaceb816e71d2279a6ee4bf79211bc06f55c46dda3f98a18748ad7a), so I used the latest one from nightly. Do let me know if anything is wrong.
2022-10-06Rollup merge of #102708 - TaKO8Ki:improve-eqeq-suggestion, r=estebankMatthias Krüger-22/+88
Suggest `==` to wrong assign expr Given the following code: ```rust fn main() { let x = 3; let y = 3; if x == x && y = y { println!("{}", x); } } ``` Current output is: ``` error[E0308]: mismatched types --> src/main.rs:4:18 | 4 | if x == x && y = y { | ^ expected `bool`, found integer error[E0308]: mismatched types --> src/main.rs:4:8 | 4 | if x == x && y = y { | ^^^^^^^^^^^^^^^ expected `bool`, found `()` ``` This adds a suggestion: ```diff error[E0308]: mismatched types --> src/main.rs:6:18 | 6 | if x == x && y = y { | ^ expected `bool`, found integer error[E0308]: mismatched types --> src/main.rs:6:8 | 6 | if x == x && y = y { | ^^^^^^^^^^^^^^^ expected `bool`, found `()` | + help: you might have meant to compare for equality + | + 6 | if x == x && y == y { + | + ``` And this fixes a part of #97469