Commit Graph

210505 Commits

Author SHA1 Message Date
Ralf Jung
7225524744 add a weak form of protection that justifies Box noalias 2022-11-20 18:15:24 +01:00
Ralf Jung
c043a0e7d6 cfg(miri) no longer needed in sys/unix/time.rs 2022-11-20 12:13:48 +01:00
Ralf Jung
a689eb0ded update lockfile 2022-11-20 12:13:48 +01:00
bors
8459a16869 Auto merge of #2683 - RalfJung:align_offset, r=RalfJung
make align_offset always work on no-provenance pointers

Fixes https://github.com/rust-lang/miri/issues/2682
2022-11-20 10:16:02 +00:00
Ralf Jung
c8c82a0bca make align_offset always work on no-provenance pointers 2022-11-20 11:01:00 +01:00
bors
c26b510dbc Auto merge of #2681 - RalfJung:seed, r=oli-obk
make miri-seed a regular integer, and also set layout-seed in many-seeds

This makes the seed format consistent between `-Zlayout-seed` and `-Zmiri-seed`.
2022-11-20 09:49:34 +00:00
Ralf Jung
772d521616 make miri-seed a regular integer, and also set layout-seed in many-seeds 2022-11-20 10:49:13 +01:00
bors
0a9e5e8e81 Auto merge of #2680 - RalfJung:rustup, r=RalfJung
Rustup
2022-11-20 07:06:11 +00:00
Ralf Jung
4da7d4b168 fix unused warning in a test 2022-11-20 08:04:36 +01:00
Ralf Jung
3865e654f0 Merge from rustc 2022-11-20 07:48:27 +01:00
Ralf Jung
aada2d1689 Preparing for merge from rustc 2022-11-20 07:48:21 +01:00
bors
7477c1f4f7 Auto merge of #104522 - RalfJung:try_normalize_after_erasing_regions, r=oli-obk
try_normalize_after_erasing_regions: promote an assertion to always run

In https://github.com/rust-lang/miri/issues/2433 this assertion has been seen to trigger, so it might be worth actually checking this? Regressing debug assertions are very easy to miss until much later, and then they become quite hard to debug.
2022-11-20 01:16:52 +00:00
bors
fc105ef61f Auto merge of #2679 - RalfJung:clock_gettime, r=RalfJung
implement clock_gettime on macos

and pull in rustc changes so we can test this against https://github.com/rust-lang/rust/pull/103594.

Fixes https://github.com/rust-lang/miri/issues/2664
2022-11-19 22:48:10 +00:00
Ralf Jung
21321f57c2 implement clock_gettime on macos 2022-11-19 23:47:41 +01:00
bors
cd1f782b74 Auto merge of #104470 - ehuss:cdb-dupe-last-command, r=jyn514
Don't duplicate last cdb debuginfo test command

cdb scripts interpret a blank line to mean "repeat the last command", similar to what happens when running the debugger from a console. The code for compiletest that constructs the debugger script was inserting a blank line between the last command and the "quit" command. This caused the last command to be executed twice. This can cause some confusion since the `-check` lines are expecting the output in a certain order. But printing the last command twice causes that order-assumption to fail, and that can cause confusion.

This fixes it by removing the blank line.

AFAICT, gdb and lldb scripts don't have the same behavior with blank lines (and the gdb code doesn't add any blank lines anyways).
2022-11-19 22:25:18 +00:00
bors
c5d82ed7a4 Auto merge of #102795 - lukas-code:constify-is-aligned-via-align-offset, r=oli-obk
Constify `is_aligned` via `align_offset`

Alternative to https://github.com/rust-lang/rust/pull/102753

Make `align_offset` work in const eval (and not always return `usize::MAX`) and then use that to constify `is_aligned{_to}`.

