about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-06-12Rollup merge of #97920 - bjorn3:test_annotation_fixes, r=Dylan-DPCMichael Goulet-3/+5
Fix some test annotations These are necessary for running the rustc test suite with cg_clif.
2022-06-12Fix some test annotationsbjorn3-3/+5
These are necessary for running the rustc test suite with cg_clif
2022-06-12Rollup merge of #98012 - compiler-errors:poly-trait-refs-are-traits, r=cjgillotDylan DPC-28/+28
`ValuePairs::PolyTraitRefs` should be called "trait"s in type error diagnostics Pretty simple, we already do this for `ValuePairs::TraitRefs`...
2022-06-12Auto merge of #97993 - lengyijun:clean-variance, r=compiler-errorsbors-9/+9
clean variance test Remove unnecessary generic parameter.
2022-06-12Auto merge of #97778 - compiler-errors:misc-diagnostics-tidy, r=cjgillotbors-14/+80
Tidy up miscellaneous bounds suggestions Just some small fixes to suggestions - Generalizes `Ty::is_suggestable` into a `TypeVisitor`, so that it can be called on things other than `Ty` - Makes `impl Trait` in arg position no longer suggestible (generalizing the fix in #97640) - Fixes `impl Trait` not being replaced with fresh type param when it's deeply nested in function signature (fixes #97760) - Fixes some poor handling of `where` clauses with no predicates (also #97760) - Uses `InferCtxt::resolve_numeric_literals_with_default` so we suggest `i32` instead of `{integer}` (fixes #97677) Sorry there aren't many tests the fixes. Most of them would just be duplicates of other tests with empty `where` clauses or `impl Trait` in arg position instead of generic params. Let me know if you'd want more test coverage.
2022-06-11Properly replace `impl Trait` in fn args, turn {integer} to i32Michael Goulet-0/+49
2022-06-11Handle empty where-clause betterMichael Goulet-14/+31
2022-06-11ValuePairs::PolyTraitRefs should be called 'trait'Michael Goulet-28/+28
2022-06-11Auto merge of #97705 - compiler-errors:guide-inference, r=lcnrbors-0/+31
Fix inference issues with unconstrained base expr in `type_changing_struct_update` Use fresh infer vars to guide inference along in `type_changing_struct_update`. Fixes #96878
2022-06-11Auto merge of #95880 - cjgillot:def-ident-span, r=petrochenkovbors-92/+189
Handle `def_ident_span` like `def_span`. `def_ident_span` had an ad-hoc status in the compiler. This PR refactors it to be a first-class citizen like `def_span`: - it gets encoded in the main metadata loop, instead of the visitor; - its implementation is updated to mirror the one of `def_span`. We do not remove the `Option` in the return type, since some items do not have an ident, AnonConsts for instance.
2022-06-11Auto merge of #97996 - matthiaskrgr:rollup-bvbjlid, r=matthiaskrgrbors-0/+5
Rollup of 5 pull requests Successful merges: - #97904 (Small grammar fix in the compile_error documentation) - #97943 (line 1352, change `self` to `*self`, other to `*other`) - #97969 (Make -Cpasses= only apply to pre-link optimization) - #97990 (Add more eslint checks) - #97994 (feat(fix): update some links in `hir.rs`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-11Guide inference along during type_changing_struct_updateMichael Goulet-0/+31
2022-06-11Rollup merge of #97990 - GuillaumeGomez:eslint-checks, r=Dylan-DPCMatthias Krüger-0/+5
Add more eslint checks List of newly added checks: * [no-lonely-if](https://eslint.org/docs/rules/no-lonely-if) * [no-mixed-operators](https://eslint.org/docs/rules/no-mixed-operators) * [no-multi-assign](https://eslint.org/docs/rules/no-multi-assign) * [no-return-assign](https://eslint.org/docs/rules/no-return-assign) * [no-script-url](https://eslint.org/docs/rules/no-script-url) r? `@Dylan-DPC`
2022-06-11Auto merge of #97989 - Dylan-DPC:rollup-wol1a1y, r=Dylan-DPCbors-8/+17
Rollup of 5 pull requests Successful merges: - #97761 (validating the vtable can lead to Stacked Borrows errors) - #97789 (Fix #71363's test by adding `-Z translate-remapped-path-to-local-path=no`) - #97913 (Wrap `HirId`s of locals into `LocalVarId`s for THIR nodes) - #97979 (Fix typos in Provider API docs) - #97987 (remove an unnecessary `String`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-11clean variance testlengyijun-9/+9
2022-06-11Add eslint rule "no-script-url"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-return-assign"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-multi-assign"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-mixed-operator"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-lonely-if"Guillaume Gomez-0/+1
2022-06-11Rollup merge of #97789 - ferrocene:pa-fix-issue-71363-test, r=cjgillotDylan DPC-8/+17
Fix #71363's test by adding `-Z translate-remapped-path-to-local-path=no` The test relies on `library/std/src/error.rs` not corresponding to a local path, but remapping might still find the related local file of a remapped path. To fix the test, this PR adds a new `-Z` flag to disable finding the corresponding local path of a remapped path.
2022-06-11Auto merge of #97903 - est31:unused_macro_rules_compile_error, r=petrochenkovbors-0/+113
Never regard macro rules with compile_error! invocations as unused The very point of compile_error! is to never be reached, and one of the use cases of the macro, currently also listed as examples in the documentation of compile_error, is to create nicer errors for wrong macro invocations. Thus, we should never warn about unused macro arms that contain invocations of compile_error. See also https://github.com/rust-lang/rust/pull/96150#issuecomment-1126599107 and the discussion after that. Furthermore, the PR also contains two commits to silence `unused_macro_rules` when a macro has an invalid rule, and to add a test that `unused_macros` does not behave badly in the same situation. r? `@petrochenkov` as I've talked to them about this
2022-06-11Auto merge of #97980 - Dylan-DPC:rollup-l8exe4b, r=Dylan-DPCbors-161/+319
Rollup of 6 pull requests Successful merges: - #96868 (Stabilize explicit_generic_args_with_impl_trait) - #97703 (some additional `need_type_info.rs` cleanup) - #97812 (Suggest to swap a struct and a trait in trait impls) - #97958 (ExitStatus docs fixups) - #97967 (Mention `infer::Trace` methods on `infer::At` methods' docs) - #97972 (Update #[doc(html_playground_url)] documentation to mention what the request will be) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-11Rollup merge of #97972 - hamza1311:patch-1, r=Dylan-DPCDylan DPC-1/+3
Update #[doc(html_playground_url)] documentation to mention what the request will be The [documentation for `#![doc(html_playground_url = "_")]`](https://doc.rust-lang.org/rustdoc/write-documentation/the-doc-attribute.html#html_playground_url) specifies that a request will be made to the given URL but does specify what the contents of the request will be. This PR updates the documentation to include the query parameters through which the code is provided to the playground.
2022-06-11Rollup merge of #97812 - TaKO8Ki:suggest-to-swap-struct-and-trait, r=estebankDylan DPC-0/+143
Suggest to swap a struct and a trait in trait impls closes #89590
2022-06-11Rollup merge of #97703 - lcnr:post-89862, r=estebankDylan DPC-10/+164
some additional `need_type_info.rs` cleanup also fixes #97698, fixes #97806 cc `@estebank`
2022-06-11Rollup merge of #96868 - nrc:turbo-stable, r=jhpratt,nbdd0121,nagisaDylan DPC-150/+9
Stabilize explicit_generic_args_with_impl_trait This is a stabilisation PR for `explicit_generic_args_with_impl_trait`. * [tracking issue](https://github.com/rust-lang/rust/issues/83701) - [Stabilisation report](https://github.com/rust-lang/rust/issues/83701#issuecomment-1109949897) - [FCP entered](https://github.com/rust-lang/rust/issues/83701#issuecomment-1120285703) * [implementation PR](https://github.com/rust-lang/rust/pull/86176) * [Reference PR](https://github.com/rust-lang/reference/pull/1212) * There is no mention of using the turbofish operator in the book (other than an entry in the operator list in the appendix), so there is no documentation to change/add there, unless we felt like we should add a section on using turbofish, but that seems orthogonal to `explicit_generic_args_with_impl_trait`
2022-06-11Auto merge of #97905 - nnethercote:revert-infallible-encoder, r=bjorn3bors-15/+15
Revert part of #94372 to improve performance #94732 was supposed to give small but widespread performance improvements, as judged from three per-merge performance runs. But the performance run that occurred after merging included a roughly equal number of improvements and regressions, for unclear reasons. This PR is for a test run reverting those changes, to see what happens. r? `@ghost`
2022-06-11Update the-doc-attribute.mdMuhammad Hamza-2/+2
2022-06-11Update the-doc-attribute.mdMuhammad Hamza-1/+3
2022-06-10Rollup merge of #97957 - estebank:spancito, r=compiler-errorsMatthias Krüger-9/+18
Make `std::` prefix suggestion test `run-rustfix`
2022-06-10Bless tests.Camille GILLOT-92/+189
2022-06-11Add regression test for #54378Yuki Okushi-0/+26
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
2022-06-10Auto merge of #96837 - tmiasko:stdio-fcntl, r=joshtriplettbors-0/+46
Use `fcntl(fd, F_GETFD)` to detect if standard streams are open In the previous implementation, if the standard streams were open, but the RLIMIT_NOFILE value was below three, the poll would fail with EINVAL: > ERRORS: EINVAL The nfds value exceeds the RLIMIT_NOFILE value. Switch to the existing fcntl based implementation to avoid the issue. Fixes #96621.
2022-06-10Auto merge of #97939 - JohnTitor:rollup-79pxupb, r=JohnTitorbors-1/+30
Rollup of 6 pull requests Successful merges: - #97718 (Fix `delayed_good_path_bug` ice for expected diagnostics (RFC 2383)) - #97876 (update docs for `std::future::IntoFuture`) - #97888 (Don't use __gxx_personality_v0 in panic_unwind on emscripten target) - #97922 (Remove redundant calls to reserve in impl Write for VecDeque) - #97927 (Do not introduce bindings for types and consts in HRTB.) - #97937 (Fix a typo in `test/ui/hrtb/hrtb-just-for-static.rs`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-10Rollup merge of #97937 - TaKO8Ki:fix-typo-in-hrtb-just-for-static, r=Dylan-DPCYuki Okushi-1/+1
Fix a typo in `test/ui/hrtb/hrtb-just-for-static.rs` closes #97934
2022-06-10Rollup merge of #97927 - cjgillot:issue-97836, r=petrochenkovYuki Okushi-0/+21
Do not introduce bindings for types and consts in HRTB. Fixes https://github.com/rust-lang/rust/issues/97836 r? `@petrochenkov`
2022-06-10Rollup merge of #97718 - xFrednet:95540-delayed-good-path-ice-for-expect, ↵Yuki Okushi-0/+8
r=wesleywiser Fix `delayed_good_path_bug` ice for expected diagnostics (RFC 2383) Fixes a small ICE with the `delayed_good_path_bug` check. --- r? ``@wesleywiser`` cc: ``@eddyb`` this might be interesting, since you've added a `FIXME` comment above the modified check which kind of discusses a case like this closes: https://github.com/rust-lang/rust/issues/95540 cc: https://github.com/rust-lang/rust/issues/85549
2022-06-10Auto merge of #95818 - petrochenkov:stabundle, r=wesleywiserbors-149/+80
Stabilize the `bundle` native library modifier And remove the legacy `static-nobundle` linking kind. Stabilization report - https://github.com/rust-lang/rust/pull/95818#issuecomment-1120470945. cc #81490 Closes #37403
2022-06-10fix a typoTakayuki Maeda-1/+1
2022-06-10Revert dc08bc51f2c58a0f5f815a07f9bb3d671153b5a1.Nicholas Nethercote-4/+4
2022-06-10Revert b983e42936feab29f6333e9835913afc6b4a394e.Nicholas Nethercote-11/+11
2022-06-09Test that the unused_macros lint works correctly if rules are malformedest31-0/+41
The unused_macro_rules lint had a bug where it would regard all rules of a macro as unused if one rule were malformed. This bug doesn't exist with the unused_macros lint. To ensure it doesn't appear in the future, we add a test for it.
2022-06-09Suppress the unused_macro_rules lint if malformed rules are encounteredest31-0/+19
Prior to this commit, if a macro had any malformed rules, all rules would be reported as unused, regardless of whether they were used or not. So we just turn off unused rule checking completely for macros with malformed rules.
2022-06-09Never regard macro rules with compile_error! invocations as unusedest31-0/+53
The very point of compile_error! is to never be reached, and one of the use cases of the macro, currently also listed as examples in the documentation of compile_error, is to create nicer errors for wrong macro invocations. Thus, we shuuld never warn about unused macro arms that contain invocations of compile_error.
2022-06-09Do not introduce bindings for types and consts in HRTB.Camille GILLOT-0/+21
2022-06-09Stabilize the `bundle` native library modifierVadim Petrochenkov-149/+80
2022-06-09Auto merge of #97911 - dtolnay:numcpu, r=Mark-Simulacrumbors-6/+6
Revert "remove num_cpus dependency" in rustc and update cargo Fixes #97549. This PR reverts #94524 and does a Cargo update to pull in rust-lang/cargo#10737. Rust 1.61.0 has a regression in which it misidentifies the number of available CPUs in some environments, leading to enormously increased memory usage and failing builds. In between Rust 1.60 and 1.61 both rustc and cargo replaced some uses of `num_cpus` with `available_parallelism`, which eliminated support for cgroupv1, still apparently in common use. This PR switches both rustc and cargo back to using `num_cpus` in order to support environments where the available parallelism is controlled by cgroupv1. Both can use `available_parallism` again once it handles cgroupv1 (if ever). I have confirmed that the rustc part of this PR fixes the memory usage regression in my non-Cargo environment, and others have confirmed in #97549 that the Cargo regression was at fault for the memory usage regression in their environments.
2022-06-09Auto merge of #97916 - RalfJung:miri, r=RalfJungbors-8/+12
update Miri Fixes https://github.com/rust-lang/rust/issues/97886 Cc `@rust-lang/miri` r? `@ghost`
2022-06-09update MiriRalf Jung-8/+12