]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoRollup merge of #105071 - nnethercote:nnethercote-mailmap, r=compiler-errors
Matthias Krüger [Wed, 30 Nov 2022 06:00:32 +0000 (07:00 +0100)]
Rollup merge of #105071 - nnethercote:nnethercote-mailmap, r=compiler-errors

Add Nicholas Nethercote to `.mailmap`.

Before:
```
$ git shortlog -se | grep Nethercote
   517 Nicholas Nethercote <n.nethercote@gmail.com>
     2 Nicholas Nethercote <nnethercote@apple.com>
   560 Nicholas Nethercote <nnethercote@mozilla.com>
```
After
```
$ git shortlog -se | grep Nethercote
  1079 Nicholas Nethercote <n.nethercote@gmail.com>
```

19 months agoRollup merge of #105039 - nnethercote:fix-104769, r=petrochenkov
Matthias Krüger [Wed, 30 Nov 2022 06:00:31 +0000 (07:00 +0100)]
Rollup merge of #105039 - nnethercote:fix-104769, r=petrochenkov

Fix an ICE parsing a malformed literal in `concat_bytes!`.

Fixes #104769.

r? `@petrochenkov`

19 months agoRollup merge of #104811 - haraldh:feat/wasm32_wasi_shutdown, r=joshtriplett
Matthias Krüger [Wed, 30 Nov 2022 06:00:31 +0000 (07:00 +0100)]
Rollup merge of #104811 - haraldh:feat/wasm32_wasi_shutdown, r=joshtriplett

feat: implement TcpStream shutdown for wasm32-wasi

Signed-off-by: Harald Hoyer <harald@profian.com>
19 months agoRollup merge of #104697 - dingxiangfei2009:fix-euv-control-flow, r=oli-obk
Matthias Krüger [Wed, 30 Nov 2022 06:00:30 +0000 (07:00 +0100)]
Rollup merge of #104697 - dingxiangfei2009:fix-euv-control-flow, r=oli-obk

Restore control flow on error in EUV

cc `@Nilstrieb`

Fix #104649

Since #98574 refactored a piece of scrutinee memory categorization out as a subroutine, there is a subtle change in handling match arms especially when the categorization process faults and bails. In the correct case, it is not supposed to continue to process the arms any more. This PR restores the original control flow in EUV.

I promise to add a compile-fail test to demonstrate that this indeed fixes the issue after coming back from a nap.

19 months agoFix an ICE parsing a malformed literal in `concat_bytes!`.
Nicholas Nethercote [Tue, 29 Nov 2022 00:50:03 +0000 (11:50 +1100)]
Fix an ICE parsing a malformed literal in `concat_bytes!`.

Fixes #104769.

19 months agoAuto merge of #105070 - matthiaskrgr:rollup-9b25khj, r=matthiaskrgr
bors [Wed, 30 Nov 2022 00:42:43 +0000 (00:42 +0000)]
Auto merge of #105070 - matthiaskrgr:rollup-9b25khj, r=matthiaskrgr

Rollup of 14 pull requests

Successful merges:

 - #103876 (type alias impl trait: add tests showing that hidden type only outlives lifetimes that occur in bounds)
 - #104427 (Explain why `rematch_impl` fails to be infallible)
 - #104436 (Add slice to the stack allocated string comment)
 - #104523 (Don't use periods in target names)
 - #104627 (Print all features with --print target-features)
 - #104911 (Make inferred_outlives_crate return Clause)
 - #105002 (Add `PathBuf::as_mut_os_string` and `Path::as_mut_os_str`)
 - #105023 (Statics used in reachable function's inline asm are reachable)
 - #105045 (`rustc_ast_{passes,pretty}`: remove `ref` patterns)
 - #105049 (Hermit: Minor build fixes)
 - #105051 (Replace a macro with a function)
 - #105062 (rustdoc: use shorthand background for rustdoc toggle CSS)
 - #105066 (move `candidate_from_obligation` out of assembly)
 - #105068 (Run patchelf also on rust-analyzer-proc-macro-srv.)

Failed merges:

 - #105050 (Remove useless borrows and derefs)

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

19 months agoAdd Nicholas Nethercote to `.mailmap`.
Nicholas Nethercote [Tue, 29 Nov 2022 21:51:43 +0000 (08:51 +1100)]
Add Nicholas Nethercote to `.mailmap`.

Before:
```
$ git shortlog -se | grep Nethercote
   517 Nicholas Nethercote <n.nethercote@gmail.com>
     2 Nicholas Nethercote <nnethercote@apple.com>
   560 Nicholas Nethercote <nnethercote@mozilla.com>
```
After
```
$ git shortlog -se | grep Nethercote
  1079 Nicholas Nethercote <n.nethercote@gmail.com>
```

19 months agoRollup merge of #105068 - jneem:master, r=jyn514
Matthias Krüger [Tue, 29 Nov 2022 21:43:22 +0000 (22:43 +0100)]
Rollup merge of #105068 - jneem:master, r=jyn514

Run patchelf also on rust-analyzer-proc-macro-srv.

On NixOS, `rust-analyzer-proc-macro-srv` needs to be `patchelf`ed just like all the other libs and binaries.

