Commit Graph

199688 Commits

Author SHA1 Message Date
Dylan DPC
36144f2b3d
Rollup merge of #101021 - MingyuChen1:diagnostic, r=davidtwco
Migrate ``rustc_middle`` diagnostic

Part of #100717
2022-09-06 16:34:42 +05:30
Dylan DPC
3f22020006
Rollup merge of #100658 - chenyukang:100631-check-get-attr, r=lcnr
TyCtxt::get_attr should check that no duplicates are allowed

Fixes #100631
2022-09-06 16:34:41 +05:30
Vadim Petrochenkov
c34047cbd5 Fix CI failures on windows and aarch64-linux 2022-09-06 14:05:54 +04:00
Daniil Belov
b67271507d change stdlib circular dependencies handling 2022-09-06 14:05:54 +04:00
bors
a594044533 Auto merge of #101362 - compiler-errors:unnecessary-let, r=cjgillot
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-06 08:49:54 +00:00
Michael Goulet
38935bbe6a Report number of delayed bugs properly with -Ztreat-err-as-bug 2022-09-06 07:12:52 +00:00
yukang
00b10a5552 get_attr should check that no duplicates are allowed 2022-09-06 14:16:54 +08:00
bors
098cf88022 Auto merge of #101359 - 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-06 05:57:39 +00:00
Nicholas Nethercote
246d126edd Add more size assertions for MIR types.
And move them into a module, as has been done previously for AST, HIR,
etc.
2022-09-06 15:25:54 +10:00
xphoniex
b21d9d307b
Suggest unwrap_or_default when closure returns "".to_string
Signed-off-by: xphoniex <xphoniex@users.noreply.github.com>
2022-09-06 04:38:29 +00:00
bors
ce339b219a Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillot
`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-06 03:16:29 +00:00
bors
6c358c67d4 Auto merge of #101241 - camsteffen:refactor-binding-annotations, r=cjgillot
`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-06 03:16:29 +00:00
bors
56b27110e7 Auto merge of #101464 - JohnTitor:rollup-unsjgm6, r=JohnTitor
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-06 00:23:01 +00:00
Yuki Okushi
0d8a1f4cbf
Rollup merge of #101447 - cjgillot:no-remap-resolver, r=spastorino
Remove generics_def_id_map from the resolver.

This is internal state for lowering.  This does not belong in the resolver.

r? ``@spastorino``
2022-09-06 08:36:10 +09:00
Yuki Okushi
c6f6b1821d
Rollup merge of #101426 - beetrees:dup-no-stdio, r=thomcc
Don't duplicate file descriptors into stdio fds

Ensures that file descriptors are never duplicated into the stdio fds even if a stdio fd has been closed.
2022-09-06 08:36:09 +09:00
Yuki Okushi
c3faa2250c
Rollup merge of #101425 - compiler-errors:point-at-ty-param, r=spastorino
Point at type parameter in plain path expr

Slightly better error message for a kinda unique use case.
2022-09-06 08:36:08 +09:00
Yuki Okushi
c633b0a72c
Rollup merge of #101418 - rust-lang:revert-99183-proc_macro-mention-r-a, r=Mark-Simulacrum
Revert "Mention rust-analyzer maintainers when `proc_macro` bridge is changed"

Reverts rust-lang/rust#99183

rust-analyzer is now a subtree, and CI fails when the `proc_macro` bridge changes break our tests, so these notifications aren't needed anymore.
2022-09-06 08:36:06 +09:00
Yuki Okushi
ff124c6ae8
Rollup merge of #101404 - joboet:always_cleanup_stdout, r=joshtriplett
Fix cleanup for uninitialized stdout

Fixes #101375 by disabling buffering even if the buffer was not initialized yet.
2022-09-06 08:36:05 +09:00
Yuki Okushi
957b44a13c
Rollup merge of #101402 - saethlin:inline-asm-hook, r=oli-obk
Add a Machine hook for inline assembly

I'm sketching out some support in Miri to "execute" inline assembly. I want this because there are codebases which have very simple inline assembly like hand-written syscall wrappers, and it would be nice to test such code without modification.