Tracking Issue: https://github.com/rust-lang/rust/issues/104203
2022-11-19 18:57:39 +00:00
Lukas Markeffsky
c9c017dfb5 update provenance test
* fix allocation alignment for 16bit platforms
* add edge case where `stride % align != 0` on pointers with provenance
2022-11-19 16:58:02 +01:00
Lukas Markeffsky
53c2ee8e9b fix assembly test on apple 2022-11-19 16:58:02 +01:00
Lukas
e90d15b247 Update comment on pointer-to-usize transmute
Co-authored-by: Ralf Jung <post@ralfj.de>
2022-11-19 16:58:02 +01:00
Lukas Markeffsky
3d7e9c4b7f Revert "don't call align_offset during const eval, ever"
This reverts commit f3a577bfae376c0222e934911865ed14cddd1539.
2022-11-19 16:58:02 +01:00
Lukas Markeffsky
9e5d497b67 fix const align_offset implementation 2022-11-19 16:57:58 +01:00
Lukas Markeffsky
8717455b9d fix assembly test on windows 2022-11-19 16:47:42 +01:00
Lukas Markeffsky
60f352fd7d replace potential ICE with graceful error (no_core only) 2022-11-19 16:47:42 +01:00
Lukas Markeffsky
8a6053618f docs cleanup
* Fix doc examples for Platforms with underaligned integer primitives.
* Mutable pointer doc examples use mutable pointers.
* Fill out tracking issue.
* Minor formatting changes.
2022-11-19 16:47:42 +01:00
Lukas Markeffsky
daccb8c11a always use align_offset in is_aligned_to + add assembly test 2022-11-19 16:47:42 +01:00
Lukas Markeffsky
4696e8906d Schrödinger's pointer
It's aligned *and* not aligned!
2022-11-19 16:47:42 +01:00
Lukas Markeffsky
df0bcfe644 address more review comments
* `cfg` only the body of `align_offset`
* put explicit panics back
* explain why `ptr.align_offset(align) == 0` is slow
2022-11-19 16:47:42 +01:00
Lukas Markeffsky
093c02ed46 document is_aligned{,_to} 2022-11-19 16:47:42 +01:00
Lukas Markeffsky
a906f6cb69 don't call align_offset during const eval, ever 2022-11-19 16:47:42 +01:00
Lukas Markeffsky
24e88066dc mark align_offset as #[must_use] 2022-11-19 16:47:42 +01:00
Lukas Markeffsky
2ef9a8ae0f add coretests for is_aligned 2022-11-19 16:47:42 +01:00
Lukas Markeffsky
6f6320a0a9 constify pointer::is_aligned{,_to} 2022-11-19 16:47:42 +01:00
Lukas Markeffsky
8cf6b16185 add coretests for const align_offset 2022-11-19 16:47:38 +01:00
bors
2a434286a9 Auto merge of #104607 - matthiaskrgr:rollup-9s589me, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #103117 (Use `IsTerminal` in place of `atty`)
 - #103969 (Partial support for running UI tests with `download-rustc`)
 - #103989 (Fix build of std for thumbv7a-pc-windows-msvc)
 - #104076 (fix sysroot issue which appears for ci downloaded rustc)
 - #104469 (Make "long type" printing type aware and trim types in E0275)
 - #104497 (detect () to avoid redundant <> suggestion for type)
 - #104577 (Don't focus on notable trait parent when hiding it)
 - #104587 (Update cargo)
 - #104593 (Improve spans for RPITIT object-safety errors)
 - #104604 (Migrate top buttons style to CSS variables)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-19 15:40:04 +00:00
Lukas Markeffsky
211743b2c8 make const align_offset useful 2022-11-19 16:36:08 +01:00
Lukas Markeffsky
f770fecfe1 unify inherent impls of CompileTimeEvalContext 2022-11-19 16:36:08 +01:00
Lukas Markeffsky
f13c4f4d6a constify exact_div intrinsic 2022-11-19 16:36:08 +01:00
Matthias Krüger
f69f4cb19c
Rollup merge of #104604 - GuillaumeGomez:migrate-top-button-to-css-var, r=notriddle
Migrate top buttons style to CSS variables

No UI changes.

r? `@notriddle`
2022-11-19 15:35:23 +01:00
Matthias Krüger
c571b2a964
Rollup merge of #104593 - compiler-errors:rpitit-object-safety-spans, r=fee1-dead
Improve spans for RPITIT object-safety errors

No reason why we can't point at the `impl Trait` that causes the object-safety violation.

Also [drive-by: Add is_async fn to hir::IsAsync](c4165f3a96), which touches clippy too.
2022-11-19 15:35:23 +01:00
Matthias Krüger
c916a8df53
Rollup merge of #104587 - weihanglo:update-cargo, r=weihanglo
Update cargo

