| Age | Commit message (Collapse) | Author | Lines |
|
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
|
|
|
|
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.
|
|
|
|
|
|
JhonnyBillM:migrate-codegen-ssa-to-diagnostics-structs-pt3, r=davidtwco
Migrate `codegen_ssa` to diagnostics structs - [Part 3]
Completes migrating `codegen_ssa` module except 2 outstanding errors that depend on other crates:
1. [`rustc_middle::mir::interpret::InterpError`](https://github.com/rust-lang/rust/blob/b6097f2e1b2ca62e188ba53cf43bd66b06b36915/compiler/rustc_middle/src/mir/interpret/error.rs#L475): I saw `rustc_middle` is unassigned, I am open to take this work.
2. `codegen_llvm`'s use of `fn span_invalid_monomorphization_error`, which I started to replace in the [last commit](https://github.com/rust-lang/rust/commit/9a31b3cdda78a2c0891828254fe9886e0a1cfd16) of this PR, but would like to know the team's preference on how we should keep replacing the other macros:
2.1. Update macros to expect a `Diagnostic`
2.2. Remove macros and expand the code on each use.
See [some examples of the different options in this experimental commit](https://github.com/JhonnyBillM/rust/commit/64aee83e80857dcfa450f0c6e31d5f29c6d577e6)
_Part 2 - https://github.com/rust-lang/rust/pull/103792_
r? ``@davidtwco``
Cc ``@compiler-errors``
|
|
|
|
|
|
|
|
WIP - replacing span_invalid_monomorphization_error function. Still in progress due to its use in codegen_llvm inside macros
|
|
Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses-for-that, r=cjgillot
Remove wrapper functions for some unstable options
They are trivial and just forward to the option. Like most other options, we can just access it directly.
|
|
rustc: Remove needless lifetimes
|
|
Allow building std with cranelift
- Don't pass llvm-specific args when using cranelift
- Don't use `asm` in compiler_builtins when using cranelift
r? `@bjorn3` cc `@Mark-Simulacrum`
|
|
- Don't pass llvm-specific args when using cranelift
- Don't use `asm` in compiler_builtins when using cranelift
|
|
Correct branch-protection ModFlagBehavior for Aarch64 on LLVM-15
When building with Fat LTO and BTI enabled on aarch64, the BTI is set to `Module::Min` for alloc shim but is set to `Module::Error` for the crate. This was fine when we were using LLVM-14 but LLVM-15 changes it's behaviour to support for compiling with different `mbranch-protection` flags.
Refer:
https://github.com/rust-lang/llvm-project/commit/b0343a38a5910e980bb031e4014655d77cd0c162
fixes https://github.com/rust-lang/rust/issues/102162
|
|
Add `-Zno-jump-tables`
This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes the codegen backend avoid generating jump tables when lowering switches.
In the case of LLVM, the `"no-jump-tables"="true"` function attribute is added to every function.
The kernel currently needs it for x86 when enabling IBT [3], as well as for Alpha (plus VDSO objects in MIPS/LoongArch).
[1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables
[2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables
[3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83
|
|
|
|
This flag mimics GCC/Clang's `-fno-jump-tables` [1][2], which makes
the codegen backend avoid generating jump tables when lowering switches.
In the case of LLVM, the `"no-jump-tables"="true"` function attribute is
added to every function.
The kernel currently needs it for x86 when enabling IBT [3], as well
as for Alpha (plus VDSO objects in MIPS/LoongArch).
[1] https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-fno-jump-tables
[2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fjump-tables
[3] https://github.com/torvalds/linux/blob/v6.1/arch/x86/Makefile#L75-L83
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
|
|
CI fails when building with LLVM-13. This raises unknown behavior
constant `8` from IRVerifier.
|
|
They are trivial and just forward to the option. Like most other
options, we can just access it directly.
|
|
When building with Fat LTO and BTI enabled on aarch64, the BTI is set to
`Module::Min` for alloc shim but is set to `Module::Error` for the
crate. This was fine when we were using LLVM-14 but LLVM-15 changes it's
behaviour to support for compiling with different `mbranch-protection`
flags.
Refer:
https://github.com/rust-lang/llvm-project/commit/b0343a38a5910e980bb031e4014655d77cd0c162
|
|
Following the s390x ELF ABI and based on the clang implementation,
provide appropriate definitions of va_list in library/core/src/ffi/mod.rs
and va_arg handling in compiler/rustc_codegen_llvm/src/va_arg.rs.
Fixes the following test cases on s390x:
src/test/run-make-fulldeps/c-link-to-rust-va-list-fn
src/test/ui/abi/variadic-ffi.rs
Fixes https://github.com/rust-lang/rust/issues/84628.
|
|
clippy::complexity fixes
filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool
r? `@compiler-errors`
|
|
filter_next
needless_question_mark
bind_instead_of_map
manual_find
derivable_impls
map_identity
redundant_slicing
skip_while_next
unnecessary_unwrap
needless_bool
|
|
use &str / String literals instead of format!()
|
|
|
|
|
|
Check AArch64 branch-protection earlier in the pipeline.
As suggested in #93516.
r? `@nagisa`
|
|
Avoid a temporary file when processing macOS fat archives
r? `@bjorn3`
|
|
|