Commit graph

2506 commits

Author SHA1 Message Date
Guillaume Gomez 1bdeeef0d5 Update pulldown-cmark version to 0.9.5 2024-01-29 14:14:03 +01:00
Dylan DPC 5de94a3c80
Rollup merge of #120420 - lnicola:rm-pattern-analysis-derivative, r=Nilstrieb
Stop using derivative in rustc_pattern_analysis

CC #109302, https://github.com/rust-lang/rust-analyzer/pull/16420#discussion_r1464357157

r? ````@Nadrieril````
2024-01-29 12:56:53 +00:00
Nicholas Nethercote 5d9dfbd08f Stop using String for error codes.
Error codes are integers, but `String` is used everywhere to represent
them. Gross!

This commit introduces `ErrCode`, an integral newtype for error codes,
replacing `String`. It also introduces a constant for every error code,
e.g. `E0123`, and removes the `error_code!` macro. The constants are
imported wherever used with `use rustc_errors::codes::*`.

With the old code, we have three different ways to specify an error code
at a use point:
```
error_code!(E0123)  // macro call

struct_span_code_err!(dcx, span, E0123, "msg");  // bare ident arg to macro call

\#[diag(name, code = "E0123")]  // string
struct Diag;
```

With the new code, they all use the `E0123` constant.
```
E0123  // constant

struct_span_code_err!(dcx, span, E0123, "msg");  // constant

\#[diag(name, code = E0123)]  // constant
struct Diag;
```

The commit also changes the structure of the error code definitions:
- `rustc_error_codes` now just defines a higher-order macro listing the
  used error codes and nothing else.
- Because that's now the only thing in the `rustc_error_codes` crate, I
  moved it into the `lib.rs` file and removed the `error_codes.rs` file.
- `rustc_errors` uses that macro to define everything, e.g. the error
  code constants and the `DIAGNOSTIC_TABLES`. This is in its new
  `codes.rs` file.
2024-01-29 07:41:41 +11:00
bors 6b4f1c5e78 Auto merge of #120201 - clubby789:dep-update, r=dtolnay
Bump some deps with syn 1.0 dependencies

cc #109302

`cargo update`ing `unic-langid` and `object` removes two dependencies on Syn 1.0.
2024-01-27 14:19:12 +00:00
Laurențiu Nicola f5c78955c8 Stop using derivative in rustc_pattern_analysis 2024-01-27 14:21:01 +02:00
Matthias Krüger 37b9022cef
Rollup merge of #120345 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? `@Manishearth`

Closes https://github.com/rust-lang/rust-clippy/issues/12148
2024-01-26 14:43:32 +01:00
Philipp Krones d7a0182157
Update Cargo.lock 2024-01-25 19:17:52 +01:00
Matthias Krüger eeac90cbba
Rollup merge of #120288 - clubby789:bump-askama, r=GuillaumeGomez
Bump `askama` version

Ran into this while looking at #112865 and thought it would be useful to fix it now. Some more details in [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/Askama.20parser.20changes)
2024-01-25 17:39:27 +01:00
Josh Stone 8f3af4c6e2 rustc_data_structures: use either instead of itertools 2024-01-24 15:36:57 -08:00
clubby789 da336190e3 Bump askama version 2024-01-24 01:04:34 +00:00
clubby789 c7517206ea Bump openssl version 2024-01-21 23:52:35 +00:00
clubby789 527f903a42 Bump ctrlc version 2024-01-21 23:51:33 +00:00
clubby789 b50b333a0f Bump uniq-langid version 2024-01-21 17:19:31 +00:00
clubby789 56bc5525b3 Bump object version 2024-01-21 17:19:29 +00:00
bors 159bdc1e93 Auto merge of #108359 - Zoxc:side-effects-tweak, r=cjgillot
Avoid code generation for ThinVec<Diagnostic>'s destructor in the query system

This avoids 2 instances of the destructor of `ThinVec<Diagnostic>` from being included in `execute_job`. It also outlines the cold branch in `store_side_effects` / `store_side_effects_for_anon_node`.
2024-01-20 15:20:15 +00:00
John Kåre Alsaker 862011e1ca Avoid code generation for ThinVec<Diagnostic>'s destructor in the query system 2024-01-20 13:43:05 +01:00
Matthias Krüger ae09415fa4
Rollup merge of #119815 - nagisa:nagisa/polishes-libloading-use-somewhat, r=bjorn3
Format sources into the error message when loading codegen backends

cc https://github.com/rust-lang/rustc_codegen_cranelift/issues/1447
cc `@bjorn3`
2024-01-19 19:27:00 +01:00
Matthias Krüger 3a3242a0f9
Rollup merge of #120039 - Nadrieril:remove-idx, r=compiler-errors
pat_analysis: Don't rely on contiguous `VariantId`s outside of rustc

Today's pattern_analysis uses `BitSet` and `IndexVec` on the provided enum variant ids, which only makes sense if these ids count the variants from 0. In rust-analyzer, the variant ids are global interning ids, which would make `BitSet` and `IndexVec` ridiculously wasteful. In this PR I add some shims to use `FxHashSet`/`FxHashMap` instead outside of rustc.

r? ```@compiler-errors```
2024-01-17 20:21:23 +01:00
bors 25b706cde3 Auto merge of #119111 - michaelwoerister:measureme-11, r=Mark-Simulacrum
Update measureme crate to version 11

perf.rlo has been updated to use 11.0.0 already, so it should be able to handle the new file format.

r? `@Mark-Simulacrum`

Fixes https://github.com/rust-lang/rust/issues/99282
Fixes https://github.com/rust-lang/rust/issues/119103
2024-01-17 09:32:03 +00:00
Nadrieril 19d6f068ee Don't rely on contiguous VariantIds outside of rustc 2024-01-17 03:09:06 +01:00
Matthias Krüger b6f68a7fca
Rollup merge of #119971 - compiler-errors:zip-eq, r=nnethercote
Use `zip_eq` to enforce that things being zipped have equal sizes

Some `zip`s are best enforced to be equal, since size mismatches suggest deeper bugs in the compiler.
2024-01-15 08:44:49 +01:00
bors 9567c3ee73 Auto merge of #119581 - Nadrieril:detangle-arena, r=compiler-errors
Exhaustiveness: remove the need for arena-allocation within the algorithm

