about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-07-09Rollup merge of #99008 - obeis:issue-98974, r=compiler-errorsDylan DPC-6/+24
Adding suggestion for E0530 Closes #98974
2022-07-09Rollup merge of #98980 - RalfJung:const-prop-ice, r=oli-obkDylan DPC-0/+18
fix ICE in ConstProp Fixes https://github.com/rust-lang/rust/issues/96169
2022-07-09Rollup merge of #98350 - pcwalton:dwarf5, r=michaelwoeristerDylan DPC-0/+29
Implement support for DWARF version 5. DWARF version 5 brings a number of improvements over version 4. Quoting from the announcement [1]: > Version 5 incorporates improvements in many areas: better data compression, > separation of debugging data from executable files, improved description of > macros and source files, faster searching for symbols, improved debugging > optimized code, as well as numerous improvements in functionality and > performance. On platforms where DWARF version 5 is supported (Linux, primarily), this commit adds support for it behind a new `-Z dwarf-version=5` flag. [1]: https://dwarfstd.org/Public_Review.php r? ``@michaelwoerister``
2022-07-08Auto merge of #98816 - estebank:implicit-sized, r=oli-obkbors-99/+230
Track implicit `Sized` obligations in type params When we evaluate `ty::GenericPredicates` we introduce the implicit `Sized` predicate of type params, but we do so with only the `Predicate` its `Span` as context, we don't have an `Obligation` or `ObligationCauseCode` we could influence. To try and carry this information through, we add a new field to `ty::GenericPredicates` that tracks both which predicates come from a type param and whether that param has any bounds already (to use in suggestions). We also suggest adding a `?Sized` bound if appropriate on E0599. Address part of #98539.
2022-07-08Auto merge of #99034 - RalfJung:miri, r=Mark-Simulacrumbors-9/+9
update Miri Fixes https://github.com/rust-lang/rust/issues/98922 r? `@ghost`
2022-07-08Implement support for DWARF version 5.Patrick Walton-0/+29
DWARF version 5 brings a number of improvements over version 4. Quoting from the announcement [1]: > Version 5 incorporates improvements in many areas: better data compression, > separation of debugging data from executable files, improved description of > macros and source files, faster searching for symbols, improved debugging > optimized code, as well as numerous improvements in functionality and > performance. On platforms where DWARF version 5 is supported (Linux, primarily), this commit adds support for it behind a new `-Z dwarf-version=5` flag. [1]: https://dwarfstd.org/Public_Review.php
2022-07-08Auto merge of #98614 - oli-obk:take_unsound_opaque_types, r=wesleywiserbors-173/+86
don't succeed `evaluate_obligation` query if new opaque types were registered fixes #98608 fixes #98604 The root cause of all this is that in type flag computation we entirely ignore nongeneric things like struct fields and the signature of function items. So if a flag had to be set for a struct if it is set for a field, that will only happen if the field is generic, as only the generic parameters are checked. I now believe we cannot use type flags to handle opaque types. They seem like the wrong tool for this. Instead, this PR replaces the previous logic by adding a new variant of `EvaluatedToOk`: `EvaluatedToOkModuloOpaqueTypes`, which says that there were some opaque types that got hidden types bound, but that binding may not have been legal (because we don't know if the opaque type was in its defining scope or not).
2022-07-08Auto merge of #99054 - Dylan-DPC:rollup-0zuhhds, r=Dylan-DPCbors-5/+34
Rollup of 4 pull requests Successful merges: - #98533 (Add a `-Zdump-drop-tracking-cfg` debugging flag) - #98654 (An optimization for `pest-2.1.3`) - #98657 (Migrate some diagnostics from `rustc_const_eval` to `SessionDiagnostic`) - #98794 (Highlight conflicting param-env candidates) Failed merges: - #98957 ( don't allow ZST in ScalarInt ) r? `@ghost` `@rustbot` modify labels: rollup
2022-07-08Rollup merge of #98794 - compiler-errors:conflicting-param-env, ↵Dylan DPC-5/+34
r=michaelwoerister Highlight conflicting param-env candidates This could probably be further improved by noting _why_ equivalent param-env candidates (modulo regions) leads to ambiguity. Fixes #98786
2022-07-08Auto merge of #98758 - nnethercote:more-derive-output-improvements, ↵bors-362/+413
r=Mark-Simulacrum More derive output improvements This PR includes: - Some test improvements. - Some cosmetic changes to derive output that make the code look more like what a human would write. - Some more fundamental improvements to `cmp` and `partial_cmp` generation. r? `@Mark-Simulacrum`
2022-07-08Update ui test for the new E0530 suggestionObei Sideg-6/+24
2022-07-08Rollup merge of #99026 - anall:buffix/clippy-9131, r=xFrednetMatthias Krüger-2/+8
Add test for and fix rust-lang/rust-clippy#9131 This lint seems to have been broken by #98446 -- but of course, there was no clippy test for this case at the time. `expr.span.ctxt().outer_expn_data()` now has `MacroKind::Derive` instead of `MacroKind::Attr` for something like: ``` #[derive(Clone, Debug)] pub struct UnderscoreInStruct { _foo: u32, } ``` --- changelog: none closes: https://github.com/rust-lang/rust-clippy/issues/9131
2022-07-08Rollup merge of #98798 - jyn514:download-rustc-cached, r=Mark-SimulacrumMatthias Krüger-1/+3
Fix caching bug in `download-rustc = true` When moving this to rustbuild, I introduced a bug: if you had the file already downloaded, but deleted the sysroot for whatever reason, rustbuil would fail to unpack the cached tarball. This only affects people if they have a cached tarball, which is probably why we haven't seen an issue yet - wiping `build/cache` would work around the issue, or just not deleting `build/$TARGET/stage2`. Fixes the following error: ``` thread 'main' panicked at 'fs::read_dir(&lib_dir) failed with No such file or directory (os error 2) ("/home/jnelson/rust-lang/rust2/build/x86_64-unknown-linux-gnu/ci-rustc/lib")', config.rs:1563:20 ``` r? ``@Mark-Simulacrum``
2022-07-08Rollup merge of #98718 - yoshuawuyts:stabilize-into-future, r=yaahcMatthias Krüger-2/+0
Stabilize `into_future` https://github.com/rust-lang/rust/issues/67644 has been labeled with [S-tracking-ready-to-stabilize](https://github.com/rust-lang/rust/labels/S-tracking-ready-to-stabilize) - which mentions someone needs to file a stabilization PR. So hence this PR! :sparkles: Thanks! Closes https://github.com/rust-lang/rust/issues/67644 r? ``@joshtriplett``
2022-07-08Rollup merge of #95635 - davidtwco:terminal-width-stabilization, r=oli-obkMatthias Krüger-23/+66
sess: stabilize `--terminal-width` as `--diagnostic-width` Formerly `-Zterminal-width`, `--terminal-width` allows the user or build tool to inform rustc of the width of the terminal so that diagnostics can be truncated. Pending agreement to stabilize, see tracking issue at #84673. r? ```@oli-obk```
2022-07-08add regex to rustc-workspace-hackRalf Jung-0/+2
2022-07-08Highlight conflicting param-env candidatesMichael Goulet-5/+34
2022-07-08Auto merge of #98482 - cjgillot:short-struct-span-closure, r=estebankbors-1352/+969
Shorten def_span of closures to just their header Continuation of https://github.com/rust-lang/rust/pull/93967.
2022-07-07update MiriRalf Jung-9/+7
2022-07-07Auto merge of #98360 - estebank:uninit-binding, r=oli-obkbors-403/+771
On partial uninit error point at where we need init When a binding is declared without a value, borrowck verifies that all codepaths have *one* assignment to them to initialize them fully. If there are any cases where a condition can be met that leaves the binding uninitialized or we attempt to initialize a field of an uninitialized binding, we emit E0381. We now look at all the statements that initialize the binding, and use them to explore branching code paths that *don't* and point at them. If we find *no* potential places where an assignment to the binding might be missing, we display the spans of all the existing initializers to provide some context. Fix https://github.com/rust-lang/rust/issues/97956.
2022-07-07Auto merge of #99024 - matthiaskrgr:rollup-8ygpcpg, r=matthiaskrgrbors-125/+182
Rollup of 9 pull requests Successful merges: - #97917 (Implement ExitCodeExt for Windows) - #98844 (Reword comments and rename HIR visiting methods.) - #98979 (interpret: use AllocRange in UninitByteAccess) - #98986 (Fix missing word in comment) - #98994 (replace process exit with more detailed exit in src/bootstrap/*.rs) - #98995 (Add a test for #80471) - #99002 (suggest adding a derive for #[default] applied to variants) - #99004 (Add a test for #70408) - #99017 (Replace boolean argument for print_where_clause with an enum to make code more clear) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-07fix arm testEsteban Küber-6/+10
2022-07-07Add test for and fix rust-lang/rust-clippy#9131Andrea Nall-2/+8
This lint seems to have been broken by #98446
2022-07-07Wording tweakEsteban Küber-18/+24
2022-07-07Fix label on uninit binding field assignmentEsteban Küber-6/+6
2022-07-07Avoid misleading message/label in `match-cfg-fake-edges.rs` testEsteban Küber-2/+5
2022-07-07Add test for `for` loop maybe initializing bindingEsteban Küber-0/+20
2022-07-07Review comments: wordingEsteban Küber-31/+34
2022-07-07Tweak wording and spansEsteban Küber-302/+300
2022-07-07On partial uninit error point at where we need initEsteban Küber-397/+731
When a binding is declared without a value, borrowck verifies that all codepaths have *one* assignment to them to initialize them fully. If there are any cases where a condition can be met that leaves the binding uninitialized or we attempt to initialize a field of an unitialized binding, we emit E0381. We now look at all the statements that initialize the binding, and use them to explore branching code paths that *don't* and point at them. If we find *no* potential places where an assignment to the binding might be missing, we display the spans of all the existing initializers to provide some context.
2022-07-07Track implicit `Sized` obligations in type paramsEsteban Küber-112/+174
Suggest adding a `?Sized` bound if appropriate on E0599 by inspecting the HIR Generics. (Fix #98539)
2022-07-07Rollup merge of #99017 - GuillaumeGomez:rustdoc-ending-enum, r=notriddleMatthias Krüger-17/+23
Replace boolean argument for print_where_clause with an enum to make code more clear As you suggested ``@notriddle.`` Just not sure if the naming seems good to you? r? ``@notriddle``
2022-07-07Rollup merge of #99004 - TaKO8Ki:add-test-for-70408, r=Mark-SimulacrumMatthias Krüger-0/+13
Add a test for #70408 closes #70408
2022-07-07Rollup merge of #99002 - fee1-dead-contrib:sugg_derive, r=michaelwoeristerMatthias Krüger-5/+5
suggest adding a derive for #[default] applied to variants cc ``@TaKO8Ki`` as followup to #98873.
2022-07-07Rollup merge of #98995 - TaKO8Ki:add-test-for-80471, r=Mark-SimulacrumMatthias Krüger-0/+31
Add a test for #80471 Tests #80471, but doesn't close it, see https://github.com/rust-lang/rust/issues/80471#issuecomment-1177658967.
2022-07-07Rollup merge of #98994 - kons-9:dont_use_process_exit, r=jyn514Matthias Krüger-41/+48
replace process exit with more detailed exit in src/bootstrap/*.rs Fixes [#98830](https://github.com/rust-lang/rust/issues/98830) I implemeted "detail_exit.rs" in lib.rs, and replace all of std::process::exit. So, error code should panic in test code. ``` // lib.rs pub fn detail_exit(code: i32) -> ! { // Successful exit if code == 0 { std::process::exit(0); } if cfg!(test) { panic!("status code: {}", code); } else { std::panic::resume_unwind(Box::new(code)); } } ``` <details> <summary>% rg "exit\(" src/bootstrap/*.rs</summary> ``` builder.rs 351: crate::detail_exit(1); 1000: crate::detail_exit(1); 1429: crate::detail_exit(1); compile.rs 1331: crate::detail_exit(1); config.rs 818: crate::detail_exit(2); 1488: crate::detail_exit(1); flags.rs 263: crate::detail_exit(exit_code); 349: crate::detail_exit(exit_code); 381: crate::detail_exit(1); 602: crate::detail_exit(1); 616: crate::detail_exit(1); 807: crate::detail_exit(1); format.rs 35: crate::detail_exit(1); 117: crate::detail_exit(1); lib.rs 714: detail_exit(1); 1620: detail_exit(1); 1651:pub fn detail_exit(code: i32) -> ! { 1654: std::process::exit(0); sanity.rs 107: crate::detail_exit(1); setup.rs 97: crate::detail_exit(1); 290: crate::detail_exit(1); test.rs 676: crate::detail_exit(1); 1024: crate::detail_exit(1); 1254: crate::detail_exit(1); tool.rs 207: crate::detail_exit(1); toolstate.rs 96: crate::detail_exit(3); 111: crate::detail_exit(1); 182: crate::detail_exit(1); 228: crate::detail_exit(1); util.rs 339: crate::detail_exit(1); 378: crate::detail_exit(1); 468: crate::detail_exit(1); ``` </details>
2022-07-07Rollup merge of #98979 - RalfJung:more-alloc-range, r=oli-obkMatthias Krüger-1/+1
interpret: use AllocRange in UninitByteAccess also use nice new format string syntax in `interpret/error.rs`, and use the `#` flag to add `0x` prefixes where applicable. r? ``@oli-obk``
2022-07-07Rollup merge of #98844 - cjgillot:deep-visit, r=jyn514Matthias Krüger-61/+61
Reword comments and rename HIR visiting methods. Sparked by this discussion in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Confused.20by.20comment.20on.20.60deep_visit_item_likes_in_module.60) r? ``@jyn514`` ``@camsteffen``
2022-07-07Add test for #98539Esteban Küber-0/+69
2022-07-07Auto merge of #95573 - cjgillot:lower-query, r=michaelwoeristerbors-1/+2
Make lowering a query Split from https://github.com/rust-lang/rust/pull/88186. This PR refactors the relationship between lowering and the resolver outputs in order to make lowering itself a query. In a first part, lowering is changed to avoid modifying resolver outputs, by maintaining its own data structures for creating new `NodeId`s and so. Then, the `TyCtxt` is modified to allow creating new `LocalDefId`s from inside it. This is done by: - enclosing `Definitions` in a lock, so as to allow modification; - creating a query `register_def` whose purpose is to declare a `LocalDefId` to the query system. See `TyCtxt::create_def` and `TyCtxt::iter_local_def_id` for more detailed explanations of the design.
2022-07-07Replace boolean argument for print_where_clause with an enum to make code ↵Guillaume Gomez-17/+23
more clear
2022-07-07Reword comments and rename HIR visiting methods.Camille GILLOT-61/+61
2022-07-07Rollup merge of #98973 - GuillaumeGomez:inherent-impl-anchors, r=notriddleDylan DPC-4/+72
Remove (unused) inherent impl anchors This is something `@notriddle` realized a few days ago: we have unused anchors in the DOM. This PR removes them. You can test it [here](https://rustdoc.crud.net/imperio/inherent-impl-anchors/foo/index.html). r? `@notriddle`
2022-07-07Rollup merge of #98930 - tmiasko:pub-basic-blocks, r=oli-obkDylan DPC-1/+1
Make MIR basic blocks field public This makes it possible to mutably borrow different fields of the MIR body without resorting to methods like `basic_blocks_local_decls_mut_and_var_debug_info`. To preserve validity of control flow graph caches in the presence of modifications, a new struct `BasicBlocks` wraps together basic blocks and control flow graph caches. The `BasicBlocks` dereferences to `IndexVec<BasicBlock, BasicBlockData>`. On the other hand a mutable access requires explicit `as_mut()` call.
2022-07-07Rollup merge of #98901 - davidtwco:split-dwarf-incr-workproduct, ↵Dylan DPC-0/+25
r=michaelwoerister incr: cache dwarf objects in work products Cache DWARF objects alongside object files in work products when those exist so that DWARF object files are available for thorin in packed mode in incremental scenarios. r? `@michaelwoerister`
2022-07-07Rollup merge of #98692 - camelid:more-fixmes, r=GuillaumeGomezDylan DPC-6/+2
rustdoc: Cleanup more FIXMEs r? `@GuillaumeGomez`
2022-07-07Rollup merge of #98507 - xFrednet:rfc-2383-manual-expectation-magic, ↵Dylan DPC-6/+48
r=wesleywiser Finishing touches for `#[expect]` (RFC 2383) This PR adds documentation and some functionality to rustc's lint passes, to manually fulfill expectations. This is needed for some lints in Clippy. Hopefully, it should be one of the last things before we can move forward with stabilizing this feature. As part of this PR, I've also updated `clippy::duplicate_mod` to showcase how this new functionality can be used and to ensure that it works correctly. --- changelog: [`duplicate_mod`]: Fixed lint attribute interaction r? `@wesleywiser` cc: https://github.com/rust-lang/rust/issues/97660, https://github.com/rust-lang/rust/issues/85549 And I guess that's it. Here have a magical unicorn :unicorn:
2022-07-07Rollup merge of #96856 - DrMeepster:fix_projection_validation, r=IcnrDylan DPC-2/+2
Fix ProjectionElem validation `TypeChecker::visit_projection_elem` was not actually being called.
2022-07-07Bless coverage reports.Camille GILLOT-11/+11
2022-07-07Bless MSVC debuginfo.Camille GILLOT-2/+2