about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-12-05Auto merge of #104824 - klensy:bump-some, r=Mark-Simulacrumbors-4/+5
deps: update cpufeatures, swap difference to dissimilar Updating cpufeatures v0.2.1 -> v0.2.5: https://github.com/RustCrypto/utils/blob/master/cpufeatures/CHANGELOG.md#025-2022-09-04, was yanked bc of miscompile (https://github.com/RustCrypto/utils/pull/800, https://github.com/rust-lang/rust/issues/101346) Removing difference v2.0.0 Adding dissimilar v1.0.4 Updating expect-test v1.0.1 -> v1.4.0 difference unmaintened https://rustsec.org/advisories/RUSTSEC-2020-0095.html, so replaced with https://github.com/dtolnay/dissimilar (as dependency of `expect-test`)
2022-12-05Auto merge of #104920 - compiler-errors:avoid-infcx-build, r=jackh726bors-4/+34
Avoid some `InferCtxt::build` calls Either because we're inside of an `InferCtxt` already, or because we're not in a place where we'd ever see inference vars. r? types
2022-12-04Auto merge of #105094 - Swatinem:generator-not-future, r=compiler-errorsbors-0/+126
Make sure async constructs do not `impl Generator` Async lowering turns async functions and blocks into generators internally. Though these special kinds of generators should not `impl Generator` themselves. The other way around, normal generators should not `impl Future`. This was discovered in https://github.com/rust-lang/rust/pull/105082#issuecomment-1332210907 and is a regression from https://github.com/rust-lang/rust/pull/104321. r? `@compiler-errors`
2022-12-04Auto merge of #104535 - mikebenfield:discr-fix, r=pnkfelixbors-5/+38
rustc_codegen_ssa: Fix for codegen_get_discr When doing the optimized implementation of getting the discriminant, the arithmetic needs to be done in the tag type so wrapping behavior works correctly. Fixes #104519
2022-12-04Auto merge of #105261 - matthiaskrgr:rollup-9ghhc9c, r=matthiaskrgrbors-139/+294
Rollup of 6 pull requests Successful merges: - #101975 (Suggest to use . instead of :: when accessing a method of an object) - #105141 (Fix ICE on invalid variable declarations in macro calls) - #105224 (Properly substitute inherent associated types.) - #105236 (Add regression test for #47814) - #105247 (Use parent function WfCheckingContext to check RPITIT.) - #105253 (Update a couple of rustbuild deps) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-04Rollup merge of #105253 - bjorn3:update_rustbuild_deps, r=jyn514Matthias Krüger-30/+24
Update a couple of rustbuild deps These mostly remove some dependency edges potentially making compilation of rustbuild itself a tiny bit faster. I hoped to be able to completely remove some dependencies, but other than replacing ansi_term with yansi all dependencies are still used.
2022-12-04Rollup merge of #105247 - cjgillot:issue-102682, r=compiler-errorsMatthias Krüger-58/+47
Use parent function WfCheckingContext to check RPITIT. WF-check for RPITIT was done in the opaque type's param-env, so it could not benefit from assumed wf types from the function's parameters. cc `@compiler-errors` since you chose that param-env in fd2766e7fde4 Fixes https://github.com/rust-lang/rust/issues/102682 Fixes https://github.com/rust-lang/rust/issues/104908 Fixes https://github.com/rust-lang/rust/issues/102552 Fixes https://github.com/rust-lang/rust/issues/104529
2022-12-04Rollup merge of #105236 - JohnTitor:issue-47814, r=compiler-errorsMatthias Krüger-0/+28
Add regression test for #47814 Closes #47814 r? `@compiler-errors` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-04Rollup merge of #105224 - cjgillot:issue-104240, r=compiler-errorsMatthias Krüger-0/+15
Properly substitute inherent associated types. Fixes https://github.com/rust-lang/rust/issues/104240
2022-12-04Rollup merge of #105141 - ohno418:fix-ice-on-invalid-var-decl-in-macro-call, ↵Matthias Krüger-0/+52
r=compiler-errors Fix ICE on invalid variable declarations in macro calls This fixes ICE that happens with invalid variable declarations in macro calls like: ```rust macro_rules! m { ($s:stmt) => {} } m! { var x } m! { auto x } m! { mut x } ``` Found this is because of not collecting tokens on recovery, so I changed to force collect them. Fixes https://github.com/rust-lang/rust/issues/103529.
2022-12-04Rollup merge of #101975 - chenyukang:fix-101749, r=compiler-errorsMatthias Krüger-51/+128
Suggest to use . instead of :: when accessing a method of an object Fixes #101749 Fixes #101542
2022-12-04Auto merge of #103293 - est31:untwist_and_drop_order, r=nagisabors-7/+127
Remove drop order twist of && and || and make them associative Previously a short circuiting binop chain (chain of && or ||s) would drop the temporaries created by the first element after all the other elements, and otherwise follow evaluation order. So `f(1).g() && f(2).g() && f(3).g() && f(4).g()` would drop the temporaries in the order `2,3,4,1`. This made `&&` and `||` non-associative regarding drop order. In other words, adding ()'s to the expression would change drop order: `f(1).g() && (f(2).g() && f(3).g()) && f(4).g()` for example would drop in the order `3,2,4,1`. As, except for the bool result, there is no data returned by the sub-expressions of the short circuiting binops, we can safely discard of any temporaries created by the sub-expr. Previously, code was already putting the rhs's into terminating scopes, but missed it for the lhs's. This commit addresses this "twist". We now also put the lhs into a terminating scope. The drop order of the above expressions becomes `1,2,3,4`. There might be code relying on the current order, and therefore I'd recommend doing a crater run to gauge the impact. I'd argue that such code is already quite wonky as it is one `foo() &&` addition away from breaking. ~~For the impact, I don't expect any *build* failures, as the compiler gets strictly more tolerant: shortening the lifetime of temporaries only expands the list of programs the compiler accepts as valid. There might be *runtime* failures caused by this change however.~~ Edit: both build and runtime failures are possible, e.g. see the example provided by dtolnay [below](https://github.com/rust-lang/rust/pull/103293#issuecomment-1285341113). Edit2: the crater run has finished and [results](https://github.com/rust-lang/rust/pull/103293#issuecomment-1292275203) are that there is only one build failure which is easy to fix with a +/- 1 line diff. I've included a testcase that now compiles thanks to this patch. The breakage is also limited to drop order relative to conditionals in the && chain: that is, in code like this: ```Rust let hello = foo().hi() && bar().world(); println!("hi"); ``` we already drop the temporaries of `foo().hi()` before we reach "hi". I'd ideally have this PR merged before let chains are stabilized. If this PR is taking too long, I'd love to have a more restricted version of this change limited to `&&`'s in let chains: the `&&`'s of such chains are quite special anyways as they accept `let` bindings, in there the `&&` is therefore more a part of the "if let chain" construct than a construct of its own. Fixes #103107 Status: waiting on [this accepted FCP](https://github.com/rust-lang/rust/pull/103293#issuecomment-1293411354) finishing.
2022-12-04Update crossbeambjorn3-12/+10
This removes a lazy_static dependency edge
2022-12-04Update rayon to 1.6bjorn3-5/+4
This removes an autocfg dependency edge
2022-12-04Update pretty_assertions to 1.3bjorn3-13/+10
This replaces ansi_term with yansi which in turn removes a winapi dependency edge
2022-12-04Rollup merge of #105237 - JohnTitor:issue-79450, r=oli-obkMatthias Krüger-0/+32
Add regression test for #79450 Closes #79450 r? `@oli-obk` Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-04Rollup merge of #105142 - nbdd0121:inline_const, r=petrochenkovMatthias Krüger-0/+25
Make inline const block `ExprWithBlock` Fix https://github.com/rust-lang/rust/pull/104087#issuecomment-1324190817 `@rustbot` label: +T-lang +F-inline_const
2022-12-04Rollup merge of #105123 - BlackHoleFox:fixing-the-macos-deployment, r=oli-obkMatthias Krüger-0/+25
Fix passing MACOSX_DEPLOYMENT_TARGET to the linker I messed up in https://github.com/rust-lang/rust/pull/103929 when merging the two base files together and as a result, started ignoring `MACOSX_DEPLOYMENT_TARGET` at the linker level. This ended up being the cause of nighty builds not running on older macOS versions. My original hope with the previous PR was that CI would have caught something like that but there were only tests checking the compiler target definitions in codegen tests. Because of how badly this sucks to break, I put together a new test via `run-make` that actually confirms the deployment target set makes it to the linker instead of just LLVM. Closes https://github.com/rust-lang/rust/issues/104570 (for real this time)
2022-12-04Rollup merge of #104856 - luqmana:associated-const-bad-suggestion, ↵Matthias Krüger-7/+1
r=compiler-errors Don't suggest associated function call for associated const. Fixes #104801. r? `@compiler-errors`
2022-12-04Use parent function WfCheckingContext to check RPITIT.Camille GILLOT-58/+47
2022-12-04Also avoid creating a terminating scope in mixed chainsest31-0/+19
This avoids creation of a terminating scope in chains that contain both && and ||, because also there we know that a terminating scope is not neccessary: all the chain members are already in such terminating scopes. Also add a mixed && / || test.
2022-12-04Auto merge of #104757 - camelid:consolidate-lints, ↵bors-505/+441
r=GuillaumeGomez,jyn514,Manishearth Consolidate rustdoc's lint passes into a single pass This should improve performance and simplify the code. r? `@GuillaumeGomez`
2022-12-04Add regression test for #79450Yuki Okushi-0/+32
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-04Add regression test for #47814Yuki Okushi-0/+28
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-12-04Auto merge of #105217 - jyn514:submodule-fixes, r=bjorn3bors-2/+15
Don't exit with an error if there are no changes to submodules Fixes https://github.com/rust-lang/rust/issues/105215, which regressed in https://github.com/rust-lang/rust/pull/104865.
2022-12-03Remove drop order twist of && and || and make them associativeest31-7/+108
Previously a short circuiting && chain would drop the first element after all the other elements, and otherwise follow evaluation order, so code like: f(1).g() && f(2).g() && f(3).g() && f(4).g() would drop the temporaries in the order 2,3,4,1. This made && and || non-associative regarding drop order, so adding ()'s to the expression would change drop order: f(1).g() && (f(2).g() && f(3).g()) && f(4).g() for example would drop in the order 3,2,4,1. As, except for the bool result, there is no data returned by the sub-expressions of the short circuiting binops, we can safely discard of any temporaries created by the sub-expr. Previously, code was already putting the rhs's into terminating scopes, but missed it for the lhs's. This commit addresses this "twist". In the expression, we now also put the lhs into a terminating scope. The drop order for the above expressions is 1,2,3,4 now.
2022-12-03Auto merge of #105218 - matthiaskrgr:rollup-8d3k08n, r=matthiaskrgrbors-913/+1196
Rollup of 9 pull requests Successful merges: - #104199 (Keep track of the start of the argument block of a closure) - #105050 (Remove useless borrows and derefs) - #105153 (Create a hacky fail-fast mode that stops tests at the first failure) - #105164 (Restore `use` suggestion for `dyn` method call requiring `Sized`) - #105193 (Disable coverage instrumentation for naked functions) - #105200 (Remove useless filter in unused extern crate check.) - #105201 (Do not call fn_sig on non-functions.) - #105208 (Add AmbiguityError for inconsistent resolution for an import) - #105214 (update Miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-03Properly substitute inherent associated types.Camille GILLOT-0/+15
2022-12-03Auto merge of #105212 - pietroalbini:pa-macos-xl, r=jyn514bors-1/+1
Switch to the `macos-12-xl` builder This PR switches us to the `macos-12-xl` builders, a more powerful builder pool managed by GitHub for us.
2022-12-03Rollup merge of #105214 - RalfJung:miri, r=RalfJungMatthias Krüger-907/+1073
update Miri r? `@ghost`
2022-12-03Rollup merge of #105208 - chenyukang:yukang/fix-105069, r=cjgillotMatthias Krüger-0/+32
Add AmbiguityError for inconsistent resolution for an import Fixes #105069 Fixes #83950
2022-12-03Rollup merge of #105201 - cjgillot:issue-105040, r=compiler-errorsMatthias Krüger-0/+32
Do not call fn_sig on non-functions. Fixes https://github.com/rust-lang/rust/issues/105040 Fixes https://github.com/rust-lang/rust/issues/89271
2022-12-03Rollup merge of #105200 - cjgillot:issue-104562, r=compiler-errorsMatthias Krüger-0/+22
Remove useless filter in unused extern crate check. Fixes https://github.com/rust-lang/rust/issues/104562
2022-12-03Rollup merge of #105193 - tmiasko:naked-nocoverage, r=wesleywiserMatthias Krüger-0/+19
Disable coverage instrumentation for naked functions Fixes #105170.
2022-12-03Rollup merge of #105164 - compiler-errors:revert-import-filter, r=estebankMatthias Krüger-6/+15
Restore `use` suggestion for `dyn` method call requiring `Sized` Add the suggestion back that I accidentally removed in 88f2140d8736329610a4c0bd8000e164c9170537 because I didn't understand that suggestion was actually useful... Fixes #105159
2022-12-03Rollup merge of #105153 - oli-obk:fail_faster, r=compiler-errorsMatthias Krüger-0/+1
Create a hacky fail-fast mode that stops tests at the first failure This is useful for not having to wait until all 10k+ ui tests have finished running and then having to crawl through hundreds of failure reports. You now only get the first report when you turn on that env var and no new tests are run at all This works like a charm, but is obviously welded on very crudely
2022-12-03Rollup merge of #104199 - SarthakSingh31:issue-97417-1, r=cjgillotMatthias Krüger-0/+2
Keep track of the start of the argument block of a closure This removes a call to `tcx.sess.source_map()` from [compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs](https://github.com/rust-lang/rust/compare/master...SarthakSingh31:issue-97417-1?expand=1#diff-8406bbc0d0b43d84c91b1933305df896ecdba0d1f9269e6744f13d87a2ab268a) as required by #97417. VsCode automatically applied `rustfmt` to the files I edited under `src/tools`. I can undo that if its a problem. r? `@cjgillot`
2022-12-03Don't exit with an error if there are no changes to submodulesJoshua Nelson-2/+15
2022-12-03Auto merge of #97485 - bjorn3:new_archive_writer, r=wesleywiserbors-12/+13
Rewrite LLVM's archive writer in Rust This allows it to be used by other codegen backends. Fixes https://github.com/bjorn3/rustc_codegen_cranelift/issues/1155
2022-12-03switch to the macos-12-xl builderPietro Albini-1/+1
2022-12-03fix #101749, use . instead of :: when accessing a method of an objectyukang-51/+128
2022-12-03fix #105069, Add AmbiguityError for inconsistent resolution for an importyukang-0/+32
2022-12-03parser: fix ICE with invalid variable declaration in macro callYutaro Ohno-0/+52
Fix ICE on parsing an invalid variable declaration as a statement like: ``` macro_rules! m { ($s:stmt) => {} } m! { var x } ```
2022-12-03clippyRalf Jung-42/+15
2022-12-03Auto merge of #105183 - GuillaumeGomez:merge-and-dedup-predicates, r=notriddlebors-39/+117
Merge generics and where predicates and prevent duplicates in where predicates Part of #104886 (I didn't include bounds from parent trait yet as I think the PR is already big enough). Also we'll need to run a perf check. cc `@fmease` since you worked a bit on this. r? `@notriddle`
2022-12-03Do not call fn_sig on non-functions.Camille GILLOT-0/+32
2022-12-03Remove useless filter in unused extern crate check.Camille GILLOT-0/+22
2022-12-03Auto merge of #105196 - JohnTitor:rollup-8rxqnq6, r=JohnTitorbors-69/+175
Rollup of 7 pull requests Successful merges: - #104903 (Use ocx.normalize in report_projection_error) - #105032 (improve doc of into_boxed_slice and impl From<Vec<T>> for Box<[T]>) - #105100 (Add missing intra-doc link) - #105181 (Don't add a note for implementing a trait if its inner type is erroneous) - #105182 (Rustdoc-Json: Don't inline foreign traits) - #105188 (Don't elide type information when printing E0308 with `-Zverbose`) - #105189 (rustdoc: clean up redundant CSS on `.rustdoc-toggle.hideme`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-12-03Rollup merge of #105189 - notriddle:notriddle/rustdoc-toggle-hideme, ↵Yuki Okushi-8/+2
r=GuillaumeGomez rustdoc: clean up redundant CSS on `.rustdoc-toggle.hideme`
2022-12-03Rollup merge of #105188 - compiler-errors:verbose-ty-err, r=TaKO8KiYuki Okushi-0/+34
Don't elide type information when printing E0308 with `-Zverbose` When we pass `-Zverbose`, we kinda expect for all `_` to be replaced with more descriptive information, for example -- ``` = note: expected fn pointer `fn(_, u32)` found fn item `fn(_, i32) {foo}` ``` Where `_` is the "identical" part of the fn signatures, now gets rendered as: ``` = note: expected fn pointer `fn(i32, u32)` found fn item `fn(i32, i32) {foo}` ```