| Age | Commit message (Collapse) | Author | Lines |
|
`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:
https://github.com/rust-lang/rust/blob/101e1822c3e54e63996c8aaa014d55716f3937eb/library/alloc/src/vec/mod.rs#L2479-L2492
|
|
|
|
|
|
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).
|
|
Use it in all UI tests that are about the semantics and not the syntax
of type ascription.
|
|
|
|
|
|
|
|
Before, the lint did the checking for `must_use` and pretty printing the
types in a special format in one pass, causing quite complex and
untranslatable code.
Now the collection and printing is split in two. That should also make
it easier to translate or extract the type pretty printing in the
future.
Also fixes an integer overflow in the array length pluralization
calculation.
|
|
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
|
|
This relies on the CI testing a rustc that's compiled with overflow-checks = true
|
|
|
|
|
|
|
|
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](https://github.com/rust-lang/rust/pull/104593/commits/c4165f3a965e258531928180195637455299c6f3), which touches clippy too.
|
|
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`
|
|
detect () to avoid redundant <> suggestion for type
fix #104379
|
|
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.
|
|
|
|
Revert "Normalize opaques with escaping bound vars"
This caused a perf regression in #103423, cc `@skyzh` this should fix #103423.
reverts #100980
r? `@oli-obk`
|
|
r=compiler-errors
diagnostics: only show one suggestion for method -> assoc fn
Fixes #102354
|
|
deduplicate tests
originally added in #100514. Using revisions for this reduces the amount of tests in the repo
|
|
Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less
there are only like 3 or 4 call sites left after this but it wasnt obvious to me how to remove them
|
|
nll: correctly deal with bivariance
fixes #104409
when in a bivariant context, relating stuff should always trivially succeed. Also changes the mir validator to correctly deal with higher ranked regions.
r? types cc ``@RalfJung``
|
|
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #102977 (remove HRTB from `[T]::is_sorted_by{,_key}`)
- #103378 (Fix mod_inv termination for the last iteration)
- #103456 (`unchecked_{shl|shr}` should use `u32` as the RHS)
- #103701 (Simplify some pointer method implementations)
- #104047 (Diagnostics `icu4x` based list formatting.)
- #104338 (Enforce that `dyn*` coercions are actually pointer-sized)
- #104498 (Edit docs for `rustc_errors::Handler::stash_diagnostic`)
- #104556 (rustdoc: use `code-header` class to format enum variants)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
rustdoc: use `code-header` class to format enum variants
The font size and weights should be exactly the same after this PR, but the spacing is changed to be the same as methods.
Preview: http://notriddle.com/notriddle-rustdoc-demos/variant/test_dingus_enum/enum.TestEnum.html
|
|
Enforce that `dyn*` coercions are actually pointer-sized
Implement a perma-unstable, rudimentary `PointerSized` trait to enforce `dyn*` casts are `usize`-sized for now, at least to prevent ICEs and weird codegen issues from cropping up after monomorphization since currently we enforce *nothing*.
This probably can/should be removed in favor of a more sophisticated trait for handling `dyn*` conversions when we decide on one, but I just want to get something up for discussion and experimentation for now.
r? ```@eholk``` cc ```@tmandry``` (though feel free to claim/reassign)
Fixes #102141
Fixes #102173
|
|
`unchecked_{shl|shr}` should use `u32` as the RHS
The other shift methods, such as https://doc.rust-lang.org/nightly/std/primitive.u64.html#method.checked_shr and https://doc.rust-lang.org/nightly/std/primitive.i16.html#method.wrapping_shl, use `u32` for the shift amount. That's consistent with other things, like `count_ones`, which also always use `u32` for a bit count, regardless of the size of the type.
This PR changes `unchecked_shl` and `unchecked_shr` to also use `u32` for the shift amount (rather than Self).
cc #85122, the `unchecked_math` tracking issue
|
|
remove HRTB from `[T]::is_sorted_by{,_key}`
Changes the signature of `[T]::is_sorted_by{,_key}` to match `[T]::binary_search_by{,_key}` and make code like https://github.com/rust-lang/rust/issues/53485#issuecomment-885393452 compile.
Tracking issue: https://github.com/rust-lang/rust/issues/53485
~~Do we need an ACP for something like this?~~ Edit: Filed ACP here: https://github.com/rust-lang/libs-team/issues/121
|
|
When doing the optimized implementation of getting the discriminant, the
arithmetic needs to be done in the tag type so wrapping behavior works
correctly.
Fixes #104519
|
|
Rollup of 8 pull requests
Successful merges:
- #101162 (Migrate rustc_resolve to use SessionDiagnostic, part # 1)
- #103386 (Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting))
- #103405 (Detect incorrect chaining of if and if let conditions and recover)
- #103594 (Fix non-associativity of `Instant` math on `aarch64-apple-darwin` targets)
- #104006 (Add variant_name function to `LangItem`)
- #104494 (Migrate GUI test to use functions)
- #104516 (rustdoc: clean up sidebar width CSS)
- #104550 (fix a typo)
Failed merges:
- #104554 (Use `ErrorGuaranteed::unchecked_claim_error_was_emitted` less)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
|
|
|
|
Fixes #102354
|
|
|
|
Shrink `ast::Expr` harder
r? `@ghost`
|
|
`_` might confuse people into believing that the type isn't known,
while `...` is not used anywhere else for types and is not valid
syntax, making it more likely to convey the right understanding.
|
|
When printing requirement overflow errors, do not print out the full
type name when it is longer than 50 characters long.
|
|
|
|
Instead of simple string cutting, use a custom printer to hide parts of
long printed types.
|
|
|
|
|
|
Migrate GUI test to use functions
r? `@notriddle`
|
|
Detect incorrect chaining of if and if let conditions and recover
Fixes #103381
|
|
Don't allow `CoerceUnsized` into `dyn*` (except for trait upcasting)
This makes sure we don't accidentally allow coercions like `Box<T>` -> `Box<dyn* Trait>`, or in the case of this ICE, `&T` to `&dyn* Trait`. These coercions don't make sense, at least not via the `CoerceUnsized` trait.
Fixes #102172
Fixes #102429
|
|
Rollup of 11 pull requests
Successful merges:
- #103852 (Don't remap early-bound regions for return-position `impl Trait` in trait originating from `impl`)
- #104366 (Simplify settings theme choice)
- #104433 (Fix `emit_unused_delims_expr` ICE)
- #104444 (Fix ICE in in_operand for ty error)
- #104483 (Convert predicates into Predicate in the Obligation constructor)
- #104496 (Don't attempt to normalize compiler backtraces)
- #104503 (rustdoc: remove redundant font-color CSS on `.where`)
- #104508 (Check `dyn*` return type correctly)
- #104515 (ICE fixing, remove is_tainted_by_errors since we have ty_error for delay bug)
- #104532 (Migrate tooltip style to CSS variables)
- #104545 (Readd the matches_macro diag item)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|