]> git.lizzy.rs Git - rust.git/log
rust.git
19 months agoRollup merge of #105087 - HKalbasi:master, r=eddyb
Matthias Krüger [Thu, 1 Dec 2022 10:59:00 +0000 (11:59 +0100)]
Rollup merge of #105087 - HKalbasi:master, r=eddyb

Extract llvm datalayout parsing out of spec module

fix https://github.com/rust-lang/rust/pull/103693#discussion_r1033250846

19 months agoRollup merge of #105078 - TaKO8Ki:fix-105011, r=nnethercote
Matthias Krüger [Thu, 1 Dec 2022 10:58:59 +0000 (11:58 +0100)]
Rollup merge of #105078 - TaKO8Ki:fix-105011, r=nnethercote

Fix `expr_to_spanned_string` ICE

Fixes #105011

19 months agoAuto merge of #104861 - nnethercote:attr-cleanups, r=petrochenkov
bors [Thu, 1 Dec 2022 07:13:45 +0000 (07:13 +0000)]
Auto merge of #104861 - nnethercote:attr-cleanups, r=petrochenkov

Attribute cleanups

Best reviewed one commit at a time.

r? `@petrochenkov`

19 months agoAuto merge of #105095 - matthiaskrgr:rollup-9pu7vrx, r=matthiaskrgr
bors [Thu, 1 Dec 2022 04:16:30 +0000 (04:16 +0000)]
Auto merge of #105095 - matthiaskrgr:rollup-9pu7vrx, r=matthiaskrgr

Rollup of 9 pull requests

Successful merges:

 - #103065 (rustdoc-json: Document and Test that args can be patterns.)
 - #104865 (Don't overwrite local changes when updating submodules)
 - #104895 (Avoid Invalid code suggested when encountering unsatisfied trait bounds in derive macro code)
 - #105063 (Rustdoc Json Tests: Don't assume that core::fmt::Debug will always have one item.)
 - #105064 (rustdoc: add comment to confusing CSS `main { min-width: 0 }`)
 - #105074 (Add Nicholas Bishop to `.mailmap`)
 - #105081 (Add a regression test for #104322)
 - #105086 (rustdoc: clean up sidebar link CSS)
 - #105091 (add Tshepang Mbambo to .mailmap)

Failed merges:

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

19 months agoAuto merge of #104160 - Ayush1325:windows-args, r=m-ou-se
bors [Thu, 1 Dec 2022 01:22:32 +0000 (01:22 +0000)]
Auto merge of #104160 - Ayush1325:windows-args, r=m-ou-se

  Extract WStrUnits to sys_common::wstr

This commit extracts WStrUnits from sys::windows::args to sys_common::wstr. This allows using the same structure for other targets which use wtf8 (example UEFI).

This was originally a part of https://github.com/rust-lang/rust/pull/100316

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
19 months agoRollup merge of #105091 - tshepang:mailmap, r=compiler-errors
Matthias Krüger [Wed, 30 Nov 2022 18:53:21 +0000 (19:53 +0100)]
Rollup merge of #105091 - tshepang:mailmap, r=compiler-errors

add Tshepang Mbambo to .mailmap

... because my surname has changed

