about summary refs log tree commit diff
path: root/compiler/rustc_symbol_mangling/src
AgeCommit message (Collapse)AuthorLines
2023-11-14finish `RegionKind` renamelcnr-3/+3
- `ReFree` -> `ReLateParam` - `ReEarlyBound` -> `ReEarlyParam`
2023-11-14Auto merge of #117773 - nnethercote:rm-Zperf-stats, r=wesleywiserbors-32/+29
Remove `-Zperf-stats`. The included measurements have varied over the years. At one point there were quite a few more, but #49558 deleted a lot that were no longer used. Today there's just four, and it's a motley collection that doesn't seem particularly valuable. I think it has been well and truly subsumed by self-profiling, which collects way more data. r? `@wesleywiser`
2023-11-13rename `ReLateBound` to `ReBound`lcnr-3/+4
other changes: - `Region::new_late_bound` -> `Region::new_bound` - `Region::is_late_bound` -> `Region::is_bound`
2023-11-13Remove `-Zperf-stats`.Nicholas Nethercote-32/+29
The included measurements have varied over the years. At one point there were quite a few more, but #49558 deleted a lot that were no longer used. Today there's just four, and it's a motley collection that doesn't seem particularly valuable. I think it has been well and truly subsumed by self-profiling, which collects way more data.
2023-10-27Rollup merge of #116834 - nnethercote:rustc_symbol_mangling, r=davidtwcoMatthias Krüger-18/+26
Remove `rustc_symbol_mangling/messages.ftl`. It contains a single message that (a) doesn't contain any natural language, and (b) is only used in tests. r? `@davidtwco`
2023-10-21Make `ty::print::Printer` take `&mut self` instead of `self`Nilstrieb-134/+135
This simplifies the code by removing all the `self` assignments and makes the flow of data clearer - always into the printer. Especially in v0 mangling, which already used `&mut self` in some places, it gets a lot more uniform.
2023-10-20s/generator/coroutine/Oli Scherer-2/+2
2023-10-20s/Generator/Coroutine/Oli Scherer-9/+9
2023-10-17Remove `Print::Error`Nilstrieb-1/+1
All printing goes through `fmt::Error` now.
2023-10-17Remove `Printer::Error`Nilstrieb-41/+37
It's always a `fmt::Error` except in some cases where it was `!`, but we're not really winning anything in that case.
2023-10-17Remove `Print::Output`Nilstrieb-1/+1
Now that `Printer` doesn't have subprinters anymore, the output of a printing operation is always the same.
2023-10-17Remove "subprinter" types from `Printer`Nilstrieb-38/+26
These are `Self` in almost all printers except one, which can just store the state as a field instead. This simplifies the printer and allows for further simplifications, for example using `&mut self` instead of passing around the printer.
2023-10-17Remove `rustc_symbol_mangling/messages.ftl`.Nicholas Nethercote-18/+26
It contains a single message that (a) doesn't contain any natural language, and (b) is only used in tests.
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+3
2023-09-24Remove span from BrAnon.Camille GILLOT-1/+1
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-4/+1
2023-09-23Enable drop_tracking_mir by default.Camille GILLOT-6/+2
2023-09-20the Const::eval_bits methods don't need to be given the TyRalf Jung-3/+3
2023-09-14Auto merge of #115817 - fee1-dead-contrib:fix-codegen, r=oli-obkbors-5/+4
treat host effect params as erased in codegen This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`. r? `@oli-obk`
2023-09-14treat host effect params as erased generics in codegenDeadbeef-5/+4
This fixes the changes brought to codegen tests when effect params are added to libcore, by not attempting to monomorphize functions that get the host param by being `const fn`.
2023-09-13make the set of methods between our two Const types more consistentRalf Jung-1/+1
2023-09-13make the eval() functions on our const types return the resulting valueRalf Jung-1/+1
2023-08-24Fix CFI: f32 and f64 are encoded incorrectly for cRamon de C Valle-4/+13
Fix #115150 by encoding f32 and f64 correctly for cross-language CFI. I missed changing the encoding for f32 and f64 when I introduced the integer normalization option in #105452 as integer normalization does not include floating point. `f32` and `f64` should be always encoded as `f` and `d` since they are both FFI safe when their representation are the same (i.e., IEEE 754) for both the Rust compiler and Clang.
2023-08-11Auto merge of #114672 - lenawanel:master, r=compiler-errorsbors-5/+2
make `typeid::typeid_itanium_cxx_abi::transform_ty` evaluate length in array types the ICE in https://github.com/rust-lang/rust/issues/114275 was caused by `transform_ty` in compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs encountering an unevaluated const, while expecting it to already be evaluated.
2023-08-10fix #114275lena-5/+2
this ICE was caused by `transform_ty` in compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs encountering an unevaluated const, while expecting it to already be evaluated. add a regression test Update tests/ui/sanitize/issue-114275-cfi-const-expr-in-arry-len.rs Co-authored-by: Michael Goulet <michael@errs.io> Update tests/ui/sanitize/issue-114275-cfi-const-expr-in-arry-len.rs Co-authored-by: Michael Goulet <michael@errs.io> fix test compiling for targets with -crt-static and failing this was causign https://github.com/rust-lang/rust/pull/114686 to fail
2023-08-09rustc: Move `stable_crate_id` from `Session` to `GlobalCtxt`Vadim Petrochenkov-1/+1
Removes a piece of mutable state. Follow up to #114578.
2023-08-02avoid 'miri' when refering to the shared interpreterRalf Jung-1/+2
2023-07-27Auto merge of #113708 - rcvalle:rust-cfi-fix-100778, r=compiler-errorsbors-34/+45
CFI: Fix ICE: encode_const: unexpected type [usize Fixes #100778 and #113366, and complements #106547 by adding support for encoding const parameters.
2023-07-23more clippy::style fixes:Matthias Krüger-1/+1
get_first single_char_add_str unnecessary_mut_passed manual_map manual_is_ascii_check
2023-07-17CFI: Fix ICE: encode_const: unexpected type [usizeRamon de C Valle-34/+45
Fixes #100778 and #113366, and complements #106547 by adding support for encoding const parameters.
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-83/+78
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-36/+47
2023-07-05Deal with falloutBoxy-6/+4
2023-07-04nitBoxy-0/+1
Co-authored-by: lcnr <rust@lcnr.de>
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-1/+1
2023-06-16Add `AliasKind::Weak` for type aliases.Oli Scherer-0/+1
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
2023-06-02Rollup merge of #112182 - rcvalle:rust-cfi-fix-111185, r=compiler-errorsMatthias Krüger-3/+10
CFI: Fix cfi with repr(transparent): transform_ty: unexpected Alias(Proj Fixes https://github.com/rust-lang/rust/issues/111185 by normalizing ty::Alias before encoding.
2023-06-02Auto merge of #112198 - compiler-errors:rollup-o2xe4of, r=compiler-errorsbors-5/+24
Rollup of 7 pull requests Successful merges: - #111670 (Require that const param tys implement `ConstParamTy`) - #111914 (CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi…) - #112030 (Migrate `item_trait_alias` to Askama) - #112150 (Support 128-bit atomics on all x86_64 Apple targets) - #112174 (Fix broken link) - #112190 (Improve comments on `TyCtxt` and `GlobalCtxt`.) - #112193 (Check tuple elements are `Sized` in `offset_of`) Failed merges: - #112071 (Group rfcs tests) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-01Rollup merge of #111914 - rcvalle:rust-cfi-fix-111184, r=compiler-errorsMichael Goulet-5/+24
CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(Bi… Fixes https://github.com/rust-lang/rust/issues/111184 by encoding ty::Generator parent substs only.
2023-06-01CFI: Fix cfi with async: transform_ty: unexpected GeneratorWitness(BindeRamon de C Valle-5/+24
Fixes #111184 by encoding ty::Generator parent substs only.
2023-06-01CFI: Fix cfi with repr(transparent): transform_ty: unexpected Alias(ProjRamon de C Valle-3/+10
Fixes #111185 by normalizing ty::Alias before encoding.
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-2/+15
2023-05-29EarlyBinder::new -> EarlyBinder::bindlcnr-1/+1
2023-05-29Use `Cow` in `{D,Subd}iagnosticMessage`.Nicholas Nethercote-9/+2
Each of `{D,Subd}iagnosticMessage::{Str,Eager}` has a comment: ``` // FIXME(davidtwco): can a `Cow<'static, str>` be used here? ``` This commit answers that question in the affirmative. It's not the most compelling change ever, but it might be worth merging. This requires changing the `impl<'a> From<&'a str>` impls to `impl From<&'static str>`, which involves a bunch of knock-on changes that require/result in call sites being a little more precise about exactly what kind of string they use to create errors, and not just `&str`. This will result in fewer unnecessary allocations, though this will not have any notable perf effects given that these are error paths. Note that I was lazy within Clippy, using `to_string` in a few places to preserve the existing string imprecision. I could have used `impl Into<{D,Subd}iagnosticMessage>` in various places as is done in the compiler, but that would have required changes to *many* call sites (mostly changing `&format("...")` to `format!("...")`) which didn't seem worthwhile.
2023-05-28Replace EarlyBinder(x) with EarlyBinder::new(x)Kyle Matsuda-1/+1
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-1/+1
2023-05-23Rollup merge of #111851 - rcvalle:rust-cfi-fix-111515, r=bjorn3Matthias Krüger-7/+7
CFI: Fix encode_region: unexpected ReEarlyBound(0, 'a) Fixes #111515 and complements #106547 by adding support for encoding early bound regions and also excluding projections when transforming trait objects' traits into their identities before emitting type checks.
2023-05-23Rollup merge of #111486 - fmease:pp-inh-proj, r=petrochenkovMatthias Krüger-2/+5
Pretty-print inherent projections correctly Previously, we were trying to pretty-print inherent projections with `Printer::print_def_path` which is incorrect since it expects the substitutions to be of a certain format (parents substs followed by own substs) which doesn't hold for inherent projections (self type subst followed by own substs). Now we print inherent projections manually. Fixes #111390. Fixes #111397. Lacking tests! Is there a test suite / compiletest flags for the pretty-printer? In most if not all cases, inherent projections are normalized away before they get the chance to appear in diagnostics. If I were to create regression tests for linked issues, they would need to be `mir-opt` tests to exercise `-Zdump-mir=all` (right?) which doesn't feel quite adequate to me. `@rustbot` label F-inherent_associated_types
2023-05-23CFI: Fix encode_region: unexpected ReEarlyBound(0, 'a)Ramon de C Valle-7/+7
Fixes #111515 and complements #106547 by adding support for encoding early bound regions and also excluding projections when transforming trait objects' traits into their identities before emitting type checks.
2023-05-22properly pretty-print inherent projectionsLeón Orell Valerian Liehr-2/+5