Commit Graph

168264 Commits

Author SHA1 Message Date
Ralf Jung
bd31ba045d make Size and Align debug-printing a bit more compact 2022-05-06 10:57:03 +02:00
Lukas Lueg
cd1746b2b4 Clarify unreachable_unchecked docs 2022-05-06 09:34:41 +02:00
bors
7f9e013ba6 Auto merge of #96510 - m-ou-se:futex-bsd, r=Amanieu
Use futex-based locks and thread parker on {Free, Open, DragonFly}BSD.

This switches *BSD to our futex-based locks and thread parker.

Tracking issue: https://github.com/rust-lang/rust/issues/93740

This is a draft, because this still needs a new version of the `libc` crate to be published that includes https://github.com/rust-lang/libc/pull/2770.

r? `@Amanieu`
2022-05-06 07:20:04 +00:00
Elliot Roberts
647d0b6dd3 fix unmatched braces 2022-05-06 00:17:02 -07:00
Scott McMurray
ebdcb08abf For now, don't change the details of hashing a str
We might want to change the default before stabilizing (or maybe even after), but for getting in the new unstable methods, leave it as-is for now.  That way it won't break cargo and such.
2022-05-06 00:14:44 -07:00
Scott McMurray
98054377ee Add a dedicated length-prefixing method to Hasher
This accomplishes two main goals:
- Make it clear who is responsible for prefix-freedom, including how they should do it
- Make it feasible for a `Hasher` that *doesn't* care about Hash-DoS resistance to get better performance by not hashing lengths

This does not change rustc-hash, since that's in an external crate, but that could potentially use it in future.
2022-05-06 00:03:38 -07:00
bors
9714e139ff Auto merge of #96759 - compiler-errors:rollup-p4jtm92, r=compiler-errors
Rollup of 7 pull requests

Successful merges:

 - #96174 (mark ptr-int-transmute test as no_run)
 - #96639 (Fix typo in `offset_from` documentation)
 - #96704 (Add rotation animation on settings button when loading)
 - #96730 (Add a regression test for #64173 and #66152)
 - #96741 (Improve settings loading strategy)
 - #96744 (Implement [OsStr]::join)
 - #96747 (Add `track_caller` to `DefId::expect_local()`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-06 04:56:23 +00:00
SparrowLii
8ff01894a0 turn append_place_to_string from recursion into iteration 2022-05-06 12:11:42 +08:00
David Wood
af47257c0d typeck: port "explicit generic args w/ impl trait"
Port the "explicit generic arguments with impl trait" diagnostic to
using the diagnostic derive.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-06 03:46:12 +01:00
David Wood
3f413d2abb sess: add create_{err,warning}
Currently, the only API for creating errors from a diagnostic derive
will emit it immediately. This makes it difficult to add subdiagnostics
to diagnostics from the derive, so add `create_{err,warning}` functions
that return the diagnostic without emitting it.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-06 03:44:41 +01:00
David Wood
859079ff12 macros: allow Vec fields in diagnostic derive
Diagnostics can have multiple primary spans, or have subdiagnostics
repeated at multiple locations, so support `Vec<..>` fields in the
diagnostic derive which become loops in the generated code.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-06 03:43:30 +01:00
Michael Goulet
b8c829b64f
Rollup merge of #96747 - JohnTitor:expect-local-track-caller, r=compiler-errors
Add `track_caller` to `DefId::expect_local()`

Suggested in https://github.com/rust-lang/rust/issues/96738#issuecomment-1118961888.
`DefId::expect_local()` often causes ICEs (panics) and should be a good candidate to add `track_caller`.
2022-05-05 19:34:27 -07:00
Michael Goulet
8bcf4b0efc
Rollup merge of #96744 - est31:join_osstr, r=thomcc
Implement [OsStr]::join

Implements join for `OsStr` and `OsString` slices:

