Commit graph

1695 commits

Author SHA1 Message Date
Ralf Jung 6c4bda6de4
Rollup merge of #100730 - CleanCut:diagnostics-rustc_monomorphize, r=davidtwco
Migrate rustc_monomorphize to use SessionDiagnostic

### Description

- Migrates diagnostics in `rustc_monomorphize` to use `SessionDiagnostic`
- Adds an `impl IntoDiagnosticArg for PathBuf`

### TODO / Help!
- [x] I'm having trouble figuring out how to apply an optional note. 😕  Help!?
  - Resolved. It was bad docs. Fixed in https://github.com/rust-lang/rustc-dev-guide/pull/1437/files
- [x] `errors:RecursionLimit` should be `#[fatal ...]`, but that doesn't exist so it's `#[error ...]` at the moment.
  - Maybe I can switch after this is merged in? --> https://github.com/rust-lang/rust/pull/100694
  - Or maybe I need to manually implement `SessionDiagnostic` instead of deriving it?
- [x] How does one go about converting an error inside of [a call to struct_span_lint_hir](8064a49508/compiler/rustc_monomorphize/src/collector.rs (L917-L927))?
- [x] ~What placeholder do you use in the fluent template to refer to the value in a vector? It seems like [this code](0b79f758c9/compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs (L83-L114)) ought to have the answer (or something near it)...but I can't figure it out.~ You can't. Punted.
2022-08-31 14:29:51 +02:00
Jhonny Bill Mena 86f8c4e8e3 ADD - InvalidSymbolName to migrate symbol-name({}) error to new diagnostics infraestructure
ADD - dependencies needed to port a module to new Diagnostics infra (rustc_macros, rustc_errors, errors file, and fluent file)
2022-08-30 14:27:42 -04:00
bors fce6a7d66e Auto merge of #101195 - Dylan-DPC:rollup-rhjaz6r, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #99517 (Display raw pointer as *{mut,const} T instead of *-ptr in errors)
 - #99928 (Do not leak type variables from opaque type relation)
 - #100473 (Attempt to normalize `FnDef` signature in `InferCtxt::cmp`)
 - #100653 (Move the cast_float_to_int fallback code to GCC)
 - #100941 (Point at the string inside literal and mention if we need string inte…)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-30 14:52:02 +00:00
Dylan DPC c57a932c3f
Rollup merge of #100653 - cuviper:fptoint_sat, r=michaelwoerister,antoyo
Move the cast_float_to_int fallback code to GCC

Now that we require at least LLVM 13, that codegen backend is always
using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it
doesn't need the manual implementation. However, the GCC backend still
needs it, so we can move all of that code down there.
2022-08-30 16:56:09 +05:30
bors 230a8ee364 Auto merge of #98100 - bjorn3:use_object_for_bitcode_reading, r=wesleywiser
Use object instead of LLVM for reading bitcode from rlibs

Together with changes I plan to make as part of https://github.com/rust-lang/rust/pull/97485 this will allow entirely removing usage of LLVM's archive reader and thus allow removing `archive_ro.rs` and `ArchiveWrapper.cpp`.
2022-08-30 11:13:58 +00:00
bors fcc2bddd26 Auto merge of #101147 - weihanglo:update-cargo, r=Mark-Simulacrum
Update cargo

