]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agodoc: fix minor typo
Akhilesh Singhania [Fri, 9 Sep 2022 09:30:40 +0000 (11:30 +0200)]
doc: fix minor typo

21 months agoAuto merge of #101527 - Kobzol:ci-update-llvm, r=Mark-Simulacrum
bors [Fri, 9 Sep 2022 09:05:59 +0000 (09:05 +0000)]
Auto merge of #101527 - Kobzol:ci-update-llvm, r=Mark-Simulacrum

Update LLVM used in x86 CI dist builds to `15.0.0`

LLVM 15.0.0 has been released, so we can use it in CI builds. We need (at least) LLVM 15 for BOLT, and we regularly update to most recent stable versions. It would also be good to first see the perf. effect of upgrading by itself, to have a better baseline for BOLT.

r? `@Mark-Simulacrum`

21 months agoRename `{Create,Lazy}TokenStream` as `{To,Lazy}AttrTokenStream`.
Nicholas Nethercote [Fri, 9 Sep 2022 07:15:53 +0000 (17:15 +1000)]
Rename `{Create,Lazy}TokenStream` as `{To,Lazy}AttrTokenStream`.

`To` is better than `Create` for indicating that this is a non-consuming
conversion, rather than creating something out of nothing.

And the addition of `Attr` is because the current names makes them sound
like they relate to `TokenStream`, but really they relate to
`AttrTokenStream`.

21 months agoInline and remove `TokenStream::opt_from_ast`.
Nicholas Nethercote [Fri, 9 Sep 2022 06:53:17 +0000 (16:53 +1000)]
Inline and remove `TokenStream::opt_from_ast`.

21 months agoTweak some formatting.
Nicholas Nethercote [Fri, 9 Sep 2022 06:40:25 +0000 (16:40 +1000)]
Tweak some formatting.

21 months agoChange return type of `Attribute::tokens`.
Nicholas Nethercote [Fri, 9 Sep 2022 06:23:39 +0000 (16:23 +1000)]
Change return type of `Attribute::tokens`.

The `AttrTokenStream` is always immediately turned into a `TokenStream`.

21 months agoAuto merge of #101603 - matthiaskrgr:rollup-8y6kf20, r=matthiaskrgr
bors [Fri, 9 Sep 2022 06:24:25 +0000 (06:24 +0000)]
Auto merge of #101603 - matthiaskrgr:rollup-8y6kf20, r=matthiaskrgr

Rollup of 6 pull requests

Successful merges:

 - #99207 (Enable eager checks for memory sanitizer)
 - #101253 (fix the suggestion of format for asm_sub_register)
 - #101450 (Add `const_extern_fn` to 1.62 release notes.)
 - #101556 (Tweak future opaque ty pretty printing)
 - #101563 (Link UEFI target documentation from target list)
 - #101593 (Cleanup themes (tooltip))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

21 months agotranslations(rustc_session): migrates session.rs and config.rs
Luis Cardoso [Fri, 26 Aug 2022 14:06:27 +0000 (16:06 +0200)]
translations(rustc_session): migrates session.rs and config.rs

21 months agoRollup merge of #101593 - GuillaumeGomez:cleanup-theme-tooltip, r=notriddle
Matthias Krüger [Fri, 9 Sep 2022 05:02:34 +0000 (07:02 +0200)]
Rollup merge of #101593 - GuillaumeGomez:cleanup-theme-tooltip, r=notriddle

Cleanup themes (tooltip)

No changes in the UI. I used this opportunity to unify the dark theme with the others for the alpha parameter though.

r? `@notriddle`

21 months agoRollup merge of #101563 - sanxiyn:doc-link-uefi, r=ehuss
Matthias Krüger [Fri, 9 Sep 2022 05:02:33 +0000 (07:02 +0200)]
Rollup merge of #101563 - sanxiyn:doc-link-uefi, r=ehuss

Link UEFI target documentation from target list

#99760 added UEFI target documentation, but forgot to link it from the main target list.

21 months agoRollup merge of #101556 - compiler-errors:tweak-generator-print, r=jackh726
Matthias Krüger [Fri, 9 Sep 2022 05:02:32 +0000 (07:02 +0200)]
Rollup merge of #101556 - compiler-errors:tweak-generator-print, r=jackh726

Tweak future opaque ty pretty printing

1. The `Return` type of a generator doesn't need to be a lang item just for diagnostic printing of types
2. We shouldn't suppress the `Output = Ty` of a opaque future if the type is a int or float var.

21 months agoRollup merge of #101450 - ehuss:relnotes-95346, r=Mark-Simulacrum
Matthias Krüger [Fri, 9 Sep 2022 05:02:31 +0000 (07:02 +0200)]
Rollup merge of #101450 - ehuss:relnotes-95346, r=Mark-Simulacrum