```
# before
❯ git shortlog --summary --email | rg Tshepang
   326  Tshepang Lekhonkhobe <tshepang@gmail.com>
     8  Tshepang Mbambo <tshepang@gmail.com>

# after
❯ git shortlog --summary --email | rg Tshepang
   334  Tshepang Mbambo <tshepang@gmail.com>

19 months agoRollup merge of #105086 - notriddle:notriddle/sidebar-css, r=GuillaumeGomez
Matthias Krüger [Wed, 30 Nov 2022 18:53:20 +0000 (19:53 +0100)]
Rollup merge of #105086 - notriddle:notriddle/sidebar-css, r=GuillaumeGomez

rustdoc: clean up sidebar link CSS

Group `text-overflow: ellipses` along with `white-space: nowrap`. It makes no sense to try to apply it to links with `overflow-wrap: anywhere`, because it can't actually make ellipses when that's turned on.

Simplify the selector for the 25rem left padding on sidebar links, to match up with the style for the container left padding that makes room for it.

19 months agoRollup merge of #105081 - weiznich:regression_test_for_104322, r=compiler-errors
Matthias Krüger [Wed, 30 Nov 2022 18:53:20 +0000 (19:53 +0100)]
Rollup merge of #105081 - weiznich:regression_test_for_104322, r=compiler-errors

Add a regression test for #104322

r? ``@compiler-errors``

19 months agoRollup merge of #105074 - nicholasbishop:bishop-mailmap, r=Mark-Simulacrum
Matthias Krüger [Wed, 30 Nov 2022 18:53:19 +0000 (19:53 +0100)]
Rollup merge of #105074 - nicholasbishop:bishop-mailmap, r=Mark-Simulacrum

Add Nicholas Bishop to `.mailmap`

19 months agoRollup merge of #105064 - notriddle:notriddle/main-min-width, r=GuillaumeGomez
Matthias Krüger [Wed, 30 Nov 2022 18:53:19 +0000 (19:53 +0100)]
Rollup merge of #105064 - notriddle:notriddle/main-min-width, r=GuillaumeGomez

rustdoc: add comment to confusing CSS `main { min-width: 0 }`

This CSS was added in cad0fce2053d52b7ba04c458f4c124c8b5c6141e, but the reason why it was necessary was unclear. This comment makes it clear.

19 months agoRollup merge of #105063 - aDotInTheVoid:rdj-dont-assume-core, r=notriddle
Matthias Krüger [Wed, 30 Nov 2022 18:53:18 +0000 (19:53 +0100)]
Rollup merge of #105063 - aDotInTheVoid:rdj-dont-assume-core, r=notriddle

Rustdoc Json Tests: Don't assume that core::fmt::Debug will always have one item.

See https://github.com/rust-lang/rust/pull/104525#issuecomment-1330837047 and https://github.com/rust-lang/rust/pull/104525#issuecomment-1331087852 for motivation.

This still assumes that `fmt` is the first method, but thats alot less brittle than assuming it will be the only method.

Sadly, we can't use a aux crate to insulate the tests from core changes, because core is special, so all we can do is try not to depend on things that may change.

19 months agoRollup merge of #104895 - chenyukang:yukang/fix-104884-serde, r=TaKO8Ki
Matthias Krüger [Wed, 30 Nov 2022 18:53:18 +0000 (19:53 +0100)]
Rollup merge of #104895 - chenyukang:yukang/fix-104884-serde, r=TaKO8Ki

Avoid Invalid code suggested when encountering unsatisfied trait bounds in derive macro code

Fixes #104884

19 months agoRollup merge of #104865 - pratushrai0309:bootstrap, r=jyn514
Matthias Krüger [Wed, 30 Nov 2022 18:53:17 +0000 (19:53 +0100)]
Rollup merge of #104865 - pratushrai0309:bootstrap, r=jyn514

Don't overwrite local changes when updating submodules

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

19 months agoRollup merge of #103065 - aDotInTheVoid:rdj-arg-pattern, r=GuillaumeGomez
Matthias Krüger [Wed, 30 Nov 2022 18:53:17 +0000 (19:53 +0100)]
Rollup merge of #103065 - aDotInTheVoid:rdj-arg-pattern, r=GuillaumeGomez

rustdoc-json: Document and Test that args can be patterns.

19 months agoExtract llvm datalayout parsing out of spec module
hkalbasi [Wed, 30 Nov 2022 15:43:09 +0000 (19:13 +0330)]
Extract llvm datalayout parsing out of spec module

19 months agoadd Tshepang Mbambo to .mailmap
Tshepang Mbambo [Wed, 30 Nov 2022 17:29:41 +0000 (19:29 +0200)]
add Tshepang Mbambo to .mailmap

19 months agoAuto merge of #104940 - cjgillot:query-feed-simple, r=oli-obk
bors [Wed, 30 Nov 2022 17:20:14 +0000 (17:20 +0000)]
Auto merge of #104940 - cjgillot:query-feed-simple, r=oli-obk

Allow to feed a value in another query's cache

Restricted version of https://github.com/rust-lang/rust/pull/96840

A query can create new definitions.

If those definitions are created after HIR lowering, they do not appear in the initial HIR map, and information for them cannot be provided in the normal pull-based way.

In order to make those definitions useful, we allow to feed values as query results for the newly created definition.

The API is as follows:
```rust
let feed = tcx.create_def(<parent def id>, <DefPathData>);
// `feed` is a TyCtxtFeed<'tcx>.