After https://github.com/rust-lang/rust/pull/119688, exhaustiveness checking doesn't need access to the arena anymore. This simplifies the lifetime story and makes it compile on stable without the extra dependency.

r? `@compiler-errors`
2024-01-15 00:04:09 +00:00
Michael Goulet c811662fb0 Use zip_eq to enforce that things being zipped have equal sizes 2024-01-14 20:01:12 +00:00
bors 665d2c6f2c Auto merge of #119796 - androm3da:bcain/compiler_builtins_0_1_105, r=Mark-Simulacrum
Update compiler_builtins to 0.1.105

This provides the builtins for the hexagon architecture.
2024-01-14 19:15:37 +00:00
Michael Woerister ac58f9ae03 Update measureme crate to version 11 2024-01-13 16:32:03 +01:00
Nadrieril db36304102 rustc_pattern_analysis no longer needs to be passed an arena 2024-01-12 18:55:27 +01:00
bors 2b1365b34f Auto merge of #119735 - lcnr:provisional-cache-readd, r=compiler-errors
next solver: provisional cache

this adds the cache removed in #115843. However, it should now correctly track whether a provisional result depends on an inductive or coinductive stack.

While working on this, I was using the following doc: https://hackmd.io/VsQPjW3wSTGUSlmgwrDKOA. I don't think it's too helpful to understanding this, but am somewhat hopeful that the inline comments are more useful.

There are quite a few future perf improvements here. Given that this is already very involved I don't believe it is worth it (for now). While working on this PR one of my few attempts to significantly improve perf ended up being unsound again because I was not careful enough 

r? `@compiler-errors`
2024-01-12 07:04:42 +00:00
Matthias Krüger fe97e93166
Rollup merge of #119448 - klensy:annotate-snippets-0.10, r=davidtwco
annotate-snippets: update to 0.10

Ports `annotate-snippets` to 0.10, temporary dupes versions; other crates left that depends on 0.9 is `ui_test` and `rustfmt`.
2024-01-11 19:42:49 +01:00
Simonas Kazlauskas fcaeb45421 deps: deduplicate the version of libloading used
The changelog can be found here:
https://docs.rs/libloading/latest/libloading/changelog/r0_8_0/index.html
2024-01-10 17:18:10 +02:00
Brian Cain d5c39d0638 Update compiler_builtins to 0.1.105
This provides the builtins for the hexagon architecture.
2024-01-09 20:30:56 -08:00
Guillaume Gomez 3da96aed94
Rollup merge of #118680 - djkoloski:shell_argfiles, r=compiler-errors
Add support for shell argfiles

Closes https://github.com/rust-lang/compiler-team/issues/684
2024-01-09 17:52:21 +01:00
Guillaume Gomez 87b0de6cb7
Rollup merge of #118645 - Patryk27:bump-compiler-builtins, r=Nilstrieb,dtolnay
chore: Bump compiler_builtins

Actually closes https://github.com/rust-lang/rust/issues/118079.
2024-01-09 17:52:20 +01:00
Guillaume Gomez 4a24b5bc05
Rollup merge of #117556 - obeis:static-mut-ref-lint, r=davidtwco
Disallow reference to `static mut` and adding `static_mut_ref` lint

Closes #114447

r? `@scottmcm`
2024-01-09 13:23:15 +01:00
lcnr 88271deac2 avoid always rerunning in case of a cycle 2024-01-09 11:19:34 +01:00
Matthias Krüger 91fcc17117
Rollup merge of #119734 - RalfJung:miri, r=RalfJung
Miri subtree update

r? ``@ghost``
2024-01-09 05:33:23 +01:00
David Koloski 684aa2c9d1 Add support for shell argfiles 2024-01-08 15:25:55 -05:00
Ralf Jung 0ddccf933a update lockfile 2024-01-08 11:21:50 +01:00
Mark Rousskov be0293f468 Remove crossbeam-channel
The standard library's std::sync::mpsc basically is a crossbeam channel,
and for the use case here will definitely suffice. This drops this
dependency from librustc_driver.
2024-01-07 19:16:13 -05:00
klensy 5b153b52a2 annotate-snippets: update to 0.10 2024-01-07 16:53:32 +03:00
Obei Sideg 2c088f9520 Disallow reference to static mut for expressions
Add `E0796` error code.
Add `static_mut_ref` lint.

This is the idea for the 2024 edition.
2024-01-06 06:31:35 +03:00
bjorn3 6ed37bdc42 Avoid specialization for the Span Encodable and Decodable impls 2023-12-31 20:42:17 +00:00
Nilstrieb ffafcd8819 Update to bitflags 2 in the compiler
This involves lots of breaking changes. There are two big changes that
force changes. The first is that the bitflag types now don't
automatically implement normal derive traits, so we need to derive them
manually.

Additionally, bitflags now have a hidden inner type by default, which
breaks our custom derives. The bitflags docs recommend using the impl
form in these cases, which I did.
2023-12-30 18:17:28 +01:00
Philipp Krones 0217ac9da6
Update Cargo.lock 2023-12-28 19:33:21 +01:00
bors 2df6406b88 Auto merge of #118431 - sjwang05:issue-44695, r=estebank
Emit better suggestions for `&T == T` and `T == &T`

Fixes #40660
Fixes #44695
2023-12-26 21:34:24 +00:00
Guillaume Gomez c2dcfc762d Update sysinfo sub-dependency version to 0.29.11 2023-12-25 22:45:38 +01:00
Guillaume Gomez 51dff45aa3 Update sysinfo version to 0.30.1 2023-12-25 22:44:49 +01:00
Nadrieril c6aa16c469 Use derivative for better derive bounds 2023-12-23 00:04:20 +01:00
bors 3a539c0889 Auto merge of #118842 - Nadrieril:librarify-further, r=compiler-errors
Make exhaustiveness usable outside of rustc

With this PR, `rustc_pattern_analysis` compiles on stable (with the `stable` feature)! `rust-analyzer` will be able to use it to provide match-related diagnostics and refactors.

Two questions:
- Should I name the feature `nightly` instead of `rustc` for consistency with other crates? `rustc` makes more sense imo.
- `typed-arena` is an optional dependency but tidy made me add it to the allow-list anyway. Can I avoid that somehow?