Add `const_extern_fn` to 1.62 release notes.

Adds #95346 which did not get tagged with relnotes.

Closes #101443

21 months agoRollup merge of #101253 - lyming2007:issue-101163, r=Amanieu
Matthias Krüger [Fri, 9 Sep 2022 05:02:30 +0000 (07:02 +0200)]
Rollup merge of #101253 - lyming2007:issue-101163, r=Amanieu

fix the suggestion of format for asm_sub_register

modified:   compiler/rustc_typeck/src/check/intrinsicck.rs
modified:   src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
modified:   src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
modified:   src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
modified:   src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
modified:   src/test/ui/asm/type-check-1.rs
modified:   src/test/ui/asm/type-check-1.stderr
modified:   src/test/ui/asm/x86_64/type-check-3.stderr

21 months agoRollup merge of #99207 - 5225225:msan-eager-checks, r=jackh726
Matthias Krüger [Fri, 9 Sep 2022 05:02:30 +0000 (07:02 +0200)]
Rollup merge of #99207 - 5225225:msan-eager-checks, r=jackh726

Enable eager checks for memory sanitizer

Fixes #99179

21 months agoAuto merge of #13207 - randomicon00:semicol#13196, r=lnicola
bors [Fri, 9 Sep 2022 04:15:20 +0000 (04:15 +0000)]
Auto merge of #13207 - randomicon00:semicol#13196, r=lnicola

fix: add semicolon completion to mod

fixes #13196

`@Veykril` The tests are passing. I added one specifically for this case.

21 months agoAuto merge of #101224 - compiler-errors:rpitit, r=oli-obk
bors [Fri, 9 Sep 2022 03:40:17 +0000 (03:40 +0000)]
Auto merge of #101224 - compiler-errors:rpitit, r=oli-obk

Initial implementation of return-position `impl Trait` in traits

* Create a new item kind, called `ImplTraitPlaceholder`, which is used to lower `ast::TyKind::ImplTrait` in trait method returns.
    * This item is the child of the trait method, which simplifies the way we calculate bounds and stuff.
* Use the def-id of this type to construct a projection type that we use during astconv for the return type of the trait method signature.
* Implement logic to normalize this `ImplTraitPlaceholder` projection type when we know its concrete impl (this is pretty limited currently, but really there are no other selection candidates that make sense -- for now!)
* Check that the `impl Trait`'s bounds are satisfied on the concrete type provided in the impl.

This is obviously nowhere near complete, but I wanted to at least get some initial support landed so we can start playing around with it.

What works:
* async fn in trait and RPITIT, including multiple `impl Trait`s and `impl Trait` nested in associated type bindings, like `impl Future<Output = impl Sized>`

21 months agoRename `AttrAnnotatedToken{Stream,Tree}`.
Nicholas Nethercote [Fri, 9 Sep 2022 02:44:05 +0000 (12:44 +1000)]
Rename `AttrAnnotatedToken{Stream,Tree}`.

These two type names are long and have long matching prefixes. I find
them hard to read, especially in combinations like
`AttrAnnotatedTokenStream::new(vec![AttrAnnotatedTokenTree::Token(..)])`.

This commit renames them as `AttrToken{Stream,Tree}`.

21 months agoMove `Spacing` out of `AttrAnnotatedTokenStream`.
Nicholas Nethercote [Fri, 9 Sep 2022 01:51:23 +0000 (11:51 +1000)]
Move `Spacing` out of `AttrAnnotatedTokenStream`.

And into `AttrAnnotatedTokenTree::Token`.

PR #99887 did the same thing for `TokenStream`.

21 months agofix #101097, avoid infinite loop in fn arguments checking
chenyukang [Tue, 30 Aug 2022 02:03:02 +0000 (10:03 +0800)]
fix #101097, avoid infinite loop in fn arguments checking

21 months agoFix documentation lint failures
Michael Goulet [Fri, 9 Sep 2022 01:31:36 +0000 (01:31 +0000)]
Fix documentation lint failures

21 months agoAdjust pretty printing of RPITITs
Michael Goulet [Thu, 8 Sep 2022 00:45:09 +0000 (00:45 +0000)]
Adjust pretty printing of RPITITs

21 months agoRebase fallout
Michael Goulet [Thu, 8 Sep 2022 00:26:01 +0000 (00:26 +0000)]
Rebase fallout

21 months agoAppease clippy again
Michael Goulet [Tue, 6 Sep 2022 17:27:47 +0000 (17:27 +0000)]
Appease clippy again

