Commit Graph

17074 Commits

Author SHA1 Message Date
Nicholas Nethercote
f6c9e1df59 Inline and remove TokenStream::opt_from_ast. 2022-09-09 16:53:17 +10:00
Nicholas Nethercote
81eaf877d6 Tweak some formatting. 2022-09-09 16:40:25 +10:00
Nicholas Nethercote
208ca93cda Change return type of Attribute::tokens.
The `AttrTokenStream` is always immediately turned into a `TokenStream`.
2022-09-09 16:25:31 +10:00
bors
4a09adf99f Auto merge of #101603 - matthiaskrgr:rollup-8y6kf20, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #99207 (Enable eager checks for memory sanitizer)
 - #101253 (fix the suggestion of format for asm_sub_register)
 - #101450 (Add `const_extern_fn` to 1.62 release notes.)
 - #101556 (Tweak future opaque ty pretty printing)
 - #101563 (Link UEFI target documentation from target list)
 - #101593 (Cleanup themes (tooltip))

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-09 06:24:25 +00:00
Luis Cardoso
b0cfeec293 translations(rustc_session): migrates session.rs and config.rs 2022-09-09 08:21:23 +02:00
Matthias Krüger
bdfbc3597b
Rollup merge of #101556 - compiler-errors:tweak-generator-print, r=jackh726
Tweak future opaque ty pretty printing

1. The `Return` type of a generator doesn't need to be a lang item just for diagnostic printing of types
2. We shouldn't suppress the `Output = Ty` of a opaque future if the type is a int or float var.
2022-09-09 07:02:32 +02:00
Matthias Krüger
0354eee4c6
Rollup merge of #101253 - lyming2007:issue-101163, r=Amanieu
fix the suggestion of format for asm_sub_register

	modified:   compiler/rustc_typeck/src/check/intrinsicck.rs
	modified:   src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
	modified:   src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
	modified:   src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
	modified:   src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
	modified:   src/test/ui/asm/type-check-1.rs
	modified:   src/test/ui/asm/type-check-1.stderr
	modified:   src/test/ui/asm/x86_64/type-check-3.stderr
2022-09-09 07:02:30 +02:00
Matthias Krüger
6d2033512b
Rollup merge of #99207 - 5225225:msan-eager-checks, r=jackh726
Enable eager checks for memory sanitizer

Fixes #99179
2022-09-09 07:02:30 +02:00
Nicholas Nethercote
a56d345490 Rename AttrAnnotatedToken{Stream,Tree}.
These two type names are long and have long matching prefixes. I find
them hard to read, especially in combinations like
`AttrAnnotatedTokenStream::new(vec![AttrAnnotatedTokenTree::Token(..)])`.

This commit renames them as `AttrToken{Stream,Tree}`.
2022-09-09 12:45:26 +10:00
Nicholas Nethercote
890e759ffc Move Spacing out of AttrAnnotatedTokenStream.
And into `AttrAnnotatedTokenTree::Token`.