```Rust
    let strings = [OsStr::new("hello"), OsStr::new("dear"), OsStr::new("world")];
    assert_eq!("hello dear world", strings.join(OsStr::new(" ")));
````

This saves one from converting to strings and back, or from implementing it manually.
2022-05-05 19:34:26 -07:00
Michael Goulet
7cdad77536
Rollup merge of #96741 - GuillaumeGomez:improve-settings-loading-strategy, r=jsha
Improve settings loading strategy

I learned about this thanks to ```@jsha``` who suggested this approach:

It improves the settings loading strategy by loading CSS and JS at the same time to prevent the style to be applied afterwards on slow connections.

r? ```@jsha```
2022-05-05 19:34:25 -07:00
Michael Goulet
b78179e1f7
Rollup merge of #96730 - JohnTitor:unused-lifetimes-tests, r=compiler-errors
Add a regression test for #64173 and #66152

Closes #64173
Closes #66152

Mixed the code as the root cause seems the same.
2022-05-05 19:34:25 -07:00
Michael Goulet
292eefe753
Rollup merge of #96704 - GuillaumeGomez:rotation-animation, r=jsha
Add rotation animation on settings button when loading

As discussed, I added an animation when the settings JS file is loading (I voluntarily made the timeout at the end of the `settings.js` super long so we can see what the animation looks like):

https://user-images.githubusercontent.com/3050060/166693243-816a08b7-5e39-4142-acd3-686ad9950d8e.mp4

r? ````@jsha````
2022-05-05 19:34:24 -07:00
Michael Goulet
ef949daf03
Rollup merge of #96639 - adpaco-aws:fix-offset-from-typo, r=scottmcm
Fix typo in `offset_from` documentation

Small fix for what I think is a typo in the `offset_from` documentation.

Someone reading this may understand that the distance in bytes is obtained by dividing the distance by `mem::size_of::<T>()`, but here we just want to define "units of T" in terms of bytes (i.e., units of T == bytes / `mem::size_of::<T>()`).
2022-05-05 19:34:23 -07:00
Michael Goulet
87ad928c15
Rollup merge of #96174 - RalfJung:no-run-transmute, r=scottmcm
mark ptr-int-transmute test as no_run

This causes [CI failures in Miri](https://github.com/rust-lang/miri-test-libstd/runs/6062500259?check_suite_focus=true) since ptr-int-transmutes are rejected there (when strict provenance is enabled).
2022-05-05 19:34:22 -07:00
David Wood
3dac70fcc0 typeck: port "unconstrained opaque type" diag
Port the "unconstrained opaque type" diagnostic to using the diagnostic
derive.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-06 03:04:30 +01:00
David Wood
80087b98cc bootstrap: bsd platform flags for split debuginfo
Bootstrap currently provides `-Zunstable-options` for OpenBSD when using
split debuginfo - this commit provides it for all BSD targets.

Signed-off-by: David Wood <david.wood@huawei.com>
2022-05-06 03:04:04 +01:00
Joshua Nelson
101f952265 Don't constantly rebuild clippy on x test src/tools/clippy.
This happened because the `SYSROOT` variable was set for `x test`, but not `x build`.
Set it consistently for both to avoid unnecessary rebuilds.
2022-05-05 20:40:01 -05:00
Michael Howell
903aebe318 Fix test case checking for where the JS goes 2022-05-05 18:26:47 -07:00
Joshua Nelson
7443cc2bd6 Enable compiler-docs by default for compiler, codegen, and tools profiles. 2022-05-05 20:05:12 -05:00
Michael Howell
20010d7597 rustdoc: ensure HTML/JS side implementors don't have dups 2022-05-05 17:45:33 -07:00
Scott McMurray
30309db972 Put the 2229 migration errors in alphabetical order
Looks like they were in FxHash order before, so it might just be luck that this used to be consistent across different word lengths.
2022-05-05 17:41:02 -07:00
Peh
e79ba76ec4 Fixing #95444 by only displaying passes that take more than 5 milliseconds
95444: Adding passes that include memory increase

Fix95444: Change the substraction with the abs_diff() method

Fix95444: Change the substraction with abs_diff() method
2022-05-05 23:56:40 +00:00
bors
74cea9fdb9 Auto merge of #96520 - lcnr:general-incoherent-impls, r=petrochenkov
generalize "incoherent impls" impl for user defined types

To allow the move of `trait Error` into core.

continues the work from #94963, finishes https://github.com/rust-lang/compiler-team/issues/487

r? `@petrochenkov` cc `@yaahc`
2022-05-05 23:24:36 +00:00
Yuki Okushi
2ed38cdbdd
Add track_caller to DefId::expect_local() 2022-05-06 07:28:06 +09:00
Yuki Okushi
436c0e129c
Fix an ICE on #96738 2022-05-06 07:15:35 +09:00
est31
4fcbc53820 Implement [OsStr]::join 2022-05-05 21:58:11 +02:00
Mara Bos
21c5f780f4 Remove condvar::two_mutexes test.
We don't guarantee this panics. On most platforms it doesn't anymore.
2022-05-05 21:47:13 +02:00
bors
30f3860875 Auto merge of #96735 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`
2022-05-05 19:28:41 +00:00
Guillaume Gomez
87b6326d67 Improve settings loading strategy by loading CSS and JS at the same time to prevent the style to be applied afterwards on slow connections 2022-05-05 20:19:40 +02:00
Aaron Hill
40c6d838cd
Don't cache results of coinductive cycle
Fixes #96319