21 months agoTweak feature error, add test
Michael Goulet [Tue, 6 Sep 2022 17:16:08 +0000 (17:16 +0000)]
Tweak feature error, add test

21 months agoHandle generic parameters.
Camille GILLOT [Tue, 6 Sep 2022 15:37:00 +0000 (17:37 +0200)]
Handle generic parameters.

21 months agoDeeply check that method signatures match, and allow for nested RPITITs
Michael Goulet [Fri, 2 Sep 2022 21:02:59 +0000 (21:02 +0000)]
Deeply check that method signatures match, and allow for nested RPITITs

21 months agoBless tests, fix ICE with ImplTraitPlaceholder
Michael Goulet [Fri, 2 Sep 2022 17:54:58 +0000 (17:54 +0000)]
Bless tests, fix ICE with ImplTraitPlaceholder

21 months agoAddress nits
Michael Goulet [Fri, 2 Sep 2022 16:55:24 +0000 (16:55 +0000)]
Address nits

21 months agoAddress rebase issues, make async fn in trait work
Michael Goulet [Fri, 2 Sep 2022 16:45:30 +0000 (16:45 +0000)]
Address rebase issues, make async fn in trait work

21 months agoMake async fn in traits work
Michael Goulet [Fri, 2 Sep 2022 15:57:31 +0000 (15:57 +0000)]
Make async fn in traits work

21 months agoMake clippy happy
Michael Goulet [Wed, 31 Aug 2022 05:29:36 +0000 (05:29 +0000)]
Make clippy happy

21 months agoAdd tests
Michael Goulet [Wed, 31 Aug 2022 04:46:54 +0000 (04:46 +0000)]
Add tests

21 months agoCheck that impl types actually satisfy RPITIT bounds
Michael Goulet [Wed, 31 Aug 2022 05:12:40 +0000 (05:12 +0000)]
Check that impl types actually satisfy RPITIT bounds

21 months agoRustdoc support
Michael Goulet [Wed, 31 Aug 2022 04:41:20 +0000 (04:41 +0000)]
Rustdoc support

21 months agoImplement projection for ImplTraitPlaceholder
Michael Goulet [Wed, 31 Aug 2022 04:41:16 +0000 (04:41 +0000)]
Implement projection for ImplTraitPlaceholder

21 months agoLower RPITIT to ImplTraitPlaceholder item
Michael Goulet [Wed, 31 Aug 2022 04:03:24 +0000 (04:03 +0000)]
Lower RPITIT to ImplTraitPlaceholder item

21 months agoRPITIT placeholder items
Michael Goulet [Wed, 31 Aug 2022 03:04:44 +0000 (03:04 +0000)]
RPITIT placeholder items

21 months agoAuto merge of #93873 - Stovent:big-ints, r=m-ou-se
bors [Fri, 9 Sep 2022 00:59:08 +0000 (00:59 +0000)]
Auto merge of #93873 - Stovent:big-ints, r=m-ou-se

Reimplement `carrying_add` and `borrowing_sub` for signed integers.

As per the discussion in #85532, this PR reimplements `carrying_add` and `borrowing_sub` for signed integers.

It also adds unit tests for both unsigned and signed integers, emphasing on the behaviours of the methods.

21 months agoCombine logic from lubs into lub_empty function
Jack Huey [Thu, 8 Sep 2022 22:36:55 +0000 (18:36 -0400)]
Combine logic from lubs into lub_empty function

21 months agoMake some functions pub(super)
Jack Huey [Sun, 26 Jun 2022 22:57:46 +0000 (18:57 -0400)]
Make some functions pub(super)

21 months agoRemove ReEmpty
Jack Huey [Sun, 26 Jun 2022 19:40:45 +0000 (15:40 -0400)]
Remove ReEmpty

21 months agoAuto merge of #9446 - mikerite:fix-9431-2, r=giraffate
bors [Thu, 8 Sep 2022 23:48:08 +0000 (23:48 +0000)]
Auto merge of #9446 - mikerite:fix-9431-2, r=giraffate

Fix `range_{plus,minus}_one` bad suggestions

Fixes #9431.

The current `range_plus_one` and `range_minus_one` suggestions are completely incorrect when macros are involved.

This commit resolves this by disabling the lints for any range expression that is expanded from a macro. The reasons for this are that it is very difficult to create a correct suggestion in this case and that false negatives are less important for pedantic lints.

changelog: Fix `range_{plus,minus}_one` bad suggestions

21 months agoFix ICE report flags display.
Eric Huss [Thu, 8 Sep 2022 23:08:53 +0000 (16:08 -0700)]
Fix ICE report flags display.

