Commit Graph

172673 Commits

Author SHA1 Message Date
Krasimir Georgiev
a89d014a21 llvm-wrapper: adapt for LLVM API change 2022-07-12 16:00:52 +00:00
bors
9ebacd4874 Auto merge of #8703 - aldhsu:add_repeated_where_clause_or_trait_bound, r=flip1995
Add `repeated_where_clause_or_trait_bound` lint

I thought I would try and scratch my own itch for #8674.

1. Is comparing the `Res` the correct way for ensuring we have the same trait?
2. Is there a way to get the spans for the bounds and clauses for suggestions?
I tried to use `GenericParam::bounds_span_for_suggestions` but it only gave me an empty span at the end of the spans.
I tried `WhereClause::span_for_predicates_or_empty_place` and it included the comma.
3. Is there a simpler way to get the trait names? I have used the spans of the traits because I didn't see a way to get it off the `Res` or `Def`.

changelog: Add ``[`repeated_where_clause_or_trait_bound`]`` lint.
2022-07-12 15:48:55 +00:00
Jonas Schievink
2f0172f589 Mention rust-analyzer maintainers when proc_macro bridge is changed 2022-07-12 17:34:07 +02:00
Korlo
7f4e5d8cc4 update pull request template
Improved suggestion for formatting lint names in the template:

    changelog: [`lint_name`]: your change
2022-07-12 17:26:30 +02:00
lcnr
0fc5296876 remove outdated comment 2022-07-12 15:29:32 +02:00
lcnr
baefd42861 arena > Rc for query results 2022-07-12 15:27:24 +02:00
ouz-a
b4c3a2af7b ignore wasm=32 & bless 2022-07-12 16:02:17 +03:00
Maybe Waffle
f89ef3cf66 Comment out expr size check 2022-07-12 16:26:08 +04:00
Maybe Waffle
97fcead242 --bless tests 2022-07-12 16:25:35 +04:00
Maybe Waffle
40ae7b5b8e Parse closure binders
This is first step in implementing RFC 3216.
- Parse `for<'a>` before closures in ast
  - Error in lowering
- Add `closure_lifetime_binder` feature
2022-07-12 16:25:16 +04:00
Allen Hsu
8878d674b1 Lint for repeated traits within trait bounds or where clauses. 2022-07-12 22:03:55 +10:00
bors
1c7b36d4db Auto merge of #99177 - Dylan-DPC:rollup-m0k9q2w, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #98622 (rustc_target: Flip the default for `TargetOptions::executables` to true)
 - #98633 (Fix last `let_chains` blocker)
 - #98972 (Suggest adding a missing zero to a floating point number)
 - #99038 (Some more `EarlyBinder` cleanups)
 - #99154 (use PlaceRef::iter_projections to fix old FIXME)
 - #99171 (Put back UI test regex)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-12 11:36:58 +00:00
Dylan DPC
87e25e4fd0
Rollup merge of #99171 - GuillaumeGomez:rustdoc-ui-test-regex, r=Dylan-DPC
Put back UI test regex

I just realized I overwrote these two commits in https://github.com/rust-lang/rust/pull/99055 when force pushing to fix the stdout output...

r? `@Dylan-DPC`
2022-07-12 17:06:36 +05:30
Dylan DPC
01c24213cb
Rollup merge of #99154 - rosehuds:master, r=cjgillot
use PlaceRef::iter_projections to fix old FIXME

I added this function in 53481a5a8f
2022-07-12 17:06:35 +05:30
Dylan DPC
c0bcbe8a6e
Rollup merge of #99038 - jackh726:earlybinder-cleanup, r=lcnr
Some more `EarlyBinder` cleanups

First commit has a couple unrelated cleanups, but otherwise each commit is self-explanatory

r? rust-lang/types
2022-07-12 17:06:34 +05:30
Dylan DPC
99fc65bc49
Rollup merge of #98972 - TaKO8Ki:suggest-adding-missing-zero-to-floating-point-number, r=compiler-errors
Suggest adding a missing zero to a floating point number

fixes #98836
2022-07-12 17:06:33 +05:30
Dylan DPC
9997c51496
Rollup merge of #98633 - c410-f3r:yet-another-let-chain, r=estebank
Fix last `let_chains` blocker

In order to forbid things like `let x = (let y = 1);` or `if let a = 1 && { let x = let y = 1; } {}`, the parser **HAS** to know the context of `let`.

This context thing is not a surprise in the parser because you can see **a lot** of ad hoc fixes mixing parsing logic with validation logic creating code that looks more like spaghetti with tomato sauce.

To make things even greater, a new ad hoc fix was added to only allow `let`s in a valid `let_chains` context by checking the previously processed token. This was the only solution I could think of and believe me, I thought about it for a long time 👍

In the long term, it should be preferable to segregate different responsibilities or create a more robust and cleaner parser framework.

cc https://github.com/rust-lang/rust/pull/94927
cc https://github.com/rust-lang/rust/issues/53667
2022-07-12 17:06:33 +05:30
Dylan DPC
76153661dc
Rollup merge of #98622 - petrochenkov:executables, r=oli-obk
rustc_target: Flip the default for `TargetOptions::executables` to true