PR #99887 did the same thing for `TokenStream`.
2022-09-09 12:00:46 +10:00
chenyukang
7e7dfb83dc fix #101097, avoid infinite loop in fn arguments checking 2022-09-09 09:51:21 +08:00
Michael Goulet
6876c94d80 Fix documentation lint failures 2022-09-09 01:31:46 +00:00
Michael Goulet
270b776ef9 Adjust pretty printing of RPITITs 2022-09-09 01:31:46 +00:00
Michael Goulet
ec170bef0d Rebase fallout 2022-09-09 01:31:46 +00:00
Michael Goulet
526511e86b Appease clippy again 2022-09-09 01:31:46 +00:00
Michael Goulet
55df9201fe Tweak feature error, add test 2022-09-09 01:31:46 +00:00
Camille GILLOT
05812df603 Handle generic parameters. 2022-09-09 01:31:46 +00:00
Michael Goulet
cdf78073c5 Deeply check that method signatures match, and allow for nested RPITITs 2022-09-09 01:31:46 +00:00
Michael Goulet
1f03edeabe Bless tests, fix ICE with ImplTraitPlaceholder 2022-09-09 01:31:45 +00:00
Michael Goulet
70775304cd Address nits 2022-09-09 01:31:45 +00:00
Michael Goulet
249ede4195 Address rebase issues, make async fn in trait work 2022-09-09 01:31:45 +00:00
Michael Goulet
5be30f9d79 Make async fn in traits work 2022-09-09 01:31:45 +00:00
Michael Goulet
e8fa74ae45 Check that impl types actually satisfy RPITIT bounds 2022-09-09 01:31:45 +00:00
Michael Goulet
4265ef8cb2 Implement projection for ImplTraitPlaceholder 2022-09-09 01:31:44 +00:00
Michael Goulet
d34cb98fb0 Lower RPITIT to ImplTraitPlaceholder item 2022-09-09 01:31:44 +00:00
Michael Goulet
78b962a4f3 RPITIT placeholder items 2022-09-09 01:31:44 +00:00
Jack Huey
1e54fcc1ad Combine logic from lubs into lub_empty function 2022-09-08 20:55:56 -04:00
Jack Huey
f6d2995fb8 Make some functions pub(super) 2022-09-08 20:55:56 -04:00
Jack Huey
1ca9eb8ec3 Remove ReEmpty 2022-09-08 20:55:55 -04:00
Eric Huss
ed0f0377e2 Fix ICE report flags display. 2022-09-08 16:08:53 -07:00
Jack Huey
dd0335a27f Don't construct ReEmpty regions in resolve_var 2022-09-08 18:04:10 -04:00
Jack Huey
e7e5feb637 In ReverseMapper, don't fallback to ReEmpty, instead ReStatic 2022-09-08 17:57:34 -04:00
Jack Huey
f29c91bf12 Create VarValue::Empty 2022-09-08 17:57:32 -04:00
Jack Huey
cc87d53da9 Don't use reempty as an implicit_outlives_region 2022-09-08 17:55:56 -04:00
bors
c6861df836 Auto merge of #101592 - compiler-errors:rollup-d2fya7z, r=compiler-errors
Rollup of 7 pull requests

Successful merges:

 - #101423 (Fix hermit warnings)
 - #101499 (Introduce lowering_arena to avoid creating AST nodes on the fly)
 - #101530 (llvm-wrapper: adapt for LLVM API changes)
 - #101554 (rustdoc: remove unused CSS `#implementations-list > h3 > span.in-band`)
 - #101580 (rustdoc: remove unused CSS `div.impl-items > div`)
 - #101584 (rustdoc: remove no-op CSS `#settings-menu { padding: 0 }`)
 - #101587 (Make `Debug` impl for `Term` useful)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-08 21:45:23 +00:00
Michael Goulet
e43cf3deeb
Rollup merge of #101587 - BoxyUwU:term_debug, r=compiler-errors
Make `Debug` impl for `Term` useful

because `Term { ptr: 78942378998734298342, maker: PhantomData, }` does not excel at communicating the necessary information
2022-09-08 14:41:13 -07:00
Michael Goulet
963a9ecb85
Rollup merge of #101530 - krasimirgg:llvm-16-up, r=cuviper
llvm-wrapper: adapt for LLVM API changes

No functional changes intended.

Adapts PassWrapper for a few recent LLVM API changes:
* e7bac3b9fa
* 93600eb50c
* 5e38b2a456

Note that `ModuleMemorySanitizerPass` was renamed back to its pre-14 name, `MemorySanitizerPass`, hence the funky `#if LLVM_VERSION_GE(14, 0) && LLVM_VERSION_LT(16, 0)` guard.

Found via our experimental rust + llvm at HEAD bot: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/13290#018315e6-24e1-44c8-b56d-9aad9be11c29
2022-09-08 14:41:09 -07:00
Michael Goulet
1499c089df
Rollup merge of #101499 - spastorino:add-lowering-arena, r=oli-obk
Introduce lowering_arena to avoid creating AST nodes on the fly