21 months agoAdd gui test for codeblocks tooltip colors
Guillaume Gomez [Thu, 8 Sep 2022 21:41:29 +0000 (23:41 +0200)]
Add gui test for codeblocks tooltip colors

21 months agoClean up themes a bit more
Guillaume Gomez [Thu, 8 Sep 2022 21:40:13 +0000 (23:40 +0200)]
Clean up themes a bit more

21 months agoDon't construct ReEmpty regions in resolve_var
Jack Huey [Sun, 26 Jun 2022 19:08:35 +0000 (15:08 -0400)]
Don't construct ReEmpty regions in resolve_var

21 months agoIn ReverseMapper, don't fallback to ReEmpty, instead ReStatic
Jack Huey [Sun, 26 Jun 2022 16:01:05 +0000 (12:01 -0400)]
In ReverseMapper, don't fallback to ReEmpty, instead ReStatic

21 months agoCreate VarValue::Empty
Jack Huey [Sun, 26 Jun 2022 04:10:07 +0000 (00:10 -0400)]
Create VarValue::Empty

21 months agoDon't use reempty as an implicit_outlives_region
Jack Huey [Sun, 19 Jun 2022 14:47:40 +0000 (10:47 -0400)]
Don't use reempty as an implicit_outlives_region

21 months agoAuto merge of #101592 - compiler-errors:rollup-d2fya7z, r=compiler-errors
bors [Thu, 8 Sep 2022 21:45:23 +0000 (21:45 +0000)]
Auto merge of #101592 - compiler-errors:rollup-d2fya7z, r=compiler-errors

Rollup of 7 pull requests

Successful merges:

 - #101423 (Fix hermit warnings)
 - #101499 (Introduce lowering_arena to avoid creating AST nodes on the fly)
 - #101530 (llvm-wrapper: adapt for LLVM API changes)
 - #101554 (rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`)
 - #101580 (rustdoc: remove unused CSS `div.impl-items > div`)
 - #101584 (rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`)
 - #101587 (Make `Debug` impl for `Term` useful)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

21 months agofix: removed swap file
Peh [Thu, 8 Sep 2022 21:44:10 +0000 (22:44 +0100)]
fix: removed swap file

21 months agoRollup merge of #101587 - BoxyUwU:term_debug, r=compiler-errors
Michael Goulet [Thu, 8 Sep 2022 21:41:13 +0000 (14:41 -0700)]
Rollup merge of #101587 - BoxyUwU:term_debug, r=compiler-errors

Make `Debug` impl for `Term` useful

because `Term { ptr: 78942378998734298342, maker: PhantomData, }` does not excel at communicating the necessary information

21 months agoRollup merge of #101584 - notriddle:notriddle/settings-menu, r=GuillaumeGomez
Michael Goulet [Thu, 8 Sep 2022 21:41:12 +0000 (14:41 -0700)]
Rollup merge of #101584 - notriddle:notriddle/settings-menu, r=GuillaumeGomez

rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`

This CSS was added in 5e01ba36c9f1037c4cf3e7421413fc6c41f85d05, and served to override CSS right above it that set a 5px padding for several kinds of buttons in the same toolbar:

https://github.com/rust-lang/rust/blob/5e01ba36c9f1037c4cf3e7421413fc6c41f85d05/src/librustdoc/html/static/css/rustdoc.css#L1400-L1409

The CSS that it overrode is still there, but now it only applies to `#settings-menu > a`, so there's nothing to override.

https://github.com/rust-lang/rust/blob/24d69920201563f0ee7b530f1cda0f171b205cc2/src/librustdoc/html/static/css/rustdoc.css#L1445-L1454

21 months agoRollup merge of #101580 - notriddle:notriddle/div-impl-items-div, r=GuillaumeGomez
Michael Goulet [Thu, 8 Sep 2022 21:41:11 +0000 (14:41 -0700)]
Rollup merge of #101580 - notriddle:notriddle/div-impl-items-div, r=GuillaumeGomez

rustdoc: remove unused CSS `div.impl-items > div`

This was added in 9077d540da944c41678a7129e04e7fc5d7e38582 to override the style on `<div>` tags that were acting as headers. These `<div>` tags were replaced with `<section>` tags in 32f62607c3142dfc9eb56a0bd72dee298ca43358, but this CSS was probably already redundant even then (the headers had already been replaced with real `<h3>` and `<h4>` tags in 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30).

21 months agoRollup merge of #101554 - notriddle:notriddle/implemenation-list-h3-span-in-band...
Michael Goulet [Thu, 8 Sep 2022 21:41:10 +0000 (14:41 -0700)]
Rollup merge of #101554 - notriddle:notriddle/implemenation-list-h3-span-in-band, r=Dylan-DPC

rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`

This was added in 51f26acaea46afd630fbab4ca441748802d20670 to help with the display of an `<h3>` tag that has a `<span class='in-band'>` inside.

The way implementation lists were rendered was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to have `<code class='in-band'>`, making this CSS unused.

Then it was turned into a `<div>` in 9077d540da944c41678a7129e04e7fc5d7e38582 without issue.

Finally, the header itself acquired the `in-band` class in 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30.

21 months agoRollup merge of #101530 - krasimirgg:llvm-16-up, r=cuviper
Michael Goulet [Thu, 8 Sep 2022 21:41:09 +0000 (14:41 -0700)]
Rollup merge of #101530 - krasimirgg:llvm-16-up, r=cuviper

llvm-wrapper: adapt for LLVM API changes

No functional changes intended.

Adapts PassWrapper for a few recent LLVM API changes:
* https://github.com/llvm/llvm-project/commit/e7bac3b9fa739f8d167a390a547068aad1d424a7
* https://github.com/llvm/llvm-project/commit/93600eb50ceeec83c488ded24fa0fd25f997fec6
* https://github.com/llvm/llvm-project/commit/5e38b2a456df6e263a509af60a731cec57310498

Note that `ModuleMemorySanitizerPass` was renamed back to its pre-14 name, `MemorySanitizerPass`, hence the funky `#if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0)` guard.

Found via our experimental rust + llvm at HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/13290#018315e6-24e1-44c8-b56d-9aad9be11c29

21 months agoRollup merge of #101499 - spastorino:add-lowering-arena, r=oli-obk
Michael Goulet [Thu, 8 Sep 2022 21:41:08 +0000 (14:41 -0700)]
Rollup merge of #101499 - spastorino:add-lowering-arena, r=oli-obk

Introduce lowering_arena to avoid creating AST nodes on the fly

`@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? `@oli-obk` `@cjgillot`

21 months agoRollup merge of #101423 - mkroening:hermit-warnings, r=sanxiyn
Michael Goulet [Thu, 8 Sep 2022 21:41:08 +0000 (14:41 -0700)]
Rollup merge of #101423 - mkroening:hermit-warnings, r=sanxiyn

Fix hermit warnings

This fixes two `unused_imprt` and one `dead_code` warning for hermit.

21 months agofix: add semicolon completion to mod
Peh [Thu, 8 Sep 2022 21:37:31 +0000 (22:37 +0100)]
fix: add semicolon completion to mod

21 months agoptr: 43276834268743978
Ellen [Thu, 8 Sep 2022 20:09:23 +0000 (21:09 +0100)]
ptr: 43276834268743978

21 months agoAuto merge of #9447 - flip1995:rustup, r=flip1995
bors [Thu, 8 Sep 2022 19:42:33 +0000 (19:42 +0000)]
Auto merge of #9447 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

21 months agoBump nightly version -> 2022-09-08
Philipp Krones [Thu, 8 Sep 2022 19:27:37 +0000 (21:27 +0200)]
Bump nightly version -> 2022-09-08

21 months agoMerge remote-tracking branch 'upstream/auto' into rustup
Philipp Krones [Thu, 8 Sep 2022 19:27:09 +0000 (21:27 +0200)]
Merge remote-tracking branch 'upstream/auto' into rustup

21 months agoAuto merge of #101437 - compiler-errors:erase-normalize-ordering, r=tmandry
bors [Thu, 8 Sep 2022 19:01:39 +0000 (19:01 +0000)]
Auto merge of #101437 - compiler-errors:erase-normalize-ordering, r=tmandry

Normalize before erasing late-bound regions in `equal_up_to_regions`

Normalize erasing regions **first**, before passing the type through a `BottomUpFolder` which erases late-bound regions too.

The root cause of this issue is due to 96d4137deed6c52c6db2dd19568c37d1c160f1e7, which removes a `normalize_erasing_regions` that happens before this call to `equal_up_to_regions`. While reverting that commit might be a fix, I think it was suspicious to be erasing late-bound regions first _then_ normalizing types in the first place in `equal_up_to_regions`.

-----

I am tempted to ask the reviewer to review and `r+` this without a UI test, since the existing issues that I think this fixes are all incredibly difficult to minimize (anything hyper/warp related, given the nature of those libraries :sweat:) or impossible to reproduce locally (the miri test), namely:
* This recently reported issue with tokio + warp: #101430
* This issue from `@RalfJung` about Miri being broken: #101344
* This additional issue reported in a comment by `@tmandry` (issue with fuchsia + hyper): https://github.com/rust-lang/rust/issues/101344#issuecomment-1235974564

I have locally verified that the repro in #101430 is fixed with this PR, but after a couple of hours of attempting to minimize this error and either failing to actually repro the ICE, or being overwhelmed with the number of traits and functions I need to inline into a UI test, I have basically given up. Thoughts are appreciated on how best to handle this.

r? `@oli-obk` who is at the intersection of MIR and types-related stuff who may be able to give advice :sweat_smile:

21 months agoFix `range_{plus,minus}_one` bad suggestions
Michael Wright [Thu, 8 Sep 2022 18:04:43 +0000 (20:04 +0200)]
Fix `range_{plus,minus}_one` bad suggestions

Fixes #9431.

The current `range_plus_one` and `range_minus_one` suggestions
are completely incorrect when macros are involved.

This commit resolves this by disabling the lints for any range
expression that is expanded from a macro. The reasons for this
are that it is very difficult to create a correct suggestion in
this case and that false negatives are less important for
pedantic lints.

21 months agoAuto merge of #9443 - c410-f3r:arith, r=flip1995
bors [Thu, 8 Sep 2022 17:58:57 +0000 (17:58 +0000)]
Auto merge of #9443 - c410-f3r:arith, r=flip1995

Rename the arithmetic lint

changelog: Rename the `arithmetic` lint

21 months agorustdoc: remove no-op CSS `#settings-menu { padding: 0 }`
Michael Howell [Thu, 8 Sep 2022 17:33:15 +0000 (10:33 -0700)]
rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`

This CSS was added in 5e01ba36c9f1037c4cf3e7421413fc6c41f85d05, and served to
override CSS right above it that set a 5px padding for several kinds of
buttons in the same toolbar.

The CSS that it overrode is still there, but now it only applies to
`#settings-menu > a`, so there's nothing to override.

