Commit graph

2257 commits

Author SHA1 Message Date
Matthias Krüger effc27dea4
Rollup merge of #117488 - GuillaumeGomez:update-minifier, r=notriddle
Update minifier-rs version to 0.3.0

It fixes https://github.com/GuillaumeGomez/minifier-rs/issues/105.

r? ```@notriddle```
2023-11-01 21:40:06 +01:00
Guillaume Gomez d6666e2ccc Update minifier-rs version to 0.3.0 2023-11-01 15:18:41 +01:00
Michael Goulet de83057ac4 Use derivative for Clone 2023-10-31 13:16:37 +00:00
Nicholas Nethercote bb3e09f144 Streamline gate_feature_* macros.
The debug probably isn't useful, and assigning all the `$foo`
metavariables to `foo` variables is verbose and weird. Also, `$x:expr`
usually doesn't have a space after the `:`.
2023-10-31 08:00:53 +11:00
Nicholas Nethercote 28e60de487 Remove memoffset dependency from rustc_query_impl.
The comment explains it's for `unstable_offset_of`, but `offset_of` is
now stable.
2023-10-30 08:25:51 +11:00
Jubilee 48a3865218
Rollup merge of #117268 - nnethercote:rustc_interface, r=oli-obk
`rustc_interface` cleanups

Particularly in and around `--cfg` and `--check-cfg` handling.

r? `@oli-obk`
2023-10-28 01:07:38 -07:00
bors 6f349cdbfa Auto merge of #116471 - notriddle:notriddle/js-trait-alias, r=GuillaumeGomez
rustdoc: use JS to inline target type impl docs into alias

Preview docs:

- https://notriddle.com/rustdoc-html-demo-5/js-trait-alias/std/io/type.Result.html

- https://notriddle.com/rustdoc-html-demo-5/js-trait-alias-compiler/rustc_middle/ty/type.PolyTraitRef.html

