about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-09-09fix #101097, avoid infinite loop in fn arguments checkingchenyukang-4/+185
2022-09-08Avoid infinite loop in function arguments checkingyukang-0/+133
2022-09-06Auto merge of #101479 - Dylan-DPC:rollup-v8ite0y, r=Dylan-DPCbors-0/+91
Rollup of 5 pull requests Successful merges: - #100658 (TyCtxt::get_attr should check that no duplicates are allowed) - #101021 (Migrate ``rustc_middle`` diagnostic) - #101287 (Document eager evaluation of `bool::then_some` argument) - #101412 (Some more cleanup in `core`) - #101427 (Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-06Rollup merge of #101427 - compiler-errors:issue-101421, r=cjgillotDylan DPC-0/+71
Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments Fixes #101421 cc #100838
2022-09-06Rollup merge of #100658 - chenyukang:100631-check-get-attr, r=lcnrDylan DPC-0/+20
TyCtxt::get_attr should check that no duplicates are allowed Fixes #100631
2022-09-06Auto merge of #101362 - compiler-errors:unnecessary-let, r=cjgillotbors-0/+31
Suggest removing unnecessary prefix let in patterns Helps with #101291, though I think `@estebank` probably wants this: > Finally, I think it'd be nice if we could detect that we don't know for sure and "just" swallow the rest of the expression (find the next ; accounting for nested braces) or the end of the item (easier). ... to be implemented before we close that issue out completely.
2022-09-06get_attr should check that no duplicates are allowedyukang-0/+20
2022-09-06Auto merge of #101359 - ↵bors-3/+1
compiler-errors:cannot-call-trait-object-with-unsized-return, r=lcnr Point out when a callable is not actually callable because its return is not sized Fixes #100755 I didn't add a UI test for that one because it's equivalent to the UI test that already exists in the suite.
2022-09-06Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillotbors-108/+102
`BindingAnnotation` refactor * `ast::BindingMode` is deleted and replaced with `hir::BindingAnnotation` (which is moved to `ast`) * `BindingAnnotation` is changed from an enum to a tuple struct e.g. `BindingAnnotation(ByRef::No, Mutability::Mut)` * Associated constants added for convenience `BindingAnnotation::{NONE, REF, MUT, REF_MUT}` One goal is to make it more clear that `BindingAnnotation` merely represents syntax `ref mut` and not the actual binding mode. This was especially confusing since we had `ast::BindingMode`->`hir::BindingAnnotation`->`thir::BindingMode`. I wish there were more symmetry between `ByRef` and `Mutability` (variant) naming (maybe `Mutable::Yes`?), and I also don't love how long the name `BindingAnnotation` is, but this seems like the best compromise. Ideas welcome.
2022-09-06Auto merge of #101464 - JohnTitor:rollup-unsjgm6, r=JohnTitorbors-0/+344
Rollup of 7 pull requests Successful merges: - #99291 (Add let else drop order tests) - #101402 (Add a Machine hook for inline assembly) - #101404 (Fix cleanup for uninitialized stdout) - #101418 (Revert "Mention rust-analyzer maintainers when `proc_macro` bridge is changed") - #101425 (Point at type parameter in plain path expr) - #101426 (Don't duplicate file descriptors into stdio fds) - #101447 (Remove generics_def_id_map from the resolver.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-06Rollup merge of #101425 - compiler-errors:point-at-ty-param, r=spastorinoYuki Okushi-0/+23
Point at type parameter in plain path expr Slightly better error message for a kinda unique use case.
2022-09-06Rollup merge of #99291 - est31:let_else_tests, r=joshtriplettYuki Okushi-0/+321
Add let else drop order tests Add a systematic matrix based test that checks temporary drop order in various settings, `let-else-drop-order.rs`, as requested [here](https://github.com/rust-lang/rust/pull/93628#issuecomment-1055738523). The drop order of let and let else is supposed to be the and in order to ensure this, the test checks that this holds for a number of cases. The test also ensures that we drop the temporaries of the condition before executing the else block. cc #87335 tracking issue for `let else`
2022-09-05Auto merge of #101460 - rust-lang:update-cargo, r=ehussbors-0/+0
Update cargo 8 commits in 4ed54cecce3ce9ab6ff058781f4c8a500ee6b8b5..646e9a0b9ea8354cc409d05f10e8dc752c5de78e 2022-08-27 18:41:39 +0000 to 2022-09-02 14:29:28 +0000 - Support inheriting jobserver fd for external subcommands (rust-lang/cargo#10511) - refactor(cli): Lazy load config (rust-lang/cargo#11029) - chore: Don't show genned docs in ripgrep (rust-lang/cargo#11040) - Document private items for Cargo and publish under contributor guide (rust-lang/cargo#11019) - Add names to CI jobs (rust-lang/cargo#11039) - Rework test error handling (rust-lang/cargo#11028) - Very slight `cargo add` documentation improvements (rust-lang/cargo#11033) - Update compiling requirements. (rust-lang/cargo#11030)
2022-09-05Point out when a callable is not actually callable because its return is not ↵Michael Goulet-3/+1
sized
2022-09-05Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr ↵Michael Goulet-0/+71
arguments
2022-09-05Update cargoWeihang Lo-0/+0
8 commits in 4ed54cecce3ce9ab6ff058781f4c8a500ee6b8b5..646e9a0b9ea8354cc409d05f10e8dc752c5de78e 2022-08-27 18:41:39 +0000 to 2022-09-02 14:29:28 +0000 - Support inheriting jobserver fd for external subcommands (rust-lang/cargo#10511) - refactor(cli): Lazy load config (rust-lang/cargo#11029) - chore: Don't show genned docs in ripgrep (rust-lang/cargo#11040) - Document private items for Cargo and publish under contributor guide (rust-lang/cargo#11019) - Add names to CI jobs (rust-lang/cargo#11039) - Rework test error handling (rust-lang/cargo#11028) - Very slight `cargo add` documentation improvements (rust-lang/cargo#11033) - Update compiling requirements. (rust-lang/cargo#11030)
2022-09-05Auto merge of #101261 - TaKO8Ki:separate-receiver-from-arguments-in-hir, ↵bors-609/+700
r=cjgillot Separate the receiver from arguments in HIR Related to #100232 cc `@cjgillot`
2022-09-05use `propagate_through_exprs` instead of `propagate_through_expr`Takayuki Maeda-28/+24
fix `ExprKind` static_assert_size fix hir-stats
2022-09-05Auto merge of #101228 - nnethercote:simplify-hir-PathSegment, r=petrochenkovbors-22/+19
Simplify `hir::PathSegment` r? `@petrochenkov`
2022-09-05refactor: remove unnecessary variablesTakayuki Maeda-76/+67
2022-09-05separate the receiver from arguments in HIR under /clippyTakayuki Maeda-558/+662
2022-09-05separate the receiver from arguments in HIRTakayuki Maeda-1/+1
2022-09-05Add matrix based test for documenting the let / let else temporary drop orderest31-0/+321
The drop order of let and let else is supposed to be the same, and in order to ensure this, the test checks that this holds for the given list of cases. The test also ensures that we drop the temporaries of the condition before executing the else block. We made the test matrix based so it can check all the possible combinations and find out possible edge cases.
2022-09-05Auto merge of #101439 - Dylan-DPC:rollup-2wf1mtj, r=Dylan-DPCbors-160/+361
Rollup of 6 pull requests Successful merges: - #101142 (Improve HIR stats) - #101367 (Suggest `{Option,Result}::{copied,clone}()` to satisfy type mismatch) - #101391 (more clippy::perf fixes) - #101409 (Don't fire `rust_2021_incompatible_closure_captures` in `edition = 2021` crates) - #101420 (Fix `hir::Local` doc to match with the variable name used: `init`) - #101429 (Don't suggest reborrow if usage is inside a closure) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-09-05Rollup merge of #101429 - compiler-errors:issue-101119, r=lcnrDylan DPC-0/+31
Don't suggest reborrow if usage is inside a closure I can't think of why we would ever be able to *successfully* suggest a mutable reborrow `&mut *` due to a move happening due to a closure, so just suppress it. Fixes #101119
2022-09-05Rollup merge of #101409 - ↵Dylan DPC-0/+15
WaffleLapkin:rust_2021_compatibility_no_warn_in_2021_crates, r=TaKO8Ki Don't fire `rust_2021_incompatible_closure_captures` in `edition = 2021` crates Fixes #101284
2022-09-05Rollup merge of #101391 - matthiaskrgr:perf0309, r=oli-obkDylan DPC-3/+3
more clippy::perf fixes
2022-09-05Rollup merge of #101367 - compiler-errors:suggest-copied-or-cloned, r=lcnrDylan DPC-0/+129
Suggest `{Option,Result}::{copied,clone}()` to satisfy type mismatch Fixes #100699, but in the opposite direction (instead of suggesting to fix the signature, it fixes the body)
2022-09-05Rollup merge of #101142 - nnethercote:improve-hir-stats, r=davidtwcoDylan DPC-157/+183
Improve HIR stats #100398 improve the AST stats collection done by `-Zhir-stats`. This PR does the same for HIR stats collection. r? `@davidtwco`
2022-09-05Auto merge of #101414 - mystor:pm_nested_cross_thread, r=eddybbors-3/+20
proc_macro/bridge: use the cross-thread executor for nested proc-macros While working on some other changes in the bridge, I noticed that when running a nested proc-macro (which is currently only possible using the unstable `TokenStream::expand_expr`), any symbols held by the proc-macro client would be invalidated, as the same thread would be used for the nested macro by default, and the interner doesn't handle nested use. After discussing with `@eddyb,` we decided the best approach might be to force the use of the cross-thread executor for nested invocations, as it will never re-use thread-local storage, avoiding the issue. This shouldn't impact performance, as expand_expr is still unstable, and infrequently used. This was chosen rather than making the client symbol interner handle nested invocations, as that would require replacing the internal interner `Vec` with a `BTreeMap` (as valid symbol id ranges could now be disjoint), and the symbol interner is known to be fairly perf-sensitive. This patch adds checks to the execution strategy to use the cross-thread executor when doing nested invocations. An alternative implementation strategy could be to track this information in the `ExtCtxt`, however a thread-local in the `proc_macro` crate was chosen to add an assertion so that `rust-analyzer` is aware of the issue if it implements `expand_expr` in the future. r? `@eddyb`
2022-09-05Don't suggest reborrow if usage is inside a closureMichael Goulet-0/+31
2022-09-05Make `hir::PathSegment::hir_id` non-optional.Nicholas Nethercote-18/+16
2022-09-05Make `hir::PathSegment::res` non-optional.Nicholas Nethercote-4/+3
2022-09-05Auto merge of #101386 - aDotInTheVoid:rdj-discriminant, r=GuillaumeGomezbors-21/+213
Rustdoc-Json: Add enum discriminant Does the first part of #101337, by adding it to `clean`, but doesn't change HTML output, as 1. [No Consensus has appeared on the UI for this](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Enum.20discriminant.20values.20in.20HTML.20output) 2. [When inlining across crates, information is lost](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.60clean_variant_def.20.60vs.20.60clean_variant_data.60) JSON doesn't have either of these limitations. r? `@GuillaumeGomez`
2022-09-05Auto merge of #100759 - fee1-dead-contrib:const_eval_select_real_intrinsic, ↵bors-70/+89
r=oli-obk,RalfJung Make `const_eval_select` a real intrinsic This fixes issues where `track_caller` functions do not have nice panic messages anymore when there is a call to the function, and uses the MIR system to replace the call instead of dispatching via lang items. Fixes #100696.
2022-09-04Point at type parameter in plain path exprMichael Goulet-0/+23
2022-09-04proc_macro/bridge: use the cross-thread executor for nested proc-macrosNika Layzell-3/+20
While working on some other changes in the bridge, I noticed that when running a nested proc-macro (which is currently only possible using the unstable `TokenStream::expand_expr`), any symbols held by the proc-macro client would be invalidated, as the same thread would be used for the nested macro by default, and the interner doesn't handle nested use. After discussing with @eddyb, we decided the best approach might be to force the use of the cross-thread executor for nested invocations, as it will never re-use thread-local storage, avoiding the issue. This shouldn't impact performance, as expand_expr is still unstable, and infrequently used. This was chosen rather than making the client symbol interner handle nested invocations, as that would require replacing the internal interner `Vec` with a `BTreeMap` (as valid symbol id ranges could now be disjoint), and the symbol interner is known to be fairly perf-sensitive. This patch adds checks to the execution strategy to use the cross-thread executor when doing nested invocations. An alternative implementation strategy could be to track this information in the `ExtCtxt`, however a thread-local in the `proc_macro` crate was chosen to add an assertion so that `rust-analyzer` is aware of the issue if it implements `expand_expr` in the future. r? @eddyb
2022-09-04Rollup merge of #101407 - GuillaumeGomez:rm-duplicated-gui-test, r=Dylan-DPCMatthias Krüger-22/+0
Remove duplicated test (superseeded by search-form-elements.goml) I realized it when I worked on https://github.com/rust-lang/rust/pull/101348. The checks are more complete in `search-form-elements.goml` (for example [here](https://github.com/rust-lang/rust/blob/master/src/test/rustdoc-gui/search-form-elements.goml#L12-L29)). r? `@Dylan-DPC`
2022-09-04Rollup merge of #101401 - mx00s:expand-const, r=fee1-deadMatthias Krüger-10/+20
Make `char::is_lowercase` and `char::is_uppercase` const Implements #101400.
2022-09-04Rollup merge of #101397 - notriddle:notriddle/source-nav-not-sidebar-sub, ↵Matthias Krüger-4/+0
r=GuillaumeGomez rustdoc: remove redundant mobile-sized `.source nav:not(.sidebar).sub` It's redundant because there's already a selector `.source nav.sub` with exactly the same margin-left at [line 796]. [line 796]: https://github.com/rust-lang/rust/blob/84f0c3f79a85329dd79a54694ff8a7f427c842e9/src/librustdoc/html/static/css/rustdoc.css#L796 This selector was added in 1e98fb10274ea0245f865ddb1e295e454382000b, along with an identical desktop selector, but that desktop selector was removed in 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c as part of a larger simplification.
2022-09-04Rollup merge of #101388 - compiler-errors:issue-101376, r=fee1-deadMatthias Krüger-0/+35
Don't delay invalid LHS bug unless it will be covered by an error in `check_overloaded_binop` Fixes #101376
2022-09-04Rollup merge of #101322 - ChrisDenton:internal-doc, r=Mark-SimulacrumMatthias Krüger-1/+2
Fix internal doc link The doc link from `DedupSortedIter` to `BTreeMap::bulk_build_from_sorted_iter` was broken when building internal documentation, This prevented me from building internal documentation locally: ``` R:\Rust\rust> $env:RUSTDOCFLAGS="--document-private-items" R:\Rust\rust> x doc library/std --open --stage 0 Building rustbuild Compiling bootstrap v0.0.0 (R:\Rust\rust\src\bootstrap) Finished dev [unoptimized] target(s) in 3.15s Documenting stage0 std (x86_64-pc-windows-msvc) Documenting core v0.0.0 (R:\Rust\rust\library\core) Finished release [optimized] target(s) in 36.42s Checking core v0.0.0 (R:\Rust\rust\library\core) Checking rustc-std-workspace-core v1.99.0 (R:\Rust\rust\library\rustc-std-workspace-core) Checking compiler_builtins v0.1.79 Documenting alloc v0.0.0 (R:\Rust\rust\library\alloc) error: unresolved link to `BTreeMap::bulk_build_from_sorted_iter` --> library\alloc\src\collections\btree\dedup_sorted_iter.rs:6:15 | 6 | /// Used by [`BTreeMap::bulk_build_from_sorted_iter`]. | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no item named `BTreeMap` in scope | = note: `-D rustdoc::broken-intra-doc-links` implied by `-D warnings` error: could not document `alloc` ```
2022-09-04Don't fire `rust_2021_incompatible_closure_captures` in edition = 2021Maybe Waffle-0/+15
2022-09-04Test internal documentationChris Denton-1/+2
2022-09-04Address feedback from PR #101401Sage Mitchell-4/+8
2022-09-04Make `char::is_lowercase` and `char::is_uppercase` constSage Mitchell-10/+16
Implements #101400.
2022-09-04Remove duplicated test (superseeded by search-form-elements.goml)Guillaume Gomez-22/+0
2022-09-04Auto merge of #101296 - compiler-errors:head-span-for-enclosing-scope, r=oli-obkbors-266/+189
Use head span for `rustc_on_unimplemented`'s `enclosing_scope` attr This may make #101281 slightly easier to understand
2022-09-04Make `const_eval_select` a real intrinsicDeadbeef-70/+89
2022-09-04rustdoc: Compute enum discriminant on demandNixon Enraght-Moony-24/+28