about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2021-09-23Auto merge of #89139 - camsteffen:write-perf, r=Mark-Simulacrumbors-72/+51
Use ZST for fmt unsafety as suggested here - https://github.com/rust-lang/rust/pull/83302#issuecomment-923529151.
2021-09-22Auto merge of #89187 - ehuss:update-cargo, r=ehussbors-0/+0
Update cargo 7 commits in 9a28ac83c9eb73e42ffafac552c0a55f00dbf40c..0121d66aa2ef5ffa9735f86c2b56f5fdc5a837a6 2021-09-18 15:42:28 -0500 to 2021-09-22 16:08:27 +0000 - Implement example completion for zsh (rust-lang/cargo#9939) - Bump curl-sys dependency (rust-lang/cargo#9937) - Add fetch smoke test. (rust-lang/cargo#9921) - Differentiate tests in progress bar. (rust-lang/cargo#9934) - Remove TOML incompatibility hacks (rust-lang/cargo#9932) - Change diesel compatibility messages (rust-lang/cargo#9927) - Remove broken link in contrib docs. (rust-lang/cargo#9928)
2021-09-22Update cargoEric Huss-0/+0
2021-09-22Rollup merge of #89170 - rusticstuff:aarch64_macos_disable_leak_sanitizer, ↵the8472-1/+2
r=petrochenkov Disable the leak sanitizer on Macos aarch64 for now It is currently broken, see #88132.
2021-09-22Rollup merge of #89164 - camelid:show-type-layout-docs, r=jyn514the8472-2/+18
Document `--show-type-layout` in the rustdoc book I also made a few small, related changes as separate commits. r? `@jyn514`
2021-09-22Rollup merge of #89133 - FabianWolff:issue-79546, r=michaelwoeristerthe8472-0/+8
Fix ICE with `--cap-lints=allow` and `-Zfuel=...=0` Fixes #79546.
2021-09-22Rollup merge of #89127 - wesleywiser:reenable_mutex_debuginfo_test, r=ehussthe8472-7/+5
Re-enable the `src/test/debuginfo/mutex.rs` test on Windows This test required a newer version of cdb than was previously enabled in CI thus leading to some bitrot in the test since the time it was originally created. With the update to the `windows-latest` image last week, we're now running this test in CI and thus uncovered the regression. I've updated the test and it now passes. r? `@ehuss`
2021-09-22Rollup merge of #89046 - oli-obk:fix_oflo, r=estebankthe8472-1/+1
"Fix" an overflow in byte position math r? `@estebank` help! I fixed the ICE only to brick the diagnostic. I mean, it was wrong previously (using an already expanded macro span), but it is really bad now XD
2021-09-22Fix testCameron Steffen-3/+3
2021-09-22Auto merge of #89134 - est31:revert_rustdoc_box_syntax, r=GuillaumeGomezbors-54/+47
Revert the rustdoc box syntax removal Reverts the rustdoc box syntax removal from #87781. It turned out to cause (minor) perf regressions. Requested in https://github.com/rust-lang/rust/pull/87781#issuecomment-922589168
2021-09-22Auto merge of #88865 - guswynn:must_not_suspend, r=oli-obkbors-0/+417
Implement `#[must_not_suspend]` implements #83310 Some notes on the impl: 1. The code that searches for the attribute on the ADT is basically copied from the `must_use` lint. It's not shared, as the logic did diverge 2. The RFC does specify that the attribute can be placed on fn's (and fn-like objects), like `must_use`. I think this is a direct copy from the `must_use` reference definition. This implementation does NOT support this, as I felt that ADT's (+ `impl Trait` + `dyn Trait`) cover the usecase's people actually want on the RFC, and adding an imp for the fn call case would be significantly harder. The `must_use` impl can do a single check at fn call stmt time, but `must_not_suspend` would need to answer the question: "for some value X with type T, find any fn call that COULD have produced this value". That would require significant changes to `generator_interior.rs`, and I would need mentorship on that. `@eholk` and I are discussing it. 3. `@estebank` do you know a way I can make the user-provided `reason` note pop out? right now it seems quite hidden Also, I am not sure if we should run perf on this r? `@nikomatsakis`
2021-09-22Disable the leak sanitizer on Macos aarch64 for now.Hans Kratz-1/+2
It is currently broken, see #88132.
2021-09-22Auto merge of #88846 - jackh726:issue-88360, r=nikomatsakisbors-0/+39
In suggest_missing_return_type, erase late bound regions after normalizing Fixes #88360 There might be some hardening that could be done to not error or avoid erroring with LUBing `ReErased` with `ReEmpty`, but this was the most simple fix for this particular case. r? `@nikomatsakis`
2021-09-21rustdoc: Emphasize "completely unstable"Noah Lev-1/+1
2021-09-21rustdoc: Note that type layout may differ between compilationsNoah Lev-1/+1
2021-09-21Fix inconsistent heading level in the rustdoc bookNoah Lev-1/+1
2021-09-21Document `--show-type-layout` in the rustdoc bookNoah Lev-0/+16
2021-09-22Auto merge of #88629 - wesleywiser:fix_debuginfo_for_scalarpair_params, ↵bors-0/+101
r=oli-obk Fix debuginfo for parameters passed via the ScalarPair abi on Windows Mark all of these as locals so the debugger does not try to interpret them as being a pointer to the value. This extends the approach used in #81898. Fixes #88625
2021-09-21Auto merge of #89158 - the8472:rollup-3e4ijth, r=the8472bors-46/+189
Rollup of 12 pull requests Successful merges: - #88795 (Print a note if a character literal contains a variation selector) - #89015 (core::ascii::escape_default: reduce struct size) - #89078 (Cleanup: Remove needless reference in ParentHirIterator) - #89086 (Stabilize `Iterator::map_while`) - #89096 ([bootstrap] Improve the error message when `ninja` is not found to link to installation instructions) - #89113 (dont `.ensure()` the `thir_abstract_const` query call in `mir_build`) - #89114 (Fixes a technicality regarding the size of C's `char` type) - #89115 (:arrow_up: rust-analyzer) - #89126 (Fix ICE when `indirect_structural_match` is allowed) - #89141 (Impl `Error` for `FromSecsError` without foreign type) - #89142 (Fix match for placeholder region) - #89147 (add case for checking const refs in check_const_value_eq) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-09-21Rollup merge of #89147 - b-naber:refs_in_check_const_value_eq, r=oli-obkthe8472-0/+48
add case for checking const refs in check_const_value_eq Previously in `check_const_value_eq` we destructured `ConstValue::ByRef` instances, this didn't account for `ty::Ref`s however, which led to an ICE. Fixes https://github.com/rust-lang/rust/issues/88876 Fixes https://github.com/rust-lang/rust/issues/88384 r? `@oli-obk`
2021-09-21Rollup merge of #89126 - FabianWolff:issue-89088, r=petrochenkovthe8472-0/+22
Fix ICE when `indirect_structural_match` is allowed Fixes #89088. The ICE is caused by `delay_good_path_bug()`, which is called (indirectly) from a `format!()` macro invocation. I have moved the macro invocation into the `decorate` closure of `struct_span_lint_hir()`, so that the macro is only invoked if the lint is not allowed (i.e., causes at least a warning, and thus prevents `delay_good_path_bug()` from firing).
2021-09-21Rollup merge of #89115 - lnicola:rust-analyzer-2021-09-20, r=Mark-Simulacrumthe8472-32/+16
:arrow_up: rust-analyzer `@bors` r+ rollup
2021-09-21Rollup merge of #89096 - daira:improve-ninja-error-message, r=jyn514the8472-2/+7
[bootstrap] Improve the error message when `ninja` is not found to link to installation instructions fixes #89091 Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-09-21Rollup merge of #89078 - camsteffen:map-ref, r=cjgillotthe8472-12/+6
Cleanup: Remove needless reference in ParentHirIterator It forces an intermediate binding of `Map` which is a Copy type.
2021-09-21Rollup merge of #88795 - FabianWolff:issue-88684, r=wesleywiserthe8472-0/+90
Print a note if a character literal contains a variation selector Fixes #88684.
2021-09-21Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebankbors-41/+70
Migrate in-tree crates to 2021 This replaces #89075 (cherry picking some of the commits from there), and closes #88637 and fixes #89074. It excludes a migration of the library crates for now (see tidy diff) because we have some pending bugs around macro spans to fix there. I instrumented bootstrap during the migration to make sure all crates moved from 2018 to 2021 had the compatibility warnings applied first. Originally, the intent was to support cargo fix --edition within bootstrap, but this proved fairly difficult to pull off. We'd need to architect the check functionality to support running cargo check and cargo fix within the same x.py invocation, and only resetting sysroots on check. Further, it was found that cargo fix doesn't behave too well with "not quite workspaces", such as Clippy which has several crates. Bootstrap runs with --manifest-path ... for all the tools, and this makes cargo fix only attempt migration for that crate. We can't use e.g. --workspace due to needing to maintain sysroots for different phases of compilation appropriately. It is recommended to skip the mass migration of Cargo.toml's to 2021 for review purposes; you can also use `git diff d6cd2c6c877110748296760aefddc21a0ea1d316 -I'^edition = .20...$'` to ignore the edition = 2018/21 lines in the diff.
2021-09-21Auto merge of #88981 - durin42:llvm-14-crc32, r=nagisabors-0/+28
rustc_codegen_llvm: make sse4.2 imply crc32 for LLVM 14 This fixes compiling things like the `snap` crate after https://reviews.llvm.org/D105462. I added a test that verifies the additional attribute gets specified, and confirmed that I can build cargo with both LLVM 13 and 14 with this change applied. r? `@nagisa` cc `@nikic`
2021-09-21Use ZST for fmt unsafetyCameron Steffen-69/+48
This allows the format_args! macro to keep the pre-expansion code out of the unsafe block without doing gymnastics with nested `match` expressions. This reduces codegen.
2021-09-21add case for checking const refs in check_const_value_eqb-naber-0/+48
2021-09-21Auto merge of #89125 - Aaron1011:remove-intercrate-cache, r=jackh726bors-0/+1
Don't use projection cache or candidate cache in intercrate mode Fixes #88969 It appears that *just* disabling the evaluation cache (in #88994) leads to other issues involving intercrate mode caching. I suspect that since we now always end up performing the full evaluation in intercrate mode, we end up 'polluting' the candidate and projection caches with results that depend on being in intercrate mode in some way. Previously, we might have hit a cached evaluation (stored during non-intercrate mode), and skipped doing this extra work in intercrate mode. The whole situation with intercrate mode caching is turning into a mess. Ideally, we would remove intercrate mode entirely - however, this might require waiting on Chalk.
2021-09-21Auto merge of #89045 - oli-obk:lazy_normalization_in_opaque_types, ↵bors-25/+6
r=nikomatsakis Register normalization obligations instead of immediately normalizing in opaque type instantiation For lazy TAIT we will need to instantiate opaque types from within `rustc_infer`, which cannot invoke normalization methods (they are in `rustc_trait_resolution`). So before we move the logic over to `rustc_infer`, we need make sure no normalization happens anymore. This PR resolves that by just registering normalization obligations and continuing. This PR is best reviewed commit by commit I also included f7ad36e which is just an independent cleanup that touches the same code and reduces diagnostics noise a bit r? `@nikomatsakis` cc `@spastorino`
2021-09-21Auto merge of #87234 - cjgillot:lower-mono, r=petrochenkovbors-8/+12
Lower only one HIR owner at a time Based on https://github.com/rust-lang/rust/pull/83723 Additional diff is here: https://github.com/cjgillot/rust/compare/ownernode...lower-mono Lowering is very tangled and has a tendency to intertwine the transformation of different items. This PR aims at simplifying the logic by: - moving global analyses to the resolver (item_generics_num_lifetimes, proc_macros, trait_impls); - removing a few special cases (non-exported macros and use statements); - restricting the amount of available information at any one time; - avoiding back-and-forth between different owners: an item must now be lowered all at once, and its parent cannot refer to its nodes. I also removed the sorting of bodies by span. The diagnostic ordering changes marginally, since definitions are pretty much sorted already according to the AST. This uncovered a subtlety in thir-unsafeck. (While these items could logically be in different PRs, the dependency between commits and the amount of conflicts force a monolithic PR.)
2021-09-20Adjust documentation for compatibility with 2021Mark Rousskov-0/+4
This also adjusts the lint docs generation to accept (and ignore) an allow attribute, rather than expecting the documentation to be immediately followed by the lint name.
2021-09-20Remove Drop-caused migration-added capturesMark Rousskov-5/+1
All of these were added due to insignificant Drop types being present.
2021-09-20Adjust tidy edition lint to force 2021Noah Lev-9/+35
This has a few exceptions today (library crates, a few submodules), but is mostly accurate.
2021-09-20Migrate to 2021Mark Rousskov-28/+28
2021-09-21Auto merge of #87830 - ↵bors-0/+66
hkmatsumoto:suggest-brackets-for-array-esque-block-expr, r=estebank Suggest replacing braces for brackets on array-esque invalid block expr Newcomers may write `{1, 2, 3}` for making arrays, and the current error message is not informative enough to quickly convince them what is needed to fix the error. This PR implements a diagnostic for this case, and its output looks like this: ```text error: this code is interpreted as a block expression, not an array --> src/lib.rs:1:22 | 1 | const FOO: [u8; 3] = { | ______________________^ 2 | | 1, 2, 3 3 | | }; | |_^ | = note: to define an array, one would use square brackets instead of curly braces help: try using [] instead of {} | 1 | const FOO: [u8; 3] = [ 2 | 1, 2, 3 3 | ]; | ``` Fix #87672
2021-09-21Revert the rustdoc box syntax removalest31-54/+47
It turned out to cause (minor) perf regressions.
2021-09-21Fix ICE with `--cap-lints=allow` and `-Zfuel=...=0`Fabian Wolff-0/+8
2021-09-20Don't use projection cache or candidate cache in intercrate modeAaron Hill-0/+1
Fixes #88969 It appears that *just* disabling the evaluation cache (in #88994) leads to other issues involving intercrate mode caching. I suspect that since we now always end up performing the full evaluation in intercrate mode, we end up 'polluting' the candidate and projection caches with results that depend on being in intercrate mode in some way. Previously, we might have hit a cached evaluation (stored during non-intercrate mode), and skipped doing this extra work in intercrate mode. The whole situation with intercrate mode caching is turning into a mess. Ideally, we would remove intercrate mode entirely - however, this might require waiting on Chalk.
2021-09-20Re-enable the `src/test/debuginfo/mutex.rs` test on WindowsWesley Wiser-7/+5
This test required a newer version of cdb than was previously enabled in CI thus leading to some bitrot in the test since the time it was originally created. With the update to the `windows-latest` image last week, we're now running this test in CI and thus uncovered the regression. I've updated the test and it now passes.
2021-09-20Fix ICE when `indirect_structural_match` is allowedFabian Wolff-0/+22
2021-09-20Avoid the overflow with rustc+debugassertions in issue-44406Oli Scherer-1/+1
2021-09-20rustc_codegen_llvm: make sse4.2 imply crc32 for LLVM 14Augie Fackler-0/+28
This fixes compiling things like the `snap` crate after https://reviews.llvm.org/D105462. I added a test that verifies the additional attribute gets specified, and confirmed that I can build cargo with both LLVM 13 and 14 with this change applied.
2021-09-20Use `ty::Error` for opaque types with errors in its bounds.Oli Scherer-37/+9
This reduces unhelpful diagnostics down the road.
2021-09-20Generate inference vars and obligations for projections in opaque types ↵Oli Scherer-3/+12
instead of trying to normalize them.
2021-09-20:arrow_up: rust-analyzerLaurențiu Nicola-32/+16
2021-09-20Enable 2021 compatibility lints for all in-tree codeMark Rousskov-1/+5
This just applies the suggested fixes from the compatibility warnings, leaving any that are in practice spurious in. This is primarily intended to provide a starting point to identify possible fixes to the migrations (e.g., by avoiding spurious warnings). A secondary commit cleans these up where they are false positives (as is true in many of the cases).
2021-09-20Adjust to SourceType::InTree in several placesMark Rousskov-4/+3
These were left over in migrations to subtrees, which should generally be treated as-if it was local. Also fixes a warning caused by this change.
2021-09-20Auto merge of #88321 - glaubitz:m68k-linux, r=wesleywiserbors-1/+129
Add initial support for m68k This patch series adds initial support for m68k making use of the new M68k backend introduced with LLVM-13. Additional changes will be needed to be able to actually use the backend for this target.