Commit graph

165944 commits

Author SHA1 Message Date
Mara Bos
1f2c2bb24f Add comments to futex rwlock implementation. 2022-04-11 14:27:06 +02:00
Mara Bos
7c28791565 Add doc comments to futex operations. 2022-04-11 14:26:52 +02:00
Mara Bos
307aa588f4
Fix typo in futex rwlock.
Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2022-04-08 16:07:07 +02:00
Mara Bos
6cb463cb11 Add futex-based RwLock on Linux. 2022-04-08 13:49:18 +02:00
Mara Bos
f1a40410ec Return status from futex_wake(). 2022-04-07 11:34:35 +02:00
bors
8cd6080f6c Auto merge of #95748 - Dylan-DPC:rollup-t208j51, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #95352 ([bootstrap] Print the full relative path to failed tests)
 - #95646 (Mention `std::env::var` in `env!`)
 - #95708 (Update documentation for `trim*` and `is_whitespace` to include newlines)
 - #95714 (Add test for issue #83474)
 - #95725 (Message: Chunks cannot have a size of zero.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-07 05:12:08 +00:00
Dylan DPC
939f84ab00
Rollup merge of #95725 - hkBst:patch-1, r=Dylan-DPC
Message: Chunks cannot have a size of zero.

Add a message to the assertion that chunks cannot have a size of zero.
2022-04-07 06:04:54 +02:00
Dylan DPC
2e4964ed3d
Rollup merge of #95714 - KSBilodeau:master, r=Dylan-DPC
Add test for issue #83474

Adds test for https://github.com/rust-lang/rust/issues/83474 - second attempt at PR https://github.com/rust-lang/rust/pull/91821 which was abandoned.
2022-04-07 06:04:54 +02:00
Dylan DPC
eeabdec14c
Rollup merge of #95708 - fee1-dead:doc_whitespace_trim, r=Dylan-DPC
Update documentation for `trim*` and `is_whitespace` to include newlines
2022-04-07 06:04:52 +02:00
Dylan DPC
a2df05d4d5
Rollup merge of #95646 - mgeisler:mention-std-env-var, r=Dylan-DPC
Mention `std::env::var` in `env!`

When searching for how to read an environment variable, I first encountered the `env!` macro. It would have been useful to me if the documentation had included a link to `std::env::var`, which is what I was actually looking for.
2022-04-07 06:04:52 +02:00
Dylan DPC
f7499a892e
Rollup merge of #95352 - jyn514:full-relative-path, r=Mark-Simulacrum
[bootstrap] Print the full relative path to failed tests

Before:
```
failures:
    [ui] rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.rs

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 163 filtered out; finished in 0.45s
```

After:
```
failures:
    [ui] src/test/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.rs

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 163 filtered out; finished in 0.45s
```

This allows copy pasting the path or using Ctrl+Click in IDEs to go directly to the file, instead of having to edit the filename first.
2022-04-07 06:04:51 +02:00
Dylan DPC
c331a9293a
Update library/core/src/slice/mod.rs
Co-authored-by: Janusz Marcinkiewicz <virrages@gmail.com>
2022-04-07 04:44:30 +02:00
Dylan DPC
7660b2fd74
remove exclamation mark
Co-authored-by: Janusz Marcinkiewicz <virrages@gmail.com>
2022-04-07 04:44:11 +02:00
bors
846993ec43 Auto merge of #95688 - pfmooney:libc-update, r=Mark-Simulacrum
Update libc to 0.2.121

With the updated libc, UNIX stack overflow handling in libstd can now
use the common `si_addr` accessor function, rather than attempting to
use a field from that name in `siginfo_t`.  This simplifies the
collection of the fault address, particularly on platforms where that
data resides within a union in `siginfo_t`.
2022-04-07 02:41:28 +00:00
bors
2310da432c Auto merge of #95745 - Dylan-DPC:rollup-485ajqi, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #95185 (Stabilize Stdin::lines.)
 - #95626 (Don't cast thread name to an integer for prctl)
 - #95709 (Improve terse test output.)
 - #95735 (Revert "Mark Location::caller() as #[inline]")
 - #95738 (Switch item-info from div to span)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-07 00:15:18 +00:00
Dylan DPC
fe6d69f410
Rollup merge of #95738 - GuillaumeGomez:item-info-switch-to-span, r=jsha
Switch item-info from div to span

Following discussion in #95684.

