about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-07-05Auto merge of #113370 - compiler-errors:rollup-8gvyy8e, r=compiler-errorsbors-1459/+2035
Rollup of 8 pull requests Successful merges: - #113010 (rust-installer & rls: remove exclusion from rustfmt & tidy ) - #113317 ( -Ztrait-solver=next: stop depending on old solver) - #113319 (`TypeParameterDefinition` always require a `DefId`) - #113320 (Add some extra information to opaque type cycle errors) - #113321 (Move `ty::ConstKind` to `rustc_type_ir`) - #113337 (Winnow specialized impls during selection in new solver) - #113355 (Move most coverage code out of `rustc_codegen_ssa`) - #113356 (Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-05Rollup merge of #113356 - he32:netbsd-riscv64, r=oli-obkMichael Goulet-2/+32
Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.
2023-07-05Rollup merge of #113355 - Zalathar:ssa, r=oli-obkMichael Goulet-168/+88
Move most coverage code out of `rustc_codegen_ssa` *This is one step in my larger coverage refactoring ambitions described at <https://github.com/rust-lang/compiler-team/issues/645>.* The backend implementation of coverage instrumentation was originally split between SSA and LLVM, perhaps in the hopes that it could be used by other backends. In practice, this split mostly just makes the coverage implementation harder to navigate and harder to modify. It seems unlikely that any backend will actually implement coverage instrumentation in the foreseeable future, especially since many parts of the existing implementation (outside the LLVM backend) are heavily tied to the specific details of LLVM's coverage instrumentation features. The current shared implementation of `codegen_coverage` is heavily tied to the details of `StatementKind::Coverage`, which makes those details difficult to change. I have reason to want to change those details as part of future fixes/improvements, so this will reduce the amount of interface churn caused by those later changes. --- This is intended to be a pure refactoring change, with no changes to actual behaviour. All of the “added” code has really just been moved from other files.
2023-07-05Rollup merge of #113337 - compiler-errors:next-solver-winnow-specializing, ↵Michael Goulet-4/+37
r=lcnr Winnow specialized impls during selection in new solver We need to be able to winnow impls that are specialized by more specific impls in order for codegen to be able to proceed. r? ``@lcnr``
2023-07-05Rollup merge of #113321 - BoxyUwU:move_constkind_to_typeir, r=oli-obkMichael Goulet-250/+459
Move `ty::ConstKind` to `rustc_type_ir` Needed this in another PR for custom debug impls, and this will also be required to move the new solver into a separate crate that does not use `TyCtxt` so that r-a and friends can depend on the trait solver. Rebased on top of #113325, only the second and third commits needs reviewing
2023-07-05Rollup merge of #113320 - oli-obk:eval_obligation_query, r=petrochenkov,BoxyUwUMichael Goulet-55/+443
Add some extra information to opaque type cycle errors Plus a bunch of cleanups. This should help users debug query cycles due to auto trait checking. We'll probably want to fix cycle errors in most (or all?) cases by looking at the current item's hidden types (new solver does this), and by delaying the auto trait checks to after typeck.
2023-07-05Rollup merge of #113319 - lcnr:type-param-def-def-id, r=compiler-errorsMichael Goulet-8/+8
`TypeParameterDefinition` always require a `DefId` the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc #113310
2023-07-05Rollup merge of #113317 - lcnr:sketchy-new-select, r=oli-obkMichael Goulet-84/+87
-Ztrait-solver=next: stop depending on old solver removes the final dependencies on the old solver when `-Ztrait-solver=next` is enabled.
2023-07-05Rollup merge of #113010 - klensy:ri-rls-fmt, r=ozkanonurMichael Goulet-888/+881
rust-installer & rls: remove exclusion from rustfmt & tidy <strike>based on #112884</strike> `rust-installer` and `rls` no longer submodules, but not removed from exclude list for rustfmt and tidy, preventing running fmt and lints on them.
2023-07-05Add support for NetBSD/riscv64 aka. riscv64gc-unknown-netbsd.Havard Eidnes-2/+32
2023-07-05Auto merge of #113210 - fee1-dead-contrib:effects-mvp, r=oli-obkbors-26/+269
Effects/keyword generics MVP This adds `feature(effects)`, which adds `const host: bool` to the generics of const functions, const traits and const impls. This will be used to replace the current logic around const traits. r? `@oli-obk`
2023-07-05Auto merge of #112594 - ChrisDenton:process=-kill, r=Amanieubors-14/+32
Return `Ok` on kill if process has already exited This will require an FCP from `@rust-lang/libs-api.` Fixes #112423. See that issue for more details.
2023-07-05Move `coverageinfo::ffi` and `coverageinfo::map` out of SSAZalathar-6/+6
2023-07-05Remove trait `CoverageInfoMethods`, since non-LLVM backends don't need itZalathar-60/+13
These methods are only ever called from within `rustc_codegen_llvm`, so they can just be declared there as well.
2023-07-05Narrow trait `CoverageInfoBuilderMethods` down to just one methodZalathar-102/+69
This effectively inlines most of `FunctionCx::codegen_coverage` into the LLVM implementation of `CoverageInfoBuilderMethods`.
2023-07-05Workaround for old android not having echoChris Denton-1/+8
2023-07-05Auto merge of #112319 - oli-obk:assoc_ty_sized_bound_for_object_safety2, ↵bors-404/+652
r=compiler-errors Don't require associated types with Self: Sized bounds in `dyn Trait` objects Trait objects require *all* associated types to be specified, even if the associated type has an explicit `where Self: Sized` bound. The following snippet does not compile on master, but does with this PR. ```rust fn _assert_is_object_safe(_: &dyn Foo) {} pub trait Foo { type Bar where Self: Sized; } ``` In contrast, if a `Self: Sized` bound is added to a method, the methodjust isn't callable on trait objects, but the trait can be made object safe just fine. ```rust fn _assert_is_object_safe(_: &dyn Foo) {} pub trait Foo { fn foo() where Self: Sized; } ``` This PR closes this inconsistency (though it still exists for associated constants). Additionally this PR adds a new lint that informs users they can remove associated type bounds from their trait objects if those associated type bounds have a `where Self: Sized` bound, and are thus useless. r? `@compiler-errors`
2023-07-05Deal with falloutBoxy-29/+47
2023-07-05move `ConstKind` to typeir and move inherent impls to `Const`Boxy-222/+413
2023-07-05Test that you can't circumvent the `Sized` bound checkOli Scherer-0/+73
2023-07-05Only use a single loop over the associated typesOli Scherer-5/+2
2023-07-05Prefer `retain` over hand-rolling an inefficient version of itOli Scherer-7/+3
2023-07-05Make `unused_associated_type_bounds`'s lint level changeableOli Scherer-0/+4
2023-07-05Make all generics_require_sized_self go through the query to get caching.Oli Scherer-3/+3
2023-07-05Add more testsOli Scherer-0/+59
2023-07-05tidy: move a large function out of an even larger fileOli Scherer-406/+418
2023-07-05Add some extra information to opaque type cycle errorsOli Scherer-24/+421
2023-07-05Remove redundant `delay_span_bug`Oli Scherer-9/+3
2023-07-05Fix some tests to *only* test their main issue and not have secondary failuresOli Scherer-9/+9
2023-07-05Lint now-unnecessary associated type boundsOli Scherer-4/+102
2023-07-05Don't require associated types with `Self: Sized` bounds in `dyn Trait` objectsOli Scherer-14/+23
2023-07-05Show which type was not specialized on query cycle misuseOli Scherer-2/+5
2023-07-05Remove a redundant argumentOli Scherer-11/+5
2023-07-05Winnow specializing implsMichael Goulet-4/+37
2023-07-05Auto merge of #112697 - tgross35:explain-markdown, r=oli-obkbors-17/+1406
Add simple markdown formatting to `rustc --explain` output This is a second attempt at #104540, which is #63128 without dependencies. This PR adds basic markdown formatting to `rustc --explain` output when available. Currently, the output just displays raw markdown: this works of course, but it really doesn't look very elegant. (output is `rustc --explain E0038`) <img width="583" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/ea418117-47af-455b-83c0-6fc59276efee"> After this patch, sample output from the same file: <img width="693" alt="image" src="https://github.com/rust-lang/rust/assets/13724985/12f7bf9b-a3fe-4104-b74b-c3e5227f3de9"> This also obeys the `--color always/auto/never` command option. Behavior: - If pager is available and supports color, print with formatting to the pager - If pager is not available or fails print with formatting to stdout - otherwise without formatting - Follow `--color always/never` if suppied - If everything fails, just print plain text to stdout r? `@oli-obk` cc `@estebank` (since the two of you were involved in the previous discussion)
2023-07-05Auto merge of #113329 - lcnr:probe_candidate, r=BoxyUwUbors-298/+280
add `ecx.probe_candidate` Not yet changing the candidate source to an enum because that would be more involved, but this by itself should already be a significant improvement imo r? `@BoxyUwU`
2023-07-04Auto merge of #113330 - matthiaskrgr:rollup-zm3owin, r=matthiaskrgrbors-93/+298
Rollup of 5 pull requests Successful merges: - #113192 (`assemble_candidates_after_normalizing_self_ty` docs) - #113251 (Use scoped-tls for SMIR to map between TyCtxt and SMIR datastructures) - #113282 (Update platform-support.md to improve ARM target descriptions) - #113296 (add flag for enabling global cache usage for proof trees and printing proof trees on error) - #113324 (implement `ConstEvaluatable` goals in new solver) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-04Auto merge of #113325 - BoxyUwU:move_mk_methods_to_const, r=lcnrbors-191/+284
Replace `mk_const` with `Const::new_x` methods Part of rust-lang/compiler-team#616. Instead of just havign `Const::new(` and nothing else I did it like this since this is more like how the `mk_x` works for `Ty`, and also another PR of mine will require changing from `Const::new(` to `Const::new_x(` anyway. r? `@oli-bok`
2023-07-04Auto merge of #113274 - workingjubilee:demote-mips, r=jyn514bors-24/+0
Remove `mips*-unknown-linux-gnu*` builders Pursuant to the current consensus in https://github.com/rust-lang/compiler-team/issues/648
2023-07-04add fixmeDeadbeef-0/+1
2023-07-04include `host_effect_index` in `Generics`Deadbeef-21/+34
2023-07-04fix typoklensy-1/+1
2023-07-04bootstrap: rust-installer no loger subtree, so allow running lints over itklensy-1/+1
2023-07-04tidy: exclude sh files from rust-installer tests from tidy bins checkklensy-1/+25
2023-07-04Rollup merge of #113324 - lcnr:const-evaluatable-goal, r=BoxyUwUMatthias Krüger-9/+75
implement `ConstEvaluatable` goals in new solver this only supports stable const generics. `feature(generic_const_exprs)` needs to extend that function is non-trivial ways. Leaving this for someone else or some later date. r? `@BoxyUwU`
2023-07-04Rollup merge of #113296 - BoxyUwU:proof_trees_on_error, r=lcnrMatthias Krüger-34/+159
add flag for enabling global cache usage for proof trees and printing proof trees on error This adds a few new things: - `-Zdump-solver-proof-tree=always/never/on-error` - `always`/`never` were previosuly specifiable by whether the flag exists or not, th new flag is `on_error` which reruns obligations of fulfillment and selection errors with proof tree generation enabled and prints them out - `-Zdump-solver-proof-tree-uses-cache` - allows forcing global cache to be used or unused for all generated proof trees, global cache is enabled by default for `always` so that it accurately represents what happend. This flag currently would affect misc uses of `GenerateProofTree::Yes` which will be added in the future for things like diagnostics logic and rustdoc's auto_trait file. We can fix this when we start using proof tree generation for those use cases if it's desirable. I also changed the output to go straight to stdout instead of going through `debug!` so that `-Zdump-solver-proof-tree` can be adequately used on `nightly` not just a locally built toolchain. The idea for `on-error` is that it should hopefully make it easier to quickly figure out "why doesnt this code compile"- you just pass in `-Zdump-solver-proof-tree=on-error` and you'll only get proof trees you care about. --- r? `@lcnr` `@compiler-errors`
2023-07-04Rollup merge of #113282 - jonathanpallant:update-arm-target-descriptions, ↵Matthias Krüger-32/+32
r=JohnTitor Update platform-support.md to improve ARM target descriptions Updates the descriptions of the various ARM targets in platform-support.md so they are a little more consistent. For example, all instances of ARMv7 are changed to ARMv7-A (as opposed to ARMv7-R and ARMv7-M). I also remove the Cortex-Mx CPUs on the thumbv6/7m targets, as most of the other targets refer only to CPU architectures and not specific CPUs (and the list was missing on thumbv8m anyway, so this is more consistent).
2023-07-04Rollup merge of #113251 - chenyukang:yukang-fix-112940-smir, r=oli-obkMatthias Krüger-14/+19
Use scoped-tls for SMIR to map between TyCtxt and SMIR datastructures Fixes #112940 r? `@oli-obk`
2023-07-04Rollup merge of #113192 - lcnr:add-comment, r=compiler-errorsMatthias Krüger-4/+13
`assemble_candidates_after_normalizing_self_ty` docs I already explained that in different places a few times, should have added that explanation as a doc comment the first time I did so :3 r? `@BoxyUwU`
2023-07-04fix bash long lines and replace TODO with FIXMEklensy-11/+18