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
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
Jhonny Bill Mena
d14b3af6db
[Gardening] UPDATE - tidy fixes
2022-09-05 12:09:10 -04:00
Jhonny Bill Mena
1524b59444
UPDATE - avoid exposing source_map methods from Handler
2022-09-05 11:42:48 -04: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
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
Takayuki Maeda
fea1c5f5c8
refactor: remove unnecessary variables
2022-09-05 22:31:02 +09:00
Takayuki Maeda
87c6da363f
separate the receiver from arguments in HIR
2022-09-05 22:25:49 +09:00
Camille GILLOT
037ab1d183
Remove generics_def_id_map from the resolver.
2022-09-05 13:32:13 +02:00
Takayuki Maeda
016626ab12
suggest introducing an explicit lifetime if it does not exist
2022-09-05 19:45:53 +09:00
Dylan DPC
d2fdb5d1d6
Rollup merge of #101429 - compiler-errors:issue-101119, r=lcnr
...
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-05 14:15:55 +05:30
Dylan DPC
75e7bb842a
Rollup merge of #101420 - kraktus:doc_hir_local, r=cjgillot
...
Fix `hir::Local` doc to match with the variable name used: `init`
2022-09-05 14:15:54 +05:30
Dylan DPC
3a9e2ff3d8
Rollup merge of #101409 - 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-05 14:15:53 +05:30
Dylan DPC
e4534fe6fe
Rollup merge of #101391 - matthiaskrgr:perf0309, r=oli-obk
...
more clippy::perf fixes
2022-09-05 14:15:52 +05:30
Dylan DPC
d18dc3d2ab
Rollup merge of #101367 - compiler-errors:suggest-copied-or-cloned, r=lcnr
...
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-05 14:15:51 +05:30
Dylan DPC
5d55009b79
Rollup merge of #101142 - nnethercote:improve-hir-stats, r=davidtwco
...
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-05 14:15:51 +05:30
Michael Goulet
76b494a9dd
Normalize before erasing late-bound regions in equal_up_to_regions
2022-09-05 06:44:33 +00:00
Jhonny Bill Mena
321e60bf34
UPDATE - into_diagnostic to take a Handler instead of a ParseSess
...
Suggested by the team in this Zulip Topic https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20SessionDiagnostic.20on.20Handler
Handler already has almost all the capabilities of ParseSess when it comes to diagnostic emission, in this migration we only needed to add the ability to access source_map from the emitter in order to get a Snippet and the start_point. Not sure if this is the best way to address this gap
2022-09-05 02:18:45 -04:00
Nicholas Nethercote
79db32b64e
Pack Term in the same way as GenericArg.
...
This shrinks the `PredicateS` type, which is instanted frequently.
2022-09-05 15:08:52 +10:00
Michael Goulet
7e226e6d3f
Look at move place's type when suggesting mutable reborrow
2022-09-05 05:00:33 +00:00
Michael Goulet
41d4ea2314
Don't suggest reborrow if usage is inside a closure
2022-09-05 04:27:07 +00:00
Nicholas Nethercote
08a00eb0da
Address review comments.
2022-09-05 14:20:29 +10:00
Nicholas Nethercote
bb0ae3c446
Make hir::PathSegment::hir_id non-optional.
2022-09-05 14:20:25 +10:00
Nicholas Nethercote
6d850d936b
Make hir::PathSegment::res non-optional.
2022-09-05 14:20:25 +10:00
Nicholas Nethercote
ee244bf196
Remove dead code from print_generic_args.
2022-09-05 14:20:25 +10:00
Nicholas Nethercote
49b90573ac
Add some blank lines to the definition of Res.
...
To make the spacing consistent.
Also shorten an overly long comment line.
2022-09-05 14:20:16 +10:00
bors
9358d09a55
Auto merge of #100759 - fee1-dead-contrib:const_eval_select_real_intrinsic, 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-05 01:35:01 +00:00
Nicholas Nethercote
d565d51071
Put size assertions together.
...
As has already been done in various other places in the compiler.
2022-09-05 10:59:00 +10:00
Michael Goulet
3b3c7063c2
Point at type parameter in plain path expr
2022-09-04 20:48:39 +00:00
kraktus
e1bb09edff
Fix hir::Local doc to match with the variable name used: init
2022-09-04 21:46:28 +02:00
Matthias Krüger
dd35e2f79b
Rollup merge of #101388 - compiler-errors:issue-101376, r=fee1-dead
...
Don't delay invalid LHS bug unless it will be covered by an error in `check_overloaded_binop`
Fixes #101376
2022-09-04 18:55:45 +02:00
Maybe Waffle
fcd42d628c
Don't fire rust_2021_incompatible_closure_captures in edition = 2021
2022-09-04 20:04:51 +04:00
bors
a2cdcb3fea
Auto merge of #101296 - compiler-errors:head-span-for-enclosing-scope, r=oli-obk
...
Use head span for `rustc_on_unimplemented`'s `enclosing_scope` attr
This may make #101281 slightly easier to understand
2022-09-04 13:03:07 +00:00
Deadbeef
58c8823e31
remap mir before running optimization passes
2022-09-04 20:35:23 +08:00
Deadbeef
075084f772
Make const_eval_select a real intrinsic
2022-09-04 20:35:23 +08:00
bors
8521a8c92d
Auto merge of #100726 - jswrenn:transmute, r=oli-obk
...
safe transmute: use `Assume` struct to provide analysis options
This task was left as a TODO in #92268 ; resolving it brings [`BikeshedIntrinsicFrom`](https://doc.rust-lang.org/nightly/core/mem/trait.BikeshedIntrinsicFrom.html ) more in line with the API defined in [MCP411](https://github.com/rust-lang/compiler-team/issues/411 ).
**Before:**
```rust
pub unsafe trait BikeshedIntrinsicFrom<
Src,
Context,
const ASSUME_ALIGNMENT: bool,
const ASSUME_LIFETIMES: bool,
const ASSUME_VALIDITY: bool,
const ASSUME_VISIBILITY: bool,
> where
Src: ?Sized,
{}
```
**After:**
```rust
pub unsafe trait BikeshedIntrinsicFrom<Src, Context, const ASSUME: Assume = { Assume::NOTHING }>
where
Src: ?Sized,
{}
```
`Assume::visibility` has also been renamed to `Assume::safety`, as library safety invariants are what's actually being assumed; visibility is just the mechanism by which it is currently checked (and that may change).
r? `@oli-obk`
---
Related:
- https://github.com/rust-lang/compiler-team/issues/411
- https://github.com/rust-lang/rust/issues/99571
2022-09-04 07:55:44 +00:00
Michael Goulet
98f4b20abc
Also suggest dereferencing LHS when both &mut T and T are valid binop LHS
2022-09-04 05:35:18 +00:00
Michael Goulet
edba0c92de
Address nits, rename enclosing_scope => parent_label
2022-09-04 02:10:31 +00:00
Michael Goulet
c23fe81764
Use head span for rustc_on_unimplemented's enclosing_scope attr
2022-09-04 01:55:51 +00:00
Matthias Krüger
a3dda51438
Rollup merge of #101369 - compiler-errors:global-asm-pprint, r=jackh726
...
Fix `global_asm` macro pretty printing
Fixes #101051
Fixes #101047
2022-09-04 00:20:43 +02:00
Matthias Krüger
d085194539
Rollup merge of #100647 - obeis:issue-99875, r=nagisa
...
Make trait bound not satisfied specify kind
Closes #99875
2022-09-04 00:20:40 +02:00
Matthias Krüger
bd9750fd2a
Rollup merge of #100302 - compiler-errors:deref-path-methods, r=jackh726
...
Suggest associated method on deref types when path syntax method fails
Fixes #100278
2022-09-04 00:20:39 +02:00
Ben Kimock
563a75b6e3
Add a Machine hook for inline assembly
2022-09-03 18:05:02 -04:00
Matthias Krüger
6f4726541e
more clippy::perf fixes
2022-09-03 22:57:22 +02:00
Michael Goulet
771456264b
Don't delay invalid lhs bug unless we know it'll be replaced by one in check_overloaded_binop
2022-09-03 19:12:44 +00:00