cc `@jsha`
r? `@notriddle`
2022-04-07 01:59:24 +02:00
Dylan DPC
b22df08bb0
Rollup merge of #95735 - bjorn3:revert_inline_location_caller, r=compiler-errors
Revert "Mark Location::caller() as #[inline]"

This reverts https://github.com/rust-lang/rust/pull/95619. As noted in https://github.com/rust-lang/rust/pull/95619#issuecomment-1088548140 this seems to break several tests with cg_clif.
2022-04-07 01:59:24 +02:00
Dylan DPC
687e40a959
Rollup merge of #95709 - nnethercote:improve-terse-test-output, r=Dylan-DPC
Improve terse test output.

The current terse output gives 112 chars per line, which causes
wraparound for people using 100 char wide terminals, which is very
common.

This commit changes it to be exactly 100 wide, which makes the output
look much nicer.
2022-04-07 01:59:23 +02:00
Dylan DPC
64e7bf9fae
Rollup merge of #95626 - saethlin:pass-pointer-to-prctl, r=cuviper
Don't cast thread name to an integer for prctl

`libc::prctl` and the `prctl` definitions in glibc, musl, and the kernel headers are C variadic functions. Therefore, all the arguments (except for the first) are untyped. It is only the Linux man page which says that `prctl` takes 4 `unsigned long` arguments. I have no idea why it says this.

In any case, the upshot is that we don't need to cast the pointer to an integer and confuse Miri.

But in light of this... what are we doing with those three `0`s? We're passing 3 `i32`s to `prctl`, which doesn't fill me with confidence. The man page says `unsigned long` and all the constants in the linux kernel are macros for expressions of the form `1UL << N`. I'm mostly commenting on this because looks a whole lot like some UB that was found in SQLite a few years ago: <https://youtu.be/LbzbHWdLAI0?t=1925> that was related to accidentally passing a 32-bit value from a literal `0` instead of a pointer-sized value. This happens to work on x86 due to the size of pointers and happens to work on x86_64 due to the calling convention. But also, there is no good reason for an implementation to be looking at those arguments. Some other calls to `prctl` require that other arguments be zeroed, but not `PR_SET_NAME`... so why are we even passing them?

I would prefer to end such questions by either passing 3 `libc::c_ulong`, or not passing those at all, but I'm not sure which is better.
2022-04-07 01:59:22 +02:00
Dylan DPC
d2f1a0b88c
Rollup merge of #95185 - m-ou-se:stabilize-stdin-lines, r=Mark-Simulacrum
Stabilize Stdin::lines.

Closes https://github.com/rust-lang/rust/issues/87096

Fcp completed here: https://github.com/rust-lang/rust/issues/87096#issuecomment-1028792980
2022-04-07 01:59:21 +02:00
bors
8f36334ca9 Auto merge of #95742 - Dylan-DPC:rollup-8n7o87y, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #95342 (Ignore "format the world" commit in git blame)
 - #95353 ([bootstrap] Give a hard error when filtering tests for a file that does not exist)
 - #95649 (New mir-opt deref_separator)
 - #95721 (Fix typo in bootstrap/setup.rs)
 - #95730 (Rename RWLock to RwLock in std::sys.)
 - #95731 (Check that all hidden types are the same and then deduplicate them.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-06 21:15:16 +00:00
Ben Kimock
e8a6f53af8 Change trailing prctl arguments to c_ulong 2022-04-06 17:11:50 -04:00
Dylan DPC
ebba894f19
Rollup merge of #95731 - oli-obk:lazy_tait_regression, r=compiler-errors
Check that all hidden types are the same and then deduplicate them.

fixes #95538

This used to trigger a sanity check. Now we accept that there may be multiple places where a hidden type is constrained and we merge all of these at the end.

Ideally we'd merge eagerly, but that is a larger refactoring that I don't want to put into a backport
2022-04-06 23:06:10 +02:00
Dylan DPC
d2697e3128
Rollup merge of #95730 - m-ou-se:rwlock-case, r=Dylan-DPC
Rename RWLock to RwLock in std::sys.

std::sync::RwLock is spelled with two capital letters, but std::sys's RWLock was spelled with three capital letters. This cleans that up and uses `RwLock` everywhere.
2022-04-06 23:06:08 +02:00
Dylan DPC
bd92c7c6d7
Rollup merge of #95721 - xu-cheng:typo, r=compiler-errors
Fix typo in bootstrap/setup.rs
2022-04-06 23:06:07 +02:00
Dylan DPC
9fa941c23e
Rollup merge of #95649 - ouz-a:mir-opt, r=oli-obk
New mir-opt deref_separator