// Access the created definition.
let def_id: LocalDefId = feed.def_id;

// Assign `my_query(def_id) := my_value`.
feed.my_query(my_value).
```

This PR keeps the consistency checks introduced by https://github.com/rust-lang/rust/pull/96840, even if they are not reachable. This allows to extend the behaviour later without forgetting them.

cc `@oli-obk` `@spastorino`

19 months agoAdd Nicholas Bishop to `.mailmap`
Nicholas Bishop [Tue, 29 Nov 2022 23:01:58 +0000 (18:01 -0500)]
Add Nicholas Bishop to `.mailmap`

19 months agorustdoc: clean up sidebar link CSS
Michael Howell [Wed, 30 Nov 2022 14:51:18 +0000 (07:51 -0700)]
rustdoc: clean up sidebar link CSS

Group `text-overflow: ellipses` along with `white-space: nowrap`. It makes
no sense to try to apply it to links with `overflow-wrap: anywhere`, because
it can't actually make ellipses when that's turned on.

Simplify the selector for the 25rem left padding on sidebar links, to match
up with the style for the container left padding that makes room for it.

19 months agoAuto merge of #99814 - aliemjay:patch-2, r=jackh726
bors [Wed, 30 Nov 2022 14:03:36 +0000 (14:03 +0000)]
Auto merge of #99814 - aliemjay:patch-2, r=jackh726

fix universe map in ifcx.instantiate_canonical_*

Previously, `infcx.instantiate_canonical_*` maps the root universe in `canonical` into `ty::UniverseIndex::Root`, I think because it assumes it works with a fresh `infcx` but this is not true for the use cases in mir typeck. Now the root universe is mapped into `infcx.universe()`.

I catched this accidentally while reviewing the code. I'm not sure if this is the right fix or if it is really a bug!

19 months agoAdd a regression test for #104322
Georg Semmler [Wed, 30 Nov 2022 06:46:01 +0000 (07:46 +0100)]
Add a regression test for #104322

19 months agoAuto merge of #104905 - compiler-errors:normalization-changes, r=spastorino
bors [Wed, 30 Nov 2022 11:13:09 +0000 (11:13 +0000)]
Auto merge of #104905 - compiler-errors:normalization-changes, r=spastorino

Some initial normalization method changes

1. Rename `AtExt::normalize` to `QueryNormalizeExt::query_normalize` (using the `QueryNormalizer`)
2. Introduce `NormalizeExt::normalize` to replace `partially_normalize_associated_types_in` (using the `AssocTypeNormalizer`)
3. Rename `FnCtxt::normalize_associated_types_in` to `FnCtxt::normalize`
4. Remove some unused other normalization fns in `Inherited` and `FnCtxt`

Also includes one drive-by where we're no longer creating a `FnCtxt` inside of `check_fn`, but passing it in. This means we don't need such weird `FnCtxt` construction logic.

Stacked on top of #104835 for convenience.

r? types

19 months agoAuto merge of #105080 - matthiaskrgr:rollup-7ffj4oe, r=matthiaskrgr
bors [Wed, 30 Nov 2022 07:59:24 +0000 (07:59 +0000)]
Auto merge of #105080 - matthiaskrgr:rollup-7ffj4oe, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - #104697 (Restore control flow on error in EUV)
 - #104811 (feat: implement TcpStream shutdown for wasm32-wasi)
 - #105039 (Fix an ICE parsing a malformed literal in `concat_bytes!`.)
 - #105071 (Add Nicholas Nethercote to `.mailmap`.)
 - #105079 (Add bots to `.mailmap`)

Failed merges:

 - #105074 (Add Nicholas Bishop to `.mailmap`)

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

19 months agoRollup merge of #105079 - nnethercote:bots-mailmap, r=jyn514
Matthias Krüger [Wed, 30 Nov 2022 06:00:32 +0000 (07:00 +0100)]
Rollup merge of #105079 - nnethercote:bots-mailmap, r=jyn514

Add bots to `.mailmap`

r? `@compiler-errors`

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 agoavoid an unnecessary `&str` to `String` conversion
Takayuki Maeda [Wed, 30 Nov 2022 04:31:35 +0000 (13:31 +0900)]
avoid an unnecessary `&str` to `String` conversion

19 months agoreport literal errors when `token_lit` has errors
Takayuki Maeda [Wed, 30 Nov 2022 04:31:11 +0000 (13:31 +0900)]
report literal errors when `token_lit` has errors

19 months agoAuto merge of #104679 - dvdhrm:rw/dso, r=petrochenkov
bors [Wed, 30 Nov 2022 04:18:15 +0000 (04:18 +0000)]
Auto merge of #104679 - dvdhrm:rw/dso, r=petrochenkov

codegen-llvm: never combine DSOLocal and DllImport

Prevent DllImport from being attached to DSOLocal definitions in the LLVM IR. The combination makes no sense, since definitions local to the compilation unit will never be imported from external objects.

Additionally, LLVM will refuse the IR if it encounters the combination (introduced in [1]):

```
  if (GV.hasDLLImportStorageClass())
    Assert(!GV.isDSOLocal(),
           "GlobalValue with DLLImport Storage is dso_local!", &GV);