21 months agoAuto merge of #9444 - Alexendoo:lintcheck-cargo, r=matthiaskrgr
bors [Thu, 8 Sep 2022 16:50:52 +0000 (16:50 +0000)]
Auto merge of #9444 - Alexendoo:lintcheck-cargo, r=matthiaskrgr

Update cargo in lintcheck_crates.toml

0.49.0 depends on a version of socket2 that no longer builds due to

```
error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
   --> /home/alex/.cargo/registry/src/github.com-1ecc6299db9ec823/socket2-0.3.11/src/sockaddr.rs:156:9
    |
156 |         mem::transmute::<SocketAddrV4, sockaddr_in>(v4);
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: source type: `SocketAddrV4` (48 bits)
    = note: target type: `sockaddr_in` (128 bits)
```

changelog: none

21 months agoAuto merge of #13158 - jonas-schievink:inlayhint-links, r=jonas-schievink
bors [Thu, 8 Sep 2022 16:38:40 +0000 (16:38 +0000)]
Auto merge of #13158 - jonas-schievink:inlayhint-links, r=jonas-schievink

feat: make clicking a closing brace inlay hint go to the opening brace

21 months agoIntroduce lowering_arena to avoid creating AST nodes on the fly
Santiago Pastorino [Tue, 6 Sep 2022 18:36:13 +0000 (15:36 -0300)]
Introduce lowering_arena to avoid creating AST nodes on the fly

21 months agoUpdate crates/rust-analyzer/src/to_proto.rs
Jonas Schievink [Thu, 8 Sep 2022 16:33:53 +0000 (18:33 +0200)]
Update crates/rust-analyzer/src/to_proto.rs

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
21 months agoAuto merge of #101577 - Dylan-DPC:rollup-l9xw7i7, r=Dylan-DPC
bors [Thu, 8 Sep 2022 15:53:14 +0000 (15:53 +0000)]
Auto merge of #101577 - Dylan-DPC:rollup-l9xw7i7, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #98933 (Opaque types' generic params do not imply anything about their hidden type's lifetimes)
 - #101041 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2)
 - #101424 (Adjust and slightly generalize operator error suggestion)
 - #101496 (Allow lower_lifetime_binder receive a closure)
 - #101501 (Allow lint passes to be bound by `TyCtxt`)
 - #101515 (Recover from typo where == is used in place of =)
 - #101545 (Remove unnecessary `PartialOrd` and `Ord`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup

21 months agorustdoc: remove unused CSS `div.impl-items > div`
Michael Howell [Thu, 8 Sep 2022 15:51:18 +0000 (08:51 -0700)]
rustdoc: remove unused CSS `div.impl-items > div`

This was added in 9077d540da944c41678a7129e04e7fc5d7e38582 to override the
style on `<div>` tags that were acting as headers. These `<div>` tags were
replaced with `<section>` tags in 32f62607c3142dfc9eb56a0bd72dee298ca43358,
but this CSS was probably already redundant even then (the headers had
already been replaced with real `<h3>` and `<h4>` tags in
76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30).