r? ``@oli-obk``
2022-09-06 08:36:04 +09:00
Yuki Okushi
0e6747fb25
Rollup merge of #99291 - est31:let_else_tests, r=joshtriplett
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-06 08:36:03 +09:00
Nixon Enraght-Moony
065e0b9c9c Rustdoc-Json: Store Variant Fields as their own item.
Closes #100587
Closes #92945
2022-09-05 23:59:33 +01:00
bors
676afc5149 Auto merge of #101460 - rust-lang:update-cargo, r=ehuss
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-05 21:55:48 +00:00
Jhonny Bill Mena
46ba27d5b5 [Gardening] UPDATE - use let chain to unwrap snippet and evaluate flag 2022-09-05 17:32:23 -04:00
Jhonny Bill Mena
dd5850b8fa UPDATE - accept start_point and snippet instead of SourceMap 2022-09-05 17:26:57 -04:00
Michael Goulet
1254b32479 Point out when a callable is not actually callable because its return is not sized 2022-09-05 20:55:43 +00:00
Michael Goulet
bee48e3fdc Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments 2022-09-05 20:47:20 +00:00
Chayim Refael Friedman
fbf11cfc13 Recover from using ; as separator between fields 2022-09-05 19:15:23 +00:00
Camille GILLOT
fdf56cfc7c Add test. 2022-09-05 20:11:34 +02:00
Weihang Lo
11e66e155d 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-05 18:34:53 +01:00
Jhonny Bill Mena
31e9f40bcf FIX - broken translatable diagnostics tests 2022-09-05 12:59:56 -04:00
bors
b44197abb0 Auto merge of #101261 - TaKO8Ki:separate-receiver-from-arguments-in-hir, r=cjgillot
Separate the receiver from arguments in HIR

Related to #100232

cc `@cjgillot`
2022-09-05 16:21:40 +00:00
bors
2ccf843471 Auto merge of #101261 - TaKO8Ki:separate-receiver-from-arguments-in-hir, r=cjgillot
Separate the receiver from arguments in HIR

Related to #100232

cc `@cjgillot`
2022-09-05 16:21:40 +00:00
Jhonny Bill Mena
d14b3af6db [Gardening] UPDATE - tidy fixes 2022-09-05 12:09:10 -04:00
Jhonny Bill Mena
72f766ae71 FIX - broken translatable diagnostics tests 2022-09-05 12:07:48 -04:00
Jhonny Bill Mena
1524b59444 UPDATE - avoid exposing source_map methods from Handler 2022-09-05 11:42:48 -04:00
Thom Chiovoloni
850090d99c
Avoid UB in the Windows filesystem code in... bootstrap? 2022-09-05 08:39:11 -07:00
111
a42c0d79da fix comment 2022-09-05 23:18:18 +08:00
Takayuki Maeda
9cde34e180 use propagate_through_exprs instead of propagate_through_expr
fix `ExprKind` static_assert_size

fix hir-stats
2022-09-05 23:11:34 +09:00
Takayuki Maeda
8931da40e3 use propagate_through_exprs instead of propagate_through_expr
fix `ExprKind` static_assert_size

fix hir-stats
2022-09-05 23:11:34 +09:00
bors
2dc703fd6e Auto merge of #101228 - nnethercote:simplify-hir-PathSegment, r=petrochenkov
Simplify `hir::PathSegment`

r? `@petrochenkov`
2022-09-05 13:36:54 +00:00
bors
5ea99770d8 Auto merge of #101228 - nnethercote:simplify-hir-PathSegment, r=petrochenkov
Simplify `hir::PathSegment`

r? `@petrochenkov`
2022-09-05 13:36:54 +00:00
Takayuki Maeda
fea1c5f5c8 refactor: remove unnecessary variables 2022-09-05 22:31:02 +09:00
Takayuki Maeda
097ef517fe refactor: remove unnecessary variables 2022-09-05 22:31:02 +09:00
Takayuki Maeda
3955dc3480 separate the receiver from arguments in HIR under /clippy 2022-09-05 22:25:57 +09:00
Takayuki Maeda
4bcaddeeb2 separate the receiver from arguments in HIR under /clippy 2022-09-05 22:25:57 +09:00
Takayuki Maeda
87c6da363f separate the receiver from arguments in HIR 2022-09-05 22:25:49 +09:00
Nikita Popov
cbf3b2432e Add test for #98294
Add a test to make that the failure condition for this pattern is
optimized away.

Fixes #98294.
2022-09-05 15:24:18 +02:00
Eric Huss
ce3d526027 Add const_extern_fn to 1.62 release notes. 2022-09-05 05:57:46 -07:00
Camille GILLOT
037ab1d183 Remove generics_def_id_map from the resolver. 2022-09-05 13:32:13 +02:00
est31
2d8460ef43 Add matrix based test for documenting the let / let else temporary drop order
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-05 13:06:23 +02:00