```

Right now, codegen-llvm will only apply DllImport to constants and rely on call-stubs for functions. Hence, we simply extend the codegen of constants to skip DllImport for any local definitions.

This was discovered when switching the EFI targets to the static relocation model [2]. With this fixed, we can start another attempt at this.

[1] https://smlnj-gitlab.cs.uchicago.edu/manticore/llvm/commit/509132b368efed10bbdad825403f45e9cf1d6e38
[2] https://github.com/rust-lang/rust/issues/101656

19 months agoAdd dependabot to `.mailmap`.
Nicholas Nethercote [Wed, 30 Nov 2022 02:08:43 +0000 (13:08 +1100)]
Add dependabot to `.mailmap`.

Before:
```
$ git shortlog -se | grep "depend"
    44 dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
     6 dependabot-preview[bot] <dependabot-preview[bot]@users.noreply.github.com>
     4 dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    74 dependabot[bot] <dependabot[bot]@users.noreply.github.com>
    93 dependabot[bot] <support@dependabot.com>
```
After:
```
$ git shortlog -se | grep "depend"
   221  dependabot[bot] <dependabot[bot]@users.noreply.github.com>
```

19 months agoAdd bors to `.mailmap`.
Nicholas Nethercote [Wed, 30 Nov 2022 02:01:17 +0000 (13:01 +1100)]
Add bors to `.mailmap`.

Before:
```
$ git shortlog -se | grep "\<bors\>"
 27755 bors <bors@rust-lang.org>
  5729 bors[bot] <26634292+bors[bot]@users.noreply.github.com>
   995 bors[bot] <bors[bot]@users.noreply.github.com>
```
After:
```
$ git shortlog -se | grep "\<bors\>"
 34479 bors <bors@rust-lang.org>