This adds a new mir-opt that split certain derefs into this form:
`let x = (*a.b).c;` to => `tmp = a.b; let x = (*tmp).c;`

Huge thanks to ``@oli-obk`` for his patient mentoring.
2022-04-06 23:06:06 +02:00
Dylan DPC
76cd8f8bf0
Rollup merge of #95353 - jyn514:invalid-filter-hard-error, r=Mark-Simulacrum
[bootstrap] Give a hard error when filtering tests for a file that does not exist

A common issue people run into when running compiletest is that filtering for files that don't exist is only a warning and not an error; running the whole test suite instead.
See for example https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Question.20about.20compiletest.
This is especially bad when using `--bless`, which will modify all `.stderr` files.

Change bootstrap to require valid filters instead of discarding invalid filters and continuing.

Before:

```
Warning: Skipping "/home/jnelson/rust-lang/rust/src/test/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.r": not a regular file or directory
Check compiletest suite=rustdoc-ui mode=ui (x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu) -> x86_64-unknown-linux-gnu(x86_64-unknown-linux-gnu))

running 163 tests
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii.......................... 100/163
...............................................................
test result: ok. 89 passed; 0 failed; 74 ignored; 0 measured; 0 filtered out; finished in 7.20s

        finished in 7.248 seconds
Build completed successfully in 0:00:08
```

After:
```
thread 'main' panicked at 'Invalid test suite filter "/home/jnelson/rust-lang/rust/src/test/rustdoc-ui/intra-doc/feature-gate-intra-doc-pointers.r": file or directory does not exist', src/bootstrap/util.rs:311:
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Build completed unsuccessfully in 0:00:08
```
2022-04-06 23:06:05 +02:00
Dylan DPC
86ddbf236e
Rollup merge of #95342 - jyn514:ignore-revs, r=Mark-Simulacrum
Ignore "format the world" commit in git blame

This tells github to hide it in its blame view: https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view
It can also be used locally by running `git config blame.ignorerevsfile .git-blame-ignore-revs` (although it's advised to avoid `--global` since git gives a hard error when the file doesn't exist).

We may want to add more commits in later PRs, but this should be a good start.

