about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2023-12-14reviewlcnr-1/+1
2023-12-14consistently use "next solver" instead of "new solver"lcnr-15/+15
2023-12-14update use of feature flagslcnr-26/+25
2023-12-14rename `-Ztrait-solver` to `-Znext-solver`lcnr-89/+102
2023-12-14Don't forget pure rustc target features in check-cfgUrgau-2/+6
2023-12-14Use all the known features in check-cfgUrgau-4/+2
2023-12-14Move rustc_codegen_ssa target features to rustc_targetUrgau-442/+450
2023-12-14Fix cases where std accidentally relied on inline(never)Ben Kimock-10/+37
2023-12-14Auto merge of #118566 - klensy:cstr-new, r=WaffleLapkinbors-59/+42
use c literals in compiler and library Relands refreshed https://github.com/rust-lang/rust/pull/111647
2023-12-14Auto merge of #118417 - anforowicz:default-hidden-visibility, r=TaKO8Kibors-8/+23
Add unstable `-Zdefault-hidden-visibility` cmdline flag for `rustc`. The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/656
2023-12-14interpret: extend comment on the inhabitedness check in downcastRalf Jung-0/+18
2023-12-14Auto merge of #118538 - RalfJung:size-of-val-comments, r=WaffleLapkinbors-48/+57
fix dynamic size/align computation logic for packed types with dyn trait tail This logic was never updated to support `packed(N)` where `N > 1`, and it turns out to be wrong for that case. Fixes https://github.com/rust-lang/rust/issues/80925 `@bjorn3` I have not looked at cranelift; I assume it basically copied the size-of-val logic and hence could use much the same patch.
2023-12-14Remove one use of `span_bug_no_panic`.Nicholas Nethercote-2/+1
It's unclear why this is used here. All entries in the third column of `UNICODE_ARRAY` are covered by `ASCII_ARRAY`, so if the lookup fails it's a genuine compiler bug. It was added way back in #29837, for no clear reason. This commit changes it to `span_bug`, which is more typical.
2023-12-14Avoid `struct_diagnostic` where possible.Nicholas Nethercote-19/+26
It's necessary for `derive(Diagnostic)`, but is best avoided elsewhere because there are clearer alternatives. This required adding `Handler::struct_almost_fatal`.
2023-12-14Inline and remove `HandlerInner::emit_diag_at_span`.Nicholas Nethercote-5/+1
It has a single call site.
2023-12-14Remove unused `Handler::treat_err_as_bug`.Nicholas Nethercote-5/+0
2023-12-14Auto merge of #117749 - aliemjay:perf-canon-cache, r=lcnrbors-122/+197
cache param env canonicalization Canonicalize ParamEnv only once and store it. Then whenever we try to canonicalize `ParamEnvAnd<'tcx, T>` we only have to canonicalize `T` and then merge the results. Prelimiary results show ~3-4% savings in diesel and serde benchmarks. Best to review commits individually. Some commits have a short description. Initial implementation had a soundness bug (https://github.com/rust-lang/rust/pull/117749#issuecomment-1840453387) due to cache invalidation: - When canonicalizing `Ty<'?0>` we first try to resolve region variables in the current InferCtxt which may have a constraint `?0 == 'static`. This means that we register `Ty<'?0> => Canonical<Ty<'static>>` in the cache, which is obviously incorrect in another inference context. - This is fixed by not doing region resolution when canonicalizing the query *input* (vs. response), which is the only place where ParamEnv is used, and then in a later commit we *statically* guard against any form of inference variable resolution of the cached canonical ParamEnv's. r? `@ghost`
2023-12-14remove canonicalize_query_preserving_universesAli MJ Al-Nasrawy-47/+0
unused!
2023-12-14make infcx optional in canonicalizerAli MJ Al-Nasrawy-47/+45
This doesn't change behavior. It should prevent unintentional resolution of inference variables during canonicalization, which previously caused a soundness bug. See PR description for more.
2023-12-14Address commentKai Luo-2/+5
2023-12-14Auto merge of #118491 - cuviper:aarch64-stack-probes, r=wesleywiserbors-58/+69
Enable stack probes on aarch64 for LLVM 18 I tested this on `aarch64-unknown-linux-gnu` with LLVM main (~18). cc #77071, to be closed once we upgrade our LLVM submodule.
2023-12-13fix: Overlapping spans in delimited meta-varsEliseZeroTwo-0/+7
2023-12-13Add spread arg and missing CoroutineKindCelina G. Val-11/+84
2023-12-13Erase late bound regions from instance `fn_sig()`Celina G. Val-7/+19
Late bound regions were still part of the signature.
2023-12-13Tweak `short_ty_string` to reduce number of filesEsteban Küber-98/+105
When shortening types and writing them to disk, make `short_ty_string` capable of reusing the same file, instead of writing a file per shortened type.
2023-12-13Add unstable `-Zdefault-hidden-visibility` cmdline flag for `rustc`.Lukasz Anforowicz-8/+23
The new flag has been described in the Major Change Proposal at https://github.com/rust-lang/compiler-team/issues/656
2023-12-13Auto merge of #118213 - Urgau:check-cfg-diagnostics-rustc-cargo, r=petrochenkovbors-3/+48
Add more suggestions to unexpected cfg names and values This pull request adds more suggestion to unexpected cfg names and values diagnostics: - it first adds a links to the [rustc unstable book](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html) or the [Cargo reference](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg), depending if rustc is invoked by Cargo - it secondly adds a suggestion on how to expect the cfg name or value: *excluding well known names and values* - for Cargo: it suggest using a feature or `cargo:rust-check-cfg` in build script - for rustc: it suggest using `--check-cfg` (with the correct invocation) Those diagnostics improvements are directed towards enabling users to fix the issue if the previous suggestions weren't good enough. r? `@petrochenkov`
2023-12-13fix computing the dynamic alignment of packed structs with dyn trait tailsRalf Jung-48/+57
2023-12-13Rollup merge of #118871 - tmiasko:coroutine-maybe-uninit-fields, ↵Matthias Krüger-1/+4
r=compiler-errors Coroutine variant fields can be uninitialized Wrap coroutine variant fields in MaybeUninit to indicate that they might be uninitialized. Otherwise an uninhabited field will make the entire variant uninhabited and introduce undefined behaviour. The analogous issue in the prefix of coroutine layout was addressed by 6fae7f807146e400fa2bbd1c44768d9bcaa57c4c.
2023-12-13Rollup merge of #118759 - compiler-errors:bare-unit-structs, r=petrochenkovMatthias Krüger-0/+2
Support bare unit structs in destructuring assignments We should be allowed to use destructuring assignments on *bare* unit structs, not just unit structs that are located within other pattern constructors. Fixes #118753 r? petrochenkov since you reviewed #95380, reassign if you're busy or don't want to review this.
2023-12-13Add more suggestion to unexpected cfg names and valuesUrgau-3/+48
2023-12-13don't resolve regions in query inputAli MJ Al-Nasrawy-15/+15
fixes a soundness regression described in the PR description.
2023-12-13fix small perf regressionsAli MJ Al-Nasrawy-1/+11
2023-12-13don't store OriginalQueryValues::universe_mapAli MJ Al-Nasrawy-4/+12
ParamEnv is canonicalized in *queries input* rather than query response. In such case we don't "preserve universes" of canonical variable. This means that `universe_map` always has the default value, which is wasteful to store in the cache.
2023-12-13global param_env canonicalization cacheAli MJ Al-Nasrawy-22/+128
2023-12-13Auto merge of #118870 - Enselic:rustc_passes-query-stability, r=compiler-errorsbors-1/+10
rustc_passes: Enforce `rustc::potential_query_instability` lint Stop allowing `rustc::potential_query_instability` in all of `rustc_passes` and instead allow it on a case-by-case basis if it is safe. In this case, all instances of the lint are safe to allow. Part of https://github.com/rust-lang/rust/issues/84447 which is E-help-wanted.
2023-12-13Auto merge of #118500 - ZetaNumbers:tcx_hir_refactor, r=petrochenkovbors-323/+322
Move some methods from `tcx.hir()` to `tcx` https://github.com/rust-lang/rust/pull/118256#issuecomment-1826442834 Renamed: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id
2023-12-13Auto merge of #118534 - RalfJung:extern-type-size-of-val, r=WaffleLapkinbors-100/+60
codegen: panic when trying to compute size/align of extern type The alignment is also computed when accessing a field of extern type at non-zero offset, so we also panic in that case. Previously `size_of_val` worked because the code path there assumed that "thin pointer" means "sized". But that's not true any more with extern types. The returned size and align are just blatantly wrong, so it seems better to panic than returning wrong results. We use a non-unwinding panic since code probably does not expect size_of_val to panic.
2023-12-13Auto merge of #117050 - c410-f3r:here-we-go-again, r=petrochenkovbors-32/+335
[`RFC 3086`] Attempt to try to resolve blocking concerns Implements what is described at https://github.com/rust-lang/rust/issues/83527#issuecomment-1744822345 to hopefully make some progress. It is unknown if such approach is or isn't desired due to the lack of further feedback, as such, it is probably best to nominate this PR to the official entities. `@rustbot` labels +I-compiler-nominated
2023-12-13Fix XCOFF metadataKai Luo-10/+11
2023-12-13Rename some unescaping functions.Nicholas Nethercote-9/+7
`unescape_raw_str_or_raw_byte_str` only does checking, no unescaping. And it also now handles C string literals. `unescape_raw_str` is used for all the non-raw strings.
2023-12-12Rollup merge of #118891 - compiler-errors:async-gen-blocks, r=eholkJubilee-9/+18
Actually parse async gen blocks correctly 1. I got the control flow in `parse_expr_bottom` messed up, and obviously forgot a test for `async gen`, so we weren't actually ever parsing it correctly. 2. I forgot to gate the span for `async gen {}`, so even if we did parse it, we wouldn't have correctly denied it in `cfg(FALSE)`. r? eholk
2023-12-12Rollup merge of #118889 - matthiaskrgr:compl_2023_2, r=WaffleLapkinJubilee-24/+14
more clippy::complexity fixes redundant_guards redundant_slicing filter_next needless_borrowed_reference useless_format
2023-12-12Rollup merge of #118887 - smoelius:patch-1, r=NilstriebJubilee-1/+1
Typo
2023-12-12Rollup merge of #118885 - matthiaskrgr:compl_2023, r=compiler-errorsJubilee-32/+12
clippy::complexity fixes filter_map_identity needless_bool search_is_some unit_arg map_identity needless_question_mark derivable_impls
2023-12-12Rollup merge of #118884 - matthiaskrgr:auszweimacheins, r=NadrierilJubilee-2/+3
NFC: simplify merging of two vecs
2023-12-12Rollup merge of #118864 - farnoy:masked-load-store-fixes, r=workingjubileeJubilee-1/+1
Fix alignment passed down to LLVM for simd_masked_load Follow up to #117953 The alignment for a masked load operation should be that of the element/lane, not the vector as a whole It can produce miscompilations after the LLVM optimizer notices the higher alignment and promotes this to an unmasked, aligned load followed up by blend/select - https://rust.godbolt.org/z/KEeGbevbb
2023-12-12Set the `StackProbeType` in `apple::opts`Josh Stone-56/+32
2023-12-12Uplift TypeAndMutMichael Goulet-30/+55
2023-12-12Uplift ClosureKindMichael Goulet-76/+107