about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2023-02-10implement `compute_alias_eq_goal`Boxy-14/+163
2023-02-10emit `AliasEq` when relating type and const aliasesBoxy-147/+157
2023-02-10add `AliasEq` to `PredicateKind`Boxy-5/+77
2023-02-10Auto merge of #107870 - matthiaskrgr:rollup-3z1q4rm, r=matthiaskrgrbors-61/+58
Rollup of 6 pull requests Successful merges: - #107043 (Support `true` and `false` as boolean flag params) - #107831 (Query refactoring) - #107841 (Handled snap curl issue inside Rust) - #107852 (rustdoc: remove unused fn parameter `tab`) - #107861 (Sync release notes for 1.67.1) - #107863 (Allow multiple candidates with same response in new solver) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-10Rollup merge of #107863 - compiler-errors:new-solver-multiple-candidates, ↵Matthias Krüger-3/+6
r=jackh726 Allow multiple candidates with same response in new solver Treat >1 candidates as *not* ambiguous if they return the same response.
2023-02-10Rollup merge of #107831 - nnethercote:query-refactoring, r=oli-obkMatthias Krüger-53/+47
Query refactoring Just some cleanups I found when learning about the query system. Best reviewed one commit at a time. r? `@oli-obk`
2023-02-10Rollup merge of #107043 - Nilstrieb:true-and-false-is-false, r=wesleywiserMatthias Krüger-5/+5
Support `true` and `false` as boolean flag params Implements [MCP 577](https://github.com/rust-lang/compiler-team/issues/577).
2023-02-10Auto merge of #101680 - jackh726:implied-cleanup, r=lcnrbors-104/+142
Fix implied outlives bounds logic for projections The logic here is subtly wrong. I put a bit of an explanation in a767d7b5165cea8ee5cbe494a4a636c50ef67c9c. TL;DR: we register outlives predicates to be proved, because wf code normalizes projections (from the unnormalized types) to type variables. This causes us to register those as constraints instead of implied. This was "fine", because we later added that implied bound in the normalized type, and delayed registering constraints. When I went to cleanup `free_region_relations` to *not* delay adding constraints, this bug was uncovered. cc. `@aliemjay` because this caused your test failure in #99832 (I only realized as I was writing this) r? `@nikomatsakis`
2023-02-09Update implied_outlives_bounds to properly register implied bounds behind ↵Jack Huey-41/+60
normalization
2023-02-09Cleanup free_region_relations a bitJack Huey-69/+88
2023-02-10Multiple candidates with same response is not ambiguousMichael Goulet-3/+6
2023-02-10Auto merge of #102963 - ilammy:xray-basic, r=estebankbors-8/+158
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.
2023-02-09Rollup merge of #107815 - compiler-errors:new-solver-no-auto-if-impl, r=lcnrDylan DPC-0/+14
Disqualify `auto trait` built-in impl in new solver if explicit `impl` exists
2023-02-09Rollup merge of #107803 - ↵Dylan DPC-17/+31
eggyal:do_not_bring_trait_alias_supertraits_into_scope, r=compiler-errors Do not bring trait alias supertraits into scope Fixes #107747 cc #41517
2023-02-09Rollup merge of #107786 - compiler-errors:new-solver-some-tweaks, r=lcnrDylan DPC-135/+85
Implement some tweaks in the new solver I've been testing the new solver on some small codebases, and these are a few small changes I've needed to make. The most "controversial" here is implementing `trait_candidate_should_be_dropped_in_favor_of`, which I just implemented to always return false. This surprisingly allows some code to compile, without us having to actually decide on any semantics yet. r? `@rust-lang/initiative-trait-system-refactor`
2023-02-09Rollup merge of #107659 - bvanjoi:issue-107649, r=estebankDylan DPC-11/+11
test: snapshot for derive suggestion in diff files fixed #107649
2023-02-09Rollup merge of #107648 - matthiaskrgr:unused_lifetime_104432_fix, r=cjgillotDylan DPC-12/+16
unused-lifetimes: don't warn about lifetimes originating from expanded code previously, we would warn like this: ```` warning: lifetime parameter `'s` never used --> /tmp/unusedlif/code.rs:6:62 | 5 | #[derive(Clone)] | - help: elide the unused lifetime 6 | struct ShimMethod4<T: Trait2 + 'static>(pub &'static dyn for<'s> Fn(&'s mut T::As)); | ^^ | = note: requested on the command line with `-W unused-lifetimes` ```` Fixes #104432
2023-02-09Disqualify auto-trait builtin impl in new solver if impl existsMichael Goulet-0/+14
2023-02-09Move winnowing to assemblyMichael Goulet-140/+81
2023-02-09Implement a dummy drop-in-favor-of for the new solverMichael Goulet-19/+33
2023-02-09Use elaborated item bounds for alias typesMichael Goulet-4/+1
2023-02-09Fix subst issue with object_ty_for_traitMichael Goulet-5/+3
2023-02-09test: snapshot for derive suggestion in diff filesbohan-11/+11
2023-02-09Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3bors-331/+640
Sync rustc_codegen_cranelift * Couple of bugfixes * A significant runtime perf improvement * Implemented sym and const support for inline asm * Improved self profile integration r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2023-02-09Merge commit '7d53619064ab7045c383644cb445052d2a3d46db' into ↵bjorn3-331/+640
sync_cg_clif-2023-02-09
2023-02-09Rollup merge of #107835 - tshepang:fmt, r=WaffleLapkinMatthias Krüger-12/+13
use idiomatic formatting Also, remove needless `else`
2023-02-09Rollup merge of #107752 - riverar:rafael/gnu_dlltool_temp_prefix, r=petrochenkovMatthias Krüger-0/+8
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.)
2023-02-09Rollup merge of #107446 - clubby789:rustc-parse-diag-migrate, r=compiler-errorsMatthias Krüger-380/+641
Migrate some of `rustc_parse` to derive diagnostics `@rustbot` label +A-translation r? rust-lang/diagnostics cc #100717
2023-02-09use idiomatic formattingTshepang Mbambo-12/+13
Also, remove needless else
2023-02-09Auto merge of #106938 - GuillaumeGomez:normalize-projection-field-ty, r=oli-obkbors-1/+1
Add missing normalization for union fields types Overshadows https://github.com/rust-lang/rust/pull/106808. From the experiment https://github.com/rust-lang/rust/pull/103985. In short, it allows to use projections as a type for union's fields. cc `@compiler-errors` r? `@oli-obk`
2023-02-09Remove `QueryContext`.Nicholas Nethercote-34/+31
There is a type `QueryCtxt`, which impls the trait `QueryContext`. Confusingly, there is another type `QueryContext`. The latter is (like `TyCtxt`) just a pointer to a `GlobalContext`. It's not used much, e.g. its `impl` block has a single method. This commit removes `QueryContext`, replacing its use with direct `GlobalCtxt` use.
2023-02-09Avoid some `tls::with` calls.Nicholas Nethercote-11/+8
These are in places where a `tcx` is easily obtained.
2023-02-09Simplify `with_tlv`.Nicholas Nethercote-3/+3
2023-02-09Simplify `tls::enter_context`.Nicholas Nethercote-6/+6
2023-02-08Rollup merge of #107813 - compiler-errors:bad-impl-trait-in-macro-is-ok, ↵Michael Goulet-2/+3
r=estebank Do not eagerly recover for bad `impl Trait` types in macros Fixes #107796 cc #106712, ```@estebank``` and ```@Ezrashaw``` please make sure to use [`Parser::may_recover`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_parse/parser/struct.Parser.html#method.may_recover) for all eager-token-consuming parser recoveries. This also fixes a separate regression from #99915, that was introduced before we added `may_recover` though.
2023-02-08Rollup merge of #107799 - lcnr:update-provisional-result, r=oli-obkMichael Goulet-5/+8
correctly update goals in the cache we may want to actually write the response for our goal into the provisional or global cache instead of simply using the result from the last iteration '^^ r? ```@rust-lang/initiative-trait-system-refactor```
2023-02-08Rollup merge of #107761 - oli-obk:miri_🪵, r=TaKO8KiMichael Goulet-34/+6
Replace a command line flag with an env var to allow tools to initialize the tracing loggers at their own discretion fixes https://github.com/rust-lang/miri/issues/2778 this was introduced in https://github.com/rust-lang/rust/pull/104645, so this PR reverts the flag-part and uses an env var instead.
2023-02-08Rollup merge of #107713 - ↵Michael Goulet-24/+40
nnethercote:extend-BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE, r=RalfJung Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`. To temporarily allow a `str` field in a packed struct using `derive`, along with `[u8]`. r? ``@RalfJung``
2023-02-09Emit an error if -Z instrument-xray is not supportedOleksii Lozovskyi-0/+12
This is somewhat important because LLVM enables the pass based on target architecture, but support by the target OS also matters. For example, XRay attributes are processed by codegen for macOS targets, but Apple linker fails to process relocations in XRay data sections, so the feature as a whole is not supported there for the time being.
2023-02-09XRay support flag in TargetOptionsOleksii Lozovskyi-0/+15
Specify where XRay is supported. I only test ARM64 and x86_64, but hey those others should work too, right? LLVM documentation says that MIPS and PPC are also supported, but I don't have the hardware, so I won't pretend. Naturally, more targets can be added later with more testing.
2023-02-09Emit basic XRay instrumentation attributesOleksii Lozovskyi-0/+28
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.
2023-02-09Allow multiple instrumentation attributesOleksii Lozovskyi-5/+5
Four because that's the new reasonable maximum for XRay instrumentation attributes in the following commit.
2023-02-09Parse "-Z instrument-xray" codegen optionOleksii Lozovskyi-3/+98
Recognize all bells and whistles that LLVM's XRay pass is capable of. The always/never settings are a bit dumb without attributes but they're still there. The default instruction count is chosen by the compiler, not LLVM pass. We'll do it later.
2023-02-09Extend `BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`.Nicholas Nethercote-24/+40
To temporarily allow a `str` field in a packed struct using `derive`, along with `[u8]`.
2023-02-09Auto merge of #107717 - nnethercote:opt-TyKind-eq, r=compiler-errorsbors-41/+45
Optimize `TyKind::eq`. r? `@ghost`
2023-02-08Auto merge of #107811 - matthiaskrgr:rollup-rpjzshk, r=matthiaskrgrbors-153/+236
Rollup of 8 pull requests Successful merges: - #105641 (Implement cursors for BTreeMap) - #107271 (Treat Drop as a rmw operation) - #107710 (Update strip-ansi-escapes and vte) - #107758 (Change `arena_cache` to not alter the declared query result) - #107777 (Make `derive_const` derive properly const-if-const impls) - #107780 (Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*`) - #107793 (Add missing tracking issue for `RawOsError`) - #107807 (Fix small debug typo) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-08Do not assemble supertraits for trait aliasesAlan Egerton-17/+31
2023-02-08correctly update goals in the cachelcnr-5/+8
2023-02-08Do not eagerly recover for bad impl-trait in macrosMichael Goulet-2/+3
2023-02-08Rollup merge of #107780 - compiler-errors:instantiate-binder, r=lcnrMatthias Krüger-60/+67
Rename `replace_bound_vars_with_*` to `instantiate_binder_with_*` Mentioning "binder" rather than "bound vars", imo, makes it clearer that we're doing something to the binder as a whole. Also, "instantiate" is the verb that I'm always reaching for when I'm looking for these functions, and the name that we use in the new solver anyways. r? types