r? `@compiler-errors`
2023-12-19 17:15:04 +00:00
sjwang05 2618e0f805
Provide better suggestions for T == &T and &T == T 2023-12-16 19:56:50 -08:00
Philipp Krones b92ab506d3
Update Cargo.lock 2023-12-16 14:13:12 +01:00
Nadrieril 63c5b008e1 Make the crate compile on stable 2023-12-15 16:58:38 +01:00
Rémy Rakic 4cb2a281cb update measureme to 10.1.2 to deduplicate parking_lot 2023-12-14 15:40:50 +00:00
bors 1aa6aefdc9 Auto merge of #118566 - klensy:cstr-new, r=WaffleLapkin
use c literals in compiler and library

Relands refreshed https://github.com/rust-lang/rust/pull/111647
2023-12-14 11:14:03 +00:00
Nadrieril 281002d42c Extract exhaustiveness into its own crate 2023-12-11 11:20:55 +01:00
Matthias Krüger 1889e5a00b
Rollup merge of #118694 - celinval:smir-alloc-methods, r=ouz-a
Add instance evaluation and methods to read an allocation in StableMIR

The instance evaluation is needed to handle intrinsics such as `type_id` and `type_name`.

Since we now use Allocation to represent all evaluated constants, provide a few methods to help process the data inside an allocation.

I've also started to add a structured way to get information about the compilation target machine. For now, I've only added information needed to process an allocation.

r? ``````@ouz-a``````
2023-12-08 23:15:12 +01:00
Michael Goulet cb41509601 Uplift canonicalizer into new trait solver crate 2023-12-08 17:44:01 +00:00
Celina G. Val 4c9e842a09 Add instance evaluation and methods to read alloc
The instance evaluation is needed to handle intrinsics such as
`type_id` and `type_name`.

Since we now use Allocation to represent all evaluated constants,
provide a few methods to help process the data inside an allocation.
2023-12-07 17:01:29 -08:00
Zalathar 47e6e5ee67 coverage: Avoid unnecessary macros in unit tests
These macros don't provide enough value to justify their complexity, when they
can just as easily be functions instead.
2023-12-07 11:12:48 +11:00
bors 84a554cda9 Auto merge of #117072 - betrusted-io:unwinding-crate-support, r=cuviper
Use `unwinding` crate for unwinding on Xous platform