The logic around handling co-inductive cycles in the evaluation cache
is confusing and error prone. Fortunately, a perf run showed that it
doesn't actually appear to improve performance, so we can simplify
this code (and eliminate a source of ICEs) by just skipping caching
the evaluation results for co-inductive cycle participants.

This commit makes no changes to any of the other logic around
co-inductive cycle handling. Thus, while this commit could
potentially expose latent bugs that were being hidden by
caching, it should not introduce any new bugs.
2022-05-05 14:01:35 -04:00
est31
3989f02301 Allow unused rules in the testsuite where the lint triggers 2022-05-05 19:13:00 +02:00
est31
d76a9394ba Add tests
Also rename the test files for the unused_macros lint to avoid confusion.
The test files now follow a <lint_name><-maybe-decl>.rs scheme.
2022-05-05 19:13:00 +02:00
est31
5646e9a172 Allow unused rules in some places in the compiler, library and tools 2022-05-05 19:13:00 +02:00
est31
0bd2232fe4 Implement the unused_macro_rules lint 2022-05-05 19:13:00 +02:00
bors
50cf76c24b Auto merge of #96734 - matthiaskrgr:rollup-hng33tb, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #95359 (Update `int_roundings` methods from feedback)
 - #95843 (Improve Rc::new_cyclic and Arc::new_cyclic documentation)
 - #96507 (Suggest calling `Self::associated_function()`)
 - #96635 (Use "strict" mode in JS scripts)
 - #96673 (Report that opaque types are not allowed in impls even in the presence of other errors)
 - #96682 (Show invisible delimeters (within comments) when pretty printing.)
 - #96714 (interpret/validity: debug-check ScalarPair layout information)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-05-05 16:59:54 +00:00
Ellen
fea1d76503 make compare_generic_param_kinds errors consistent 2022-05-05 17:45:39 +01:00
Michael Howell
4c183cd2d4 rustdoc: fix JS error when rendering parse error 2022-05-05 09:39:47 -07:00
Michael Howell
75790fabed rustdoc: add test case assertions for ArrowDown highlight first result 2022-05-05 09:39:47 -07:00
Michael Howell
8b2147b497 rustdoc: fix keyboard shortcuts and console log on search page 2022-05-05 09:39:45 -07:00
Michael Howell
21a121332b rustdoc: change the "In Function Signatures" to context-sensitive
* If it's just `-> a`, use "In Function Return Types"
* If it's just `a b`, use "In Function Parameters"
* Otherwise, still use "In Function Signatures"
2022-05-05 09:37:29 -07:00
Michael Howell
345a580e8d Use STARTS_WITH, since it's more specific
Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-05-05 09:37:29 -07:00
Michael Howell
6c8a2d4715 rustdoc: when running a function-signature search, tweak the tab bar 2022-05-05 09:37:29 -07:00
flip1995
f47d2b3ad6
(Partially) Revert "HACK: Move buggy lints to nursery"
This reverts commit bb01aca86f.

Partial: Keep regression tests
2022-05-05 15:20:07 +01:00
flip1995
463c760aa1
Update Cargo.lock 2022-05-05 15:13:10 +01:00
flip1995
496384531e
Merge commit '7c21f91b15b7604f818565646b686d90f99d1baf' into clippyup 2022-05-05 15:12:52 +01:00
Matthias Krüger
68048199c9
Rollup merge of #96714 - RalfJung:scalar-pair-debug, r=oli-obk
interpret/validity: debug-check ScalarPair layout information

This would have caught https://github.com/rust-lang/rust/issues/96158.
I ran the Miri test suite and it still passes.

r? `@oli-obk`
2022-05-05 15:43:07 +02:00