21 months agoUpdate cargo in lintcheck_crates.toml
Alex Macleod [Thu, 8 Sep 2022 15:29:26 +0000 (15:29 +0000)]
Update cargo in lintcheck_crates.toml

21 months agoAvoid infinite loop in function arguments checking
yukang [Sun, 14 Aug 2022 06:09:16 +0000 (14:09 +0800)]
Avoid infinite loop in function arguments checking

21 months agoMake clicking closing brace hint go to the opening brace
Jonas Schievink [Wed, 31 Aug 2022 16:54:19 +0000 (18:54 +0200)]
Make clicking closing brace hint go to the opening brace

21 months agoRollup merge of #101545 - TaKO8Ki:remove-unnecessary-partialord-ord, r=oli-obk
Dylan DPC [Thu, 8 Sep 2022 15:18:38 +0000 (20:48 +0530)]
Rollup merge of #101545 - TaKO8Ki:remove-unnecessary-partialord-ord, r=oli-obk

Remove unnecessary `PartialOrd` and `Ord`

21 months agoRollup merge of #101515 - chenyukang:fix-101477, r=fee1-dead
Dylan DPC [Thu, 8 Sep 2022 15:18:37 +0000 (20:48 +0530)]
Rollup merge of #101515 - chenyukang:fix-101477, r=fee1-dead

Recover from typo where == is used in place of =

Fixes #101477

21 months agoRollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwco
Dylan DPC [Thu, 8 Sep 2022 15:18:36 +0000 (20:48 +0530)]
Rollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwco

Allow lint passes to be bound by `TyCtxt`

This will allow storing things like `Ty<'tcx>` inside late lint passes. It's already possible to store various id types so they're already implicitly bound to a specific `TyCtxt`.

r? rust-lang/compiler

21 months agoRollup merge of #101496 - spastorino:lower_lifetime_binder_api_changes, r=oli-obk
Dylan DPC [Thu, 8 Sep 2022 15:18:36 +0000 (20:48 +0530)]
Rollup merge of #101496 - spastorino:lower_lifetime_binder_api_changes, r=oli-obk

Allow lower_lifetime_binder receive a closure

``@oli-obk`` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? ``@oli-obk`` ``@cjgillot``

21 months agoRollup merge of #101424 - compiler-errors:operator-err-sugg, r=TaKO8Ki
Dylan DPC [Thu, 8 Sep 2022 15:18:34 +0000 (20:48 +0530)]
Rollup merge of #101424 - compiler-errors:operator-err-sugg, r=TaKO8Ki

Adjust and slightly generalize operator error suggestion

(in no particular order)
* Stop passing around a whole extra `ProjectionPredicate`
* Add spaces around `=` in `Trait<..., Output = Ty>` suggestion
* Some code clean-ups, including
    * add `lang_item_for_op` to turn a `Op` into a `DefId`
    * avoid `SourceMap` because we don't really need to render an expr
    * Remove `TypeParamVisitor` in favor of just checking `ty.has_param_types_or_consts` -- this acts a bit differently, but shouldn't cause erroneous suggestions (actually might generalize them a bit)
* We now suggest `Output = Ty` in the `where` clause suggestion when we fail to add `Struct<T>` and `T`.

I can split this out into more PRs if needed, but they're all just miscellaneous generalizations, changes, and nitpicks I saw when messing with this operator code.

21 months agoRollup merge of #101041 - LuisCardosoOliveira:translation-rename-attr-warning-pt2...
Dylan DPC [Thu, 8 Sep 2022 15:18:34 +0000 (20:48 +0530)]
Rollup merge of #101041 - LuisCardosoOliveira:translation-rename-attr-warning-pt2, r=davidtwco

translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2

# Description

This is the second part of the `rustc_session` [migration](https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883).