With this fix, I am able to use the language server configuration recommended in [the guide](https://rustc-dev-guide.rust-lang.org/building/suggested.html#configuring-rust-analyzer-for-rustc).

19 months agoRollup merge of #105066 - lcnr:mv-candidate_from_obligation, r=compiler-errors
Matthias Krüger [Tue, 29 Nov 2022 21:43:22 +0000 (22:43 +0100)]
Rollup merge of #105066 - lcnr:mv-candidate_from_obligation, r=compiler-errors

move `candidate_from_obligation` out of assembly

it doesn't belong there as it also does winnowing

r? `@compiler-errors`

19 months agoRollup merge of #105062 - notriddle:notriddle/rustdoc-toggle-background, r=GuillaumeGomez
Matthias Krüger [Tue, 29 Nov 2022 21:43:21 +0000 (22:43 +0100)]
Rollup merge of #105062 - notriddle:notriddle/rustdoc-toggle-background, r=GuillaumeGomez

rustdoc: use shorthand background for rustdoc toggle CSS

19 months agoRollup merge of #105051 - WaffleLapkin:unmacro, r=oli-obk
Matthias Krüger [Tue, 29 Nov 2022 21:43:21 +0000 (22:43 +0100)]
Rollup merge of #105051 - WaffleLapkin:unmacro, r=oli-obk

Replace a macro with a function

🌸

19 months agoRollup merge of #105049 - mkroening:hermit-fixes, r=jyn514
Matthias Krüger [Tue, 29 Nov 2022 21:43:20 +0000 (22:43 +0100)]
Rollup merge of #105049 - mkroening:hermit-fixes, r=jyn514

Hermit: Minor build fixes

These changes are necessary to build for the hermit targets.

CC: ``@stlankes``
19 months agoRollup merge of #105045 - WaffleLapkin:deref-ahhhh~, r=compiler-errors
Matthias Krüger [Tue, 29 Nov 2022 21:43:19 +0000 (22:43 +0100)]
Rollup merge of #105045 - WaffleLapkin:deref-ahhhh~, r=compiler-errors

`rustc_ast_{passes,pretty}`: remove `ref` patterns

r? `@compiler-errors`
Previous PR: https://github.com/rust-lang/rust/pull/104721

19 months agoRollup merge of #105023 - tmiasko:asm-sym-static-reachable, r=wesleywiser
Matthias Krüger [Tue, 29 Nov 2022 21:43:19 +0000 (22:43 +0100)]
Rollup merge of #105023 - tmiasko:asm-sym-static-reachable, r=wesleywiser

Statics used in reachable function's inline asm are reachable

Fixes #104925.

19 months agoRollup merge of #105002 - zertosh:acp-140, r=dtolnay
Matthias Krüger [Tue, 29 Nov 2022 21:43:18 +0000 (22:43 +0100)]
Rollup merge of #105002 - zertosh:acp-140, r=dtolnay

Add `PathBuf::as_mut_os_string` and `Path::as_mut_os_str`

Implements rust-lang/libs-team#140 (tracking issue #105021).

19 months agoRollup merge of #104911 - spastorino:inferred_outlives_crate-return-clause, r=oli-obk
Matthias Krüger [Tue, 29 Nov 2022 21:43:18 +0000 (22:43 +0100)]
Rollup merge of #104911 - spastorino:inferred_outlives_crate-return-clause, r=oli-obk

Make inferred_outlives_crate return Clause

r? ``@oli-obk``

19 months agoRollup merge of #104627 - calebzulawski:print-target-features, r=compiler-errors
Matthias Krüger [Tue, 29 Nov 2022 21:43:17 +0000 (22:43 +0100)]
Rollup merge of #104627 - calebzulawski:print-target-features, r=compiler-errors

Print all features with --print target-features

This fixes `rustc --print target-features` with respect to aliases and tied features.

Before this change, the print command assumed that each LLVM feature corresponds exactly to one rustc feature.  In the case of aliases and tied features, this assumption failed and some features (such as aarch64's "pacg") were missing.  With this change, every target feature is listed.

19 months agoRollup merge of #104523 - flba-eb:fix_nto_target_name, r=wesleywiser
Matthias Krüger [Tue, 29 Nov 2022 21:43:17 +0000 (22:43 +0100)]
Rollup merge of #104523 - flba-eb:fix_nto_target_name, r=wesleywiser

Don't use periods in target names

Using a period in the target name can cause issues in e.g. cargo, see also https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Running.20tests.20on.20remote.20target

19 months agoRollup merge of #104436 - ismailmaj:add-slice-to-stack-allocated-string-comment,...
Matthias Krüger [Tue, 29 Nov 2022 21:43:16 +0000 (22:43 +0100)]
Rollup merge of #104436 - ismailmaj:add-slice-to-stack-allocated-string-comment, r=Mark-Simulacrum

Add slice to the stack allocated string comment

Precise that the "stack allocated string" is not a string but a string slice.

``@rustbot`` label +A-docs

19 months agoRollup merge of #104427 - compiler-errors:rematch-impl-may-fail-actually, r=lcnr
Matthias Krüger [Tue, 29 Nov 2022 21:43:16 +0000 (22:43 +0100)]
Rollup merge of #104427 - compiler-errors:rematch-impl-may-fail-actually, r=lcnr

Explain why `rematch_impl` fails to be infallible

Fixes #104395

r? `@lcnr`

19 months agoRollup merge of #103876 - oli-obk:tait_implications, r=lcnr
Matthias Krüger [Tue, 29 Nov 2022 21:43:15 +0000 (22:43 +0100)]
Rollup merge of #103876 - oli-obk:tait_implications, r=lcnr

type alias impl trait: add tests showing that hidden type only outlives lifetimes that occur in bounds

fixes #103642

https://github.com/rust-lang/rust/pull/102417 only made sure that hidden types cannot outlive lifetimes other than the ones mentioned on bounds, but didn't allow us to actually infer anything from that.

cc `@aliemjay`

19 months agoAuto merge of #94487 - oli-obk:stable_hash_ty, r=fee1-dead
bors [Tue, 29 Nov 2022 21:35:02 +0000 (21:35 +0000)]
Auto merge of #94487 - oli-obk:stable_hash_ty, r=fee1-dead

Also cache the stable hash of interned Predicates

continuation of https://github.com/rust-lang/rust/pull/94299

This is a small perf improvement and shares more code between `Ty` and `Predicate`

19 months agoRun patchelf also on rust-analyzer-proc-macro-srv.
Joe Neeman [Tue, 29 Nov 2022 20:33:55 +0000 (14:33 -0600)]
Run patchelf also on rust-analyzer-proc-macro-srv.

19 months agomove `candidate_from_obligation` out of assembly
lcnr [Tue, 29 Nov 2022 20:32:48 +0000 (20:32 +0000)]
move `candidate_from_obligation` out of assembly

it doesn't belong there as it also does winnowing

19 months agoExplain why rematch_impl fails to be infallible
Michael Goulet [Mon, 14 Nov 2022 23:25:41 +0000 (23:25 +0000)]
Explain why rematch_impl fails to be infallible

19 months agorustdoc: use shorthand background for rustdoc toggle CSS
Michael Howell [Tue, 29 Nov 2022 18:13:44 +0000 (11:13 -0700)]
rustdoc: use shorthand background for rustdoc toggle CSS

19 months agoadd `FIXME:` where it belongs
Waffle Maybe [Tue, 29 Nov 2022 18:01:49 +0000 (22:01 +0400)]
add `FIXME:` where it belongs

suggestion from a friend!! 🐸

Co-authored-by: Michael Goulet <michael@errs.io>
19 months agorename `{max=>largest}_max_leb128_len`
Maybe Waffle [Tue, 29 Nov 2022 17:58:09 +0000 (17:58 +0000)]
rename `{max=>largest}_max_leb128_len`

19 months agoMake inferred_outlives_crate return Clause
Santiago Pastorino [Fri, 25 Nov 2022 19:35:27 +0000 (16:35 -0300)]
Make inferred_outlives_crate return Clause

19 months agoAuto merge of #105012 - WaffleLapkin:into, r=oli-obk
bors [Tue, 29 Nov 2022 13:28:44 +0000 (13:28 +0000)]
Auto merge of #105012 - WaffleLapkin:into, r=oli-obk

Make `tcx.mk_const` more permissive wrt `kind` argument (`impl Into`)

r? `@oli-obk` you've asked for this >:)

19 months agoReplace a macro with a function
Maybe Waffle [Tue, 29 Nov 2022 11:52:48 +0000 (11:52 +0000)]
Replace a macro with a function

19 months agohermit: Remove unused exports
Martin Kröning [Tue, 29 Nov 2022 10:27:25 +0000 (11:27 +0100)]
hermit: Remove unused exports

19 months agohermit: Fix fuzzy_provenance_casts
Martin Kröning [Tue, 29 Nov 2022 10:26:40 +0000 (11:26 +0100)]
hermit: Fix fuzzy_provenance_casts

19 months agoAuto merge of #104947 - cjgillot:verify-hir-nest, r=oli-obk
bors [Tue, 29 Nov 2022 10:34:19 +0000 (10:34 +0000)]
Auto merge of #104947 - cjgillot:verify-hir-nest, r=oli-obk

Verify that HIR parenting and Def parenting match.

This relationship is relied upon for `tcx.hir_owner_parent` query to return an accurate result.

19 months ago`rustc_ast_pretty`: remove `ref` patterns
Maybe Waffle [Tue, 29 Nov 2022 08:08:26 +0000 (08:08 +0000)]
`rustc_ast_pretty`: remove `ref` patterns

19 months ago`rustc_ast_passes`: remove `ref` patterns
Maybe Waffle [Mon, 28 Nov 2022 19:16:44 +0000 (19:16 +0000)]
`rustc_ast_passes`: remove `ref` patterns

19 months agoAuto merge of #105041 - matthiaskrgr:rollup-7ffry90, r=matthiaskrgr
bors [Tue, 29 Nov 2022 07:04:01 +0000 (07:04 +0000)]
Auto merge of #105041 - matthiaskrgr:rollup-7ffry90, r=matthiaskrgr

Rollup of 10 pull requests

Successful merges:

 - #104465 (Document more settings for building rustc for Fuchsia)
 - #104951 (Simplify checking for `GeneratorKind::Async`)
 - #104959 (Revert #104269 (to avoid spurious hang/test failure in CI))
 - #104978 (notify the rust-analyzer team on changes to the rust-analyzer subtree)
 - #105010 (Fix documentation of asymptotic complexity for rustc_data_structures::SortedMap)
 - #105016 (Add sentence when rustdoc search is running)
 - #105020 (rustdoc: merge background-image rules in rustdoc-toggle CSS)
 - #105024 (rustdoc: remove `fnname` CSS class that's styled exactly like `fn`)
 - #105027 (Rustdoc-Json: Add tests for linking to foreign variants.)
 - #105038 (Clean up pr 104954)

Failed merges:

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

19 months agoRollup merge of #105038 - Rageking8:clean-up-pr-104954, r=compiler-errors
Matthias Krüger [Tue, 29 Nov 2022 04:24:25 +0000 (05:24 +0100)]
Rollup merge of #105038 - Rageking8:clean-up-pr-104954, r=compiler-errors

Clean up pr 104954

UI test filename typo fix and a simple comment rewording. Thanks.

CC `@vincenzopalazzo` (you spelled your name wrongly in the FIXME)

r? `@estebank`

19 months agoRollup merge of #105027 - aDotInTheVoid:rdj-foreign-variant-test, r=GuillaumeGomez
Matthias Krüger [Tue, 29 Nov 2022 04:24:25 +0000 (05:24 +0100)]
Rollup merge of #105027 - aDotInTheVoid:rdj-foreign-variant-test, r=GuillaumeGomez

Rustdoc-Json: Add tests for linking to foreign variants.

I initially taught these would be bugs, but it turn out they work perfectly, and the variant is added to paths.

Most of the work is done by jsondoclint checking all the ID's resolve (although this wont happen for links until #105015, which in turn is blocked on removing foreign traits), but we do check that neither the enum nor the variant is inlined, so it must be resolved correctly through paths.

r? ``@GuillaumeGomez``

19 months agoRollup merge of #105024 - notriddle:notriddle/fnname, r=jyn514
Matthias Krüger [Tue, 29 Nov 2022 04:24:24 +0000 (05:24 +0100)]
Rollup merge of #105024 - notriddle:notriddle/fnname, r=jyn514

rustdoc: remove `fnname` CSS class that's styled exactly like `fn`

It's not obvious why this was ever a separate class name, since even in c4219a478354b464079b1b7ab081e071e8e39765 when it was first added, it was styled identically to regular `fn` links.

19 months agoRollup merge of #105020 - notriddle:notriddle/rustdoc-toggle, r=GuillaumeGomez
Matthias Krüger [Tue, 29 Nov 2022 04:24:24 +0000 (05:24 +0100)]
Rollup merge of #105020 - notriddle:notriddle/rustdoc-toggle, r=GuillaumeGomez

rustdoc: merge background-image rules in rustdoc-toggle CSS

19 months agoRollup merge of #105016 - GuillaumeGomez:load-sentence-rustdoc, r=notriddle
Matthias Krüger [Tue, 29 Nov 2022 04:24:23 +0000 (05:24 +0100)]
Rollup merge of #105016 - GuillaumeGomez:load-sentence-rustdoc, r=notriddle

Add sentence when rustdoc search is running

This is a small improvement, mostly relevant on big search indexes. As soon as the search starts, it'll display:

![image](https://user-images.githubusercontent.com/3050060/204336014-4660634a-09a0-4d5e-a772-d7e1e810dddf.png)

cc ``@jsha``
r? ``@notriddle``

19 months agoRollup merge of #105010 - Neutron3529:patch-2, r=jyn514
Matthias Krüger [Tue, 29 Nov 2022 04:24:23 +0000 (05:24 +0100)]
Rollup merge of #105010 - Neutron3529:patch-2, r=jyn514

Fix documentation of asymptotic complexity for rustc_data_structures::SortedMap

https://users.rust-lang.org/t/is-the-document-in-sortedmap-in-rustc-data-structures-sorted-map-correct/84939

SortedMap have `O(n)` insertions and removal rather than `O(log(n))`

19 months agoRollup merge of #104978 - Veykril:patch-2, r=jyn514
Matthias Krüger [Tue, 29 Nov 2022 04:24:22 +0000 (05:24 +0100)]
Rollup merge of #104978 - Veykril:patch-2, r=jyn514

notify the rust-analyzer team on changes to the rust-analyzer subtree

As proposed in https://github.com/rust-lang/rust-analyzer/pull/13676#issuecomment-1327621946

19 months agoRollup merge of #104959 - compiler-errors:revert-104269, r=lcnr
Matthias Krüger [Tue, 29 Nov 2022 04:24:21 +0000 (05:24 +0100)]
Rollup merge of #104959 - compiler-errors:revert-104269, r=lcnr

Revert #104269 (to avoid spurious hang/test failure in CI)

Causes hangs/memory overflows in the test suite apparently :cry:

Reopens #104225
Fixes #104957
r? ``@lcnr``

19 months agoRollup merge of #104951 - Swatinem:async-kind, r=compiler-errors
Matthias Krüger [Tue, 29 Nov 2022 04:24:21 +0000 (05:24 +0100)]
Rollup merge of #104951 - Swatinem:async-kind, r=compiler-errors

Simplify checking for `GeneratorKind::Async`

Adds a helper method around `generator_kind` that makes matching async constructs simpler.

19 months agoRollup merge of #104465 - djkoloski:improve_fuchsia_testing_docs, r=tmandry
Matthias Krüger [Tue, 29 Nov 2022 04:24:20 +0000 (05:24 +0100)]
Rollup merge of #104465 - djkoloski:improve_fuchsia_testing_docs, r=tmandry

Document more settings for building rustc for Fuchsia

This documents that you need to link for Fuchsia with `lld` and provides configuration settings for both `clang` and `lld`. It also adjusts the documentation for running the test suite to recommend installing to a prefix.

r? ``@tmandry``

19 months agoAuto merge of #105001 - nicholasbishop:bishop-more-uefi-test, r=jyn514
bors [Tue, 29 Nov 2022 04:20:23 +0000 (04:20 +0000)]
Auto merge of #105001 - nicholasbishop:bishop-more-uefi-test, r=jyn514

test-various: Add tests for {i686,aarch64}-unknown-uefi

This extends the existing test for x86_64-unknown-uefi to test the other two UEFI targets as well.

19 months agoclean up pr 104954
Rageking8 [Tue, 29 Nov 2022 00:56:43 +0000 (08:56 +0800)]
clean up pr 104954

19 months agoAuto merge of #104992 - ehuss:docs-triagebot-assign, r=Mark-Simulacrum
bors [Tue, 29 Nov 2022 00:17:18 +0000 (00:17 +0000)]
Auto merge of #104992 - ehuss:docs-triagebot-assign, r=Mark-Simulacrum

Assign myself for docs updates

This sets myself as the reviewer for docs submodule updates. Now with https://github.com/rust-lang/triagebot/pull/1673 automating the process, this piece of the puzzle handles the assignment step.

19 months agoSimplify checking for `GeneratorKind::Async`
Arpad Borsos [Sat, 26 Nov 2022 20:33:12 +0000 (21:33 +0100)]
Simplify checking for `GeneratorKind::Async`

Adds a helper method around `generator_kind` that makes matching async constructs simpler.

19 months agoAuto merge of #105017 - matthiaskrgr:rollup-j0x550l, r=matthiaskrgr
bors [Mon, 28 Nov 2022 20:53:42 +0000 (20:53 +0000)]
Auto merge of #105017 - matthiaskrgr:rollup-j0x550l, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #104804 (Rename `ast::Lit` as `ast::MetaItemLit`.)
 - #104891 (Add documentation for `has_escaping_bound_vars`)
 - #104933 (interpret: remove PartialOrd from a bunch of types that do not have or need a sensible order)
 - #104936 (Ignore bivariant parameters in test_type_match.)
 - #104954 (make simple check of prinf function)
 - #104956 (Avoid ICE if the Clone trait is not found while building error suggestions)
 - #104982 (interpret: get rid of run() function)
 - #104998 (Update my mailmap)
 - #105006 (stricter alignment enforcement for ScalarPair)

Failed merges:

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

19 months agoRustdoc-Json: Add tests for linking to foreign variants.
Nixon Enraght-Moony [Mon, 28 Nov 2022 19:29:23 +0000 (19:29 +0000)]
Rustdoc-Json: Add tests for linking to foreign variants.

19 months agoRemove `Const::from_scalar_int`
Maybe Waffle [Mon, 28 Nov 2022 18:04:29 +0000 (18:04 +0000)]
Remove `Const::from_scalar_int`

19 months agorustdoc: remove `fnname` CSS class that's styled exactly like `fn`
Michael Howell [Mon, 28 Nov 2022 17:21:19 +0000 (10:21 -0700)]
rustdoc: remove `fnname` CSS class that's styled exactly like `fn`

It's not obvious why this was ever a separate class name, since even
in c4219a478354b464079b1b7ab081e071e8e39765 when it was first added,
it was styled identically to regular `fn` links.

19 months agoPermit deps (scarry)
Maybe Waffle [Mon, 28 Nov 2022 13:37:36 +0000 (13:37 +0000)]
Permit deps (scarry)

19 months agoRemove `Const::from_value`
Maybe Waffle [Mon, 28 Nov 2022 12:38:15 +0000 (12:38 +0000)]
Remove `Const::from_value`

...it's just `mk_const` but without the sparcles

19 months agoStatics used in reachable function's inline asm are reachable
Tomasz Miąsko [Mon, 28 Nov 2022 00:00:00 +0000 (00:00 +0000)]
Statics used in reachable function's inline asm are reachable

19 months agoSimplify calls to `tcx.mk_const`
Maybe Waffle [Mon, 28 Nov 2022 12:28:32 +0000 (12:28 +0000)]
Simplify calls to `tcx.mk_const`

`mk_const(ty::ConstKind::X(...), ty)` can now be simplified to
`mk_cosnt(...,                   ty)`.

I searched with the following regex: \mk_const\([\n\s]*(ty::)?ConstKind\
I've left `ty::ConstKind::{Bound, Error}` as-is, they seem clearer this
way.

19 months agoRemove `tcx.mk_const_var`
Maybe Waffle [Mon, 28 Nov 2022 11:27:18 +0000 (11:27 +0000)]
Remove `tcx.mk_const_var`

... `tcx.mk_const` can now be used instead

19 months agoMake `tcx.mk_const` more permissive wrt `kind` argument
Maybe Waffle [Mon, 28 Nov 2022 11:11:45 +0000 (11:11 +0000)]
Make `tcx.mk_const` more permissive wrt `kind` argument

- Accept `impl Into`
- Implement `From<>` for `ConstKind`

Note: this adds a dependency on `derive_more` (MIT license). It allows
to derive a lot of traits (like `From` here) that would be otherwise
tedious to implement.

19 months agoAdd `as_mut_os_string` to `&mut PathBuf` and `as_mut_os_str` to `&mut Path`
Andres Suarez [Mon, 28 Nov 2022 02:40:38 +0000 (02:40 +0000)]
Add `as_mut_os_string` to `&mut PathBuf` and `as_mut_os_str` to `&mut Path`

Implements rust-lang/libs-team#140

19 months agorustdoc: merge background-image rules in rustdoc-toggle CSS
Michael Howell [Mon, 28 Nov 2022 16:55:36 +0000 (09:55 -0700)]
rustdoc: merge background-image rules in rustdoc-toggle CSS

19 months agoAdd sentence when rustdoc search is running
Guillaume Gomez [Mon, 28 Nov 2022 16:23:50 +0000 (17:23 +0100)]
Add sentence when rustdoc search is running

19 months agoRollup merge of #105006 - RalfJung:scalar-pair-alignment, r=eddyb
Matthias Krüger [Mon, 28 Nov 2022 16:25:50 +0000 (17:25 +0100)]
Rollup merge of #105006 - RalfJung:scalar-pair-alignment, r=eddyb

stricter alignment enforcement for ScalarPair

`@eddyb` [indicated](https://github.com/rust-lang/rust/pull/103926#discussion_r1033315005) that alignment violating this check might be a bug. So let's see what the test suite says.

(Only the 2nd commit actually changes behavior... but I couldn't not do that other cleanup.^^)

Does the PR CI runner even enable debug assertions though...?

19 months agoRollup merge of #104998 - JakobDegen:mailmap, r=jyn514
Matthias Krüger [Mon, 28 Nov 2022 16:25:50 +0000 (17:25 +0100)]
Rollup merge of #104998 - JakobDegen:mailmap, r=jyn514

Update my mailmap

19 months agoRollup merge of #104982 - RalfJung:norun, r=oli-obk
Matthias Krüger [Mon, 28 Nov 2022 16:25:49 +0000 (17:25 +0100)]
Rollup merge of #104982 - RalfJung:norun, r=oli-obk

interpret: get rid of run() function

Miri needs its own loop anyway, so there's not much of a point in trying to share this code.

19 months agoRollup merge of #104956 - mucinoab:issue-104870, r=compiler-errors
Matthias Krüger [Mon, 28 Nov 2022 16:25:49 +0000 (17:25 +0100)]
Rollup merge of #104956 - mucinoab:issue-104870, r=compiler-errors

Avoid ICE if the Clone trait is not found while building error suggestions

Fixes #104870

r? `@compiler-errors`

19 months agoRollup merge of #104954 - vincenzopalazzo:macros/prinf, r=estebank
Matthias Krüger [Mon, 28 Nov 2022 16:25:48 +0000 (17:25 +0100)]
Rollup merge of #104954 - vincenzopalazzo:macros/prinf, r=estebank

make simple check of prinf function

Fixes https://github.com/rust-lang/rust/issues/92898

With this commit we start to make some simple
check when the name resolution fails, and
we generate some helper messages in case the
name is a C name like in the case of the `printf`
and suggest the correct rust method.

`@rustbot` r? `@pnkfelix`

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
19 months agoRollup merge of #104936 - cjgillot:self-rpit-orig-too, r=oli-obk
Matthias Krüger [Mon, 28 Nov 2022 16:25:47 +0000 (17:25 +0100)]
Rollup merge of #104936 - cjgillot:self-rpit-orig-too, r=oli-obk

Ignore bivariant parameters in test_type_match.

https://github.com/rust-lang/rust/pull/103491 made opaque types bivariant with respect of some of their lifetime parameters.  Because of this bivariance, some lifetime variables were not unified to anything during borrowck, and were considered as unequal by borrowck type test.

This PR makes type test ignore the bivariant parameters in test_type_match.

Fixes https://github.com/rust-lang/rust/issues/104815

r? `@oli-obk`

19 months agoRollup merge of #104933 - RalfJung:interpret-partial-ord, r=oli-obk
Matthias Krüger [Mon, 28 Nov 2022 16:25:47 +0000 (17:25 +0100)]
Rollup merge of #104933 - RalfJung:interpret-partial-ord, r=oli-obk

interpret: remove PartialOrd from a bunch of types that do not have or need a sensible order

r? `@oli-obk`

19 months agoRollup merge of #104891 - fee1-dead-contrib:escaping_bound_vars_docs, r=wesleywiser
Matthias Krüger [Mon, 28 Nov 2022 16:25:46 +0000 (17:25 +0100)]
Rollup merge of #104891 - fee1-dead-contrib:escaping_bound_vars_docs, r=wesleywiser

Add documentation for `has_escaping_bound_vars`

Thanks to `@BoxyUwU` for explaining this to me. Adding docs with a helpful link if people get confused.

19 months agoRollup merge of #104804 - nnethercote:MetaItemLit, r=petrochenkov
Matthias Krüger [Mon, 28 Nov 2022 16:25:46 +0000 (17:25 +0100)]
Rollup merge of #104804 - nnethercote:MetaItemLit, r=petrochenkov

Rename `ast::Lit` as `ast::MetaItemLit`.

And some other literal cleanups.

r? `@petrochenkov`

19 months agostricter alignment enforcement for ScalarPair and Vector
Ralf Jung [Mon, 28 Nov 2022 09:45:22 +0000 (10:45 +0100)]
stricter alignment enforcement for ScalarPair and Vector

19 months agoAuto merge of #105008 - Dylan-DPC:rollup-wcd19yu, r=Dylan-DPC
bors [Mon, 28 Nov 2022 13:20:33 +0000 (13:20 +0000)]
Auto merge of #105008 - Dylan-DPC:rollup-wcd19yu, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #104360 (Stabilize native library modifier `verbatim`)
 - #104732 (Refactor `ty::ClosureKind` related stuff)
 - #104795 (Change multiline span ASCII art visual order)
 - #104890 (small method code cleanup)
 - #104907 (Remove `SelectionContext::infcx()` in favor of field access)
 - #104927 (Simplify some binder shifting logic)

Failed merges:

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

19 months agoAuto merge of #102991 - Sp00ph:master, r=scottmcm
bors [Mon, 28 Nov 2022 10:39:47 +0000 (10:39 +0000)]
Auto merge of #102991 - Sp00ph:master, r=scottmcm

Update VecDeque implementation to use head+len instead of head+tail

(See #99805)

This changes `alloc::collections::VecDeque`'s internal representation from using head and tail indices to using a head index and a length field. It has a few advantages over the current design:
* It allows the buffer to be of length 0, which means the `VecDeque::new` new longer has to allocate and could be changed to a `const fn`
* It allows the `VecDeque` to fill the buffer completely, unlike the old implementation, which always had to leave a free space
* It removes the restriction for the size to be a power of two, allowing it to properly `shrink_to_fit`, unlike the old `VecDeque`
* The above points also combine to allow the `Vec<T> -> VecDeque<T>` conversion to be very cheap and guaranteed O(1). I mention this in the `From<Vec<T>>` impl, but it's not a strong guarantee just yet, as that would likely need some form of API change proposal.

All the tests seem to pass for the new `VecDeque`, with some slight adjustments.

r? `@scottmcm`

19 months agofix document
Neutron3529 [Mon, 28 Nov 2022 10:31:55 +0000 (18:31 +0800)]
fix document

https://users.rust-lang.org/t/is-the-document-in-sortedmap-in-rustc-data-structures-sorted-map-correct/84939

SortedMap have `O(n)` insertions and removal rather than `O(log(n))`

19 months agoRollup merge of #104927 - compiler-errors:binder-shifting-logic, r=oli-obk
Dylan DPC [Mon, 28 Nov 2022 10:12:12 +0000 (15:42 +0530)]
Rollup merge of #104927 - compiler-errors:binder-shifting-logic, r=oli-obk

Simplify some binder shifting logic

Not sure if worth, but we'll see

19 months agoRollup merge of #104907 - compiler-errors:selcx-infcx, r=oli-obk
Dylan DPC [Mon, 28 Nov 2022 10:12:11 +0000 (15:42 +0530)]
Rollup merge of #104907 - compiler-errors:selcx-infcx, r=oli-obk

Remove `SelectionContext::infcx()` in favor of field access

Encapsulation doesn't seem particularly important here, and having two choices is always more confusing than having one.

r? types

19 months agoRollup merge of #104890 - lcnr:small-cleanup, r=fee1-dead
Dylan DPC [Mon, 28 Nov 2022 10:12:11 +0000 (15:42 +0530)]
Rollup merge of #104890 - lcnr:small-cleanup, r=fee1-dead

small method code cleanup

19 months agoRollup merge of #104795 - estebank:multiline-spans, r=TaKO8Ki
Dylan DPC [Mon, 28 Nov 2022 10:12:10 +0000 (15:42 +0530)]
Rollup merge of #104795 - estebank:multiline-spans, r=TaKO8Ki

Change multiline span ASCII art visual order

Tweak the ASCII art for nested multiline spans so that we minimize line overlaps.

Partially addresses https://github.com/rust-lang/rust/issues/61017.

19 months agoRollup merge of #104732 - WaffleLapkin:from_def_idn't, r=compiler-errors
Dylan DPC [Mon, 28 Nov 2022 10:12:10 +0000 (15:42 +0530)]
Rollup merge of #104732 - WaffleLapkin:from_def_idn't, r=compiler-errors

Refactor `ty::ClosureKind` related stuff

I've tried to fix all duplication and weirdness, but if I missed something do tell :p

r? `@compiler-errors`

19 months agoRollup merge of #104360 - petrochenkov:stabverb, r=TaKO8Ki
Dylan DPC [Mon, 28 Nov 2022 10:12:09 +0000 (15:42 +0530)]
Rollup merge of #104360 - petrochenkov:stabverb, r=TaKO8Ki

Stabilize native library modifier `verbatim`

Stabilization report - https://github.com/rust-lang/rust/pull/104360#issuecomment-1312724787.

cc https://github.com/rust-lang/rust/issues/81490
Closes https://github.com/rust-lang/rust/issues/99425

19 months agosanity_check_layout: less rightwards drift
Ralf Jung [Mon, 28 Nov 2022 09:45:12 +0000 (10:45 +0100)]
sanity_check_layout: less rightwards drift

19 months agofix clippy tests
Esteban Küber [Mon, 28 Nov 2022 08:41:31 +0000 (00:41 -0800)]
fix clippy tests

19 months agoTweak output
Esteban Küber [Wed, 23 Nov 2022 22:51:24 +0000 (14:51 -0800)]
Tweak output

19 months agoChange multiline span ASCII art visual order
Esteban Küber [Wed, 23 Nov 2022 22:28:45 +0000 (14:28 -0800)]
Change multiline span ASCII art visual order

19 months agoRename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.
Nicholas Nethercote [Thu, 24 Nov 2022 04:00:09 +0000 (15:00 +1100)]
Rename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.

We already use a mix of `Literal` and `Lit`. The latter is better
because it is shorter without causing any ambiguity.

19 months agoAdjust comments on `StrLit`.
Nicholas Nethercote [Thu, 24 Nov 2022 21:18:57 +0000 (08:18 +1100)]
Adjust comments on `StrLit`.

19 months agoRename `ast::Lit` as `ast::MetaItemLit`.
Nicholas Nethercote [Wed, 23 Nov 2022 04:39:42 +0000 (15:39 +1100)]
Rename `ast::Lit` as `ast::MetaItemLit`.

19 months agoFactor out a repeated expression in `lower_attr_args`.
Nicholas Nethercote [Thu, 24 Nov 2022 02:47:57 +0000 (13:47 +1100)]
Factor out a repeated expression in `lower_attr_args`.

19 months agoRemove `Lit::from_included_bytes`.
Nicholas Nethercote [Wed, 23 Nov 2022 06:00:37 +0000 (17:00 +1100)]
Remove `Lit::from_included_bytes`.

`Lit::from_included_bytes` calls `Lit::from_lit_kind`, but the two call
sites only need the resulting `token::Lit`, not the full `ast::Lit`.

This commit changes those call sites to use `LitKind::to_token_lit`,
which means `from_included_bytes` can be removed.

19 months agotest-various: Add tests for {i686,aarch64}-unknown-uefi
Nicholas Bishop [Sun, 20 Nov 2022 01:28:19 +0000 (01:28 +0000)]
test-various: Add tests for {i686,aarch64}-unknown-uefi

This extends the existing test for x86_64-unknown-uefi to test the
other two UEFI targets as well.

19 months agoAuto merge of #104915 - weihanglo:update-cargo, r=ehuss
bors [Mon, 28 Nov 2022 03:16:58 +0000 (03:16 +0000)]
Auto merge of #104915 - weihanglo:update-cargo, r=ehuss

Update cargo

5 commits in ba607b23db8398723d659249d9abf5536bc322e5..e027c4b5d25af2119b1956fac42863b9b3242744 2022-11-22 20:52:39 +0000 to 2022-11-25 19:44:46 +0000

- fix: Move off atty to resolve soundness issue (rust-lang/cargo#11420)
- add newline char to `cargo install .` error message for easier reading. (rust-lang/cargo#11401)
- chore: Upgrade to env_logger (rust-lang/cargo#11417)
- Change rustdoc-scrape-examples to be a target-level configuration (rust-lang/cargo#10343)
- temporarily disable test `lto::test_profile` (rust-lang/cargo#11419)

r+ `@ghost`

19 months agoAvoid ICE if the Clone trait is not found while building error suggestions
Bruno A. Muciño [Mon, 28 Nov 2022 02:50:13 +0000 (20:50 -0600)]
Avoid ICE if the Clone trait is not found while building error suggestions

19 months agoUpdate my mailmap
Jakob Degen [Mon, 28 Nov 2022 01:18:38 +0000 (17:18 -0800)]
Update my mailmap

19 months agoAuto merge of #104990 - matthiaskrgr:rollup-oskk8v3, r=matthiaskrgr
bors [Mon, 28 Nov 2022 00:18:22 +0000 (00:18 +0000)]
Auto merge of #104990 - matthiaskrgr:rollup-oskk8v3, r=matthiaskrgr

Rollup of 4 pull requests

Successful merges:

 - #104955 (Switch rustdoc-gui test to function call)
 - #104976 (Prefer doc comments over `//`-comments in compiler)
 - #104984 (Remove Crate::primitives field)
 - #104989 (update Miri)

Failed merges:

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

19 months agoFix `pretty-std` test
Markus Everling [Sun, 27 Nov 2022 22:08:14 +0000 (23:08 +0100)]
Fix `pretty-std` test

19 months agoRollup merge of #104989 - RalfJung:miri, r=RalfJung
Matthias Krüger [Sun, 27 Nov 2022 21:14:09 +0000 (22:14 +0100)]
Rollup merge of #104989 - RalfJung:miri, r=RalfJung

update Miri

r? `@ghost`

19 months agoRollup merge of #104984 - GuillaumeGomez:remote-crate-primitives, r=notriddle
Matthias Krüger [Sun, 27 Nov 2022 21:14:09 +0000 (22:14 +0100)]
Rollup merge of #104984 - GuillaumeGomez:remote-crate-primitives, r=notriddle

Remove Crate::primitives field

It is a new approach to #90447. Instead of removing primitives from everywhere (ie from `BadImplStripper`), I just removed them from the `Crate` type, allowing to reduce its size.

cc `@camelid`
r? `@notriddle`