Before: ![image](https://user-images.githubusercontent.com/23638587/160255130-d7283cc4-4d33-4a7d-bc70-f9ce6820293c.png)
After: ![image](https://user-images.githubusercontent.com/23638587/160255138-90d0325a-e063-4e0e-8cfb-732724bf6c60.png)
cc https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/Hide.20some.20commits.20in.20GitHub.20blame
2022-04-06 23:06:04 +02:00
Guillaume Gomez
56d0f9484b Update rustdoc test following DOM change 2022-04-06 20:41:57 +02:00
Guillaume Gomez
d48a39a5e2 Switch item-info div to span to generate valid HTML 2022-04-06 20:41:44 +02:00
bjorn3
6a7ff98a99 Revert "Mark Location::caller() as #[inline]"
This reverts commit 6d0b61e2f5.
2022-04-06 18:45:11 +02:00
bors
c2afaba465 Auto merge of #95669 - nnethercote:call-compute_locs-once-per-rule, r=petrochenkov
Call `compute_locs` once per rule

This fixes the small regressions on `wg-grammar` and `hyper-0.14.18` seen in #95555.

r? `@petrochenkov`
2022-04-06 16:29:32 +00:00
Mara Bos
f87d180e7d
Bump stabilization of stdin_forwarders to 1.62.0. 2022-04-06 17:26:33 +02:00
Oli Scherer
27dc503556 Check that all hidden types are the same and then deduplicate them. 2022-04-06 15:02:37 +00:00
Mara Bos
6e16f9b10f Rename RWLock to RwLock in std::sys. 2022-04-06 16:33:53 +02:00
bors
b6ab1fae73 Auto merge of #95707 - RalfJung:initialized, r=oli-obk
interp/validity: enforce Scalar::Initialized

This is a follow-up to https://github.com/rust-lang/rust/pull/94527, to also account for the new kind of `Scalar` layout inside the validity checker.

r? `@oli-obk`
2022-04-06 14:07:27 +00:00
Martin Geisler
4f08d75375 Mention std::env::var in env!
When searching for how to read an environment variable, I first encountered the `env!` macro. It would have been useful to me if the documentation had included a link to `std::env::var`, which is what I was actually looking for.
2022-04-06 14:23:42 +02:00
bors
201cf3dba3 Auto merge of #95723 - SparrowLii:const_goto, r=fee1-dead
enhance `ConstGoto` mir-opt by moving up `StorageDead` statements

From the `FIXME` in the implementation of `ConstGoto` miropt. We can move `StorageDead` statements up to the predecessor. This can expand the scope of application of this opt.
2022-04-06 10:08:08 +00:00
Marijn Schouten
2b76da86ef
Message: Chunks cannot have a size of zero.
Add a message to the assertion that chunks cannot have a size of zero.
2022-04-06 09:54:43 +02:00
SparrowLii
a91b347768 enhance ConstGoto mir-opt by moving up StorageDead statements 2022-04-06 15:17:41 +08:00
bors
ce1a8131c6 Auto merge of #95720 - ehuss:update-cargo, r=ehuss
Update cargo

5 commits in 1ef1e0a12723ce9548d7da2b63119de9002bead8..e2e2dddebe66dfc1403a312653557e332445308b
2022-03-31 00:17:18 +0000 to 2022-04-05 17:04:53 +0000
- Part 2 of RFC2906 -- allow inheriting from a different `Cargo.toml` (rust-lang/cargo#10517)
- File Cache is valid if checkout or contents hasn't changed (rust-lang/cargo#10507)
- Fix how scrape-examples handles proc macros (rust-lang/cargo#10533)
- tools: update checkout action on CI (rust-lang/cargo#10521)
- Don't error if no binaries were installed (rust-lang/cargo#10508)
2022-04-06 06:08:47 +00:00
Cheng XU
48684097db
Fix typo in bootstrap/setup.rs 2022-04-05 22:52:30 -07:00
Eric Huss
43f80a6008 Update cargo 2022-04-05 21:19:53 -07:00
bors
5da76eeaad Auto merge of #95711 - Dylan-DPC:rollup-ujss3oi, r=Dylan-DPC
Rollup of 4 pull requests

Successful merges:

 - #95659 (Rely on #[link] attribute for unwind on Fuchsia.)
 - #95684 (rustdoc: Fix item info display overflow)
 - #95693 (interp: pass TyCtxt to Machine methods that do not take InterpCx)
 - #95699 (fix: Vec leak when capacity is 0)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-06 03:45:36 +00:00
kangarooCoder
c62d2106da Merge remote-tracking branch 'origin/master' 2022-04-05 21:50:12 -05:00
kangarooCoder
594a2fcc3f Add test for issue rust-lang/rust#83474 2022-04-05 21:45:07 -05:00
Dylan DPC
b4527492b1
Rollup merge of #95699 - SparkyPotato:master, r=dtolnay
fix: Vec leak when capacity is 0

When `RawVec::with_capacity_in` is called with capacity 0, an allocation of size 0 is allocated.
However, `<RawVec as Drop>::drop` doesn't deallocate, since it only checks if capacity was 0. Fixed by not allocating when capacity is 0.
2022-04-06 03:39:09 +02:00
Dylan DPC
acdba55b53
Rollup merge of #95693 - RalfJung:more-context, r=oli-obk
interp: pass TyCtxt to Machine methods that do not take InterpCx

This just seems like something you might need, so let's consistently have it.

One day we might have to add `ParamEnv` as well, though that seems less likely (and in Miri you can always use `reveal_all` anyway). It might make sense to have a type that packages `TyCtxt` and `ParamEnv`, this pairing occurs quite frequently in rustc...

r? `@oli-obk`
2022-04-06 03:39:08 +02:00
Dylan DPC
84e1aa2d59
Rollup merge of #95684 - GuillaumeGomez:fix-item-info-overflow, r=notriddle
rustdoc: Fix item info display overflow

I came across this issue when reading local `Iterator` docs (reproduced in this screenshot):

![Screenshot from 2022-04-05 17-45-13](https://user-images.githubusercontent.com/3050060/161798150-769ee838-4768-4df8-9d34-b02eb8104eed.png)

The problem comes from the fact that `span` isn't `display: block` by default. Since `item-info` was already present on `<div>` in other places, I moved the last one to `div` as well.

r? `@notriddle`
2022-04-06 03:39:08 +02:00
Dylan DPC
823bf7618a
Rollup merge of #95659 - anp:remove-link-print, r=tmandry
Rely on #[link] attribute for unwind on Fuchsia.

Closes #95575.
2022-04-06 03:39:07 +02:00