This pull request also includes a bug fix for trait alias inlining across crates. This means more documentation is generated, and is why ripgrep runs slower (it's a thin wrapper on top of the `grep` crate, so 5% of its docs are now the Result type).

- Before, built with rustdoc 1.75.0-nightly (aa1a71e9e 2023-10-26), Result type alias method docs are missing: http://notriddle.com/rustdoc-html-demo-5/ripgrep-js-nightly/rg/type.Result.html
- After, built with this branch, all the methods on Result are shown: http://notriddle.com/rustdoc-html-demo-5/ripgrep-js-trait-alias/rg/type.Result.html

*Review note: This is mostly just reverting https://github.com/rust-lang/rust/pull/115201. The last commit has the new work in it.*

Fixes #115718

This is an attempt to balance three problems, each of which would
be violated by a simpler implementation:

- A type alias should show all the `impl` blocks for the target
  type, and vice versa, if they're applicable. If nothing was
  done, and rustdoc continues to match them up in HIR, this
  would not work.

- Copying the target type's docs into its aliases' HTML pages
  directly causes far too much redundant HTML text to be generated
  when a crate has large numbers of methods and large numbers
  of type aliases.

- Using JavaScript exclusively for type alias impl docs would
  be a functional regression, and could make some docs very hard
  to find for non-JS readers.

- Making sure that only applicable docs are show in the
  resulting page requires a type checkers. Do not reimplement
  the type checker in JavaScript.

So, to make it work, rustdoc stashes these type-alias-inlined docs
in a JSONP "database-lite". The file is generated in `write_shared.rs`,
included in a `<script>` tag added in `print_item.rs`, and `main.js`
takes care of patching the additional docs into the DOM.

The format of `trait.impl` and `type.impl` JS files are superficially
similar. Each line, except the JSONP wrapper itself, belongs to a crate,
and they are otherwise separate (rustdoc should be idempotent). The
"meat" of the file is HTML strings, so the frontend code is very simple.
Links are relative to the doc root, though, so the frontend needs to fix
that up, and inlined docs can reuse these files.

However, there are a few differences, caused by the sophisticated
features that type aliases have. Consider this crate graph:

```text
 ---------------------------------
 | crate A: struct Foo<T>        |
 |          type Bar = Foo<i32>  |
 |          impl X for Foo<i8>   |
 |          impl Y for Foo<i32>  |
 ---------------------------------
     |
 ----------------------------------
 | crate B: type Baz = A::Foo<i8> |
 |          type Xyy = A::Foo<i8> |
 |          impl Z for Xyy        |
 ----------------------------------
```

The type.impl/A/struct.Foo.js JS file has a structure kinda like this:

```js
JSONP({
"A": [["impl Y for Foo<i32>", "Y", "A::Bar"]],
"B": [["impl X for Foo<i8>", "X", "B::Baz", "B::Xyy"], ["impl Z for Xyy", "Z", "B::Baz"]],
});
```

When the type.impl file is loaded, only the current crate's docs are
actually used. The main reason to bundle them together is that there's
enough duplication in them for DEFLATE to remove the redundancy.

The contents of a crate are a list of impl blocks, themselves
represented as lists. The first item in the sublist is the HTML block,
the second item is the name of the trait (which goes in the sidebar),
and all others are the names of type aliases that successfully match.

This way:

- There's no need to generate these files for types that have no aliases
  in the current crate. If a dependent crate makes a type alias, it'll
  take care of generating its own docs.
- There's no need to reimplement parts of the type checker in
  JavaScript. The Rust backend does the checking, and includes its
  results in the file.
- Docs defined directly on the type alias are dropped directly in the
  HTML by `render_assoc_items`, and are accessible without JavaScript.
  The JSONP file will not list impl items that are known to be part
  of the main HTML file already.

[JSONP]: https://en.wikipedia.org/wiki/JSONP
2023-10-27 23:08:24 +00:00
Nicholas Nethercote 98c469ce93 Remove an unneeded dependency. 2023-10-28 09:03:51 +11:00
Matthias Krüger df8852a934
Rollup merge of #116834 - nnethercote:rustc_symbol_mangling, r=davidtwco
Remove `rustc_symbol_mangling/messages.ftl`.

It contains a single message that (a) doesn't contain any natural language, and (b) is only used in tests.

r? `@davidtwco`
2023-10-27 19:46:06 +02:00
Matthias Krüger f131a0a771
Rollup merge of #117010 - celinval:smir-internal, r=oli-obk
Add method to convert internal to stable constructs

This is an alternative implementation to https://github.com/rust-lang/rust/pull/116999. I believe we can still improve the logic a bit here, but I wanted to see which direction we should go first.

In this implementation, the API is simpler and we keep Tables somewhat private. The definition is still public though, since we have to expose the Stable trait. However, there's a cost of keeping another thread-local and using `Rc`, but I'm hoping it will be a small cost.

r? ``@oli-obk``
r? ``@spastorino``
2023-10-24 19:29:56 +02:00
Celina G. Val 66a554b045 Add method to convert internal to stable constructs 2023-10-23 12:01:39 -07:00
bors 1322f92634 Auto merge of #107009 - cjgillot:jump-threading, r=pnkfelix
Implement jump threading MIR opt

This pass is an attempt to generalize `ConstGoto` and `SeparateConstSwitch` passes into a more complete jump threading pass.

This pass is rather heavy, as it performs a truncated backwards DFS on MIR starting from each `SwitchInt` terminator. This backwards DFS remains very limited, as it only walks through `Goto` terminators.

It is build to support constants and discriminants, and a propagating through a very limited set of operations.

The pass successfully manages to disentangle the `Some(x?)` use case and the DFA use case. It still needs a few tests before being ready.
2023-10-23 18:05:44 +00:00
Oli Scherer 4a5fecb187 Avoid having rustc_smir depend on rustc_interface or rustc_driver 2023-10-23 09:48:15 +00:00
Matthias Krüger dde77f7a33
Rollup merge of #117042 - Zalathar:file-table, r=cjgillot
coverage: Emit the filenames section before encoding per-function mappings

When embedding coverage information in LLVM IR (and ultimately in the resulting binary), there are two main things that each CGU needs to emit:

- A single `__llvm_covmap` record containing a coverage header, which mostly consists of a list of filenames used by the CGU's coverage mappings.
- Several `__llvm_covfun` records, one for each instrumented function, each of which contains the hash of the list of filenames in the header.

There is a kind of loose cyclic dependency between the two: we need the hash of the file table before we can emit the covfun records, but we need to traverse all of the instrumented functions in order to build the file table.

The existing code works by processing the individual functions first. It lazily adds filenames to the file table, and stores the mostly-complete function records in a temporary list. After this it hashes the file table, emits the header (containing the file table), and then uses the hash to emit all of the function records.

This PR reverses that order: first we traverse all of the functions (without trying to prepare their function records) to build a *complete* file table, and then emit it immediately. At this point we have the file table hash, so we can then proceed to build and emit all of the function records, without needing to store them in an intermediate list.

---

Along the way, this PR makes some necessary changes that are also worthwhile in their own right:
- We split `FunctionCoverage` into distinct collector/finished phases, which neatly avoids some borrow-checker hassles when extracting a function's final expression/mapping data.
- We avoid having to re-sort a function's mappings when preparing the list of filenames that it uses.
2023-10-23 08:12:39 +02:00
Caleb Cartwright 35400e8c16 bump rustfmt version 2023-10-22 20:34:12 -05:00
Michael Howell fa10e4d667 rustdoc: use JS to inline target type impl docs into alias
This is an attempt to balance three problems, each of which would
be violated by a simpler implementation:

- A type alias should show all the `impl` blocks for the target
  type, and vice versa, if they're applicable. If nothing was
  done, and rustdoc continues to match them up in HIR, this
  would not work.

- Copying the target type's docs into its aliases' HTML pages
  directly causes far too much redundant HTML text to be generated
  when a crate has large numbers of methods and large numbers
  of type aliases.

- Using JavaScript exclusively for type alias impl docs would
  be a functional regression, and could make some docs very hard
  to find for non-JS readers.

- Making sure that only applicable docs are show in the
  resulting page requires a type checkers. Do not reimplement
  the type checker in JavaScript.

So, to make it work, rustdoc stashes these type-alias-inlined docs
in a JSONP "database-lite". The file is generated in `write_shared.rs`,
included in a `<script>` tag added in `print_item.rs`, and `main.js`
takes care of patching the additional docs into the DOM.

The format of `trait.impl` and `type.impl` JS files are superficially
similar. Each line, except the JSONP wrapper itself, belongs to a crate,
and they are otherwise separate (rustdoc should be idempotent). The
"meat" of the file is HTML strings, so the frontend code is very simple.
Links are relative to the doc root, though, so the frontend needs to fix
that up, and inlined docs can reuse these files.

However, there are a few differences, caused by the sophisticated
features that type aliases have. Consider this crate graph:

```text
 ---------------------------------
 | crate A: struct Foo<T>        |
 |          type Bar = Foo<i32>  |
 |          impl X for Foo<i8>   |
 |          impl Y for Foo<i32>  |
 ---------------------------------
     |
 ----------------------------------
 | crate B: type Baz = A::Foo<i8> |
 |          type Xyy = A::Foo<i8> |
 |          impl Z for Xyy        |
 ----------------------------------
```

The type.impl/A/struct.Foo.js JS file has a structure kinda like this:

```js
JSONP({
"A": [["impl Y for Foo<i32>", "Y", "A::Bar"]],
"B": [["impl X for Foo<i8>", "X", "B::Baz", "B::Xyy"], ["impl Z for Xyy", "Z", "B::Baz"]],
});
```

When the type.impl file is loaded, only the current crate's docs are
actually used. The main reason to bundle them together is that there's
enough duplication in them for DEFLATE to remove the redundancy.

The contents of a crate are a list of impl blocks, themselves
represented as lists. The first item in the sublist is the HTML block,
the second item is the name of the trait (which goes in the sidebar),
and all others are the names of type aliases that successfully match.

This way:

- There's no need to generate these files for types that have no aliases
  in the current crate. If a dependent crate makes a type alias, it'll
  take care of generating its own docs.
- There's no need to reimplement parts of the type checker in
  JavaScript. The Rust backend does the checking, and includes its
  results in the file.
- Docs defined directly on the type alias are dropped directly in the
  HTML by `render_assoc_items`, and are accessible without JavaScript.
  The JSONP file will not list impl items that are known to be part
  of the main HTML file already.

[JSONP]: https://en.wikipedia.org/wiki/JSONP
2023-10-22 15:56:14 -07:00
Zalathar e985ae5a45 coverage: Build the global file table ahead of time 2023-10-22 20:37:37 +11:00
bors cc3dce5bd0 Auto merge of #116956 - Amanieu:hashbrown-0.14.2, r=Mark-Simulacrum
Update hashbrown to 0.14.2

Fixes #116880
2023-10-22 03:55:24 +00:00
Matthias Krüger d6ac149b4f
Rollup merge of #116312 - c410-f3r:try, r=Mark-Simulacrum
Initiate the inner usage of `cfg_match` (Compiler)

cc #115585

Dogfood to test the implementation and remove dependencies.
2023-10-21 21:22:59 +02:00
Philipp Krones b8b55fe316
Update Cargo.lock (ui_test update) 2023-10-21 14:16:27 +02:00
Camille GILLOT 751a079413 Implement JumpThreading pass. 2023-10-21 06:58:38 +00:00
Ralf Jung 49e8acbfe9 update lockfile 2023-10-21 08:41:45 +02:00
bors c7f3948028 Auto merge of #116946 - compiler-errors:movability-and-mutability, r=lcnr
Uplift movability and mutability, the simple way

Just make type_ir a dependency of ast. This can be relaxed later if we want to make the dependency less heavy. Part of rust-lang/types-team#124.

r? `@lcnr` or `@jackh726`
2023-10-20 08:19:54 +00:00
Ralf Jung 20fe485c57 Merge from rustc 2023-10-20 08:03:38 +02:00
bors 5cee4f305a Auto merge of #116875 - nnethercote:rustc_monomorphize, r=wesleywiser
`rustc_monomorphize` cleanups

Just some small improvements I found while looking over this code.

r? `@wesleywiser`
2023-10-20 00:03:47 +00:00
Caio 6379013876 Initiate the inner usage of cfg_match 2023-10-19 20:18:51 -03:00
Amanieu d'Antras eeea74785d Update hashbrown to 0.14.2
Fixes #116880
2023-10-19 21:44:23 +01:00
bors 94c4e5c411 Auto merge of #115214 - Urgau:rfc-3127-trim-paths, r=compiler-errors
Implement rustc part of RFC 3127 trim-paths

This PR implements (or at least tries to) [RFC 3127 trim-paths](https://github.com/rust-lang/rust/issues/111540), the rustc part. That is `-Zremap-path-scope` with all of it's components/scopes.

`@rustbot` label: +F-trim-paths
2023-10-19 19:09:29 +00:00
Michael Goulet e8e9f6a32a Uplift movability and mutability, the simple way 2023-10-19 16:42:58 +00:00
Ralf Jung d5d8a515ce Merge from rustc 2023-10-19 17:57:38 +02:00
Michael Goulet 60c95448c3 Use v0.0.0 in compiler crates 2023-10-18 21:55:15 +00:00
Nicholas Nethercote 025eb20a86 Remove unneeded dependencies from rustc_monomorphize. 2023-10-18 14:23:51 +11:00
bors 09df6108c8 Auto merge of #116767 - cjgillot:alloc-normalize, r=oli-obk
Normalize alloc-id in tests.

AllocIds are globally numbered in a rustc invocation. This makes them very sensitive to changes unrelated to what is being tested. This commit normalizes them by renumbering, in order of appearance in the output.

The renumbering allows to keep the identity, that a simple `allocN` wouldn't. This is useful when we have memory dumps.

cc `@saethlin`
r? `@oli-obk`
2023-10-17 20:46:53 +00:00
Urgau 30f94717ca [RFC 3127 - Trim Paths]: Add unstable option and parsing 2023-10-17 10:11:30 +02:00
Nicholas Nethercote f4a9d29c50 Remove rustc_symbol_mangling/messages.ftl.
It contains a single message that (a) doesn't contain any natural
language, and (b) is only used in tests.
2023-10-17 16:15:36 +11:00
Matthias Krüger 98ea131a6e
Rollup merge of #116790 - klensy:opt-dist-tabled-no-derive, r=Kobzol
opt-dist: disable unused features for tabled crate

Features looks unused, so left only used ones.

r? `@Kobzol`
2023-10-16 19:10:51 +02:00
Matthias Krüger 96be07e566
Rollup merge of #116709 - GuillaumeGomez:update-minifier, r=notriddle
Update minifier version to 0.2.3

Thanks for the fix `@notriddle` !

r? `@notriddle`
2023-10-16 19:10:50 +02:00
Camille GILLOT 02424e4bc5 Normalize alloc-id in tests. 2023-10-16 16:29:35 +00:00
klensy 83425967cb opt-dist: disable unused features for tabled crate 2023-10-16 12:59:15 +03:00
bors d60d63fbf7 Auto merge of #116527 - sthibaul:libc, r=Mark-Simulacrum
Bump libc dependency

To get GNU/Hurd support, so that CI of external repositories (e.g. getrandom) can build std.
2023-10-15 15:17:17 +00:00
bors ab73de7d7f Auto merge of #116691 - chenx97:rustix-0.38.19, r=Mark-Simulacrum
Update rustix to 0.38.19

addresses [rustix/#856](https://github.com/bytecodealliance/rustix/pull/856).

Commands that do the update:

`cargo +nightly update rustix`

r? `@Mark-Simulacrum`
2023-10-15 09:36:49 +00:00
Guillaume Gomez 87ae477af0 Update minifier version to 0.2.3 2023-10-14 00:17:27 +02:00
Peter Jaszkowiak 49aa5a23ca Revert "Invoke backtrace-rs buildscript in std buildscript"
This reverts commit 93677276bc
because it caused issues for projects building the standard
library with non-cargo build systems.
2023-10-13 13:43:00 -06:00
chenx97 b1d64c6c30 Update rustix to 0.38.19 2023-10-13 18:14:07 +08:00
bors 130ff8cb6c Auto merge of #115964 - bjorn3:cgu_reuse_tracker_global_state, r=cjgillot
Remove cgu_reuse_tracker from Session

This removes a bit of global mutable state.

It will now miss post-lto cgu reuse when ThinLTO determines that a cgu doesn't get changed, but there weren't any tests for this anyway and a test for it would be fragile to the exact implementation of ThinLTO in LLVM.
2023-10-13 00:09:30 +00:00
bors 5aa23be6b6 Auto merge of #116014 - lqd:mcp510-2-electric-boogaloo, r=petrochenkov
Implement `-Clink-self-contained=-linker` opt out

This implements the `-Clink-self-contained` opt out necessary to switch to lld by changing rustc's defaults instead of cargo's.

Components that are enabled and disabled on the CLI are recorded, for the purpose of being merged with the ones which the target spec will declare (I'll open another PR for that tomorrow, for easier review).

For MCP510, we now check whether using the self-contained linker is disabled on the CLI. Right now it would only be sensible to with `-Zgcc-ld=lld` (and I'll add some checks that we don't both enable and disable a component on the CLI in a future PR), but the goal is to simplify adding the check of the target's enabled components here in the follow-up PRs.

r? `@petrochenkov`
2023-10-11 12:11:39 +00:00
bjorn3 e9fa2ca6ad Remove cgu_reuse_tracker from Session
This removes a bit of global mutable state
2023-10-09 18:39:41 +00:00
Oğuz Ağcayazı 0f27c1b5b5 defids are indexmapped 2023-10-09 12:56:14 +03:00
Rémy Rakic acc3b61c5e move LinkSelfContainedComponents to rustc_target 2023-10-08 21:57:38 +00:00
Samuel Thibault 04d4336009 Bump libc dependency
To get GNU/Hurd support, so that CI of external repositories (e.g. getrandom)
can build std.
2023-10-08 19:56:44 +02:00
bors e9addfdecf Auto merge of #114623 - Kobzol:opt-dist-gha-summaries, r=Mark-Simulacrum
Print some information from try builds to GitHub summary

This PR adds some logs from `opt-dist` (the duration of the individual steps of the build pipeline, and the size of the resulting artifacts) to GitHub [job summaries](https://github.blog/2022-05-09-supercharging-github-actions-with-job-summaries/), in order to quickly show useful information right in the GHA CI job page, without needing to read the full log.

[This](https://github.com/rust-lang-ci/rust/actions/runs/5810621086) is how the summary currently looks like.

r? `@ghost`
2023-10-08 00:04:17 +00:00
Ralf Jung 5aecfe467b update lockfile 2023-10-07 08:03:44 +02:00
bors 4ea5190026 Auto merge of #116318 - pitaj:android-backtrace-build, r=workingjubilee
Invoke `backtrace-rs` buildscript in `std` buildscript

Based on #99883 by `@Arc-blroth`
Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705
2023-10-07 02:20:50 +00:00
Matthias Krüger 9796dfdd56
Rollup merge of #116474 - nnethercote:rustc_assorted, r=spastorino
Assorted small cleanups

r? `@spastorino`
2023-10-06 21:17:50 +02:00
Philipp Krones 6233d44815
Update Cargo.lock 2023-10-06 17:47:56 +02:00
Nicholas Nethercote 4b51a3eb52 Remove unneeded dependency.
Also sort them.
2023-10-06 14:57:25 +11:00
Nicholas Nethercote 442a66d385 Remove unneeded dependency. 2023-10-06 14:57:09 +11:00
bors 2c9b0de8ea Auto merge of #116269 - Veykril:rustc-abi, r=WaffleLapkin
Bring back generic parameters for indices in rustc_abi and make it compile on stable

This effectively reverses https://github.com/rust-lang/rust/pull/107163, allowing rust-analyzer to depend on this crate again,

It also moves some glob imports / expands them in the first commit because they made it more difficult for me to reason about things.
2023-10-06 00:03:56 +00:00
Peter Jaszkowiak 93677276bc Invoke backtrace-rs buildscript in std buildscript
Based on #99883 by @Arc-blroth
Depends on rust-lang/backtrace-rs#556 and rust-lang/cc-rs#705
2023-10-02 19:34:27 -06:00
Lukas Wirth f14b7c9443 Move FieldIdx and Layout to rustc_target 2023-10-02 21:31:16 +02:00
Jakub Beránek 209789ef4c
Add artifact size and step duration summaries from opt-dist to github job summary 2023-10-02 17:54:11 +02:00
Rémy Rakic dcfa64bc2d update jemalloc-sys to most recent release 2023-10-02 07:41:51 +00:00
Ralf Jung 6687c075df update lockfile 2023-10-01 07:03:42 +02:00
Matthias Krüger 1ed00fe491
Rollup merge of #116234 - RalfJung:miri, r=RalfJung
Miri subtree update

r? `@ghost`
2023-09-29 10:11:13 +02:00
Ralf Jung e0f4ab84a7 update lockfile 2023-09-28 16:42:07 +02:00
bors dd91aba2fd Auto merge of #114882 - ChrisDenton:riddle-me, r=dtolnay
Update windows ffi bindings

Bump `windows-bindgen` to version 0.51.1. This brings with it some changes to the generated FFI bindings, but little that affects the code.

One change that does have more of an impact is `SOCKET` being `usize` instead of either `u64` or `u32` (as is used in std's public `SOCKET` type). However, it's now easy enough to abstract over that difference.

Finally I added a few new bindings that are likely to be used in pending PRs, mostly to make sure they're ok with the new metadata.

r? libs
2023-09-28 13:35:36 +00:00
Matthias Krüger d4858878c1
Rollup merge of #115934 - oli-obk:smir_identity, r=spastorino
Split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things

Some groundwork for being able to work on https://github.com/rust-lang/project-stable-mir/issues/27 at all

r? `@spastorino`
2023-09-27 10:42:34 +02:00
bors d23062b5be Auto merge of #116139 - flip1995:clippyup, r=Manishearth
Clippy subtree update

r? `@Manishearth`
2023-09-26 07:20:55 +00:00
Oli Scherer a38e98371b Split out the stable part of smir into its own crate to prevent accidental usage of forever unstable things 2023-09-25 14:38:27 +00:00
Philipp Krones 6d331b7f03
Update Cargo.lock 2023-09-25 11:29:11 +02:00
chenx97 141c4636a7 deps: update rustix and linux-raw-sys for MIPS R6
commands that perform this update:

```shell
cargo +nightly update tempfile clap
cargo +nightly update linux-raw-sys rustix
```
2023-09-24 21:11:10 +08:00
Ayush Singh 7a956441a1
Fixes from PR
- Some comment fixes.
- Make some functions unsafe.
- Make helpers module private.
- Rebase on master
- Update r-efi to v4.2.0

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:33 +05:30
Ayush Singh 48c6ae0611
Add Minimal Std implementation for UEFI
Implemented modules:
1. alloc
2. os_str
3. env
4. math

Tracking Issue: https://github.com/rust-lang/rust/issues/100499
API Change Proposal: https://github.com/rust-lang/libs-team/issues/87

This was originally part of https://github.com/rust-lang/rust/pull/100316. Since
that PR was becoming too unwieldy and cluttered, and with suggestion
from @dvdhrm, I have extracted a minimal std implementation to this PR.

Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22 17:23:30 +05:30
Martin Kröning 4241f942b6
chore(miri): bump env_logger to 0.10
This reduces the amount of dependencies pulling in atty.

```
    Removing env_logger v0.9.3
```

Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
2023-09-19 18:39:13 +02:00
Martin Kröning 7928c7e25d
chore(Cargo.lock): bump colored and tracing-tree
This reduces the amount of dependencies pulling in atty.

```
    Updating colored v2.0.0 -> v2.0.4
    Updating tracing-tree v0.2.3 -> v0.2.4
```

Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
2023-09-19 18:39:12 +02:00
Guillaume Gomez 6cfc6a8705
Rollup merge of #115839 - Dirreke:bump-libc, r=dtolnay
Bump libc to 0.2.148
2023-09-19 11:35:51 +02:00
bors ae9c330629 Auto merge of #104101 - betrusted-io:xous-libstd-initial, r=bjorn3
Add initial libstd support for Xous

This patchset adds some minimal support to the tier-3 target `riscv32imac-unknown-xous-elf`. The following features are supported:

* alloc
* thread creation and joining
* thread sleeping
* thread_local
* panic_abort
* mutex
* condvar
* stdout

Additionally, internal support for the various Xous primitives surrounding IPC have been added as part of the Xous FFI. These may be exposed as part of `std::os::xous::ffi` in the future, however for now they are not public.

This represents the minimum viable product. A future patchset will add support for networking and filesystem support.
2023-09-19 07:38:20 +00:00
Matthias Krüger 0eec5e3d0c
Rollup merge of #115869 - ferrocene:pa-fix-tests-cargo-remap, r=compiler-errors
Avoid blessing cargo deps's source code in ui tests

Before this PR, the source code of dependencies was included in UI test error messages whenever possible. Unfortunately, "whenever possible" means in some cases the source code wouldn't be injected, resulting in a test failure.

One such case is when `$CARGO_HOME` is remapped to something that is not present on disk [^1]. As the remapped path doesn't exist on disk, the source code wouldn't be showed in `tests/ui/issues/issue-21763.rs`:

```diff
    = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
 note: required because it appears within the type `HashMap<Rc<()>, Rc<()>, RandomState>`
   --> $HASHBROWN_SRC_LOCATION
-   |
-LL | pub struct HashMap<K, V, S = DefaultHashBuilder, A: Allocator + Clone = Global> {
-   |            ^^^^^^^
 note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
   --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
 note: required by a bound in `foo`
```

This PR fixes the problem by always hiding dependencies source code in the error messages generated during UI tests. This is implemented with a new internal flag, `-Z ignore-directory-in-diagnostics-source-blocks=$path`, which compiletest passes during UI tests. Once this is merged, remapping the Cargo home will be supported.

This PR is best reviewed commit-by-commit.

[^1]: After being puzzled for a bit, I discovered why this never impacted `rust-lang/rust`: we don't remap `$CARGO_HOME` 😅. Instead, we set `$CARGO_HOME` to `/cargo` in CI, which sort-of-but-not-really achieves the same effect.
2023-09-19 01:29:41 +02:00
bors cbcf9a5368 Auto merge of #115795 - Kobzol:opt-dist-custom, r=Mark-Simulacrum
Refactor `opt-dist` to simplify local building

This PR refactors the `opt-dist` tool to make it easier to invoke it locally, outside of CI, and thus simplify building PGO/BOLT optimized `rustc` builds e.g. for distro maintainers. It should also make it easier to run the PGO/BOLT workflow locally e.g. to profile performance or debug issues (looking at you, https://github.com/rust-lang/rust/pull/115554).
2023-09-18 14:26:40 +00:00
Pietro Albini c230637b92
avoid blessing cargo deps's source code in ui tests 2023-09-15 16:22:52 +02:00
dirreke b8044774ff Bump libc to 0.2.148 2023-09-14 16:56:49 +08:00
Jakub Beránek f17047bc90
Refactor Environment 2023-09-12 19:33:41 +02:00
Philipp Krones 780cbf34a0
Update Cargo.lock (ui_test update) 2023-09-12 18:44:34 +02:00
Alex Macleod caaf1eb887 Reuse rustdoc's doc comment handling in Clippy 2023-09-08 23:42:57 +00:00
Matthias Krüger 7498dca311
Rollup merge of #115574 - Veykril:rustc_parse_format-dep, r=Nilstrieb
Replace `rustc_data_structures` dependency with `rustc_index` in `rustc_parse_format`

`rustc_data_structures` is only used for the `static_assert_size` macro, yet that is defined in `rustc_index` and merely re-exported. `rustc_index` is a lot more lightweight than `rustc_data_structures` which would make this a lot more reusable for rust-analyzer.
2023-09-06 19:31:49 +02:00
Lukas Wirth 2bba056187 Replace data_structures dependency with index in rustc_parse_format 2023-09-05 19:11:50 +02:00
Zalathar 1367104cb2 Add tool src/tools/coverage-dump for use by some new coverage tests 2023-09-05 11:11:48 +10:00
klensy 6950689030 remove some unused crate deps 2023-09-01 19:13:09 +03:00
bors 83995f320c Auto merge of #115354 - matthiaskrgr:rollup-4cotcxz, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #111580 (Don't ICE on layout computation failure)
 - #114923 (doc: update lld-flavor ref)
 - #115174 (tests: add test for #67992)
 - #115187 (Add new interface to smir)
 - #115300 (Tweaks and improvements on SMIR around generics_of and predicates_of)
 - #115340 (some more is_zst that should be is_1zst)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-29 19:24:47 +00:00
Oli Scherer 4fdb4edf9b Bump ui_test 2023-08-29 13:47:06 +00:00
ouz-a c2fe0bf253 Create StableMir replacer for SMirCalls 2023-08-29 16:30:50 +03:00
Chris Denton e7908608d9
Remove old bindings that have been moved 2023-08-28 20:17:43 +01:00
Chris Denton d9c85daa51
Update windows ffi bindings 2023-08-28 20:12:00 +01:00
Philipp Krones ac25a7387c
Update Cargo.lock (ui_test update) 2023-08-24 21:33:17 +02:00
Tyler Mandry 4c14ca3141 Bump backtrace to 0.3.69 2023-08-22 15:01:14 -07:00
Sean Cross 00280c8972 Cargo.lock: bump compiler_builtins to 0.1.101
The Xous operating system has no libc, and relies on `compiler_builtins`
to supply basic functions such as `memcpy`. Bump the version to 0.1.101
to pull in a version of this crate with the flag enabled for Xous.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-08-22 20:25:39 +08:00
Ralf Jung 47ba2a9465 update lockfile 2023-08-22 13:47:38 +02:00
Ralf Jung 83283a437e update anyhow 2023-08-20 15:55:33 +02:00
Rémy Rakic df3819bd96 update thsiserror to release >= 1.0.46
this version is the one containing the workaround for the provider API
changes on nightly
2023-08-17 19:48:22 +00:00
dirreke 74817b7053 Upgrade Object and related deps 2023-08-14 23:05:45 +08:00