```

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 agorustdoc: add comment to confusing CSS `main { min-width: 0 }`
Michael Howell [Tue, 29 Nov 2022 18:37:32 +0000 (11:37 -0700)]
rustdoc: add comment to confusing CSS `main { min-width: 0 }`

This CSS was added in cad0fce2053d52b7ba04c458f4c124c8b5c6141e, but the
reason why it was necessary was unclear. This comment makes it clear.

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 agoMake TyCtxtFeed::def_id private.
Camille GILLOT [Tue, 29 Nov 2022 18:49:37 +0000 (18:49 +0000)]
Make TyCtxtFeed::def_id private.

19 months agoFeedable queries must allow hashing.
Camille GILLOT [Sun, 27 Nov 2022 10:28:28 +0000 (10:28 +0000)]
Feedable queries must allow hashing.

19 months agoOnly allow feeding a value to newly created definitions.
Camille GILLOT [Sat, 26 Nov 2022 13:54:45 +0000 (13:54 +0000)]
Only allow feeding a value to newly created definitions.

19 months agoSanity check computed value for feeable queries.
Camille GILLOT [Sat, 29 Oct 2022 13:04:38 +0000 (13:04 +0000)]
Sanity check computed value for feeable queries.

19 months agoExpand hash check.
Camille GILLOT [Sun, 4 Sep 2022 20:42:05 +0000 (22:42 +0200)]
Expand hash check.

19 months agoAllow to set a query's result as a side effect.
Camille GILLOT [Tue, 22 Mar 2022 20:45:32 +0000 (21:45 +0100)]
Allow to set a query's result as a side effect.

19 months agoSanity check fingerprints in the dep-graph.
Camille GILLOT [Sun, 8 May 2022 12:42:12 +0000 (14:42 +0200)]
Sanity check fingerprints in the dep-graph.

19 months agoMake verbose query description more useful.
Camille GILLOT [Sun, 8 May 2022 13:00:03 +0000 (15:00 +0200)]
Make verbose query description more useful.

19 months agoDon't assume that core::fmt::Debug will always have one item.
Nixon Enraght-Moony [Tue, 29 Nov 2022 18:27:16 +0000 (18:27 +0000)]
Don't assume that core::fmt::Debug will always have one item.

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 agotest/codegen: test inter-crate linkage with static relocation
David Rheinsberg [Tue, 22 Nov 2022 10:12:26 +0000 (11:12 +0100)]
test/codegen: test inter-crate linkage with static relocation

Add a codegen-test that verifies inter-crate linkage with the static
relocation model. We expect all symbols that are part of a rust
compilation to end up in the same DSO, thus we expect `dso_local`
annotations.

19 months agocodegen-llvm: never combine DSOLocal and DllImport
David Rheinsberg [Mon, 21 Nov 2022 15:47:02 +0000 (16:47 +0100)]
codegen-llvm: never combine DSOLocal and DllImport

Prevent DllImport from being attached to DSOLocal definitions in the
LLVM IR. The combination makes no sense, since definitions local to the
compilation unit will never be imported from external objects.

Additionally, LLVM will refuse the IR if it encounters the
combination (introduced in [1]):

  if (GV.hasDLLImportStorageClass())
    Assert(!GV.isDSOLocal(),
           "GlobalValue with DLLImport Storage is dso_local!", &GV);

Right now, codegen-llvm will only apply DllImport to constants and rely
on call-stubs for functions. Hence, we simply extend the codegen of
constants to skip DllImport for any local definitions.

This was discovered when switching the EFI targets to the static
relocation model [2]. With this fixed, we can start another attempt at
this.

[1] https://smlnj-gitlab.cs.uchicago.edu/manticore/llvm/commit/509132b368efed10bbdad825403f45e9cf1d6e38
[2] https://github.com/rust-lang/rust/issues/101656

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 agoAvoid more `MetaItem`-to-`Attribute` conversions.
Nicholas Nethercote [Tue, 29 Nov 2022 07:43:44 +0000 (18:43 +1100)]
Avoid more `MetaItem`-to-`Attribute` conversions.

There is code for converting `Attribute` (syntactic) to `MetaItem`
(semantic). There is also code for the reverse direction. The reverse
direction isn't really necessary; it's currently only used when
generating attributes, e.g. in `derive` code.

This commit adds some new functions for creating `Attributes`s directly,
without involving `MetaItem`s: `mk_attr_word`, `mk_attr_name_value_str`,
`mk_attr_nested_word`, and
`ExtCtxt::attr_{word,name_value_str,nested_word}`.

These new methods replace the old functions for creating `Attribute`s:
`mk_attr_inner`, `mk_attr_outer`, and `ExtCtxt::attribute`. Those
functions took `MetaItem`s as input, and relied on many other functions
that created `MetaItems`, which are also removed: `mk_name_value_item`,
`mk_list_item`, `mk_word_item`, `mk_nested_word_item`,
`{MetaItem,MetaItemKind,NestedMetaItem}::token_trees`,
`MetaItemKind::attr_args`, `MetaItemLit::{from_lit_kind,to_token}`,
`ExtCtxt::meta_word`.

Overall this cuts more than 100 lines of code and makes thing simpler.

19 months agoInline and remove `MetaItemLit::from_lit_kind`.
Nicholas Nethercote [Tue, 29 Nov 2022 07:42:40 +0000 (18:42 +1100)]
Inline and remove `MetaItemLit::from_lit_kind`.

It has a single call site.

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 agoRemove an out-of-date comment.
Nicholas Nethercote [Tue, 29 Nov 2022 06:13:38 +0000 (17:13 +1100)]
Remove an out-of-date comment.

This comment dates back to at least 2013, and is no longer relevant.
(There used to be an `allow` attribute, but that's no longer present.)

19 months agofix #104884, Avoid Invalid code suggested when encountering unsatisfied trait bounds...
yukang [Tue, 29 Nov 2022 04:38:39 +0000 (12:38 +0800)]
fix #104884, Avoid Invalid code suggested when encountering unsatisfied trait bounds in derive macro code

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 agoAvoid more unnecessary `MetaItem`/`Attribute` conversions.
Nicholas Nethercote [Mon, 28 Nov 2022 00:17:45 +0000 (11:17 +1100)]
Avoid more unnecessary `MetaItem`/`Attribute` conversions.

In `Expander::expand` the code currently uses `mk_attr_outer` to convert
a `MetaItem` to an `Attribute`, and then follows that with
`meta_item_list` which converts back. This commit avoids the unnecessary
conversions.

There was one wrinkle: the existing conversions caused the bogus `<>` on
`Default<>` to be removed. With the conversion gone, we get a second
error message about the `<>`. This is a rare case, so I think it
probably doesn't matter much.

19 months agoReorder some types.
Nicholas Nethercote [Thu, 24 Nov 2022 22:59:36 +0000 (09:59 +1100)]
Reorder some types.

So that `Attribute` and `MetaItem` are listed first, and then the
component types are below them in a logical order.

19 months agoImprove comments about attributes and meta items.
Nicholas Nethercote [Thu, 24 Nov 2022 22:53:37 +0000 (09:53 +1100)]
Improve comments about attributes and meta items.

I have found the distinction confusing.

19 months agoAvoid unnecessary `MetaItem`/`Attribute` conversions.
Nicholas Nethercote [Thu, 24 Nov 2022 05:00:57 +0000 (16:00 +1100)]
Avoid unnecessary `MetaItem`/`Attribute` conversions.

`check_builtin_attribute` calls `parse_meta` to convert an `Attribute`
to a `MetaItem`, which it then checks. However, many callers of
`check_builtin_attribute` start with a `MetaItem`, and then convert it
to an `Attribute` by calling `cx.attribute(meta_item)`. This `MetaItem`
to `Attribute` to `MetaItem` conversion is silly.

This commit adds a new function `check_builtin_meta_item`, which can be
called instead from these call sites. `check_builtin_attribute` also now
calls it. The commit also renames `check_meta` as `check_attr` to better
match its arguments.

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.