summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa
AgeCommit message (Collapse)AuthorLines
2024-02-15Rename `-Zno_parallel_llvm` -> `-Zno_parallel_backend`Maybe Waffle-2/+2
2024-02-14clean up potential_query_instability with FxIndexMap and UnordMapyukang-39/+34
2024-02-13Bump `indexmap`clubby789-1/+2
`swap` has been deprecated in favour of `swap_remove` - the behaviour is the same though.
2024-02-12Rollup merge of #120965 - ChrisDenton:sahf, r=michaelwoeristerMatthias Krüger-0/+2
Add lahfsahf and prfchw target feature This adds target features for LAHF/SAHF and PrefetchW. These came up. along with the existing CMPXCHG16b. as [baseline features](https://download.microsoft.com/download/c/1/5/c150e1ca-4a55-4a7e-94c5-bfc8c2e785c5/Windows%2010%20Minimum%20Hardware%20Requirements.pdf) required for x86_64 Windows 10+.
2024-02-12Give const_deallocate a default bodyOli Scherer-5/+0
2024-02-12Teach llvm backend how to fall back to default bodiesOli Scherer-51/+48
2024-02-12Create ret_dest as late as possible in all code pathsOli Scherer-13/+19
2024-02-12Do the entire ReturnDest computation within make_return_destOli Scherer-6/+12
2024-02-12Add lahfsahf and prfchw target featureChris Denton-0/+2
2024-02-12Implement intrinsics with fallback bodiesOli Scherer-1/+1
2024-02-11is_closure_likeMichael Goulet-3/+3
2024-02-10Rollup merge of #120865 - saethlin:missing-o-files, r=nnethercoteMatthias Krüger-1/+11
Turn the "no saved object file in work product" ICE into a translatable fatal error I don't know if it's fair to say this fixes https://github.com/rust-lang/rust/issues/120854 but it surely makes the error reporting better and should encourage people with good instincts like ```@CinchBlue.```
2024-02-09Turn the "no saved object file in work product" ICE into a translatable ↵Ben Kimock-1/+11
fatal error
2024-02-10Rollup merge of #120846 - petrochenkov:jobs, r=oli-obkMatthias Krüger-1/+1
Update jobserver-rs to 0.1.28 Fixes the issues found in https://github.com/rust-lang/rust/issues/120515 besides the diagnostic wording.
2024-02-09Update jobserver-rs to 0.1.28Vadim Petrochenkov-1/+1
2024-02-09Auto merge of #120843 - matthiaskrgr:rollup-med37z5, r=matthiaskrgrbors-0/+2
Rollup of 8 pull requests Successful merges: - #113671 (Make privacy visitor use types more (instead of HIR)) - #120308 (core/time: avoid divisions in Duration::new) - #120693 (Invert diagnostic lints.) - #120704 (A drive-by rewrite of `give_region_a_name()`) - #120809 (Use `transmute_unchecked` in `NonZero::new`.) - #120817 (Fix more `ty::Error` ICEs in MIR passes) - #120828 (Fix `ErrorGuaranteed` unsoundness with stash/steal.) - #120831 (Startup objects disappearing from sysroot) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-09Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwcoMatthias Krüger-0/+2
Invert diagnostic lints. That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has been converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted. r? ````@davidtwco````
2024-02-08Add a new debug_assertions instrinsic (compiler)Ben Kimock-4/+10
And in clippy
2024-02-08Don't lower assume in unoptimized buildsBen Kimock-2/+5
2024-02-06Rollup merge of #120502 - clubby789:remove-ffi-returns-twice, r=compiler-errorsMatthias Krüger-3/+0
Remove `ffi_returns_twice` feature The [tracking issue](https://github.com/rust-lang/rust/issues/58314) and [RFC](https://github.com/rust-lang/rfcs/pull/2633) have been closed for a couple of years. There is also an attribute gate in R-A which should be removed if this lands.
2024-02-06Rollup merge of #120575 - nnethercote:simplify-codegen-diag-handling, r=estebankMatthias Krüger-1/+1
Simplify codegen diagnostic handling Some nice improvements. Details in the individual commit logs. r? ````@estebank````
2024-02-06Add CoroutineClosure to TyKind, AggregateKind, UpvarArgsMichael Goulet-1/+5
2024-02-06Invert diagnostic lints.Nicholas Nethercote-0/+2
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-02-05Make `Emitter::emit_diagnostic` consuming.Nicholas Nethercote-1/+1
All the other `emit`/`emit_diagnostic` methods were recently made consuming (e.g. #119606), but this one wasn't. But it makes sense to. Much of this is straightforward, and lots of `clone` calls are avoided. There are a couple of tricky bits. - `Emitter::primary_span_formatted` no longer takes a `Diagnostic` and returns a pair. Instead it takes the two fields from `Diagnostic` that it used (`span` and `suggestions`) as `&mut`, and modifies them. This is necessary to avoid the cloning of `diag.children` in two emitters. - `from_errors_diagnostic` is rearranged so various uses of `diag` occur before the consuming `emit_diagnostic` call.
2024-02-03Use `DiagnosticArgName` in a few more places.Nicholas Nethercote-2/+1
2024-02-03Remove some unnecessary `clone` calls.Nicholas Nethercote-1/+1
2024-01-30Remove `ffi_returns_twice` featureclubby789-3/+0
2024-01-30Rollup merge of #120485 - chenyukang:yukang-add-query-instability-check, ↵Guillaume Gomez-0/+2
r=michaelwoerister add missing potential_query_instability for keys and values in hashmap From https://github.com/rust-lang/rust/pull/120435#discussion_r1468883787, These API are also returning iterator, so we need add `potential_query_instability` for them?
2024-01-30Remove the lifetime from `DiagnosticArgName`.Nicholas Nethercote-1/+1
Because it's always 'static.
2024-01-30Remove `DiagnosticArgName` from `rustc_codegen_ssa`.Nicholas Nethercote-8/+9
It's identical to the one in `rustc_errors`; use that instead. Also remove some `rustc_errors::` qualifiers.
2024-01-30Remove the lifetime from `DiagnosticArgValue`.Nicholas Nethercote-5/+5
Because it's almost always static. This makes `impl IntoDiagnosticArg for DiagnosticArgValue` trivial, which is nice. There are a few diagnostics constructed in `compiler/rustc_mir_build/src/check_unsafety.rs` and `compiler/rustc_mir_transform/src/errors.rs` that now need symbols converted to `String` with `to_string` instead of `&str` with `as_str`, but that' no big deal, and worth it for the simplifications elsewhere.
2024-01-30add missing potential_query_instability for keys and values in hashmapyukang-0/+2
2024-01-29Stop using `String` for error codes.Nicholas Nethercote-43/+43
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-26Auto merge of #119968 - clubby789:unused-feature, r=compiler-errorsbors-2/+0
Remove unused/unnecessary features ~~The bulk of the actual code changes here is replacing try blocks with equivalent closures. I'm not entirely sure that's a good idea since it may have perf impact, happy to revert if that's the case/the change is unwanted.~~ I also removed a lot of `recursion_limit = "256"` since everything seems to build fine without that and most don't have any comment justifying it.
2024-01-25Rollup merge of #120099 - petrochenkov:linkapi, r=WaffleLapkinMatthias Krüger-295/+258
linker: Refactor library linking methods in `trait Linker` Linkers are not aware of Rust libraries, they look like regular static or dynamic libraries to them, so Rust-specific methods in `trait Linker` do not make much sense. They can be either removed or renamed to something more suitable. Commits after the second one are cleanups.
2024-01-25Remove unused featuresclubby789-2/+0
2024-01-24linker: Fix Rust dylib crate extension on windows-msvcVadim Petrochenkov-1/+5
2024-01-24linker: Cleanup implementations of `link_staticlib_*`Vadim Petrochenkov-23/+24
2024-01-24linker: Merge `link_staticlib_*` and `link_whole_staticlib_*`Vadim Petrochenkov-130/+86
2024-01-24linker: Do not collect search paths unless necessaryVadim Petrochenkov-21/+29
2024-01-24linker: Group library linking methods together and sort them consistentlyVadim Petrochenkov-171/+180
2024-01-24linker: Refactor APIs for linking static librariesVadim Petrochenkov-69/+114
Rename `link(_whole)(staticlib,rlib)` to something more suitable.
2024-01-24linker: Refactor APIs for linking dynamic librariesVadim Petrochenkov-93/+33
Rename `link_(dylib,framework)`, remove `link_rust_dylib`.
2024-01-23Rollup merge of #120139 - compiler-errors:fnonce-shim, r=BoxyUwULeón Orell Valerian Liehr-1/+0
Do not normalize closure signature when building `FnOnce` shim It is not necessary to normalize the closure signature when building an `FnOnce` shim for an `Fn`/`FnMut` closure. That closure shim is just calling `FnMut::call_mut(&mut self)` anyways. It's also somewhat sketchy that we were ever doing this to begin with, since we're normalizing with a `ParamEnv::reveal_all()` param-env, which is definitely not right with possibly polymorphic substs. This cuts out a tiny bit of unnecessary work in `Instance::resolve` and simplifies the signature because now we can unconditionally return an `Instance`.
2024-01-23Rename `TyCtxt::struct_span_lint_hir` as `TyCtxt::node_span_lint`.Nicholas Nethercote-1/+1
2024-01-22Do not normalize closure signature when building FnOnce shimMichael Goulet-1/+0
2024-01-22Auto merge of #120080 - cuviper:128-align-packed, r=nikicbors-1/+1
Pack u128 in the compiler to mitigate new alignment This is based on #116672, adding a new `#[repr(packed(8))]` wrapper on `u128` to avoid changing any of the compiler's size assertions. This is needed in two places: * `SwitchTargets`, otherwise its `SmallVec<[u128; 1]>` gets padded up to 32 bytes. * `LitKind::Int`, so that entire `enum` can stay 24 bytes. * This change definitely has far-reaching effects though, since it's public.
2024-01-22Correct the anchor of an URL in an error messageNoritada Kobayashi-1/+1
2024-01-19Pack the u128 in LitKind::IntJosh Stone-1/+1
2024-01-17Auto merge of #119922 - nnethercote:fix-Diag-code-is_lint, r=oli-obkbors-2/+2
Rework how diagnostic lints are stored. `Diagnostic::code` has the type `DiagnosticId`, which has `Error` and `Lint` variants. Plus `Diagnostic::is_lint` is a bool, which should be redundant w.r.t. `Diagnostic::code`. Seems simple. Except it's possible for a lint to have an error code, in which case its `code` field is recorded as `Error`, and `is_lint` is required to indicate that it's a lint. This is what happens with `derive(LintDiagnostic)` lints. Which means those lints don't have a lint name or a `has_future_breakage` field because those are stored in the `DiagnosticId::Lint`. It's all a bit messy and confused and seems unintentional. This commit: - removes `DiagnosticId`; - changes `Diagnostic::code` to `Option<String>`, which means both errors and lints can straightforwardly have an error code; - changes `Diagnostic::is_lint` to `Option<IsLint>`, where `IsLint` is a new type containing a lint name and a `has_future_breakage` bool, so all lints can have those, error code or not. r? `@oli-obk`