This patch adds support for using [unwinding](https://github.com/nbdd0121/unwinding) on platforms where libunwinding isn't viable. An example of such a platform is `riscv32imac-unknown-xous-elf`.

### Background

The Rust project maintains a fork of llvm at [llvm-project](https://github.com/rust-lang/llvm-project/) where it applies patches on top of the llvm project. This mostly seems to be to get unwinding support for the SGX project, and there may be other patches that I'm unaware of.

There is a lot of machinery in the build system to support compiling `libunwind` on other platforms, and I needed to add additional patches to llvm in order to add support for Xous.

Rather than continuing down this path, it seemed much easier to use a Rust-based library. The `unwinding` crate by `@nbdd0121` fits this description perfectly.

### Future work

This could potentially replace the custom patches for `libunwind` on other platforms such as SGX, and could enable unwinding support on many more exotic platforms.

### Anti-goals

This is not designed to replace `libunwind` on tier-one platforms or those where unwinding support already exists. There is already a well-established approach for unwinding there. Instead, this aims to enable unwinding on new platforms where C++ code may be difficult to compile.
2023-12-06 02:23:01 +00:00
Patryk Wychowaniec a2b79cd92f
chore: Bump compiler_builtins
Actually closes https://github.com/rust-lang/rust/issues/118079.
2023-12-05 15:58:07 +01:00
bors db07cccb1e Auto merge of #113730 - belovdv:jobserver-init-check, r=petrochenkov
Report errors in jobserver inherited through environment variables

This pr attempts to catch situations, when jobserver exists, but is not being inherited.

r? `@petrochenkov`
2023-12-03 16:28:22 +00:00
klensy 26e69a8816 compiler: replace cstr macro with c str literals in compiler and few other c str replacements 2023-12-03 14:54:09 +03:00
Ralf Jung 71c9ceb4da update hashbrown 2023-12-02 19:16:09 +01:00
Eric Huss b07e3160a0 Update mdbook to 0.4.36 2023-11-29 15:52:16 -08:00
belovdv 45e6342346 jobserver: check file descriptors 2023-11-29 18:00:03 +03:00
bors 3dbb4da042 Auto merge of #117301 - saethlin:finish-rmeta-encoding, r=WaffleLapkin
Call FileEncoder::finish in rmeta encoding

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

The bug here was that rmeta encoding never called FileEncoder::finish. Now it does. Most of the changes here are needed to support that, since rmeta encoding wants to finish _then_ access the File in the encoder, so finish can't move out.

I tried adding a `cfg(debug_assertions)` exploding Drop impl to FileEncoder that checked for finish being called before dropping, but fatal errors cause unwinding so this isn't really possible. If we encounter a fatal error with a dirty FileEncoder, the Drop impl ICEs even though the implementation is correct. If we try to paper over that by wrapping FileEncoder in ManuallyDrop then that just erases the fact that Drop automatically checks that we call finish on all paths.

I also changed the name of DepGraph::encode to DepGraph::finish_encoding, because that's what it does and it makes the fact that it is the path to FileEncoder::finish less confusing.

r? `@WaffleLapkin`
2023-11-26 14:43:02 +00:00
Nicholas Nethercote af3fbb3607 Remove unnecessary dependencies. 2023-11-26 08:38:42 +11:00
Nicholas Nethercote df9f83987a Remove rustc_error_messages/messages.ftl.
It's empty, and it doesn't even make sense, because
`rustc_error_messages` is a lower-level crate than `rustc_errors`.
2023-11-26 08:37:27 +11:00
bors 0f696e555f Auto merge of #118229 - crlf0710:final_bump_unicode15, r=Mark-Simulacrum
Bump `unicase` crate version.

This bumps `unicase` crate to align with Unicode 15.

Closes #101840.
2023-11-24 19:41:10 +00:00
Matthias Krüger 7e3ec1b0e2
Rollup merge of #117656 - ChrisDenton:invalid, r=thomcc
Update windows-bindgen and define `INVALID_HANDLE_VALUE` ourselves

We generate bindings to the Windows API via the `windows-bindgen` crate, which is ultimately what's also used to generate the `windows-sys` and `windows` crates. However, there currently is some custom sauce just for std which makes it a bit different from the vanilla bindings. I would love for us to reduce and eventually remove the differences entirely so that std is using the exact same bindings as everyone else. Maybe in the future we can even just have a normal dependency on `windows-sys`.

This PR removes one of those special things. Our definition of `INVALID_HANDLE_VALUE` relies on an experimental nightly feature for strict provenance, so lets bring that back in house. It also excludes it from the codegen step though that isn't strictly necessary as we override it in any case.

This PR also updates windows-bingen to 0.52.0.
2023-11-24 08:23:52 +01:00
Charles Lew 806b2b2553 Bump unicase crate version. 2023-11-23 18:55:36 +08:00
Ben Kimock fbaa24ee35 Call FileEncoder::finish in rmeta encoding 2023-11-22 22:49:22 -05:00
Nicholas Nethercote 3ef9d4d0ed Replace custom_encodable with encodable.
By default, `newtype_index!` types get a default `Encodable`/`Decodable`
impl. You can opt out of this with `custom_encodable`. Opting out is the
opposite to how Rust normally works with autogenerated (derived) impls.

This commit inverts the behaviour, replacing `custom_encodable` with
`encodable` which opts into the default `Encodable`/`Decodable` impl.
Only 23 of the 59 `newtype_index!` occurrences need `encodable`.

Even better, there were eight crates with a dependency on
`rustc_serialize` just from unused default `Encodable`/`Decodable`
impls. This commit removes that dependency from those eight crates.
2023-11-22 18:37:14 +11:00
Nicholas Nethercote ce363bb6e6 Remove IterDelimited.
itertools has `with_position` which does the same thing.
2023-11-22 08:13:21 +11:00
Nicholas Nethercote 3eadc6844b Update itertools to 0.11.
Because the API for `with_position` improved in 0.11 and I want to use
it.
2023-11-22 08:13:21 +11:00
bors 19079cf804 Auto merge of #115526 - arttet:master, r=jackh726
Add arm64e-apple-ios & arm64e-apple-darwin targets

This introduces

*  `arm64e-apple-ios`
*  `arm64e-apple-darwin`

Rust targets for support `arm64e` architecture on `iOS` and `Darwin`.

So, this is a first approach for integrating to the Rust compiler.

## Tier 3 Target Policy

> * A tier 3 target must have a designated developer or developers (the "target
maintainers") on record to be CCed when issues arise regarding the target.
(The mechanism to track and CC such developers may evolve over time.)

I will be the target maintainer.

> * Targets must use naming consistent with any existing targets; for instance, a
target for the same CPU or OS as an existing Rust target should use the same
name for that CPU or OS. Targets should normally use the same names and
naming conventions as used elsewhere in the broader ecosystem beyond Rust
(such as in other toolchains), unless they have a very good reason to
diverge. Changing the name of a target can be highly disruptive, especially
once the target reaches a higher tier, so getting the name right is important
even for a tier 3 target.
Target names should not introduce undue confusion or ambiguity unless
absolutely necessary to maintain ecosystem compatibility. For example, if
the name of the target makes people extremely likely to form incorrect
beliefs about what it targets, the name should be changed or augmented to
disambiguate it.
If possible, use only letters, numbers, dashes and underscores for the name.
Periods (.) are known to cause issues in Cargo.

The target names `arm64e-apple-ios`, `arm64e-apple-darwin` were derived from `aarch64-apple-ios`, `aarch64-apple-darwin`.
In this [ticket,](#73628) people discussed the best suitable names for these targets.

> In some cases, the arm64e arch might be "different". For example:
> * `thread_set_state` might fail with (os/kern) protection failure if we try to call it from arm64 process to arm64e process.
> * The returning value of dlsym is PAC signed on arm64e, while left untouched on arm64
> * Some function like pthread_create_from_mach_thread requires a PAC signed function pointer on arm64e, which is not required on arm64.

So, I have chosen them because there are similar triplets in LLVM. I think there are no more suitable names for these targets.

> * Tier 3 targets may have unusual requirements to build or use, but must not
create legal issues or impose onerous legal terms for the Rust project or for
Rust developers or users.
The target must not introduce license incompatibilities.
Anything added to the Rust repository must be under the standard Rust
license (MIT OR Apache-2.0).
The target must not cause the Rust tools or libraries built for any other
host (even when supporting cross-compilation to the target) to depend
on any new dependency less permissive than the Rust licensing policy. This
applies whether the dependency is a Rust crate that would require adding
new license exceptions (as specified by the tidy tool in the
rust-lang/rust repository), or whether the dependency is a native library
or binary. In other words, the introduction of the target must not cause a
user installing or running a version of Rust or the Rust tools to be
subject to any new license requirements.
Compiling, linking, and emitting functional binaries, libraries, or other
code for the target (whether hosted on the target itself or cross-compiling
from another target) must not depend on proprietary (non-FOSS) libraries.
Host tools built for the target itself may depend on the ordinary runtime
libraries supplied by the platform and commonly used by other applications
built for the target, but those libraries must not be required for code
generation for the target; cross-compilation to the target must not require
such libraries at all. For instance, rustc built for the target may
depend on a common proprietary C runtime library or console output library,
but must not depend on a proprietary code generation library or code
optimization library. Rust's license permits such combinations, but the
Rust project has no interest in maintaining such combinations within the
scope of Rust itself, even at tier 3.
"onerous" here is an intentionally subjective term. At a minimum, "onerous"
legal/licensing terms include but are not limited to: non-disclosure
requirements, non-compete requirements, contributor license agreements
(CLAs) or equivalent, "non-commercial"/"research-only"/etc terms,
requirements conditional on the employer or employment of any particular
Rust developers, revocable terms, any requirements that create liability
for the Rust project or its developers or users, or any requirements that
adversely affect the livelihood or prospects of the Rust project or its
developers or users.

No dependencies were added to Rust.

> * Neither this policy nor any decisions made regarding targets shall create any
binding agreement or estoppel by any party. If any member of an approving
Rust team serves as one of the maintainers of a target, or has any legal or
employment requirement (explicit or implicit) that might affect their
decisions regarding a target, they must recuse themselves from any approval
decisions regarding the target's tier status, though they may otherwise
participate in discussions.
>    * This requirement does not prevent part or all of this policy from being
cited in an explicit contract or work agreement (e.g. to implement or
maintain support for a target). This requirement exists to ensure that a
developer or team responsible for reviewing and approving a target does not
face any legal threats or obligations that would prevent them from freely
exercising their judgment in such approval, even if such judgment involves
subjective matters or goes beyond the letter of these requirements.

Understood.
I am not a member of a Rust team.

> * Tier 3 targets should attempt to implement as much of the standard libraries
as possible and appropriate (core for most targets, alloc for targets
that can support dynamic memory allocation, std for targets with an
operating system or equivalent layer of system-provided functionality), but
may leave some code unimplemented (either unavailable or stubbed out as
appropriate), whether because the target makes it impossible to implement or
challenging to implement. The authors of pull requests are not obligated to
avoid calling any portions of the standard library on the basis of a tier 3
target not implementing those portions.

Understood.
`std` is supported.

> * The target must provide documentation for the Rust community explaining how
to build for the target, using cross-compilation if possible. If the target
supports running binaries, or running tests (even if they do not pass), the
documentation must explain how to run such binaries or tests for the target,
using emulation if possible or dedicated hardware if necessary.

Building is described in the derived target doc.

> * Tier 3 targets must not impose burden on the authors of pull requests, or
other developers in the community, to maintain the target. In particular,
do not post comments (automated or manual) on a PR that derail or suggest a
block on the PR based on a tier 3 target. Do not send automated messages or
notifications (via any medium, including via `@)` to a PR author or others
involved with a PR regarding a tier 3 target, unless they have opted into
such messages.
>    * Backlinks such as those generated by the issue/PR tracker when linking to
an issue or PR are not considered a violation of this policy, within
reason. However, such messages (even on a separate repository) must not
generate notifications to anyone involved with a PR who has not requested
such notifications.

Understood.

> * Patches adding or updating tier 3 targets must not break any existing tier 2
or tier 1 target, and must not knowingly break another tier 3 target without
approval of either the compiler team or the maintainers of the other tier 3
target.
>     * In particular, this may come up when working on closely related targets,
such as variations of the same architecture with different features. Avoid
introducing unconditional uses of features that another variation of the
target may not have; use conditional compilation or runtime detection, as
appropriate, to let each target run code supported by that target.

These targets are not fully ABI compatible with arm64e code.

#73628
2023-11-20 03:11:17 +00:00
bors 4f3da903a4 Auto merge of #116828 - compiler-errors:nightlyify-rustc_type_ir, r=jackh726
Begin to abstract `rustc_type_ir` for rust-analyzer

This adds the "nightly" feature which is used by the compiler, and falls back to more simple implementations when that is not active.

r? `@lcnr` or `@jackh726`
2023-11-19 22:55:15 +00:00
klensy c653bb9a6b jsondocck: bump jsonpath to 0.3, dropping few dup dependencies
changes: https://github.com/freestrings/jsonpath/compare/v0.2.6...v0.3.0

self_cell: bump to 0.10.3 due to RUSTSEC-2023-0070

https://rustsec.org/advisories/RUSTSEC-2023-0070.html
https://github.com/Voultapher/self_cell/issues/49

bump h2 to 0.3.22, dropping few dup crate versions

https://github.com/hyperium/h2/blob/v0.3.22/CHANGELOG.md
2023-11-18 12:56:54 +03:00
Michael Goulet 4506681e2f Begin nightly-ifying rustc_type_ir 2023-11-18 00:20:00 +00:00
Chris Denton 00a12af3ca
Update windows-bindgen 2023-11-17 12:18:04 +00:00
Oğuz Ağcayazı ebd9c145f6 better formatting for statements 2023-11-17 13:28:07 +03:00
Philipp Krones 2ac2b26aec
Update Cargo.lock 2023-11-16 19:20:09 +01:00
Sean Cross 2a533df5bd Cargo.lock: add unwinding to lock file
Add `unwinding` as a dependency. This is required on platforms where
unwinding isn't provided by llvm.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-11-16 15:23:09 +08:00
Artyom Tetyukhin f5e3492194
Add arm64e-apple-ios target 2023-11-15 14:55:18 +04:00
klensy 7142c8d83c bump few ICU4X leftover deps
implements https://github.com/rust-lang/rust/pull/117632#issuecomment-1795027801 suggestion
2023-11-09 14:53:21 +03:00
bors 287ae4db75 Auto merge of #117632 - Nilstrieb:icup, r=davidtwco
Update ICU4X

This updates all ICU4X crates and regenerates rustc_baked_icu_data.

Since the new unicode license under which they are licensed does not have an SPDX identifier yet, we define some exceptions. The license has to be reviewed to make sure it is still fine to use here, but I assume that is the case.

I also added an exception for rustc_icu_data to the unexplained ignore doctest tidy lint. This is a bit hacky but the whole style.rs in tidy is a mess so I didn't want to touch it more than this small hack.

part of #112865

r? `@davidtwco` `@wesleywiser` `@Manishearth`
2023-11-09 09:00:57 +00:00
Matthias Krüger adf4981969
Rollup merge of #117663 - klensy:bump-deps, r=davidtwco
bump some deps

* drop `num_cpus` from rust-installer as not used
* update `rayon`, `rayon-core`, which drops it's deps on `num_cpus` and `crossbeam-channel` (for bootstrap too) (https://github.com/rayon-rs/rayon/blob/v1.8.0/RELEASES.md)
* update `errno`, which drops `errno-dragonfly` (5341791935/CHANGELOG.md)
2023-11-08 11:25:55 +01:00
bors 118a2deea5 Auto merge of #117617 - Urgau:bump-libc-0.2.150, r=Mark-Simulacrum
Bump libc dependency

This bumps the `libc` crate to version 0.2.150 which includes https://github.com/rust-lang/libc/pull/3410 which will help remove the old and deprecated check-cfg syntax.

Extracted from https://github.com/rust-lang/rust/pull/117612
2023-11-07 17:18:36 +00:00
klensy eed89185bb bump some deps
drop num_cpus from rust-installer as not used
update rayon, rayon-core, which drops it's deps on num_cpus and crossbeam-channel (for bootstrap too) (https://github.com/rayon-rs/rayon/blob/v1.8.0/RELEASES.md)
update erro, which drops errno-dragonfly (5341791935/CHANGELOG.md)
2023-11-07 15:33:59 +03:00
Nilstrieb ffffc2038f Update ICU4X
This updates all ICU4X crates and regenerates rustc_baked_icu_data.

Since the new unicode license under which they are licensed does not
have an SPDX identifier yet, we define some exceptions. The license has
to be reviewed to make sure it is still fine to use here, but I assume
that is the case.

I also added an exception for rustc_icu_data to the unexplained ignore
doctest tidy lint. This is a bit hacky but the whole style.rs in tidy is
a mess so I didn't want to touch it more than this small hack.
2023-11-06 13:42:20 +00:00
bors f9b644636f Auto merge of #117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwco
enable parallel rustc front end in nightly builds

Refers to the [MCP](https://github.com/rust-lang/compiler-team/issues/681), this pr does:
1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option.

2. Set it up to serial front end for beta/stable builds via bootstrap.

3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel.

r? `@oli-obk`

cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
2023-11-06 07:41:22 +00:00
SparrowLii f2a40e99ff use portable AtomicU64 for powerPC and MIPS 2023-11-06 09:58:51 +08:00
Urgau 15719a8c1d libc: bump dependency to 0.2.150 2023-11-05 18:32:10 +01:00
bors 513a48517e Auto merge of #117504 - pcc:android-link-libunwind, r=Mark-Simulacrum
Remove obsolete support for linking unwinder on Android

Linking libgcc is no longer supported (see #103673), so remove the related link attributes and the check in unwind's build.rs. The check was the last remaining significant piece of logic in build.rs, so remove build.rs as well.
2023-11-05 09:50:21 +00:00
Nicholas Bishop 5d3535c616 Bump compiler_builtins to 0.1.103 2023-11-04 13:11:10 -04:00
Nicholas Nethercote 5c462a32bd Remove support for compiler plugins.
They've been deprecated for four years.

This commit includes the following changes.
- It eliminates the `rustc_plugin_impl` crate.
- It changes the language used for lints in
  `compiler/rustc_driver_impl/src/lib.rs` and
  `compiler/rustc_lint/src/context.rs`. External lints are now called
  "loaded" lints, rather than "plugins" to avoid confusion with the old
  plugins. This only has a tiny effect on the output of `-W help`.
- E0457 and E0498 are no longer used.
- E0463 is narrowed, now only relating to unfound crates, not plugins.
- The `plugin` feature was moved from "active" to "removed".
- It removes the entire plugins chapter from the unstable book.
- It removes quite a few tests, mostly all of those in
  `tests/ui-fulldeps/plugin/`.

Closes #29597.
2023-11-04 08:50:46 +11:00
Peter Collingbourne 654288bbb7 Remove obsolete support for linking unwinder on Android
Linking libgcc is no longer supported (see #103673), so remove the
related link attributes and the check in unwind's build.rs. The check
was the last remaining significant piece of logic in build.rs, so
remove build.rs as well.
2023-11-02 18:06:35 -07:00
Philipp Krones 02562bfdf8
Update Cargo.lock 2023-11-02 17:50:52 +01:00
bors 62270fb4d6 Auto merge of #117204 - nnethercote:rustc_ast_passes, r=compiler-errors
Minor improvements to `rustc_ast_passes`

Some improvements I found while looking at this code.

r? `@compiler-errors`
2023-11-02 10:08:53 +00:00
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
Vadim Petrochenkov 7353c96be8 rustc: Move features from Session to GlobalCtxt
Removes two pieces of mutable state.
Follow up to #114622.
2023-08-11 16:51:50 +08:00
bors 8838c73e86 Auto merge of #99747 - ankane:float_gamma, r=workingjubilee
Add gamma function to f32 and f64

Adds the [gamma function](https://en.wikipedia.org/wiki/Gamma_function) to `f32` and `f64` (`tgamma` and `tgammaf` from C).

Refs:
- https://github.com/rust-lang/rfcs/issues/864
- https://github.com/rust-lang/rust/issues/18271
2023-08-09 03:14:31 +00:00
Andrew Kane a75e2284fb Bump compiler_builtins to 0.1.100 2023-08-07 16:38:09 -07:00
bors 84ec2633de Auto merge of #113902 - Enselic:lint-recursive-drop, r=oli-obk
Make `unconditional_recursion` warning detect recursive drops

Closes #55388

Also closes #50049 unless we want to keep it for the second example which this PR does not solve, but I think it is better to track that work in #57965.

r? `@oli-obk` since you are the mentor for #55388

Unresolved questions:
- [x] There are two false positives that must be fixed before merging (see diff). I suspect the best way to solve them is to perform analysis after drop elaboration instead of before, as now, but I have not explored that any further yet. Could that be an option? **Answer:** Yes, that solved the problem.

`@rustbot` label +T-compiler +C-enhancement +A-lint
2023-08-07 13:39:28 +00:00
klensy 55935df22d bump schannel, miow to drop windows-sys 0.42 2023-08-06 13:24:59 +03:00
bors e4c1446846 Auto merge of #114481 - matthiaskrgr:rollup-58pczpl, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #113945 (Fix wrong span for trait selection failure error reporting)
 - #114351 ([rustc_span][perf] Remove unnecessary string joins and allocs.)
 - #114418 (bump parking_lot to 0.12)
 - #114434 (Improve spans for indexing expressions)
 - #114450 (Fix ICE failed to get layout for ReferencesError)
 - #114461 (Fix unwrap on None)
 - #114462 (interpret: add mplace_to_ref helper method)
 - #114472 (Reword `confusable_idents` lint)
 - #114477 (Account for `Rc` and `Arc` when suggesting to clone)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-04 20:31:40 +00:00
bors fe896efa97 Auto merge of #114104 - oli-obk:syn2, r=compiler-errors
Lots of tiny incremental simplifications of `EmitterWriter` internals

ignore the first commit, it's https://github.com/rust-lang/rust/pull/114088 squashed and rebased, but it's needed to use to use `derive_setters`, as they need a newer `syn` version.

Then this PR starts out with removing many arguments that are almost always defaulted to `None` or `false` and replace them with builder methods that can set these fields in the few cases that want to set them.

After that it's one commit after the other that removes or merges things until everything becomes some very simple trait objects
2023-08-04 18:46:19 +00:00
klensy 383b715163 bump parking_lot 0.11 to 0.12 2023-08-03 16:05:26 +03:00
Matthias Krüger 57c57a555b
Rollup merge of #114193 - crlf0710:lexer_unicode15, r=Manishearth
Update lexer emoji diagnostics to Unicode 15.0

This replaces the `unic-emoji-char` dep tree (which hasn't been updated for a while) with `unicode-properties` crate which contains Unicode 15.0 data.

Improves diagnostics for added emoji characters in recent years. (See tests).

cc #101840

cc ``@Manishearth``
2023-07-31 22:51:15 +02:00
Oli Scherer 51c22154f5 Remove a bool for color in favor of the WriteColor trait wrapping colored and uncolored printing 2023-07-31 09:34:36 +00:00
Oli Scherer 29de70da1b Replace the many arguments of EmitterWriter::stderr with builder methods 2023-07-31 07:19:23 +00:00
Jakub Beránek a16925d5f3
Implement BOLT optimization in the opt-dist tool 2023-07-31 08:52:41 +02:00
Charles Lew bca79a26d8 Update lexer emoji diagnostics to Unicode 15.0 2023-07-29 08:47:21 +08:00
Guillaume Gomez f7123db888
Rollup merge of #114088 - oli-obk:syn, r=davidtwco
Bump syn dependency

r? `@davidtwco` because this affects diagnostics derive diagnostics (yes this sentence is grammatically correct)
2023-07-27 16:05:13 +02:00
Matthias Krüger dea5b4fff3
Rollup merge of #114098 - klensy:drop-atty, r=fee1-dead
replace atty crate with std's IsTerminal
2023-07-27 06:04:15 +02:00
klensy 31630859cc replace atty crate with std's isTerminal 2023-07-26 18:09:50 +03:00
Wesley Wiser 15e9f56088 Replace in-tree rustc_apfloat with the new version of the crate 2023-07-26 10:20:15 -04:00
Oli Scherer cf325e8187 Bump syn now that it doesn't affect diagnostics anymore 2023-07-26 08:26:50 +00:00
Martin Nordholts b4b33df983 Make unconditional_recursion warning detect recursive drops 2023-07-22 14:04:45 +02:00
Nicholas Bishop 8d5d2fea96 Bump compiler_builtins to 0.1.98 2023-07-21 13:03:58 -04:00
bors b14fd2359f Auto merge of #113695 - bjorn3:fix_rlib_cdylib_metadata_handling, r=pnkfelix,petrochenkov
Verify that all crate sources are in sync

This ensures that rustc will not attempt to link against a cdylib as if it is a rust dylib when an rlib for the same crate is available. Previously rustc didn't actually check if any further formats of a crate which has been loaded are of the same version and if they are actually valid. This caused a cdylib to be interpreted as rust dylib as soon as the corresponding rlib was loaded. As cdylibs don't export any rust symbols, linking would fail if rustc decides to link against the cdylib rather than the rlib.

Two crates depended on the previous behavior by separately compiling a test crate as both rlib and dylib. These have been changed to capture their original spirit to the best of my ability while still working when rustc verifies that all crates are in sync. It is unlikely that build systems depend on the current behavior and in any case we are taking a lot of measures to ensure that any change to either the source or the compilation options (including crate type) results in rustc rejecting it as incompatible. We merely didn't do this check here for now obsolete perf reasons.

Fixes https://github.com/rust-lang/rust/issues/10786
Fixes https://github.com/rust-lang/rust/issues/82151
Fixes https://github.com/rust-lang/rust/issues/82972
Closes https://github.com/bevy-cheatbook/bevy-cheatbook/issues/114
2023-07-20 09:00:10 +00:00
bjorn3 52853c2694 Don't compress dylib metadata 2023-07-19 14:47:06 +00:00
Esteban Küber 8eb5843a59 On nightly, dump ICE backtraces to disk
Implement rust-lang/compiler-team#578.

When an ICE is encountered on nightly releases, the new rustc panic
handler will also write the contents of the backtrace to disk. If any
`delay_span_bug`s are encountered, their backtrace is also added to the
file. The platform and rustc version will also be collected.
2023-07-19 14:10:07 +00:00
Philipp Krones c2490bdc44
Update Cargo.lock/toml
Remove clippy_test_deps from Cargo.toml
2023-07-17 10:22:41 +02:00
许杰友 Jieyou Xu (Joe) 08c77a6eb4
Add infrastructure #[rustc_confusables] attribute to allow targeted
"no method" errors on standard library types

The standard library developer can annotate methods on e.g.
`BTreeSet::push` with `#[rustc_confusables("insert")]`. When the user
mistypes `btreeset.push()`, `BTreeSet::insert` will be suggested if
there are no other candidates to suggest.
2023-07-16 19:22:03 +08:00
Stefan Lankes 8666adeb61 use latest version of hermit-abi
0.3.0 and 0.3.1 have an issue and will be yanked. Consequently, std
should switch to 0.3.2.
2023-07-12 13:15:09 +02:00
Matthias Krüger 3f73a7dba3
Rollup merge of #112717 - celinval:stable-mir-rvalue-1, r=oli-obk
Implement a few more rvalue translation to smir

Add the implementation for a few more RValue variants. For now, I simplified the stable version of `RValue::Ref` by removing the notion of Region.

r? `@oli-obk`
2023-07-11 17:46:18 +02:00
Josh Stone dd5fa7d9b3 Don't use serde-derive in the rls shim
The already-small RLS shim can get a little smaller, and faster to
build, if we drop the serde-derive dependency and decode the one
"method" field it needs manually from `serde_json::Value`.
2023-07-10 14:53:57 -07:00
Celina G. Val b9f378b19b Implement a few more rvalue translation to smir
- Introduce an Opaque type for adding information that is still
   internal to the compiler.
2023-07-10 11:47:48 -07:00
Celina G. Val 44d0fce150 Fix standalone build
Add extern declarations and optional dependencies to fix build done
directly via `cargo build`.
2023-07-10 10:06:18 -07:00
bors b12ff66f2c Auto merge of #113488 - RalfJung:miri, r=RalfJung
update Miri
2023-07-09 13:37:41 +00:00
bors 1861088f90 Auto merge of #112235 - Kobzol:opt-dist, r=Mark-Simulacrum
Port PGO/LTO/BOLT optimized build pipeline to Rust

This PR ports the `stage-build.py` PGO/LTO/BOLT optimization script from Python to Rust, to make it easier to use dependencies, and make it a bit more robust. The PR switches both the Linux and Windows dist runners to the Rust script and removes the old Python script.

Funnily enough, the Rust port has less lines of code than the Python script :) I think that clearly shows that the Python script really lacked dependencies.
2023-07-09 08:11:57 +00:00
Jakub Beránek 91d2fb2e2b
Port PGO/LTO/BOLT optimized build pipeline to Rust 2023-07-09 08:39:50 +02:00
bors f05d743c20 Auto merge of #113276 - Nilstrieb:rustix, r=Mark-Simulacrum
Update rustix

The issue has been fixed.
https://github.com/bytecodealliance/rustix/issues/716
2023-07-09 05:50:31 +00:00
Ralf Jung 9ed4669680 update lockfile 2023-07-08 18:25:13 +02:00
bors 85bf07972a Auto merge of #113269 - jyn514:update-compiler-builtins, r=Amanieu
Update compiler builtins

cc https://github.com/rust-lang/compiler-builtins/pull/532#discussion_r1249354225

in particular this pulls in https://github.com/rust-lang/compiler-builtins/pull/532 and https://github.com/rust-lang/compiler-builtins/pull/535.

Fixes https://github.com/rust-lang/rust/issues/93166. Fixes https://github.com/rust-lang/git2-rs/issues/706. Fixes https://github.com/rust-lang/rust/issues/109064. Fixes https://github.com/rust-lang/wg-cargo-std-aware/issues/74.
2023-07-06 18:58:54 +00:00
fee1-dead 1830b80c2d
Rollup merge of #113334 - fmease:revert-lexing-c-str-lits, r=compiler-errors
Revert the lexing of `c"…"` string literals

Fixes \[after beta-backport\] #113235.
Further progress is tracked in #113333.

This PR *manually* reverts parts of #108801 (since a git-revert would've been too coarse-grained & messy)
and git-reverts #111647.

CC `@fee1-dead` (#108801) `@klensy` (#111647)
r? `@compiler-errors`

`@rustbot` label F-c_str_literals beta-nominated
2023-07-06 09:20:33 +08:00
jyn fd7f53112a Update compiler-builtins to 0.1.95
This pulls in the new `outline-atomics` intrinsics.
2023-07-05 10:41:41 -05:00
León Orell Valerian Liehr 3788b7ab32
Revert "use new c literals instead of cstr! macro"
This reverts commit a17561ffc9.
2023-07-05 13:11:27 +02:00
Matthias Krüger d3fae79178
Rollup merge of #113251 - chenyukang:yukang-fix-112940-smir, r=oli-obk
Use scoped-tls for SMIR to  map between TyCtxt and SMIR datastructures

Fixes #112940
r? `@oli-obk`
2023-07-04 17:46:27 +02:00
bors cd68ead9ec Auto merge of #113303 - compiler-errors:yeet-chalk, r=lcnr
Remove chalk support from the compiler

Removes chalk (`-Ztrait-solver=chalk`) from the compiler and prunes any dead code resulting from this, mainly:
* Remove the chalk compatibility layer in `compiler/rustc_traits/src/chalk`
* Remove the chalk flag `-Ztrait-solver=chalk` and its `TraitEngine` implementation
* Remove `TypeWellFormedFromEnv` (and its many `bug!()` match arms)
* Remove the chalk migration mode from compiletest
* Remove the `chalkify` UI tests (do we want to keep any of these, but migrate them to `-Ztrait-solver=next`??)

Fulfills rust-lang/types-team#93.

r? `@jackh726`
2023-07-04 09:09:09 +00:00
Michael Goulet 810fbf086d Remove chalk from the compiler 2023-07-03 21:40:04 +00:00
Josh Stone d9b1fa93c4 Upgrade to indexmap 2.0.0
The new version was already added to the tree as an indirect dependency
in #113046, but now our direct dependents are using it too.
2023-07-03 13:51:54 -07:00
Nilstrieb dd19f1f527 Update rustix
The issue has been fixed.
2023-07-03 07:20:51 +00:00
lcnr 5378f07d64 use deeply_normalize for assumed_wf_types 2023-07-03 09:12:14 +02:00
Jubilee Young 079949da8e Update std to backtrace 0.3.68
Dedup addr2line, miniz_oxide, object in .lock
2023-07-02 17:02:45 -07:00
Nilstrieb 1e5d8fbcc9 downgrade compiler_builtins
The outline-atomics support in compiler_builtins messed up and wasn't limited to linux only.
https://github.com/rust-lang/compiler-builtins/pull/532/files#r1249354225
2023-07-02 21:02:31 +02:00
Nilstrieb fd49b1d37f Downgrade rustix
See https://github.com/rust-lang/rust/pull/113046#issuecomment-1616094626.
2023-07-02 21:02:31 +02:00
Nilstrieb 171be8ce94 Downgrade tracing and syn
There's currently a deadlock with tracing when RUSTC_LOG is enabled.
Downgrade tracing-core for now to avoid blocking the other updates.

syns upgrades cause some nontrivial changes in the diagnostics derive tests,
which are best dealt with in another PR.
2023-07-02 21:02:31 +02:00
Nilstrieb 3295cdfff4 cargo update
Additional deps:
equivalent: indexmap
nu-ansi-term: tracing
overload: nu-ansi-term
2023-07-02 20:41:03 +02:00
bors 32d81eccd6 Auto merge of #113260 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`

cc `@oli-obk` (for the ui-test changes in de69d556eb and the valtree fix in 0cbe963e51)

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

This must've been the most involved Clippy sync ever.
2023-07-02 15:14:59 +00:00