`@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? `@oli-obk` `@cjgillot`
2022-09-08 14:41:08 -07:00
Ellen
ef36af2f9d ptr: 43276834268743978 2022-09-08 21:09:23 +01:00
bors
1120c5e01d Auto merge of #101437 - compiler-errors:erase-normalize-ordering, r=tmandry
Normalize before erasing late-bound regions in `equal_up_to_regions`

Normalize erasing regions **first**, before passing the type through a `BottomUpFolder` which erases late-bound regions too.

The root cause of this issue is due to 96d4137dee, which removes a `normalize_erasing_regions` that happens before this call to `equal_up_to_regions`. While reverting that commit might be a fix, I think it was suspicious to be erasing late-bound regions first _then_ normalizing types in the first place in `equal_up_to_regions`.

-----

I am tempted to ask the reviewer to review and `r+` this without a UI test, since the existing issues that I think this fixes are all incredibly difficult to minimize (anything hyper/warp related, given the nature of those libraries 😓) or impossible to reproduce locally (the miri test), namely:
* This recently reported issue with tokio + warp: #101430
* This issue from `@RalfJung` about Miri being broken: #101344
* This additional issue reported in a comment by `@tmandry` (issue with fuchsia + hyper): https://github.com/rust-lang/rust/issues/101344#issuecomment-1235974564

I have locally verified that the repro in #101430 is fixed with this PR, but after a couple of hours of attempting to minimize this error and either failing to actually repro the ICE, or being overwhelmed with the number of traits and functions I need to inline into a UI test, I have basically given up. Thoughts are appreciated on how best to handle this.

r? `@oli-obk` who is at the intersection of MIR and types-related stuff who may be able to give advice 😅
2022-09-08 19:01:39 +00:00
Santiago Pastorino
d9a1faaa9c
Introduce lowering_arena to avoid creating AST nodes on the fly 2022-09-08 13:34:55 -03:00
bors
87788097b7 Auto merge of #101577 - Dylan-DPC:rollup-l9xw7i7, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #98933 (Opaque types' generic params do not imply anything about their hidden type's lifetimes)
 - #101041 (translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2)
 - #101424 (Adjust and slightly generalize operator error suggestion)
 - #101496 (Allow lower_lifetime_binder receive a closure)
 - #101501 (Allow lint passes to be bound by `TyCtxt`)
 - #101515 (Recover from typo where == is used in place of =)
 - #101545 (Remove unnecessary `PartialOrd` and `Ord`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-08 15:53:14 +00:00
yukang
50e5d03e16 Avoid infinite loop in function arguments checking 2022-09-08 23:26:57 +08:00
Dylan DPC
720a82dd52
Rollup merge of #101545 - TaKO8Ki:remove-unnecessary-partialord-ord, r=oli-obk
Remove unnecessary `PartialOrd` and `Ord`
2022-09-08 20:48:38 +05:30
Dylan DPC
8d2a492d73
Rollup merge of #101515 - chenyukang:fix-101477, r=fee1-dead
Recover from typo where == is used in place of =

Fixes #101477
2022-09-08 20:48:37 +05:30
Dylan DPC
2904060314
Rollup merge of #101501 - Jarcho:tcx_lint_passes, r=davidtwco
Allow lint passes to be bound by `TyCtxt`

This will allow storing things like `Ty<'tcx>` inside late lint passes. It's already possible to store various id types so they're already implicitly bound to a specific `TyCtxt`.

r? rust-lang/compiler
2022-09-08 20:48:36 +05:30
Dylan DPC
953a6b3da7
Rollup merge of #101496 - spastorino:lower_lifetime_binder_api_changes, r=oli-obk
Allow lower_lifetime_binder receive a closure

``@oli-obk`` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? ``@oli-obk`` ``@cjgillot``
2022-09-08 20:48:36 +05:30
Dylan DPC
b5ffbd32d4
Rollup merge of #101424 - compiler-errors:operator-err-sugg, r=TaKO8Ki
Adjust and slightly generalize operator error suggestion

(in no particular order)
* Stop passing around a whole extra `ProjectionPredicate`
* Add spaces around `=` in `Trait<..., Output = Ty>` suggestion
* Some code clean-ups, including
    * add `lang_item_for_op` to turn a `Op` into a `DefId`
    * avoid `SourceMap` because we don't really need to render an expr
    * Remove `TypeParamVisitor` in favor of just checking `ty.has_param_types_or_consts` -- this acts a bit differently, but shouldn't cause erroneous suggestions (actually might generalize them a bit)
* We now suggest `Output = Ty` in the `where` clause suggestion when we fail to add `Struct<T>` and `T`.

I can split this out into more PRs if needed, but they're all just miscellaneous generalizations, changes, and nitpicks I saw when messing with this operator code.
2022-09-08 20:48:34 +05:30
Dylan DPC
1561922a12
Rollup merge of #101041 - LuisCardosoOliveira:translation-rename-attr-warning-pt2, r=davidtwco
translations(rustc_session): migrates rustc_session to use SessionDiagnostic - Pt. 2

# Description

This is the second part of the `rustc_session` [migration](https://github.com/rust-lang/rust/issues/100717#issuecomment-1220279883).

**Please only review this [commit](5018581957) that belongs to the part 2. The other ones are from the PR [#100753](https://github.com/rust-lang/rust/pull/100753) that is not yet merged.**

In this PR, we migrate the files `session.rs` and `config.rs`.

Please not that we have to `allow` the lints rules in some functions from `session.rs` because they are (at least I believe) part of the diagnostic machinery.
2022-09-08 20:48:34 +05:30
Dylan DPC
d392838b69
Rollup merge of #98933 - oli-obk:opaque_type_late_bound_lifetimes, r=lcnr
Opaque types' generic params do not imply anything about their hidden type's lifetimes

fixes #97104

cc ```@aliemjay```
2022-09-08 20:48:34 +05:30
lcnr
b79a2b3f73 update ParamKindOrd 2022-09-08 16:50:44 +02:00
bors
24d6992020 Auto merge of #101467 - nnethercote:shrink-hir-Ty-Pat, r=spastorino
Shrink `hir::Ty` and `hir::Pat`

r? `@ghost`
2022-09-08 13:11:57 +00:00
Yiming Lei
28c62d28de fix the suggestion of format for asm_sub_register
modified:   compiler/rustc_typeck/src/check/intrinsicck.rs
	modified:   src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
	modified:   src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
	modified:   src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
	modified:   src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
	modified:   src/test/ui/asm/type-check-1.rs
	modified:   src/test/ui/asm/type-check-1.stderr
	modified:   src/test/ui/asm/x86_64/type-check-3.stderr
2022-09-08 04:12:13 -07:00
bors
ccb5595df2 Auto merge of #98900 - lcnr:region-stuff, r=jackh726
const_generics: correctly deal with bound variables

removes the hack in `resolve` which was needed because we evaluated constants without caring about their bound variables.

Each commit should be fairly self-contained, even if they build on each other

r? `@jackh726`
2022-09-08 10:30:00 +00:00
Luis Cardoso
0e497a714e translations(rustc_session): migrates two diagnostics in session.rs 2022-09-08 12:22:51 +02:00
lcnr
e6660326a3 bound variables during ctfe are a bug 2022-09-08 11:41:00 +02:00
lcnr
d15b00af48 don't evaluate with escaping bound vars 2022-09-08 11:41:00 +02:00
lcnr
01adb7e98d stop evaluating constants in Relate 2022-09-08 11:14:33 +02:00
lcnr
060f3e0c65 generalize: no need to cache errors 2022-09-08 11:14:33 +02:00
Oli Scherer
64d11fc8e3 Clarify some diagnostic messages 2022-09-08 08:10:21 +00:00
Oli Scherer
5c9d28d303 Opaque types' generic params do not imply anything about their hidden type's lifetimes 2022-09-08 08:10:21 +00:00
yukang
ddb225f1f5 fixes #101477: Recover from typo where == is used in place of = 2022-09-08 15:14:18 +08:00
Luis Cardoso
24de9435e2 translations(rustc_session): remove lint allow rule to the methods marked with rustc_lint_diagnostic
This commit removes the allows rules for the SessionDiagnostic lint
that were being used in the session.rs file.

Thanks to the PR #101230 we do not need to annotate the methods with
the allow rule as they are part of the diagnostic machinery.
2022-09-08 08:30:57 +02:00
Luis Cardoso
0f06320c24 translations(rustc_session): migrate TargetDataLayout::parse 2022-09-08 08:30:57 +02:00
Luis Cardoso
60b49581c4 translations(rustc_session): migrates session.rs and config.rs 2022-09-08 08:30:57 +02:00
Dylan DPC
7f46d7313c
Rollup merge of #101549 - eholk:type-ir-derive-hashstable_generic, r=jackh726
Use HashStable_Generic in rustc_type_ir

A lot of the types in this crate implemented HashStable directly to avoid circular dependencies. One way around that is to use HashStable_Generic. We adopt that here to avoid a lot of boilerplate.

This doesn't update all the types, because some would require `I: Interner + HashStable`.

r? `@cjgillot`
2022-09-08 11:55:10 +05:30
Dylan DPC
12b810063d
Rollup merge of #101498 - petrochenkov:visparam, r=cjgillot
rustc: Parameterize `ty::Visibility` over used ID

It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-08 11:55:09 +05:30
Dylan DPC
0d61a507f5
Rollup merge of #101399 - cjgillot:borrowck-binding-span, r=estebank
Shrink span for bindings with subpatterns.

Bindings with nested patterns (`binding @ pat` syntax) currently point to the full pattern.  This PR proposes to shrink the span to stop before the ````@`.```  This makes the diagnostics for move/mutability conflicts clearer, as they not point to the `binding` only, instead of the full pat.

r? ```@estebank```
2022-09-08 11:55:06 +05:30
Dylan DPC
e3ea8008cc
Rollup merge of #101153 - IntQuant:issue-100717-infer-2, r=davidtwco
Migrate another part of rustc_infer to session diagnostic

Probably will migrate another file before marking this one as ready-to-merge.

`@rustbot` label +A-translation
r? rust-lang/diagnostics
cc https://github.com/rust-lang/rust/issues/100717
2022-09-08 11:55:06 +05:30
Nicholas Nethercote
e67f39f8bc Introduce DotDotPos.
This shrinks `hir::Pat` from 88 to 72 bytes.
2022-09-08 15:25:50 +10:00
Nicholas Nethercote
4314615ff8 Arena-allocate hir::Lifetime.
This shrinks `hir::Ty` from 72 to 48 bytes.

`visit_lifetime` is added to the HIR stats collector because these types
are now stored in memory on their own, instead of being within other
types.
2022-09-08 15:07:19 +10:00
Michael Goulet
97668a5589 We can print futures with {integer} too 2022-09-08 02:52:57 +00:00
Michael Goulet
2c94102df5 Generator return doesn't need to be a lang item 2022-09-08 02:52:57 +00:00
bors
4af35b8e30 Auto merge of #101303 - jyn514:jnelson/handle-cycle-enum, r=cjgillot
Make `HandleCycleError` an enum instead of a macro-generated closure

Helps with https://github.com/rust-lang/rust/issues/96524. Based on https://github.com/rust-lang/rust/pull/100943 to avoid merge conflicts, so it looks larger than it is (only the last commit is relevant).

cc https://rust-lang.zulipchat.com/#narrow/stream/241847-t-compiler.2Fwg-incr-comp/topic/Moving.20.60Value.60.20to.20rustc_query_system.20.2396524

r? `@cjgillot`
2022-09-08 02:21:16 +00:00
Michael Goulet
48281b003f Adjust spacing in suggestion, add a test 2022-09-08 02:06:48 +00:00
Michael Goulet
30e3673d43 Add associated item binding to non-param-ty where clause suggestions 2022-09-08 02:06:48 +00:00
Michael Goulet
0dbbf0f493 Remove TypeParamVisitor 2022-09-08 01:54:59 +00:00
Michael Goulet
d0746e8863 Simplify printing operator lang item paths in error message 2022-09-08 01:54:59 +00:00
Michael Goulet
00c9d3d2ee Avoid source-map call in operator error 2022-09-08 01:54:59 +00:00
bors
512bd84f51 Auto merge of #94075 - mikebenfield:wip-enum, r=oli-obk
Use niche-filling optimization even when multiple variants have data.

Fixes #46213
2022-09-07 23:40:06 +00:00
Eric Holk
578fc49fc1 Use HashStable_Generic in rustc_type_ir
A lot of the types in this crate implemented HashStable directly to
avoid circular dependencies. One way around that is to use
HashStable_Generic. We adopt that here to avoid a lot of boilerplate.

This doesn't update all the types, because some would require
`I: Interner + HashStable`.
2022-09-07 16:05:06 -07:00
Takayuki Maeda
bdc865d8f7 remove unnecessary PartialOrd and Ord 2022-09-08 06:15:33 +09:00
Santiago Pastorino
36fa12f1a4
Allow lower_lifetime_binder receive a closure 2022-09-07 18:01:01 -03:00
Michael Benfield
d7a750b504 Use niche-filling optimization even when multiple variants have data.
Fixes #46213
2022-09-07 20:12:45 +00:00
Michael Benfield
1a08b96a0b Change name of "dataful" variant to "untagged"
This is in anticipation of a new enum layout, in which the niche
optimization may be applied even when multiple variants have data.
2022-09-07 20:12:45 +00:00
Matthias Krüger
41e1830a43
Rollup merge of #101536 - GuillaumeGomez:is_doc_comment-doc, r=lqd
Add documentation for Attr::is_doc_comment

The function name is very misleading, some explanations won't hurt.

r? `@lqd`
2022-09-07 21:48:23 +02:00
Matthias Krüger
acb3d11f1b
Rollup merge of #101525 - eltociear:patch-16, r=cjgillot
Fix typo in pass_manager.rs

overriden -> overridden
2022-09-07 21:48:20 +02:00
Matthias Krüger
0a1c816dcd
Rollup merge of #101503 - spastorino:add-debug-calls, r=compiler-errors
Add debug calls

`@oli-obk` requested this and other changes as a way of simplifying https://github.com/rust-lang/rust/pull/101345. This is just going to make the diff of https://github.com/rust-lang/rust/pull/101345 smaller.

r? `@oli-obk` `@cjgillot`
2022-09-07 21:48:16 +02:00
Matthias Krüger
c365ce3ffd
Rollup merge of #101502 - TaKO8Ki:do-not-suggest-semicolon-for-macro-without-exclamation-mark, r=wesleywiser
Do not suggest a semicolon for a macro without `!`

Fixes a regression in #101490
2022-09-07 21:48:15 +02:00
Matthias Krüger
9361297dfc
Rollup merge of #101493 - spastorino:borrow-mut-impl-trait-context, r=oli-obk
Pass ImplTraitContext as &mut to avoid the need of ImplTraitContext::reborrow

`@oli-obk` requested this and other changes as a way of simplifying #101345. This is just going to make the diff of #101345 smaller.

r? `@oli-obk` `@cjgillot`
2022-09-07 21:48:14 +02:00
bors
f91ca2878a Auto merge of #101522 - oli-obk:miriup, r=oli-obk
Update miri submodule

fixes #101344

cc `@rust-lang/miri`

r? `@ghost`
2022-09-07 16:31:39 +00:00
Oli Scherer
419c4e1c4f Update miri submodule 2022-09-07 15:42:12 +00:00
bors
a4d034126d Auto merge of #101432 - nnethercote:shrink-PredicateS, r=lcnr
Shrink `PredicateS`

r? `@ghost`
2022-09-07 13:49:58 +00:00
Santiago Pastorino
d42afd2bd1
Format hir_id_validator error using pretty print 2022-09-07 10:46:17 -03:00
Santiago Pastorino
e3a738a942
Add instrument and debug calls 2022-09-07 10:46:14 -03:00
Krasimir Georgiev
a3b60f1769 llvm-wrapper: adapt for LLVM API changes
No functional changes intended.

Adapts PassWrapper for two recent LLVM API changes:
* e7bac3b9fa
* 93600eb50c
* 5e38b2a456
2022-09-07 13:37:59 +00:00
Guillaume Gomez
88fa621bab
Add documentation for Attr::is_doc_comment 2022-09-07 15:34:16 +02:00
David Wood
38958aa8bd ssa: implement #[collapse_debuginfo]
Debuginfo line information for macro invocations are collapsed by
default - line information are replaced by the line of the outermost
expansion site. Using `-Zdebug-macros` disables this behaviour.

When the `collapse_debuginfo` feature is enabled, the default behaviour
is reversed so that debuginfo is not collapsed by default. In addition,
the `#[collapse_debuginfo]` attribute is available and can be applied to
macro definitions which will then have their line information collapsed.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-07 13:54:51 +01:00
Ikko Ashimine
9cef1ee113
Fix typo in pass_manager.rs
overriden -> overridden
2022-09-07 19:32:28 +09:00
David Wood
2991a7c715 middle: comment -> doc comment
Drive-by change of a regular comment to a documentation comment on
`TyCtxt::is_suitable_region`.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-09-07 11:10:11 +01:00
bors
e7c7aa7288 Auto merge of #98332 - oli-obk:assume, r=wesleywiser
Lower the assume intrinsic to a MIR statement

This makes https://github.com/rust-lang/rust/pull/96862#issuecomment-1153739068 easier and will generally allow us to cheaply insert assume intrinsic calls in mir building.

r? rust-lang/wg-mir-opt
2022-09-07 09:47:23 +00:00
Vadim Petrochenkov
d8d3b83e3a rustc: Parameterize ty::Visibility over used ID
It allows using `LocalDefId` instead of `DefId` when possible, and also encode cheaper `Visibility<DefIndex>` into metadata.
2022-09-07 13:35:41 +04:00
bors
ff479b1f3c Auto merge of #100801 - Kobzol:track-pgo-profile-paths, r=michaelwoerister
Track PGO profiles in depinfo

This PR makes sure that PGO profiles (`-Cprofile-use` and `-Cprofile-sample-use`) are tracked in depinfo, so that when they change, the compilation session will be invalidated.

This approach was discussed on [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Tracking.20PGO.20profile.20files.20in.20cargo).

I tried it locally and it seems that the code is recompiled just with this change, and https://github.com/rust-lang/rust/pull/100413 is not even needed. But it's possible that not everything required is recompiled, so we will probably want to land both changes.

Another approach to implement this could be to store the PGO profiles in `sess.parse_sess.file_depinfo` when the session is being created, but then the paths would have to be converted to a string and then to a symbol, which seemed unnecessarily complicated.

CC `@michaelwoerister`

r? `@Eh2406`
2022-09-07 03:17:10 +00:00
Joshua Nelson
d2c53caee2 Move Queries::new out of the macro 2022-09-06 21:41:01 -05:00
bors
8c41305631 Auto merge of #101508 - JohnTitor:rollup-i5i2vqc, r=JohnTitor
Rollup of 8 pull requests

Successful merges:

 - #101451 (Add incremental test for changing struct name in assoc type.)
 - #101468 (fix RPIT ICE for implicit HRTB when missing dyn)
 - #101481 (Fix compile errors for uwp-windows-msvc targets)
 - #101484 (Remove dead broken code from const zst handling in backends)
 - #101486 (Add list of recognized repr attributes to the unrecognized repr error)
 - #101488 (rustdoc: remove unused CSS `#results > table`)
 - #101491 (rustdoc: remove outdated CSS `.sub-variant > div > .item-info`)
 - #101497 (⬆️ rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-09-07 00:35:54 +00:00
Joshua Nelson
4856affd90 Make HandleCycleError an enum instead of a macro-generated closure
- Add a `HandleCycleError` enum to rustc_query_system, along with a `handle_cycle_error` function
- Move `Value` to rustc_query_system, so `handle_cycle_error` can use it
- Move the `Value` impls from rustc_query_impl to rustc_middle. This is necessary due to orphan rules.
2022-09-06 19:26:08 -05:00
Yuki Okushi
f68d05cf00
Rollup merge of #101486 - asquared31415:invalid_repr_list, r=estebank
Add list of recognized repr attributes to the unrecognized repr error
2022-09-07 07:43:54 +09:00
Yuki Okushi
1d49dcec10
Rollup merge of #101484 - oli-obk:no_zst, r=eddyb
Remove dead broken code from const zst handling in backends

cc `@RalfJung`

found by `@eddyb` in https://github.com/rust-lang/rust/pull/98957#discussion_r963744605
2022-09-07 07:43:54 +09:00
Yuki Okushi
a12e29af92
Rollup merge of #101468 - spastorino:fix-ice-rpit-hrtb-without-dyn, r=cjgillot
fix RPIT ICE for implicit HRTB when missing dyn

Closes #101297

r? `@cjgillot`

cc `@nikomatsakis`
2022-09-07 07:43:52 +09:00
bors
699bfa882b Auto merge of #100404 - BelovDV:linker_group, r=petrochenkov
change stdlib circular dependencies handling

Remove group_start and group_end, add dependencies to symbols.o
Implements the suggestion from https://github.com/rust-lang/rust/pull/85805#discussion_r666249351
r? `@petrochenkov`
2022-09-06 22:06:54 +00:00
Nikita Tomashevich
3d70be7240
Whoops forgot a space 2022-09-06 22:55:49 +03:00
Nikita Tomashevich
ee74f925f5
Replace manual impl with a derive macro as multipart suggestions are now supported by them 2022-09-06 22:18:56 +03:00
Takayuki Maeda
7ac124803f do not suggest a semicolon for a macro without ! 2022-09-07 03:59:47 +09:00
Camille GILLOT
5d94d42485 Shrink span for bindings with subpatterns. 2022-09-06 20:57:44 +02:00
Jason Newcomb
0126f7f3a9 Allow lint passes to be bound by TyCtxt 2022-09-06 14:23:03 -04:00
Santiago Pastorino
2166a36245
Pass ImplTraitContext as &mut to avoid the need of ImplTraitContext::reborrow later on 2022-09-06 15:22:16 -03:00
Takayuki Maeda
1e384423a9 suggest adding array lengths to references to arrays 2022-09-07 02:37:18 +09:00
IQuant
cb7ad9e548
Slightly more concise comment
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
2022-09-06 18:41:09 +03:00
Nikita Tomashevich
59c567296a
Use untranslated messages for now 2022-09-06 18:41:09 +03:00
Nikita Tomashevich
e750d7faa7
Remove a comment and use IntoDiagnosticArg instead of add_to() where feasible 2022-09-06 18:41:08 +03:00
Nikita Tomashevich
3190522294
Address some comments 2022-09-06 18:41:08 +03:00
Nikita Tomashevich
e0e9b21c78
Mugrate mismatched_static_lifetime.rs 2022-09-06 18:41:08 +03:00
Nikita Tomashevich
af3343ae29
Migrate E0623 2022-09-06 18:41:08 +03:00
Oli Scherer
a0130e62ec Check all operands, they may contain indirections in their place 2022-09-06 15:32:35 +00:00
asquared31415
ad275f5096 add list of recognized repr attributes to the unrecognized repr error 2022-09-06 11:02:42 -04:00
Guillaume Gomez
f21b6129a0
Rollup merge of #101473 - nnethercote:mir-size-assertions, r=lqd
Add more size assertions for MIR types.

And move them into a module, as has been done previously for AST, HIR,
etc.

r? `@lqd`
2022-09-06 17:00:30 +02:00
Guillaume Gomez
7d2e150e92
Rollup merge of #101471 - compiler-errors:delay-bug-are-count-too, r=oli-obk
Report number of delayed bugs properly with `-Ztreat-err-as-bug`

Report the number of delayed bugs that went into the `-Ztreat-errr-as-bug=N` being triggered, even if we don't count it in the err_count in regular diagnostic output.

Sometimes we have a session that creates a few diagnostics, perhaps: Error, Delay bug, Error, then Delay bug.
If I ran `-Ztreat-err-as-bug=3`, then I will now see "aborting after 2 errors and 1 delayed bugs" instead of just "after 2 errors" which is confusing since I passed `3`.
2022-09-06 17:00:29 +02:00
Guillaume Gomez
78968e5959
Rollup merge of #101457 - ChayimFriedman2:struct-field-semi, r=fee1-dead
Recover from using `;` as separator between fields

Partially fixes #101440 (only for record structs).

Doing that for tuple structs is harder as their parsing passes through a bunch of helper functions. I don't know how to do that. But [their error message is better anyway](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=cc6ee8bb2593596c0cea89d49e79bcb4) and suggests using a comma, even if it doesn't suggest replacing the semicolon with it.
2022-09-06 17:00:28 +02:00
Guillaume Gomez
7c7548cd37
Rollup merge of #101445 - TaKO8Ki:suggest-introducing-explicit-lifetime, r=oli-obk
Suggest introducing an explicit lifetime if it does not exist

Fixes #101027
2022-09-06 17:00:27 +02:00
Guillaume Gomez
4d830b7775
Rollup merge of #101434 - JhonnyBillM:replace-session-for-handler-in-into-diagnostic, r=davidtwco
Update `SessionDiagnostic::into_diagnostic` to take `Handler` instead of `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 adding these two methods [`span_to_snippet_from_emitter` and  `span_start_point_from_emitter`] is the best way to address this gap.

P.S. If this goes in the right direction, then we probably may want to move `SessionDiagnostic` to `rustc_errors` and rename it to `DiagnosticHandler` or something similar.

r? `@davidtwco`
r? `@compiler-errors`
2022-09-06 17:00:26 +02:00
Guillaume Gomez
d13aefdc65
Rollup merge of #101357 - compiler-errors:variant-sugg-tweak, r=oli-obk
Include enum path in variant suggestion

(except for `Result` and `Option`, which we should have via the prelude)

Fixes #101356
2022-09-06 17:00:25 +02:00
Oli Scherer
7348284073 Update docs 2022-09-06 14:18:32 +00:00
Oli Scherer
104f97e5aa Move CTFE handling of nondiverging intrinsics to intrinsics.rs 2022-09-06 14:18:32 +00:00
Oli Scherer
b7413511dc Generalize the Assume intrinsic statement to a general Intrinsic statement 2022-09-06 14:18:32 +00:00
Oli Scherer
3f07645120 Lower the assume intrinsic to a MIR statement 2022-09-06 14:18:32 +00:00
Oli Scherer
9c4fb018ca Remove dead broken code from const zst handling in backends 2022-09-06 14:09:49 +00:00
Santiago Pastorino
3f45dc1472
fix RPIT ICE for implicit HRTB when missing dyn 2022-09-06 11:00:29 -03:00
bors
3c72788461 Auto merge of #101479 - Dylan-DPC:rollup-v8ite0y, r=Dylan-DPC
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-06 11:16:02 +00:00
Dylan DPC
8936211661
Rollup merge of #101427 - compiler-errors:issue-101421, r=cjgillot
Fix ICE, generalize 'move generics to trait' suggestion for >0 non-rcvr arguments

Fixes #101421
cc #100838
2022-09-06 16:34:45 +05:30
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
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
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
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
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
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
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