3 commits in 16b097879b6f117c8ae698aab054c87f26ff325e..eb5d35917b2395194593c9ca70c3778f60c1573b
2022-11-14 23:28:16 +0000 to 2022-11-17 22:08:43 +0000
- Fix several tests that are waiting 60 seconds for publishing to time out (rust-lang/cargo#11388)
- Implement RFC 3139: alternative registry authentication support (rust-lang/cargo#10592)
- Fix cargo install --index when used with registry.default (rust-lang/cargo#11302)

r? `@ghost`
2022-11-19 15:35:22 +01:00
Matthias Krüger
e2dcc28d3c
Rollup merge of #104577 - GuillaumeGomez:remove-focus-on-blur, r=notriddle
Don't focus on notable trait parent when hiding it

I clicked on a notable trait icon so the popup remained and then clicked on the settings menu. When the settings menu was blurred, it scrolled back to when the notable trait was, which isn't great.

r? `@notriddle`
2022-11-19 15:35:22 +01:00
Matthias Krüger
e86f1845ff
Rollup merge of #104497 - lyming2007:issue-104379-fix, r=fee1-dead
detect () to avoid redundant <> suggestion for type

fix #104379
2022-11-19 15:35:21 +01:00
Matthias Krüger
06707c073d
Rollup merge of #104469 - estebank:long-types, r=oli-obk
Make "long type" printing type aware and trim types in E0275

Instead of simple string cutting, use a custom printer to hide parts of long printed types.

On E0275, check for type length before printing.
2022-11-19 15:35:21 +01:00
Matthias Krüger
d6298d3dc8
Rollup merge of #104076 - ozkanonur:fix-ci-rustc-sysroot, r=jyn514
fix sysroot issue which appears for ci downloaded rustc

Currently when compiler is downloaded rather than compiled, sysroot is being `ci-rustc-sysroot` because of 7eef946fc0/src/bootstrap/compile.rs (L1125-L1131) this.

And rustdoc is overriding the downloaded one at the end of the process.

With the condition I add, we simply check if the current compiler stage is target build stage, if so use the proper sysroot instead of `ci-rustc-sysroot`.

Resolves #103206
2022-11-19 15:35:20 +01:00
Matthias Krüger
747f29fbab
Rollup merge of #103989 - arlosi:arm32-panic, r=Amanieu
Fix build of std for thumbv7a-pc-windows-msvc

Attempting to build std for the tier-3 target `thumbv7a-pc-windows-msvc` fails with the following error:
```
Building stage1 std artifacts (x86_64-pc-windows-msvc -> thumbv7a-pc-windows-msvc)
..
LLVM ERROR: WinEH not implemented for this target
error: could not compile `panic_unwind`
```

EH (unwinding) is not supported by LLVM for 32 bit arm msvc targets. This changes panic unwind to use the dummy implementation for `thumbv7a-pc-windows-msvc`.
2022-11-19 15:35:20 +01:00
Matthias Krüger
4451e2881f
Rollup merge of #103969 - ferrocene:pa-download-rustc-ui-tests, r=jyn514
Partial support for running UI tests with `download-rustc`

Right now trying to run UI tests with `download-rustc` results in a bunch of test failures, requiring someone who wants to only work on tests to also build the full compiler. This PR **partially** addresses the problem by solving a lot of the errors (but not all).

* This installs the `rust-src` component on CI toolchains, since the test output depends on whether the standard library source code is installed; We can't just symlink the current source because the `rustc-dev` component already includes the compiler sources, but not the library sources, and mixing things is worse IMO.
* This ensures the `$SRC_DIR` normalization done by compiletest correctly handles the source code added above.
* This unconditionally sets `remap-prefix` to the prefix used in the downloaded toolchain, to ensure compiletest normalizes it.
2022-11-19 15:35:19 +01:00
Matthias Krüger
52cc0d5360
Rollup merge of #103117 - joshtriplett:use-is-terminal, r=eholk
Use `IsTerminal` in place of `atty`

In any crate that can use nightly features, use `IsTerminal` rather than
`atty`:

- Use `IsTerminal` in `rustc_errors`
- Use `IsTerminal` in `rustc_driver`
- Use `IsTerminal` in `rustc_log`
- Use `IsTerminal` in `librustdoc`
2022-11-19 15:35:18 +01:00
bors
62c627c7a3 Auto merge of #104571 - clubby789:remove-vec-rc-opt, r=the8472
Revert Vec/Rc storage reuse opt

Remove the optimization for using storage added by #104205.
The perf wins were pretty small, and it relies on non-guarenteed behaviour. On platforms that don't implement shrinking in place, the performance will be significantly worse.

While it could be gated to platforms that do this (such as GNU), I don't think it's worth the overhead of maintaining it for very small gains. (#104565, #104563)

cc `@RalfJung` `@matthiaskrgr`

Fixes #104565
Fixes #104563
2022-11-19 12:44:57 +00:00
Ralf Jung
81ee8c13dc Merge from rustc 2022-11-19 13:40:56 +01:00
Ralf Jung
e2f6a1b931 Preparing for merge from rustc 2022-11-19 13:40:47 +01:00