Commit Graph

210511 Commits

Author SHA1 Message Date
Markus Everling
b1c3c6380f Fix pretty-std test 2022-11-27 23:15:55 +01:00
Markus Everling
cd68bd9bab Fix natvis VecDeque formatter 2022-11-27 18:09:56 +01:00
Markus Everling
acf95adfe2 Add second test case in make_contiguous_head_to_end 2022-11-26 23:08:57 +01:00
Markus Everling
451259811a Improve slow path in make_contiguous 2022-11-26 22:55:39 +01:00
Markus Everling
f6f25983c6 Don't use Take in SpecExtend impl 2022-11-26 00:44:24 +01:00
Markus Everling
ecca8c5328 Changes according to code review 2022-11-25 03:39:59 +01:00
Markus Everling
a1bf25e2bd Update VecDeque implementation 2022-11-20 15:21:16 +01:00
bors
9cdfe03b06 Auto merge of #103390 - compiler-errors:metadata-mod-regions, r=eholk
Check fat pointer metadata compatibility modulo regions

Regions don't really mean anything anyways during hir typeck.

If this `erase_regions` makes anyone nervous, it's probably equally valid to just equate the types using a type relation, but regardless we should _not_ be using strict type equality while region variables are present.

Fixes #103384
2022-11-20 10:09:39 +00:00
bors
e07425d55b Auto merge of #98914 - fee1-dead-contrib:min-deref-patterns, r=compiler-errors
Minimal implementation of implicit deref patterns for Strings

cc `@compiler-errors` `@BoxyUwU` https://github.com/rust-lang/lang-team/issues/88 #87121

~~I forgot to add a feature gate, will do so in a minute~~ Done
2022-11-20 07:16:42 +00:00
bors
2ed65da152 Auto merge of #104629 - JohnTitor:rollup-vp3m98i, r=JohnTitor
Rollup of 6 pull requests

Successful merges:

 - #103901 (Add tracking issue for `const_arguments_as_str`)
 - #104112 (rustdoc: Add copy to the description of repeat)
 - #104435 (`VecDeque::resize` should re-use the buffer in the passed-in element)
 - #104467 (Fix substraction with overflow in `wrong_number_of_generic_args.rs`)
 - #104608 (Cleanup macro matching recovery)
 - #104626 (Fix doctest errors related to rustc_middle)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-20 04:28:21 +00:00
Yuki Okushi
d553811c1f
Rollup merge of #104626 - reez12g:issue-99144-2, r=jyn514
Fix doctest errors related to rustc_middle

Helps with https://github.com/rust-lang/rust/issues/99144
2022-11-20 13:16:00 +09:00
Yuki Okushi
28034bb2f8
Rollup merge of #104608 - Nilstrieb:fixmed, r=compiler-errors
Cleanup macro matching recovery

The retry has been implemented already in #104335. Also removes a `HACK` comment that's not really needed anymore because the "don't recover during macro matching" isn't really a hack but correct behavior.
2022-11-20 13:15:59 +09:00
Yuki Okushi
3e937d02a0
Rollup merge of #104467 - fuzzypixelz:fix/attempt-to-substract-with-overflow, r=compiler-errors
Fix substraction with overflow in `wrong_number_of_generic_args.rs`

Fixes #104287

This issue happens in the `suggest_moving_args_from_assoc_fn_to_trait_for_qualified_path` function, which seems to run before the error checking facilities can catch an invalid use of generic arguments. Thus we get a subtraction with overflow because the code implicitly assumes that the source program makes sense (or is this assumption not true even if the program is correct?).
2022-11-20 13:15:59 +09:00
Yuki Okushi
785237d392
Rollup merge of #104435 - scottmcm:iter-repeat-n, r=thomcc
`VecDeque::resize` should re-use the buffer in the passed-in element

Today it always copies it for *every* appended element, but one of those clones is avoidable.

This adds `iter::repeat_n` (https://github.com/rust-lang/rust/issues/104434) as the primitive needed to do this.  If this PR is acceptable, I'll also use this in `Vec` rather than its custom `ExtendElement` type & infrastructure that is harder to share between multiple different containers:

101e1822c3/library/alloc/src/vec/mod.rs (L2479-L2492)
2022-11-20 13:15:59 +09:00
Yuki Okushi
e69b84204a
Rollup merge of #104112 - yancyribbens:add-copy-to-repeat-description, r=JohnTitor
rustdoc: Add copy to the description of repeat

Small nit, but it's more clear to say `copy` here instead of defining `repeat` in terms of itself.
2022-11-20 13:15:58 +09:00
Yuki Okushi
0858ca97da
Rollup merge of #103901 - H4x5:fmt-arguments-as-str-tracking-issue, r=the8472
Add tracking issue for `const_arguments_as_str`

Tracking issue: #103900

The original PR didn't create a tracking issue.
2022-11-20 13:15:58 +09:00
reez12g
e1f0d6af15 Fix doctest errors related to rustc_middle 2022-11-20 11:10:45 +09: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
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
Mahmoud Mazouz
3046af0cf6
Add a UI test to ensure rustc doesn't do arithmetic overflows
This relies on the CI testing a rustc that's compiled with overflow-checks = true
2022-11-19 18:54:19 +01:00
Mahmoud Mazouz
01f2a15420
Fix substraction with overflow in wrong_number_of_generic_args.rs
Rarranging the substration and equality check into an addition and an equality
check is sufficient.

Algebra is cool, isn't it?

Co-authored-by: Michael Goulet <michael@errs.io>
2022-11-19 18:53:36 +01:00
Nilstrieb
825b8db34a
Cleanup macro matching recovery
The retry has been implemented already.
2022-11-19 17:46:04 +01: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