5 commits in 6da726708a4406f31f996d813790818dce837161..4ed54cecce3ce9ab6ff058781f4c8a500ee6b8b5
2022-08-23 21:39:56 +0000 to 2022-08-27 18:41:39 +0000
- doc: pause, for readability (rust-lang/cargo#11027)
- Bump git2 to 0.15 and libgit2-sys to 0.14 (rust-lang/cargo#11004)
- Fix typo (rust-lang/cargo#11025)
- Update cargo-toml-vs-cargo-lock.md (rust-lang/cargo#11021)
- Apply GitHub fast path even for partial hashes (rust-lang/cargo#10807)
2022-08-29 16:04:11 +00:00
bors b96fa1a25c Auto merge of #98626 - oli-obk:tracing, r=lcnr
bump tracing version

Bump tracing dependency to 0.1.35 to give us features like printing the return value of functions
2022-08-29 11:13:42 +00:00
Weihang Lo ae1764c507
Update cargo
5 commits in 6da726708a4406f31f996d813790818dce837161..4ed54cecce3ce9ab6ff058781f4c8a500ee6b8b5
2022-08-23 21:39:56 +0000 to 2022-08-27 18:41:39 +0000
- doc: pause, for readability (rust-lang/cargo#11027)
- Bump git2 to 0.15 and libgit2-sys to 0.14 (rust-lang/cargo#11004)
- Fix typo (rust-lang/cargo#11025)
- Update cargo-toml-vs-cargo-lock.md (rust-lang/cargo#11021)
- Apply GitHub fast path even for partial hashes (rust-lang/cargo#10807)
2022-08-29 07:16:00 +01:00
Nicholas Nethercote b38106b6d8 Replace rustc_data_structures::thin_vec::ThinVec with thin_vec::ThinVec.
`rustc_data_structures::thin_vec::ThinVec` looks like this:
```
pub struct ThinVec<T>(Option<Box<Vec<T>>>);
```
It's just a zero word if the vector is empty, but requires two
allocations if it is non-empty. So it's only usable in cases where the
vector is empty most of the time.

This commit removes it in favour of `thin_vec::ThinVec`, which is also
word-sized, but stores the length and capacity in the same allocation as
the elements. It's good in a wider variety of situation, e.g. in enum
variants where the vector is usually/always non-empty.

The commit also:
- Sorts some `Cargo.toml` dependency lists, to make additions easier.
- Sorts some `use` item lists, to make additions easier.
- Changes `clean_trait_ref_with_bindings` to take a
  `ThinVec<TypeBinding>` rather than a `&[TypeBinding]`, because this
  avoid some unnecessary allocations.
2022-08-29 15:42:13 +10:00
Matthias Krüger a3c965f5fe
Rollup merge of #100843 - IntQuant:issue-100717-infer, r=compiler-errors
Migrate part of rustc_infer to session diagnostic
2022-08-29 06:34:45 +02:00
Eric Huss 4a7e2fbb7b Sunset RLS 2022-08-27 21:36:08 -07:00
est31 d32ff14b86 Add replace-version-placeholder tool
This tool is to be ran at specific points in the release process to replace
the version place holder made by stabilizations with the version number.
2022-08-27 17:39:11 +02:00
Michael Goulet e7d870b188
Rollup merge of #100890 - adriantombu:migrate_diagnostic_rustc_driver, r=davidtwco
Migrate rustc_driver to SessionDiagnostic

First timer noob here 👋🏽 I'm having a problem understanding how I can retrieve the span, and how to properly construct the error structs to avoid the current compilation errors.

Any help pointing me in the right direction would be much appreciated 🙌🏽
2022-08-26 15:56:29 -07:00
Michael Goulet 93b2acd88a
Rollup merge of #100744 - 5225225:migrate-rustc-mir-dataflow, r=davidtwco
Migrate rustc_mir_dataflow to diagnostic structs
2022-08-26 15:56:24 -07:00
Michael Goulet 181b0410ec
Rollup merge of #100735 - Facel3ss1:ty-utils-translation, r=davidtwco
Migrate `rustc_ty_utils` to `SessionDiagnostic`

I have migrated the `rustc_ty_utils` crate to use `SessionDiagnostic`, motivated by the [recent blog post about the diagnostic translation effort](https://blog.rust-lang.org/inside-rust/2022/08/16/diagnostic-effort.html).

This is my first PR to the Rust repository, so if I have missed anything, or anything needs to be changed, please let me know! 😄

`@rustbot` label +A-translation
2022-08-26 15:56:22 -07:00
Michael Goulet bc1d205e4c
Rollup merge of #100724 - JeanCASPAR:migrate-ast_lowering-to-session-diagnostic, r=davidtwco
Migrate ast lowering to session diagnostic

I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see https://github.com/rust-lang/rust/pull/100694).
2022-08-26 15:56:21 -07:00
Nathan Stocks 845d56759c revert src/tools/cargo submodule to where it ought to be from where we rebased 2022-08-26 15:17:20 -06:00
Peter Medus 01c1616b25 Migrate rustc_ty_utils to use SessionDiagnostic 2022-08-26 14:36:51 +01:00
Guillaume Gomez fb33dd8b6d Remove unused build dependency 2022-08-26 11:29:23 +02:00
Nathan Stocks 137f20c112 rebased: convert rustc_monomorphize errors to SessionDiagnostic 2022-08-25 11:06:32 -06:00
Adrian Tombu dbe39d835e
Start moving rustc_driver to SessionDiagnostic 2022-08-25 18:06:11 +02:00
Yuki Okushi 2e4760c7e7
Rollup merge of #100780 - wonchulee:translation_save_analysis, r=davidtwco
save_analysis: Migrate diagnostic

* Migrate the `rustc_save_analysis` crate's diagnostic to translatable diagnostic structs.

Depends on https://github.com/rust-lang/rust/pull/100694 and https://github.com/rust-lang/rust/pull/100754 for #[fatal(..)] support, then aa68eb4179, f5219a3960, 7da52f694a can be removed. (I copied commits from https://github.com/rust-lang/rust/pull/100754)
2022-08-25 08:50:57 +09:00
Eric Huss 6e4603e09f Update cargo 2022-08-23 20:58:12 -07:00
Wonchul Lee 9b95eef6ea
save_analysis: Migrate diagnostics 2022-08-24 06:50:16 +09:00
Dylan DPC 35f2d125ca
Rollup merge of #100768 - Facel3ss1:plugin-impl-translation, r=davidtwco
Migrate `rustc_plugin_impl` to `SessionDiagnostic`

Migration of the `rustc_plugin_impl` crate.
~Draft PR because it is blocked on #100694 for `#[fatal(...)]` support~ (this has been merged, and I've changed over to `#[diag(...)]` now too), but I would also like to know if what I did with `LoadPluginError` is okay, because all it does is display the error message from `libloading` ([See conversation on zulip](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.23100717.20diagnostic.20translation/near/294327843)). This crate is apparently for a deprecated feature which is used by servo, so I don't know how much this matters anyway.
2022-08-23 20:40:04 +05:30
Nikita Tomashevich 313d474b35
Migrate OpaqueHiddenType, E0282, E0283, E0284, E0698 2022-08-23 14:47:07 +03:00
5225225 ee2b16100e Migrate rustc_mir_dataflow to diagnostic structs 2022-08-23 11:24:51 +01:00
Matthias Krüger 8332f6559b
Rollup merge of #100862 - ehuss:tidy-crossbeam, r=Mark-Simulacrum
tidy: remove crossbeam-utils

crossbeam-utils is no longer needed now that scoped threads are available in 1.63.
2022-08-23 06:55:29 +02:00
Jack Wrenn f46fffc276 safe transmute: use Assume struct to provide analysis options
This was left as a TODO in #92268, and brings the trait more in
line with what was defined in MCP411.

`Assume::visibility` has been renamed to `Assume::safety`, as
library safety is what's actually being assumed; visibility is
just the mechanism by which it is currently checked (this may
change).

ref: https://github.com/rust-lang/compiler-team/issues/411
ref: https://github.com/rust-lang/rust/issues/99571
2022-08-22 18:37:54 +00:00
Jean CASPAR 73ae38bac1 Migrate ast_lowering::path to SessionDiagnostic 2022-08-22 19:19:58 +02:00
Peter Medus 8c2413c4c6 Migrate rustc_plugin_impl to SessionDiagnostic 2022-08-22 16:35:05 +01:00
Eric Huss add04f93de tidy: remove crossbeam-utils 2022-08-21 17:31:22 -07:00
finalchild d6fdf14eb7 Migrate forbidden_let 2022-08-22 00:57:21 +09:00
bors aa8e761def Auto merge of #100624 - GuillaumeGomez:update-minifier-version, r=nnethercote
Update minifier version to 0.2.2

Following [this PR](https://github.com/GuillaumeGomez/minifier-rs/pull/98), the CSS minification should be much faster now (thanks to `@nnethercote).`

r? `@nnethercote`
2022-08-21 04:21:06 +00:00
Matthias Krüger c4fa35bb41
Rollup merge of #100642 - mzohreva:mz/update-sgx-abi-cancel-queue, r=Mark-Simulacrum
Update fortanix-sgx-abi and export some useful SGX usercall traits

Update `fortanix-sgx-abi` to 0.5.0 to add support for cancel queue (see https://github.com/fortanix/rust-sgx/pull/405 and https://github.com/fortanix/rust-sgx/pull/404).

Export some useful traits for processing SGX usercall. This is needed for https://github.com/fortanix/rust-sgx/pull/404 to avoid duplication.

cc `@raoulstrackx` and `@jethrogb`
2022-08-20 19:32:10 +02:00
Matthias Krüger 36d8d5565d
Rollup merge of #100656 - ehuss:update-cargo, r=ehuss
Update cargo

3 commits in efd4ca3dc0b89929dc8c5f5c023d25978d76cb61..9809f8ff33c2b998919fd0432c626f0f7323697a
2022-08-12 01:28:28 +0000 to 2022-08-16 22:10:06 +0000
- Improve error message for an array value in the manifest (rust-lang/cargo#10944)
- Fix file locking being not supported on Android raising an error (rust-lang/cargo#10975)
- Bump to 0.66.0, update changelog (rust-lang/cargo#10983)
2022-08-17 12:33:00 +02:00
Matthias Krüger c0297e2330
Rollup merge of #100646 - finalchild:emoji-diag, r=compiler-errors
Migrate emoji identifier diagnostics to `SessionDiagnostic` in rustc_interface

* Migrate emoji identifier diagnostics to `interface_ferris_identifier` and `interface_emoji_identifier`.

This is my first PR! I'm learning how to migrate these diagnostics. Thanks in advance.

r? rust-lang/diagnostics
2022-08-17 12:32:56 +02:00
Eric Huss f4674b4961 Update cargo 2022-08-16 19:02:19 -07:00
Josh Stone 147032a618 Move the cast_float_to_int fallback code to GCC
Now that we require at least LLVM 13, that codegen backend is always
using its intrinsic `fptosi.sat` and `fptoui.sat` conversions, so it
doesn't need the manual implementation. However, the GCC backend still
needs it, so we can move all of that code down there.
2022-08-16 15:46:17 -07:00
finalchild c1a98416e3 Migrate emoji identifier diagnostics to SessionDiagnostic 2022-08-17 05:07:47 +09:00
Mohsen Zohrevandi 70dd980c8d Update fortanix-sgx-abi and export some useful SGX usercall traits
Update fortanix-sgx-abi to 0.5.0 to add support for cancel queue (see
https://github.com/fortanix/rust-sgx/pull/405 and
https://github.com/fortanix/rust-sgx/pull/404).

Export some useful traits for processing SGX usercall. This is needed
for https://github.com/fortanix/rust-sgx/pull/404 to avoid duplication.
2022-08-16 11:01:53 -07:00
Guillaume Gomez fb62f2804f Update minifier version to 0.2.2 2022-08-16 13:50:18 +02:00
Michael Goulet 5309375d2c Do not report cycle error when inferring return type for suggestion 2022-08-16 03:00:32 +00:00
Matthias Krüger e65de39763
Rollup merge of #100586 - the8472:available_parallelism_2, r=jyn514
Reland changes replacing num_cpus with available_parallelism

Since #97925 added cgroupv1 support the problem in #97549 which lead to the previous revert should be addressed now.

Cargo has reapplied the replacement too https://github.com/rust-lang/cargo/pull/10969

Reverts 1ae4b25826 (part of #97911)
Relands #94524
2022-08-15 20:11:41 +02:00
The 8472 84531229bb Revert "Revert "Remove num_cpus dependency from bootstrap, build-manifest and rustc_session""
This reverts commit 1ae4b25826.
2022-08-15 16:24:07 +02:00
Ivan Markov 84a0da6848 Fix STD build for ESP-IDF 2022-08-15 07:45:58 +00:00
bors 75b7e52e92 Auto merge of #100380 - nicholasbishop:bishop-update-cb2, r=Mark-Simulacrum
Update compiler_builtins to 0.1.79

This pulls in a memcmp fix and some UEFI float-to-int fixes:
https://github.com/rust-lang/compiler-builtins/compare/0.1.78...0.1.79
2022-08-13 05:10:01 +00:00
bors cc65e1a548 Auto merge of #100435 - ehuss:update-cargo, r=ehuss
Update cargo

8 commits in ce40690a5e4e315d3dab0aae1eae69d0252c52ac..efd4ca3dc0b89929dc8c5f5c023d25978d76cb61
2022-08-09 22:32:17 +0000 to 2022-08-12 01:28:28 +0000
- Use `std:🧵:scope` to replace crossbeam (rust-lang/cargo#10977)
- [docs] Remove extra "in" from `cargo-test.md` (rust-lang/cargo#10978)
- Enable two windows tests (rust-lang/cargo#10930)
- Improve error msg for get target runner (rust-lang/cargo#10968)
- Ensure rustc-echo-wrapper works with an overridden build.target-dir (rust-lang/cargo#10962)
- Switch back to `available_parallelism` (rust-lang/cargo#10969)
- Only override published resolver when the workspace is different (rust-lang/cargo#10961)
- Add `CARGO_LOG` to "Environment variables Cargo reads" (rust-lang/cargo#10967)
2022-08-12 06:45:35 +00:00
Eric Huss bffa751b2f Update cargo 2022-08-11 20:03:43 -07:00
bors b998821e4c Auto merge of #100419 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`
2022-08-12 00:12:51 +00:00
Matthias Krüger 6737549aaf
Rollup merge of #99421 - Bryanskiy:android-crt-static, r=petrochenkov
add crt-static for android
2022-08-11 22:52:58 +02:00
Philipp Krones ea90d4bce5
Update Cargo.lock 2022-08-11 19:42:37 +02:00
Ralf Jung 3ba055fdc5 update Miri 2022-08-10 14:17:48 -04:00
Bryanskiy 874ee5bede add crt-static for android 2022-08-10 19:42:24 +03:00
Nicholas Bishop d1926ebf53 Update compiler_builtins to 0.1.79 2022-08-10 12:13:33 -04:00
bors c7ff1e8b00 Auto merge of #100260 - ehuss:compiletest-target-cfg, r=Mark-Simulacrum
compiletest: use target cfg instead of hard-coded tables

This changes compiletest to use `rustc --print=cfg` to dynamically determine the properties of a target when matching `ignore` and `only` rules instead of using hard-coded tables or target-triple parsing (which don't always follow the `<arch><sub>-<vendor>-<sys>-<abi>` pattern). The benefit here is that it will more accurately match the target properties, and not require maintaining these extra tables.

This also adds matching the `target_family` in ignore rules. The primary benefit here is so that `ignore-wasm` works as expected (matching all wasm-like targets). There were already several tests that had `ignore-wasm` in them (which previously had no effect), so it is evident that some people expected that to work. This also adds `ignore-unix/only-unix`.

There is some risk that this changes the behavior from before since the tables aren't quite the same as the target properties. However, I did fairly extensive comparisons to see what would be different. https://gist.github.com/ehuss/5bf7ab347605160cefb6f84ba5ea5f6b contains a full list of differences for all targets for all tests. I do not think any of the affected target/test combinations are things that are actually tested in CI. I tested several of the more unusual test images (test-various, dist-various-1, wasm32), and they seem fine.

A summary of most of the reasons behind the differences:

- wasm64-unknown-unknown wasm32-wasi now match "wasm"
- Targets now match "gnu" because they have target_env=gnu
    - aarch64-wrs-vxworks
    - armv7-wrs-vxworks-eabihf
    - i686-wrs-vxworks
    - powerpc-wrs-vxworks
    - powerpc64-wrs-vxworks
    - x86_64-wrs-vxworks
- wasm64-unknown-unknown now matches wasm64
- x86_64-unknown-none-linuxkernel no longer matches "linux", but will match "gnu" and "none"
- Various arm targets now match "aarch64" or "arm":
    - arm64_32-apple-watchos
    - armebv7r-none-eabi
    - armv6-unknown-freebsd
    - armv6-unknown-netbsd-eabihf
    - armv6k-nintendo-3ds
    - armv7-wrs-vxworks-eabihf
    - armv7a-kmc-solid_asp3-eabi
    - armv7a-kmc-solid_asp3-eabihf
    - armv7a-none-eabi
    - armv7a-none-eabihf
    - armv7k-apple-watchos
    - armv7r-none-eabi
    - armv7r-none-eabihf
- Now matches "thumb" and "arm"
    - thumbv4t-none-eabi
    - thumbv6m-none-eabi
    - thumbv7a-pc-windows-msvc
    - thumbv7a-uwp-windows-msvc
    - thumbv7em-none-eabi
    - thumbv7em-none-eabihf
    - thumbv7m-none-eabi
    - thumbv7neon-linux-androideabi
    - thumbv7neon-unknown-linux-gnueabihf
    - thumbv7neon-unknown-linux-musleabihf
    - thumbv8m.base-none-eabi
    - thumbv8m.main-none-eabi
- asmjs-unknown-emscripten now matches "wasm32" because that it is its defined arch
- avr-unknown-gnu-atmega328 now matches "none" (because target_os="none")
- now matches 64bit:
    - bpfeb-unknown-none
    - bpfel-unknown-none
    - sparcv9-sun-solaris
- now matches endian-big:
    - m68k-unknown-linux-gnu
- now matches 16bit:
    - msp430-none-elf
- now matches 32bit:
    - arm64_32-apple-watchos
- now matches riscv32 (and needs-asm-support):
    - riscv32gc-unknown-linux-gnu
    - riscv32gc-unknown-linux-musl
    - riscv32i-unknown-none-elf
    - riscv32im-unknown-none-elf
    - riscv32imac-unknown-none-elf
    - riscv32imac-unknown-xous-elf
    - riscv32imc-esp-espidf
    - riscv32imc-unknown-none-elf
    - riscv64imac-unknown-none-elf
2022-08-10 15:22:26 +00:00
Eric Huss 0a31aa29e4 Update cargo 2022-08-10 04:07:57 -07:00
Dylan DPC 1dc4858914
Rollup merge of #96478 - WaffleLapkin:rustc_default_body_unstable, r=Aaron1011
Implement `#[rustc_default_body_unstable]`

This PR implements a new stability attribute — `#[rustc_default_body_unstable]`.

`#[rustc_default_body_unstable]` controls the stability of default bodies in traits.
For example:
```rust
pub trait Trait {
    #[rustc_default_body_unstable(feature = "feat", isssue = "none")]
    fn item() {}
}
```
In order to implement `Trait` user needs to either
- implement `item` (even though it has a default implementation)
- enable `#![feature(feat)]`

This is useful in conjunction with [`#[rustc_must_implement_one_of]`](https://github.com/rust-lang/rust/pull/92164), we may want to relax requirements for a trait, for example allowing implementing either of `PartialEq::{eq, ne}`, but do so in a safe way — making implementation of only `PartialEq::ne` unstable.

r? `@Aaron1011`
cc `@nrc` (iirc you were interested in this wrt `read_buf`), `@danielhenrymantilla` (you were interested in the related `#[rustc_must_implement_one_of]`)
P.S. This is my first time working with stability attributes, so I'm not sure if I did everything right 😅
2022-08-09 17:34:50 +05:30
Eric Huss fab8996400 compiletest: use precise cfg matching instead of hard-coded tables 2022-08-07 23:22:28 -07:00
bors d394408fb3 Auto merge of #100218 - nicholasbishop:bishop-update-cb, r=Mark-Simulacrum
Update compiler_builtins to 0.1.78

Among other things, this pulls in https://github.com/rust-lang/compiler-builtins/pull/475, which fixes some i128/u128 arithmetic operations on the `x86_64-unknown-uefi` target.
2022-08-07 18:44:41 +00:00
Nicholas Bishop 3c432032f0 Update compiler_builtins to 0.1.78 2022-08-06 20:49:48 -04:00
bors cc71eef498 Auto merge of #100213 - matthiaskrgr:rollup-mqe7t1n, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #100071 (deps: dedupe `annotate-snippets` crate versions)
 - #100127 (Remove Windows function preloading)
 - #100130 (Avoid pointing out `return` span if it has nothing to do with type error)
 - #100169 (Optimize `pointer::as_aligned_to`)
 - #100175 (ascii -> ASCII in code comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-06 23:38:28 +00:00
Matthias Krüger aaa054e53c
Rollup merge of #100071 - klensy:annotate-snippets-bump, r=Mark-Simulacrum
deps: dedupe `annotate-snippets` crate versions

Dedupes `annotate-snippets` crate versions (https://github.com/rust-lang/annotate-snippets-rs/blob/0.9.1/CHANGELOG.md). Should work, but there is not a lot of tests.

Looks like switching to that crate a bit stalled.
2022-08-07 01:19:32 +02:00
bors 2befdefdda Auto merge of #100117 - nicholasbishop:bishop-update-cc, r=Mark-Simulacrum
Bump cc version in bootstrap

Among other changes, the newer cc release pulls in this fix:
b2792e33ff

This fixes errors when building compiler_builtins for UEFI targets.
2022-08-06 21:10:52 +00:00
bors 1b57946a40 Auto merge of #100088 - RalfJung:anyhow, r=Mark-Simulacrum
update anyhow

Fixes https://github.com/rust-lang/rust/issues/100062 by incorporating https://github.com/dtolnay/anyhow/pull/249
2022-08-03 19:34:24 +00:00
Nicholas Bishop 34537b46be Bump cc version in bootstrap
Among other changes, the newer cc release pulls in this fix:
b2792e33ff

This fixes errors when building compiler_builtins for UEFI targets.
2022-08-03 13:32:27 -04:00
bors e141246cbb Auto merge of #100082 - matthiaskrgr:rollup-ywu4iux, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #99933 (parallelize HTML checking tool)
 - #99958 (Improve position named arguments lint underline and formatting names)
 - #100008 (Update all pre-cloned submodules on startup)
 - #100049 (⬆️ rust-analyzer)
 - #100070 (Clarify Cargo.toml comments)
 - #100074 (rustc-docs: Be less specific about the representation of `+bundle`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-03 04:50:42 +00:00
Ralf Jung 2bde0e7bbc update anyhow 2022-08-02 22:14:48 -04:00
bors e4417cf020 Auto merge of #92268 - jswrenn:transmute, r=oli-obk
Initial implementation of transmutability trait.

*T'was the night before Christmas and all through the codebase, not a miri was stirring — no hint of `unsafe`!*

This PR provides an initial, **incomplete** implementation of *[MCP 411: Lang Item for Transmutability](https://github.com/rust-lang/compiler-team/issues/411)*. The `core::mem::BikeshedIntrinsicFrom` trait provided by this PR is implemented on-the-fly by the compiler for types `Src` and `Dst` when the bits of all possible values of type `Src` are safely reinterpretable as a value of type `Dst`.

What this PR provides is:
- [x] [support for transmutations involving primitives](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/primitives)
- [x] [support for transmutations involving arrays](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/arrays)
- [x] [support for transmutations involving structs](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/structs)
- [x] [support for transmutations involving enums](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/enums)
- [x] [support for transmutations involving unions](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/unions)
- [x] [support for weaker validity checks](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs) (i.e., `Assume::VALIDITY`)
- [x] visibility checking

What isn't yet implemented:
- [ ] transmutability options passed using the `Assume` struct
- [ ] [support for references](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/references.rs)
- [ ] smarter error messages

These features will be implemented in future PRs.
2022-08-02 21:17:31 +00:00
Matthias Krüger 63cd10154d
Rollup merge of #99933 - alex:parallel-html-checking, r=Mark-Simulacrum
parallelize HTML checking tool

there's a lot of IO, so timings on my laptop are far from stable, but it seems to be considerably faster.

this step often appears to take 5+ minutes in CI, so hopefully this offers a speedup
2022-08-02 23:07:44 +02:00
klensy 754b52669f dedupe 'annotate-snippets' crate versions 2022-08-02 21:07:01 +03:00
bors 760d8a2cb1 Auto merge of #99768 - klensy:bump-deps-07-22, r=Mark-Simulacrum
update few deps

Updates few crates:

* openssl-src v111.18.0+1.1.1n -> v111.22.0+1.1.1q: fixes few CVE's (https://www.openssl.org/news/vulnerabilities-1.1.1.html: https://cve.org/CVERecord?id=CVE-2022-1292 https://cve.org/CVERecord?id=CVE-2022-2068 https://cve.org/CVERecord?id=CVE-2022-2097)

* openssl-probe v0.1.2 -> v0.1.5 updates ancient (2017) crate (https://github.com/alexcrichton/openssl-probe/compare/0.1.2...0.1.5). Adds support to search cert for additional platforms.

* indoc v1.0.3 -> v1.0.6 (https://github.com/dtolnay/indoc/compare/1.0.3...1.0.6) Nothing special changed, removes unindent v0.1.7

* bstr v0.2.13 -> v0.2.17 (https://github.com/BurntSushi/bstr/compare/0.2.13...0.2.17) Few speedups (8e65992131, 5fcef919ad) and bugfix (b2111b6bbf)

* crc32fast v1.2.0 -> v1.3.2 (https://github.com/srijs/rust-crc32fast/compare/v1.2.0...v1.3.2) Speedup debug (e61ce6a39b)

* diff v0.1.12 -> v0.1.13 (https://github.com/utkarshkukreti/diff.rs/compare/0.1.12...0.1.13) Few optimizations (https://github.com/utkarshkukreti/diff.rs/pull/16, 0f0aa580f1)

* ignore v0.4.17 -> v0.4.18 (it's hard to get usable diff, but most notable perf change is a28e664abd)

* globset v0.4.5 -> v0.4.9

* regex v1.5.5 -> v1.5.6 few bugfixes (https://github.com/rust-lang/regex/blob/1.5.6/CHANGELOG.md#156-2022-05-20). There exist 1.6.0 version, but it's too fresh.
2022-07-30 06:54:38 +00:00
Alex Gaynor 5b0ec1ebe4
parallelize HTML checking tool 2022-07-29 23:26:38 -04:00
Nika Layzell 6d1650fe45 proc_macro: use crossbeam channels for the proc_macro cross-thread bridge
This is done by having the crossbeam dependency inserted into the
proc_macro server code from the server side, to avoid adding a
dependency to proc_macro.

In addition, this introduces a -Z command-line option which will switch
rustc to run proc-macros using this cross-thread executor. With the
changes to the bridge in #98186, #98187, #98188 and #98189, the
performance of the executor should be much closer to same-thread
execution.

In local testing, the crossbeam executor was substantially more
performant than either of the two existing CrossThread strategies, so
they have been removed to keep things simple.
2022-07-29 17:38:12 -04:00
Oli Scherer a4375cb292 Bump tracing to 0.1.35 2022-07-29 15:41:15 +00:00
Oli Scherer 6a0511d3d5 tracing 0.1.32 2022-07-29 15:41:15 +00:00
Oli Scherer 9f44a63570 tracing 0.1.33 2022-07-29 15:41:15 +00:00
Oli Scherer e896228ef3 Update tracing to 0.1.31 2022-07-29 15:41:15 +00:00
Philipp Krones d673219ea3
Update Cargo.lock 2022-07-28 19:08:41 +02:00
klensy 2787d4280f fix memchr features in workspace-hack 2022-07-28 17:24:46 +03:00
klensy 43512e6745 update few deps
openssl-src v111.18.0+1.1.1n -> v111.22.0+1.1.1q
openssl-probe v0.1.2 -> v0.1.5
indoc v1.0.3 -> v1.0.6
bstr v0.2.13 -> v0.2.17
crc32fast v1.2.0 -> v1.3.2
diff v0.1.12 -> v0.1.13
ignore v0.4.17 -> v0.4.18
globset v0.4.5 -> v0.4.9
regex v1.5.5 -> v1.5.6
2022-07-28 13:22:34 +03:00
Jack Wrenn bc4a1dea41 Initial (incomplete) implementation of transmutability trait.
This initial implementation handles transmutations between types with specified layouts, except when references are involved.

Co-authored-by: Igor null <m1el.2027@gmail.com>
2022-07-27 17:33:56 +00:00
Guillaume Gomez 7f78a9acc5 Update pulldown-cmark version 2022-07-26 20:36:20 +02:00
Maybe Waffle 1e1d6fe84d Improve error message for unstable default body 2022-07-26 15:40:04 +04:00
bjorn3 395d564f25 Use object instead of LLVM for reading bitcode from rlibs 2022-07-25 16:07:23 +00:00
bors 4dbc89de3f Auto merge of #99251 - cuviper:hashbrown-0.12, r=Mark-Simulacrum
Upgrade indexmap and thorin-dwp to use hashbrown 0.12

This removes the last dependencies on hashbrown 0.11.

This also upgrades to hashbrown 0.12.3 to fix a double-free (#99372).
2022-07-24 04:03:29 +00:00
bors db8086eb60 Auto merge of #95548 - rcvalle:rust-cfi-2, r=nagisa
Add fine-grained LLVM CFI support to the Rust compiler

This PR improves the LLVM Control Flow Integrity (CFI) support in the Rust compiler by providing forward-edge control flow protection for Rust-compiled code only by aggregating function pointers in groups identified by their return and parameter types.

Forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space) will be provided in later work as part of this project by identifying C char and integer type uses at the time types are encoded (see Type metadata in the design document in the tracking issue https://github.com/rust-lang/rust/issues/89653).

LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e., -Clto).

Thank you again, `@eddyb,` `@nagisa,` `@pcc,` and `@tmiasko` for all the help!
2022-07-24 01:22:36 +00:00
Ramon de C Valle 5ad7a646a5 Add fine-grained LLVM CFI support to the Rust compiler
This commit improves the LLVM Control Flow Integrity (CFI) support in
the Rust compiler by providing forward-edge control flow protection for
Rust-compiled code only by aggregating function pointers in groups
identified by their return and parameter types.

Forward-edge control flow protection for C or C++ and Rust -compiled
code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code
share the same virtual address space) will be provided in later work as
part of this project by identifying C char and integer type uses at the
time types are encoded (see Type metadata in the design document in the
tracking issue #89653).

LLVM CFI can be enabled with -Zsanitizer=cfi and requires LTO (i.e.,
-Clto).
2022-07-23 10:51:34 -07:00
bors 0e7c843da4 Auto merge of #98471 - wesleywiser:update_measureme, r=Mark-Simulacrum
Update measureme to the latest version
2022-07-23 16:14:40 +00:00
Eric Huss 31dd1f6859 Update mdbook 2022-07-22 11:59:20 -07:00
Ralf Jung c2df1c21f8 update Miri 2022-07-21 16:04:37 -04:00
Eric Huss 821e9d56ae Update mdbook 2022-07-18 14:41:10 -07:00
bors 263edd43c5 Auto merge of #99033 - 5225225:interpreter-validity-checks, r=oli-obk
Use constant eval to do strict mem::uninit/zeroed validity checks

I'm not sure about the code organisation here, I just dumped the check in rustc_const_eval at the root. Not hard to move it elsewhere, in any case.

Also, this means cranelift codegen intrinsics lose the strict checks, since they don't seem to depend on rustc_const_eval, and I didn't see a point in keeping around two copies.

I also left comments in the is_zero_valid methods about "uhhh help how do i do this", those apply to both methods equally.

Also rustc_codegen_ssa now depends on rustc_const_eval... is this okay?

Pinging `@RalfJung` since you were the one who mentioned this to me, so I'm assuming you're interested.

Haven't had a chance to run full tests on this since it's really warm, and it's 1AM, I'll check out any failures/comments in the morning :)
2022-07-17 19:28:01 +00:00
Amanieu d'Antras 931a8f81fe Upgrade hashbrown to 0.12.3
This fixes a double-free in the `clone_from` function if dropping an
existing element in the table panics. See
https://github.com/rust-lang/hashbrown/pull/348 for more details.
2022-07-17 07:05:58 -07:00
Josh Stone daa7c14a44 Upgrade indexmap and thorin-dwp to use hashbrown 0.12
This removes the last dependencies on hashbrown 0.11.
2022-07-17 07:05:58 -07:00
bors c2ecd3af87 Auto merge of #99283 - RalfJung:miri, r=RalfJung
update Miri

Fixes https://github.com/rust-lang/rust/issues/99224
r? `@ghost`
2022-07-17 13:08:06 +00:00
Ralf Jung 10430dbf8e update Miri 2022-07-17 08:47:42 -04:00
David Wood 78b19a90b7 passes: migrate half of check_attr
Migrate half of the `rustc_passes::check_attr` diagnostics to using
diagnostic derives and being translatable.
2022-07-15 16:13:49 +01:00
5225225 27412d1e3e Use constant eval to do strict validity checks 2022-07-14 22:55:17 +01:00
bors 1ba1fec234 Auto merge of #96544 - m-ysk:feature/issue-96358, r=cjgillot
Stop keeping metadata in memory before writing it to disk

Fixes #96358

I created this PR according with the instruction given in the issue except for the following points:

- While the issue says "Write metadata into the temporary file in `encode_and_write_metadata` even if `!need_metadata_file`", I could not do that. That is because though I tried to do that and run `x.py test`, I got a lot of test failures as follows.

<details>
<summary>List of failed tests</summary>
<pre>
<code>
failures:
    [ui] src/test/ui/json-multiple.rs
    [ui] src/test/ui/json-options.rs
    [ui] src/test/ui/rmeta/rmeta-rpass.rs
    [ui] src/test/ui/save-analysis/emit-notifications.rs
    [ui] src/test/ui/svh/changing-crates.rs
    [ui] src/test/ui/svh/svh-change-lit.rs
    [ui] src/test/ui/svh/svh-change-significant-cfg.rs
    [ui] src/test/ui/svh/svh-change-trait-bound.rs
    [ui] src/test/ui/svh/svh-change-type-arg.rs
    [ui] src/test/ui/svh/svh-change-type-ret.rs
    [ui] src/test/ui/svh/svh-change-type-static.rs
    [ui] src/test/ui/svh/svh-use-trait.rs

test result: FAILED. 12915 passed; 12 failed; 100 ignored; 0 measured; 0 filtered out; finished in 71.41s

Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
Build completed unsuccessfully in 0:01:58
</code>
</pre>
</details>

- I could not resolve the extra tasks about `create_rmeta_file` and `create_compressed_metadata_file` for my lack of ability.
2022-07-14 21:50:14 +00:00