| Age | Commit message (Collapse) | Author | Lines |
|
Extend `CodegenBackend` trait with a function returning the translation
resources from the codegen backend, which can be added to the complete
list of resources provided to the emitter.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
Instead of loading the Fluent resources for every crate in
`rustc_error_messages`, each crate generates typed identifiers for its
own diagnostics and creates a static which are pulled together in the
`rustc_driver` crate and provided to the diagnostic emitter.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
|
|
|
|
|
|
Add `kernel-address` sanitizer support for freestanding targets
This PR adds support for KASan (kernel address sanitizer) instrumentation in freestanding targets. I included the minimal set of `x86_64-unknown-none`, `riscv64{imac, gc}-unknown-none-elf`, and `aarch64-unknown-none` but there's likely other targets it can be added to. (`linux_kernel_base.rs`?) KASan uses the address sanitizer attributes but has the `CompileKernel` parameter set to `true` in the pass creation.
|
|
r=oli-obk,compiler-errors
Clarify iterator interners
I found the iterator interners very confusing. This PR clarifies things.
r? `@compiler-errors`
|
|
fix a line, and do a consistency fix
|
|
This makes a lot of call sites nicer.
|
|
in metadata
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- #107573 (Update the minimum external LLVM to 14)
- #107626 (Fix `x fix` on the standard library itself)
- #107673 (update ICU4X to 1.1.0)
- #107733 (Store metrics from `metrics.json` to CI PGO timer)
- #108007 (Use `is_str` instead of string kind comparison)
- #108033 (add an unstable `#[rustc_coinductive]` attribute)
- #108039 (Refactor refcounted structural_impls via functors)
- #108040 (Use derive attributes for uninteresting traversals)
- #108044 (interpret: rename Pointer::from_addr → from_addr_invalid)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
Add `-Z instrument-xray` flag
Implement MCP https://github.com/rust-lang/compiler-team/issues/561, adding `-Z instrument-xray` flag which enables XRay instrumentation in LLVM.
|
|
Specify dlltool prefix when generating import libs
Ref: https://github.com/rust-lang/rust/pull/106610#issuecomment-1418221274
tl;dr: This PR adds an explicit dlltool temporary filename prefix. The prefix resolves a race condition by ensuring dlltool temporary files are siloed in an appropriate/unique Rust temporary directory.
---
GNU dlltool, as part of its import library generation logic, uses a bunch of temporary files on disk. In the interest of deterministic build runs, dlltool supports deterministic temporary filenames. The temporary filename prefix is automatically generated internally or can be explicitly specified via a `--temp-prefix` argument.
GNU dlltool **2.38** (that ships with `x86_64-12.2.0-release-posix-seh-rt_v10-rev0` [installed during CI](https://github.com/rust-lang/rust/blob/master/src/ci/scripts/install-mingw.sh)) generates a prefix based on the target library name ([source](https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=binutils/dlltool.c;h=d95bf3f5470b999fa3b30bc887791859f48d81d1;hb=20756b0fbe065a84710aa38f2457563b57546440#l3992)). The tool writes to files such as `target_dll_h.s` and `target_dll_s00203.o` in the current working directory.
This presents a problem when multiple instances of rustc_codegen_llvm are running to generate an import library (as part of the raw_dylib feature) for the same target library (e.g. kernel32) ([source](https://github.com/rust-lang/rust/blob/master/compiler/rustc_codegen_llvm/src/back/archive.rs#L185-L196)). That is, dlltool instances race and may overwrite or delete files belonging to each other.
GNU dlltool **2.39**+ (not used in Rust CI) generates a prefix based on the output library path ([source](https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=binutils/dlltool.c;h=e2af20847009945b4c61a6fef08268fbb4429715;hb=b51c2fec1da205ea3e7354cbb3e253018d64873c#l3992)). The tool, when invoked as part of rustc_codegen_llvm, writes to files at paths such as `C_Users_Foo_AppData_Local_Temp_rustcOFqhXZ_target_lib_h.s`. (The output library path is normalized and non-alphanumeric characters are replaced with underscores.)
|
|
Add the attributes to functions according to the settings.
"xray-always" overrides "xray-never", and they both override
"xray-ignore-loops" and "xray-instruction-threshold", but we'll
let lints deal with warnings about silly attribute combinations.
|
|
Four because that's the new reasonable maximum for XRay instrumentation
attributes in the following commit.
|
|
|
|
|
|
|
|
avoid needless checks
|
|
Apply the diagnostic migration lint to more functions on `Session`.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #107022 (Implement `SpecOptionPartialEq` for `cmp::Ordering`)
- #107100 (Use proper `InferCtxt` when probing for associated types in astconv)
- #107103 (Use new solver in `evaluate_obligation` query (when new solver is enabled))
- #107190 (Recover from more const arguments that are not wrapped in curly braces)
- #107306 (Correct suggestions for closure arguments that need a borrow)
- #107339 (internally change regions to be covariant)
- #107344 (Minor tweaks in the new solver)
- #107373 (Don't merge vtables when full debuginfo is enabled.)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
michaelwoerister:dont-merge-vtables-when-debuginfo, r=WaffleLapkin
Don't merge vtables when full debuginfo is enabled.
This PR makes the compiler not emit the `unnamed_addr` attribute for vtables when full debuginfo is enabled, so that they don't get merged even if they have the same contents. This allows debuggers to more reliably map from a dyn pointer to the self-type of a trait object by looking at the vtable's debuginfo.
The PR only changes the behavior of the LLVM backend as other backends don't emit vtable debuginfo (as far as I can tell).
The performance impact of this change should be small as [measured](https://github.com/rust-lang/rust/pull/103514#issuecomment-1290833854) in a previous PR.
|
|
Fix thin archive reading
This includes a revert of https://github.com/rust-lang/rust/pull/105221 to restore fat archive reading with LlvmArchiveBuilder.
Should fix #107162, #107334 and https://github.com/google/shaderc-rs/issues/133
|
|
Rollup of 9 pull requests
Successful merges:
- #106806 (Replace format flags u32 by enums and bools.)
- #107194 (Remove dependency on slice_internals feature in rustc_ast)
- #107234 (Revisit fix_is_ci_llvm_available logic)
- #107316 (Update snap from `1.0.1` to `1.1.0`)
- #107321 (solver comments + remove `TyCtxt::evaluate_goal`)
- #107332 (Fix wording from `rustbuild` to `bootstrap`)
- #107347 (reduce rightward-drift)
- #107352 (compiler: Fix E0587 explanation)
- #107357 (Fix infinite loop in rustdoc get_all_import_attributes function)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
ArArchiveBuilder doesn't support reading thin archives, causing a
regression.
|
|
This reverts commit 047c7cc60c05e2cf182c6f578581cf2a67b1d0ff.
|
|
|
|
EarlyBinder to fn_sig in metadata
|
|
|
|
Rollup of 9 pull requests
Successful merges:
- #97373 (impl DispatchFromDyn for Cell and UnsafeCell)
- #106625 (Remove backwards compat for LLVM 12 coverage format)
- #106779 (Avoid __cxa_thread_atexit_impl on Emscripten)
- #106811 (Append .dwp to the binary filename instead of replacing the existing extension.)
- #106836 (Remove optimistic spinning from `mpsc::SyncSender`)
- #106946 (implement Hash for proc_macro::LineColumn)
- #107074 (remove unnecessary check for opaque types)
- #107287 (Improve fn pointer notes)
- #107304 (Use `can_eq` to compare types for default assoc type error)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Remove backwards compat for LLVM 12 coverage format
The minimum external LLVM was updated to 13 recently in https://github.com/rust-lang/rust/pull/100611, so this PR removes backwards compat with older coverage formats.
I kept the version check and error message there, in accordance with this comment: https://github.com/rust-lang/rust/pull/91207#issuecomment-981121867
|
|
|
|
...and remove it from `PointeeInfo`, which isn't meant for this.
There are still various places (marked with FIXMEs) that assume all pointers
have the same size and alignment. Fixing this requires parsing non-default
address spaces in the data layout string, which will be done in a followup.
|
|
|
|
Various cleanups around pre-TyCtxt queries and functions
part of #105462
based on https://github.com/rust-lang/rust/pull/106776 (everything starting at [0e2b39f](https://github.com/rust-lang/rust/pull/106810/commits/0e2b39fd1ffde51b50d45ccbe41de52b85136b8b) is new in this PR)
r? `@petrochenkov`
I think this should be most of the uncontroversial part of #105462.
|
|
Rollup of 7 pull requests
Successful merges:
- #104505 (Remove double spaces after dots in comments)
- #106784 (prevent E0512 from emitting [type error] by checking the references_error)
- #106834 (new trait solver: only consider goal changed if response is not identity)
- #106889 (Mention the lack of `windows_mut` in `windows`)
- #106963 (Use `scope_expr_id` from `ProbeCtxt`)
- #106970 (Switch to `EarlyBinder` for `item_bounds` query)
- #106980 (Hide `_use_mk_alias_ty_instead` in `<AliasTy as Debug>::fmt`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Remove double spaces after dots in comments
Most of the comments do not have double spaces, so I assume these are typos.
|
|
|
|
Previously, it was only put on scalars with range validity invariants
like bool, was uninit was obviously invalid for those.
Since then, we have normatively declared all uninit primitives to be
undefined behavior and can therefore put `noundef` on them.
The remaining concern was the `mem::uninitialized` function, which cause
quite a lot of UB in the older parts of the ecosystem. This function now
doesn't return uninit values anymore, making users of it safe from this
change.
The only real sources of UB where people could encounter uninit
primitives are `MaybeUninit::uninit().assume_init()`, which has always
be clear in the docs about being UB and from heap allocations (like
reading from the spare capacity of a vec. This is hopefully rare enough
to not break anything.
|