about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-06-10Fix codegen testsldm0-2/+2
2023-06-10Support 128-bit enum variant in debuginfo codegenDonoughLiu-9/+12
2023-06-09Auto merge of #112465 - GuillaumeGomez:rollup-gyh5buc, r=GuillaumeGomezbors-42/+232
Rollup of 3 pull requests Successful merges: - #112260 (Improve document of `unsafe_code` lint) - #112429 ([rustdoc] List matching impls on type aliases) - #112442 (Deduplicate identical region constraints in new solver) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-09Rollup merge of #112442 - ↵Guillaume Gomez-1/+36
compiler-errors:next-solver-deduplicate-region-constraints, r=lcnr Deduplicate identical region constraints in new solver the new solver doesn't track whether we've already proven a goal like the fulfillment context's obligation forest does, so we may be instantiating a canonical response (and specifically, its nested region obligations) quite a few times. This may lead to exponentially gathering up identical region constraints for things like auto traits, so let's deduplicate region constraints when in `compute_external_query_constraints`. r? ``@lcnr``
2023-06-09Rollup merge of #112429 - GuillaumeGomez:ty-alias-impls, r=notriddle,lcnrGuillaume Gomez-37/+178
[rustdoc] List matching impls on type aliases Fixes #32077. Thanks a lot to ``@lcnr`` who helped me a lot with this fix! cc ``@notriddle`` r? ``@lcnr``
2023-06-09Rollup merge of #112260 - eval-exec:exec/fix-unsafe_code_lint, r=WaffleLapkinGuillaume Gomez-4/+18
Improve document of `unsafe_code` lint This PR add another `unsafe_code` lint example, want to close #111967
2023-06-09Auto merge of #111530 - Urgau:uplift_undropped_manually_drops, r=compiler-errorsbors-141/+192
Uplift `clippy::undropped_manually_drops` lint This PR aims at uplifting the `clippy::undropped_manually_drops` lint. ## `undropped_manually_drops` (warn-by-default) The `undropped_manually_drops` lint check for calls to `std::mem::drop` with a value of `std::mem::ManuallyDrop` which doesn't drop. ### Example ```rust struct S; drop(std::mem::ManuallyDrop::new(S)); ``` ### Explanation `ManuallyDrop` does not drop it's inner value so calling `std::mem::drop` will not drop the inner value of the `ManuallyDrop` either. ----- Mostly followed the instructions for uplifting an clippy lint described here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751 `@rustbot` label: +I-lang-nominated r? compiler ----- For Clippy: changelog: Moves: Uplifted `clippy::undropped_manually_drops` into rustc
2023-06-09Improve document of `unsafe_code` lintEval EXEC-4/+18
Signed-off-by: Eval EXEC <execvy@gmail.com>
2023-06-09Auto merge of #111626 - pjhades:output, r=b-naberbors-101/+439
Write to stdout if `-` is given as output file With this PR, if `-o -` or `--emit KIND=-` is provided, output will be written to stdout instead. Binary output (those of type `obj`, `llvm-bc`, `link` and `metadata`) being written this way will result in an error unless stdout is not a tty. Multiple output types going to stdout will trigger an error too, as they will all be mixded together. This implements https://github.com/rust-lang/compiler-team/issues/431 The idea behind the changes is to introduce an `OutFileName` enum that represents the output - be it a real path or stdout - and to use this enum along the code paths that handle different output types.
2023-06-09Fix intra-doc links from pointer appearing in windows HANDLE type aliasGuillaume Gomez-9/+9
2023-06-09Add regression test for #32077Guillaume Gomez-0/+59
2023-06-09List matching impls on type aliasesGuillaume Gomez-28/+110
2023-06-09Auto merge of #112450 - matthiaskrgr:rollup-fdbazkr, r=matthiaskrgrbors-26/+95
Rollup of 5 pull requests Successful merges: - #112323 (Don't mention already-set fields in struct constructor missing field error) - #112395 (Add Terminator::InlineAsm conversion from MIR to SMIR) - #112411 (add programmerjake to portable-simd cc list) - #112428 (Structurally resolve pointee in `check_pat_lit`) - #112444 (Don't debug-print `Interned` or `PrivateZst`) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-09Rollup merge of #112444 - compiler-errors:intern-debug, r=nnethercoteMatthias Krüger-1/+7
Don't debug-print `Interned` or `PrivateZst` Instead of, e.g. `PredefinedOpaques(Interned(PredefinedOpaquesData { ... }, PrivateZst))` print: `PredefinedOpaques(PredefinedOpaquesData { ... })` Mostly observable in debug logs, or ICE backtraces where I saw this. r? ``@nnethercote``
2023-06-09Rollup merge of #112428 - compiler-errors:next-solver-struct-resolv-pat, r=lcnrMatthias Krüger-3/+13
Structurally resolve pointee in `check_pat_lit` Gotta make sure to eager norm the pointee of the match scrutinee with the new solver. r? ``@lcnr``
2023-06-09Rollup merge of #112411 - programmerjake:portable-simd-cc, r=Mark-SimulacrumMatthias Krüger-1/+1
add programmerjake to portable-simd cc list
2023-06-09Rollup merge of #112395 - spastorino:smir-terminator-3, r=oli-obkMatthias Krüger-1/+51
Add Terminator::InlineAsm conversion from MIR to SMIR This is the last variant that needed to be covered for Terminator. As we've discussed with ``@oli-obk`` I've made a lot of it's fields be `String`s. r? ``@oli-obk``
2023-06-09Rollup merge of #112323 - compiler-errors:dont-mention-set-fields, ↵Matthias Krüger-20/+23
r=WaffleLapkin Don't mention already-set fields in struct constructor missing field error Fixes #111149
2023-06-09Auto merge of #112116 - compiler-errors:misc-hir-typeck-mismatch-tweaks, ↵bors-170/+337
r=WaffleLapkin Misc HIR typeck type mismatch tweaks These are all intended to improve #112104, but I couldn't get it to actually suggest adding `as_ref` to the LHS of the equality expr without some hacks that I may play around with some more. Each commit's title should explain what it's doing except for perhaps the last one, which addresses the bogus suggestion on #112104 itself.
2023-06-09Don't print Interned or PrivateZstMichael Goulet-1/+7
2023-06-08Auto merge of #108293 - Jarcho:mut_analyses, r=eholkbors-288/+491
Take MIR dataflow analyses by mutable reference The main motivation here is any analysis requiring dynamically sized scratch memory to work. One concrete example would be pointer target tracking, where tracking the results of a dereference can result in multiple possible targets. This leads to processing multi-level dereferences requiring the ability to handle a changing number of potential targets per step. A (simplified) function for this would be `fn apply_deref(potential_targets: &mut Vec<Target>)` which would use the scratch space contained in the analysis to send arguments and receive the results. The alternative to this would be to wrap everything in a `RefCell`, which is what `MaybeRequiresStorage` currently does. This comes with a small perf cost and loses the compiler's guarantee that we don't try to take multiple borrows at the same time. For the implementation: * `AnalysisResults` is an unfortunate requirement to avoid an unconstrained type parameter error. * `CloneAnalysis` could just be `Clone` instead, but that would result in more work than is required to have multiple cursors over the same result set. * `ResultsVisitor` now takes the results type on in each function as there's no other way to have access to the analysis without cloning it. This could use an associated type rather than a type parameter, but the current approach makes it easier to not care about the type when it's not necessary. * `MaybeRequiresStorage` now no longer uses a `RefCell`, but the graphviz formatter now does. It could be removed, but that would require even more changes and doesn't really seem necessary.
2023-06-08deduplicate identical region constraintsMichael Goulet-1/+36
2023-06-08Auto merge of #112068 - WaffleLapkin:move-discrim-tests, r=compiler-errorsbors-25/+25
Move tests from `ui/discrim` dir It seems that we already have a `enum-discriminant` with more tests, so it makes sense to merge them.
2023-06-08Add Terminator::InlineAsm conversion from MIR to SMIRSantiago Pastorino-1/+51
2023-06-08Peel borrows before suggesting as_ref/as_derefMichael Goulet-10/+28
2023-06-08Don't suggest cyclic associated type constraintMichael Goulet-0/+29
2023-06-08Point at correct exprs for assert_eq type mismatchMichael Goulet-16/+69
2023-06-08More robust as_ref/as_deref suggestionsMichael Goulet-152/+207
2023-06-08Suggest type mismatches even when using ref syntax on bindingMichael Goulet-2/+14
2023-06-08Auto merge of #112420 - matthiaskrgr:rollup-spiavw5, r=matthiaskrgrbors-61/+117
Rollup of 4 pull requests Successful merges: - #109953 (Use 128 bits for TypeId hash) - #112333 (Don't hold the active queries lock while calling `make_query`) - #112339 (Fix rust-analyzer proc macro server) - #112410 (Do `fix_*_builtin_expr` hacks on the writeback results) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-08Bless tidy root entry limitMaybe Waffle-1/+1
2023-06-08Move tests from `ui/discrim` dirMaybe Waffle-24/+24
2023-06-08Rollup merge of #112410 - compiler-errors:writeback, r=lcnrMatthias Krüger-48/+46
Do `fix_*_builtin_expr` hacks on the writeback results During writeback, we do `fix_{scalar,index}_builtin_expr` so that during MIR build we generate built-in MIR instructions instead of method calls for certain built-in arithmetic operations. We do this by checking the types of these built-in operations are scalar types, and remove the method def-id to essentially mark the operation as built-in and not "overloaded". For lazy norm and the new trait solver, this is a problem, because we don't actually normalize all the types we end up seeing in the typeck results until they're copied over writeback's copy of the typeck results. To fix this, delay these fixup calls until after this normalization has been done. This doesn't affect the old trait solver, but does simplify the code a bit IMO, since we can remove a few sets of calls to `resolve_vars_if_possible` and some `borrow_mut`s. r? `@lcnr`
2023-06-08Rollup merge of #112339 - lnicola:proc-macro-srv-feature, r=VeykrilMatthias Krüger-1/+1
Fix rust-analyzer proc macro server The feature now exists on `proc-macro-srv-cli`, and without it the proc macro server will bail rigth out. CC https://github.com/rust-lang/rust-analyzer/issues/14991
2023-06-08Rollup merge of #112333 - Zoxc:try_collect_active_jobs-deadlock, r=cjgillotMatthias Krüger-4/+11
Don't hold the active queries lock while calling `make_query` This moves the call to `make_query` outside the parts that holds the active queries lock in `try_collect_active_jobs`. This should help removed the deadlock and borrow panic that has been observed when printing the query stack during an ICE. cc `@SparrowLii` r? `@cjgillot`
2023-06-08Rollup merge of #109953 - thomcc:thomcc/typeid128, r=WaffleLapkinMatthias Krüger-8/+59
Use 128 bits for TypeId hash Preliminary/Draft impl of https://github.com/rust-lang/compiler-team/issues/608 Prior art (probably incomplete list) - https://github.com/rust-lang/rust/pull/75923 - https://github.com/rust-lang/rust/pull/95845
2023-06-08Auto merge of #112415 - GuillaumeGomez:rollup-5pa9frd, r=GuillaumeGomezbors-35/+90
Rollup of 9 pull requests Successful merges: - #112034 (Migrate `item_opaque_ty` to Askama) - #112179 (Avoid passing --cpu-features when empty) - #112309 (bootstrap: remove dependency `is-terminal`) - #112388 (Migrate GUI colors test to original CSS color format) - #112389 (Add a test for #105709) - #112392 (Fix ICE for while loop with assignment condition with LHS place expr) - #112394 (Remove accidental comment) - #112396 (Track more diagnostics in `rustc_expand`) - #112401 (Don't `use compile_error as print`) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-08Allow undropped_manually_drops for some testsUrgau-0/+2
2023-06-08Drop uplifted clippy::undropped_manually_dropsUrgau-139/+64
2023-06-08Uplift clippy::undropped_manually_drops to rustcUrgau-2/+126
2023-06-08Rollup merge of #112401 - WaffleLapkin:dont_compile_error, r=NilstriebGuillaume Gomez-1/+8
Don't `use compile_error as print` I've spent **1.5 hours** debugging this while trying to compile #112400, if we use `compile_error!`, we should not just forward user input to it, but issue a reasonable error message. The better solution would be to use a lint like `clippy::print_stdout`, but since we don't have clippy in CI, let's at least make the macro error better. Also note that some functions called here actually do use `println` (see for example `print_type_sizes` function).
2023-06-08Rollup merge of #112396 - WaffleLapkin:track_more_diagnostics, r=compiler-errorsGuillaume Gomez-0/+5
Track more diagnostics in `rustc_expand` I wish we could lint this somehow...
2023-06-08Rollup merge of #112394 - clubby789:remove-comment, r=petrochenkovGuillaume Gomez-3/+0
Remove accidental comment Left this in in #110092 while debugging, thanks to `@WaffleLapkin` for spotting
2023-06-08Rollup merge of #112392 - jieyouxu:issue-112385, r=compiler-errorsGuillaume Gomez-4/+47
Fix ICE for while loop with assignment condition with LHS place expr Fixes #112385.
2023-06-08Rollup merge of #112389 - TaKO8Ki:issue-105709, r=compiler-errorsGuillaume Gomez-0/+9
Add a test for #105709 Closes #105709
2023-06-08Rollup merge of #112388 - GuillaumeGomez:migrate-gui-test-color-12, r=notriddleGuillaume Gomez-3/+3
Migrate GUI colors test to original CSS color format Follow-up of https://github.com/rust-lang/rust/pull/111459. r? `@notriddle`
2023-06-08Rollup merge of #112309 - kadiwa4:remove_is_terminal, r=albertlarsan68Guillaume Gomez-16/+1
bootstrap: remove dependency `is-terminal`
2023-06-08Rollup merge of #112179 - tamird:no-empty-cpu-features, r=petrochenkovGuillaume Gomez-5/+7
Avoid passing --cpu-features when empty Added in 12ac719b99560072cbe52a957f22d3fe6946cf2a, this logic always passed --cpu-features, even when the value was the empty string.
2023-06-08Rollup merge of #112034 - sladyn98:migrate-opaque-ty, r=GuillaumeGomezGuillaume Gomez-3/+10
Migrate `item_opaque_ty` to Askama This PR migrates `item_opaque_ty` to Askama Refers: https://github.com/rust-lang/rust/issues/108868
2023-06-08Auto merge of #110040 - ndrewxie:issue-84447-partial-1, r=lcnr,michaelwoeristerbors-192/+261
Removed use of iteration through a HashMap/HashSet in rustc_incremental and replaced with IndexMap/IndexSet This allows for the `#[allow(rustc::potential_query_instability)]` in rustc_incremental to be removed, moving towards fixing #84447 (although a LOT more modules have to be changed to fully resolve it). Only HashMaps/HashSets that are being iterated through have been modified (although many structs and traits outside of rustc_incremental had to be modified as well, as they had fields/methods that involved a HashMap/HashSet that would be iterated through) I'm making a PR for just 1 module changed to test for performance regressions and such, for future changes I'll either edit this PR to reflect additional modules being converted, or batch multiple modules of changes together and make a PR for each group of modules.