This flag is true for most targets and the remaining targets may be mistakes.
2022-07-12 17:06:32 +05:30
ouz-a
9d86ce6533 add new rval, pull deref early 2022-07-12 14:26:41 +03:00
ouz-a
cb0017f2f8 add new rval, pull deref early 2022-07-12 14:26:41 +03:00
Ding Xiang Fei
947cbda5eb
fix the typo 2022-07-12 13:24:08 +02:00
Laurențiu Nicola
697dfb56c6 ⬆️ rust-analyzer 2022-07-12 14:18:31 +03:00
Deadbeef
e65214785d add more tests 2022-07-12 10:20:55 +00:00
Deadbeef
944c0e23b8 check non_exhaustive attr and private fields for transparent types 2022-07-12 10:20:55 +00:00
Guillaume Gomez
349a3fc6a3 Update -zhelp and -chelp rustdoc-ui tests to use regex-error-pattern 2022-07-12 11:20:36 +02:00
Guillaume Gomez
f515af7e3b Add regex-error-pattern flag in compiletest 2022-07-12 11:19:52 +02:00
Oli Scherer
726919629e Always check Cell alongside with UnsafeCell 2022-07-12 07:29:36 +00:00
Oli Scherer
24e87965ae Use some more visible sigils than , 2022-07-12 07:22:52 +00:00
bors
eabad8ea53 Auto merge of #9149 - kyoto7250:issue_9013, r=Jarcho
change applicability type to MaybeIncorrect in `explicit_counter_loop`

close #9013

This PR changes  applicability type to `MaybeIncorrect`,  because the suggestion is not `MachineApplicable`.

changelog: change applicability type to MaybeIncorrect in `explicit_counter_loop`
2022-07-12 06:43:42 +00:00
Takayuki Maeda
3de6d6bb13 add regression test for #74713 2022-07-12 14:21:09 +09:00
Takayuki Maeda
e03cb7fb9a implement a suggestion for a floating point number with a type suffix 2022-07-12 13:59:51 +09:00
Ralf Jung
04b3cd9f7c use a loop rather than try_fold 2022-07-11 22:51:33 -04:00
Ralf Jung
ab225ade1e interpret: refactor projection handling code
Moves our projection handling code into a common file, and avoids the use of a
general mplace-based fallback function by have more specialized implementations.

mplace_index (and the other slice-related functions) could be more efficient by
copy-pasting the body of operand_index. Or we could do some trait magic to share
the code between them. But for now this is probably fine.
2022-07-11 22:50:46 -04:00
kyoto7250
134d0dee41 declare span variable before call 2022-07-12 11:28:15 +09:00
kadmin
e612e2603c Move abstract const to rustc_middle::ty 2022-07-12 02:21:31 +00:00
bors
3206fb4eb1 Auto merge of #9138 - Jarcho:branches_sharing_code_2, r=giraffate
Fixes for `branches_sharing_code`

fixes #7198
fixes #7452
fixes #7555
fixes #7589

changelog: Don't suggest moving modifications to locals used in any of the condition expressions in `branches_sharing_code`
changelog: Don't suggest moving anything after a local with a significant drop in `branches_sharing_code`
2022-07-12 00:38:54 +00:00
bors
b3f4c31199 Auto merge of #99165 - matthiaskrgr:rollup-rqpelfa, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #97210 (Support `-A`, `-W`, `-D` and `-F` when running `./x.py clippy`)
 - #99055 (Fix rustdoc help options)
 - #99075 (Fix duplicated type annotation suggestion)
 - #99124 (Fix sized check ICE in asm check)
 - #99142 (fix(doctest): treat fatal parse errors as incomplete attributes)
 - #99145 (Don't rerun the build script for the compiler each time on non-windows platforms)
 - #99146 (Do not error during method probe on `Sized` predicates for types that aren't the method receiver)
 - #99161 (compiletest: trim edition before passing as flag)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-07-12 00:25:45 +00:00
Christopher Durham
11694905b4 Remove duplication of layout size check 2022-07-11 17:58:42 -04:00
Ding Xiang Fei
5374688e1d
add tests for async await 2022-07-11 23:20:39 +02:00
Ding Xiang Fei
8e4a971084
extract method to read scrutinee conditionally 2022-07-11 23:20:38 +02:00
Ding Xiang Fei
af3ba22313 move else block into the Local struct 2022-07-11 23:20:37 +02:00
Ding Xiang Fei
1cd30e7b32
move else block into the Local struct 2022-07-11 23:20:37 +02:00
Ding Xiang Fei
9225ebd786 lower let-else in MIR instead 2022-07-11 23:20:36 +02:00
Ding Xiang Fei
6c529ded86
lower let-else in MIR instead 2022-07-11 23:20:36 +02:00
bors
8a801c7b83 Auto merge of #9154 - CeleritasCelery:master, r=flip1995
Remove broken link in CONTRIBUTING.md

changelog: none
2022-07-11 21:14:23 +00:00
est31
3d2494dbf2 Remove box syntax from Box<BareFunctionDecl> construction
The type has 144 bytes according to compiler internal rustdoc.
2022-07-11 22:59:50 +02:00
est31
3fa637dacb Remove box syntax for Box<rustdoc::clean::types::Type> construction
The type has 80 bytes according to compiler internal rustdoc.
2022-07-11 22:58:57 +02:00
est31
88d72a97fc Remove box syntax for Box<ImplItem> construction
ImplItem only has 80 bytes according to compiler internal rustdoc.
2022-07-11 22:58:57 +02:00
est31
ccf1bdbca6 Remove box syntax for Box<Attributes> construction
Attributes only has 48 bytes according to compiler internal rustdoc.
2022-07-11 22:58:57 +02:00
est31
1ac17fcddb Remove box syntax from Box<dyn Iterator> construction
The iterators created should be pretty light weight.
2022-07-11 22:58:57 +02:00