**Please only review this [commit](https://github.com/rust-lang/rust/pull/101041/commits/501858195734ec77f6b121ef753b03c40645df23) that belongs to the part 2. The other ones are from the PR [#100753](https://github.com/rust-lang/rust/pull/100753) that is not yet merged.**

In this PR, we migrate the files `session.rs` and `config.rs`.

Please not that we have to `allow` the lints rules in some functions from `session.rs` because they are (at least I believe) part of the diagnostic machinery.

21 months agoRollup merge of #98933 - oli-obk:opaque_type_late_bound_lifetimes, r=lcnr
Dylan DPC [Thu, 8 Sep 2022 15:18:34 +0000 (20:48 +0530)]
Rollup merge of #98933 - oli-obk:opaque_type_late_bound_lifetimes, r=lcnr

Opaque types' generic params do not imply anything about their hidden type's lifetimes

fixes #97104

cc ```@aliemjay```

21 months agoRename the `arithmetic` lint
Caio [Thu, 8 Sep 2022 15:04:55 +0000 (12:04 -0300)]
Rename the `arithmetic` lint

21 months agomerge tests
lcnr [Thu, 8 Sep 2022 13:56:32 +0000 (15:56 +0200)]
merge tests

21 months agoupdate ui tests
lcnr [Thu, 8 Sep 2022 13:53:22 +0000 (15:53 +0200)]
update ui tests

21 months agoupdate `ParamKindOrd`
lcnr [Thu, 8 Sep 2022 13:10:49 +0000 (15:10 +0200)]
update `ParamKindOrd`

21 months agoAuto merge of #101467 - nnethercote:shrink-hir-Ty-Pat, r=spastorino
bors [Thu, 8 Sep 2022 13:11:57 +0000 (13:11 +0000)]
Auto merge of #101467 - nnethercote:shrink-hir-Ty-Pat, r=spastorino

Shrink `hir::Ty` and `hir::Pat`

r? `@ghost`

21 months agofix the suggestion of format for asm_sub_register
Yiming Lei [Wed, 31 Aug 2022 21:28:28 +0000 (14:28 -0700)]
fix the suggestion of format for asm_sub_register
modified:   compiler/rustc_typeck/src/check/intrinsicck.rs
modified:   src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
modified:   src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
modified:   src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
modified:   src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
modified:   src/test/ui/asm/type-check-1.rs
modified:   src/test/ui/asm/type-check-1.stderr
modified:   src/test/ui/asm/x86_64/type-check-3.stderr

21 months agoAuto merge of #98900 - lcnr:region-stuff, r=jackh726
bors [Thu, 8 Sep 2022 10:30:00 +0000 (10:30 +0000)]
Auto merge of #98900 - lcnr:region-stuff, r=jackh726

const_generics: correctly deal with bound variables

removes the hack in `resolve` which was needed because we evaluated constants without caring about their bound variables.

Each commit should be fairly self-contained, even if they build on each other

r? `@jackh726`

21 months agotranslations(rustc_session): migrates two diagnostics in session.rs
Luis Cardoso [Thu, 8 Sep 2022 06:15:37 +0000 (08:15 +0200)]
translations(rustc_session): migrates two diagnostics in session.rs

21 months agobound variables during ctfe are a bug
lcnr [Mon, 4 Jul 2022 17:13:53 +0000 (19:13 +0200)]
bound variables during ctfe are a bug

21 months agodon't evaluate with escaping bound vars
lcnr [Mon, 4 Jul 2022 16:38:35 +0000 (18:38 +0200)]
don't evaluate with escaping bound vars

21 months agostop evaluating constants in `Relate`
lcnr [Mon, 4 Jul 2022 16:25:37 +0000 (18:25 +0200)]
stop evaluating constants in `Relate`

21 months agogeneralize: no need to cache errors
lcnr [Mon, 4 Jul 2022 13:35:21 +0000 (15:35 +0200)]
generalize: no need to cache errors

21 months agoClarify some diagnostic messages
Oli Scherer [Thu, 25 Aug 2022 10:30:46 +0000 (10:30 +0000)]
Clarify some diagnostic messages

21 months agoUncomment unsound code example
Oli Scherer [Thu, 25 Aug 2022 10:23:22 +0000 (10:23 +0000)]
Uncomment unsound code example

21 months agoOpaque types' generic params do not imply anything about their hidden type's lifetimes
Oli Scherer [Tue, 5 Jul 2022 13:56:51 +0000 (13:56 +0000)]
Opaque types' generic params do not imply anything about their hidden type's lifetimes

21 months agoLink UEFI target documentation from target list
Seo Sanghyeon [Thu, 8 Sep 2022 08:02:59 +0000 (17:02 +0900)]
Link UEFI target documentation from target list

21 months agoAuto merge of #101560 - Dylan-DPC:rollup-8m8yr89, r=Dylan-DPC
bors [Thu, 8 Sep 2022 08:00:57 +0000 (08:00 +0000)]
Auto merge of #101560 - Dylan-DPC:rollup-8m8yr89, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #101153 (Migrate another part of rustc_infer to session diagnostic)
 - #101399 (Shrink span for bindings with subpatterns.)
 - #101422 (Hermit: Add File::set_time stub)
 - #101455 (Avoid UB in the Windows filesystem code in... bootstrap?)
 - #101498 (rustc: Parameterize `ty::Visibility` over used ID)
 - #101549 (Use HashStable_Generic in rustc_type_ir)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup