Commit Graph

171427 Commits

Author SHA1 Message Date
Michael Howell
6f9a460fef Put back, fix ()-output optimization 2022-06-27 11:21:39 -07:00
Michael Howell
8081096a7f Add documentation 2022-06-27 11:07:16 -07:00
bors
d85539571f Auto merge of #9045 - alex-semenyuk:self_assignment_example, r=llogiq
Fix example `SELF_ASSIGNMENT`

changelog: Fix example in `SELF_ASSIGNMENT` docs
2022-06-27 17:33:31 +00:00
Ralf Jung
8c977cfda8 libcore tests: avoid int2ptr casts 2022-06-27 13:30:44 -04:00
bors
fdd0e727e2 Auto merge of #8649 - ebobrow:imperative_find, r=flip1995
add [`manual_find`] lint for function return case

part of the implementation discussed in #7143

changelog: add [`manual_find`] lint for function return case
2022-06-27 17:15:25 +00:00
Jason Newcomb
c10101cf1c Don't lint trivially_copy_pass_by_ref when unsafe pointers are used 2022-06-27 13:14:27 -04:00
Jason Newcomb
2315f76f9d Actually check lifetimes in trivially_copy_pass_by_ref 2022-06-27 13:14:25 -04:00
bors
8e52fa87eb Auto merge of #98566 - matthiaskrgr:rollup-43etyls, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #97389 (Improve memory ordering diagnostics)
 - #97780 (Check ADT field is well-formed before checking it is sized)
 - #98530 (compiletest: add issue number param to `known-bug`)
 - #98556 (Fix builds on Windows (closes #98546))
 - #98561 (Fix spelling in SAFETY comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-06-27 16:28:58 +00:00
alexey semenyuk
c6a2221393 Fix example SELF_ASSIGNMENT 2022-06-27 18:21:09 +03:00
Ralf Jung
8e73c3ed18 make AllocKind actually public 2022-06-27 10:58:30 -04:00
Ralf Jung
9b497abb9a liballoc tests: avoid int2ptr cast 2022-06-27 10:50:56 -04:00
Oli Scherer
dfb592a91d
Remove eddyb from miri failure pings 2022-06-27 16:08:19 +02:00
lcnr
28fafc45e6 lower-generic vs. outlive 2022-06-27 16:06:46 +02:00
Guillaume Gomez
9277f959dd Add test for associated items in rustdoc JSON 2022-06-27 16:01:13 +02:00
Guillaume Gomez
c1c0d25939 Fix kind for associated types in rustdoc JSON output for trait implementations 2022-06-27 16:01:13 +02:00
bors
eaa03ea911 Auto merge of #8972 - kyoto7250:use_retain, r=llogiq
feat(new lint): new lint `manual_retain`

close #8097

This PR is  a new  lint implementation.
This lint checks if the `retain` method is available.

Thank you in advance.

changelog: add new ``[`manual_retain`]`` lint
2022-06-27 13:58:26 +00:00
lcnr
70497d9d10 fold_region: remove unused parameter 2022-06-27 15:55:03 +02:00
lcnr
4dbf9ba0ab outside of borrowck, do not provide an implicit_region_bound
see comment added to the field in `VerifyBoundCx`.
2022-06-27 15:48:54 +02:00
bors
889b3613ae Auto merge of #8990 - tsoutsman:master, r=llogiq
Fix `let_undescore_lock` false-positive when binding without locking

Fixes #8486.

changelog: Fix `let_undescore_lock` false-positive when binding without locking.
2022-06-27 13:38:50 +00:00
Yuki Okushi
c24f06354a
Remove a back-compat hack on lazy TAIT 2022-06-27 20:43:44 +09:00
Klim Tsoutsman
65f700fa89
Fix let_undescore_lock false-positive when binding without locking
Signed-off-by: Klim Tsoutsman <klimusha@gmail.com>
2022-06-27 20:35:26 +10:00
Guillaume Gomez
768129d4bd Finish rustdoc error improvement 2022-06-27 10:52:53 +02:00
Shivani Bhardwaj
70ced2502b Add test for help output with -W 2022-06-27 10:43:51 +02:00
Shivani Bhardwaj
ed62a09de1 Add test for default rustdoc run 2022-06-27 10:43:51 +02:00
Shivani Bhardwaj
e1b6f16fd4 Fix rustdoc argument error 2022-06-27 10:43:51 +02:00
SparrowLii
ec137f29c5 catch unwind of every iter in parallel mode during wfcheck 2022-06-27 16:39:10 +08:00
David Wood
15d61d711d privacy: deny diagnostic migration lints
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27 08:53:42 +01:00
David Wood
74f3a965f4 privacy: port "in public interface" diag
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27 08:53:42 +01:00
David Wood
0557d02a9d privacy: port unnamed "item is private" diag
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27 08:53:42 +01:00
David Wood
cb90a4f30c privacy: port "item is private" diag
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27 08:53:42 +01:00
David Wood
be9ebfdbce privacy: port "field is private" diag
Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27 08:53:42 +01:00
David Wood
ae612241dc various: add rustc_lint_diagnostics to diag fns
The `rustc_lint_diagnostics` attribute is used by the diagnostic
translation/struct migration lints to identify calls where
non-translatable diagnostics or diagnostics outwith impls are being
created. Any function used in creating a diagnostic should be annotated
with this attribute so this commit adds the attribute to many more
functions.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27 08:32:06 +01:00
David Wood
871c879bff lint: fix condition in diagnostic lints
Unfortunately, the diagnostic lints are very broken and trigger much
more often than they should. Correct the conditional which checks if the
function call being made is to a diagnostic function so that it returns
in every intended case.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-06-27 08:32:06 +01:00
bors
6b762ee330 Auto merge of #9054 - alex-semenyuk:string_add_example, r=giraffate
STRING_ADD example

changelog: none
STRING_ADD example, how it should be
2022-06-27 06:08:00 +00:00
Matthias Krüger
54b81dd8d7
Rollup merge of #98561 - Wilfred:patch-4, r=fee1-dead
Fix spelling in SAFETY comment

"can not" should be "cannot", and add punctuation.
2022-06-27 08:06:49 +02:00
Matthias Krüger
31ec973b15
Rollup merge of #98556 - BlaCoiso:patch-1, r=jyn514
Fix builds on Windows (closes #98546)

closes https://github.com/rust-lang/rust/issues/98546
2022-06-27 08:06:48 +02:00
Matthias Krüger
13e4f87c4d
Rollup merge of #98530 - davidkna:known-bug-ref, r=Mark-Simulacrum
compiletest: add issue number param to `known-bug`

I was getting some errors while testing this, but I'm pretty sure that was unrelated to my changes.

Closes #98436

> Basically, instead of `// known-bug`, do `// known-bug #00000` or maybe `// known-bug chalk#00`?
>
> From: https://rust-lang.zulipchat.com/#narrow/stream/326866-t-types.2Fnominated/topic/.2398095.3A.20NLL.3A.20unsound.20verification.20of.20higher.20ranked.20outlives.E2.80.A6/near/287258738

I also added an `unknown` escape-hatch because I didn't find corresponding issues for every `// known-bug`.

The syntax also ended up being `// known-bug: `, because of `set_name_value_directive`.
2022-06-27 08:06:47 +02:00
Matthias Krüger
43dd0e2424
Rollup merge of #97780 - compiler-errors:field-wfcheck-before-sized, r=jackh726
Check ADT field is well-formed before checking it is sized

Fixes #96810.

There is one diagnostics regression, in [`src/test/ui/generic-associated-types/bugs/issue-80626.stderr`](https://github.com/rust-lang/rust/pull/97780/files#diff-53795946378e78a0af23a10277c628ff79091c18090fdc385801ee70c1ba6963). I am not super concerned about it, since it's GAT related.
We _could_ fix it, possibly by using the `FieldSized` obligation cause code instead of `BuiltinDerivedObligation`. But that would require changing `Sized` trait confirmation and the `adt_sized_constraint` query.
2022-06-27 08:06:46 +02:00
Matthias Krüger
3694e40ffa
Rollup merge of #97389 - m-ou-se:memory-ordering-diagnostics, r=estebank
Improve memory ordering diagnostics

Before:

![image](https://user-images.githubusercontent.com/783247/170234545-891cac30-eaa2-4186-847b-35cd51e00f2b.png)

After:

![image](https://user-images.githubusercontent.com/783247/170239684-645f186f-5a02-4eb9-8651-2e5fe9591352.png)

---

Before this change, the compiler suggests the failure ordering is too strong and suggests choosing a weaker ordering. After this change, it instead suggests the success ordering is not strong enough, and suggests chosing a stronger one. This is more likely to be correct.

Also, before this change, the compiler suggested downgrading an invalid AcqRel failure ordering to Relaxed, without mentioning Acquire as an option.
2022-06-27 08:06:45 +02:00
bors
bd2e51a338 Auto merge of #98285 - nikic:update-llvm-5, r=cuviper
Rebase LLVM submodule

This is a rebase of our LLVM fork onto LLVM 14.0.5, which is intended to be the last release of the 14.x series. Additionally:

 * I've dropped three patches that were needed to build on FreeBSD 11, which is no longer necessary after #97944.
 * I've dropped some cherry-picks that were later reverted.
 * I've cherry-picked caa2a829cd for https://github.com/rust-lang/rust/issues/96797 (fyi `@Amanieu)`
2022-06-27 05:36:50 +00:00
Joshua Nelson
d16187c47f Remove references to ./tmp in-tree
These used to be used by codegen-units tests, but were switched from manually specifying directories
to just using `// incremental` in https://github.com/rust-lang/rust/pull/89101.
Remove the old references.
2022-06-26 23:25:12 -05:00
bors
7702ae16a2 Auto merge of #98221 - cjgillot:single-coh, r=lcnr
Perform coherence checking per impl.

r? `@ghost`
2022-06-27 02:56:06 +00:00
Ralf Jung
b094116538 interpret: refactor allocation info query
We now have an infallible function that also tells us which kind of allocation we are talking about.
Also we do longer have to distinguish between data and function allocations for liveness.
2022-06-26 22:49:40 -04:00
Nika Layzell
f28dfdf1c7 proc_macro: stop using a remote object handle for Group
This greatly reduces round-trips to fetch relevant extra information about the
token in proc macro code, and avoids RPC messages to create Group tokens.
2022-06-26 22:20:33 -04:00
Nika Layzell
72bfe618fa proc_macro: stop using a remote object handle for Punct
This greatly reduces round-trips to fetch relevant extra information about the
token in proc macro code, and avoids RPC messages to create Punct tokens.
2022-06-26 22:20:33 -04:00
Wilfred Hughes
1c1ae78db7
Fix spelling in SAFETY comment
"can not" should be "cannot", and add punctuation.
2022-06-26 19:17:34 -07:00
DrMeepster
d317988505 validate box's allocator 2022-06-26 18:54:03 -07:00
Takayuki Maeda
89a23bf54f add regression test for #85907 2022-06-27 10:07:19 +09:00
bors
57e7e1d7d8 Auto merge of #8871 - Serial-ATA:cargo-dev-deprecate, r=giraffate
Add `cargo dev deprecate`

changelog: none

I wrote this awhile ago when `regex` was still a dependency. Is it alright to add it back?
2022-06-27 00:32:22 +00:00
bors
221bdb62a2 Auto merge of #98212 - petrochenkov:addlinkargs, r=lqd
rustc_target: Add convenience functions for adding linker arguments

They ensure that lld and non-lld linker flavors get the same set of arguments.

The second commit also adds some tests checking for linker argument inconsistencies, and tweaks some arguments to fix those inconsistencies.
2022-06-27 00:27:40 +00:00