| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Also includes a simple test with a custom panic hook to ensure we don't regress.
|
|
The same problem as in https://github.com/rust-lang/rust/issues/65023 was
introduced by https://github.com/rust-lang/rust/pull/67657. This works
around the current incrcomp issue with these attributes by allowing it
here.
|
|
|
|
libstd uses `core::panic::Location` where possible.
cc @eddyb
|
|
|
|
Also remove const-hack for abs
Closes #67842.
r? @oli-obk
|
|
no longer promote non-pattern const functions
This is trying to pack-pedal a bit on promotion feature creep, as proposed by @eddyb [here](https://github.com/rust-lang/const-eval/issues/19#issuecomment-472799062): possibly, a sane subset of `const fn` that we could promote are those that are just constructors -- the same subset that we might want to allow in pattern position at some point.
So, this removes the `rustc_promotable` attribute from the three functions they identified that do not fit this pattern. The first step is to run crater to see if there is code in the wild that relies on this being promotable.
r? @oli-obk
|
|
|
|
Rollup of 10 pull requests
Successful merges:
- #67450 (Allow for setting a ThinLTO import limit during bootstrap)
- #67595 (Suggest adding a lifetime constraint for opaque type)
- #67636 (allow rustfmt key in [build] section)
- #67736 (Less-than is asymmetric, not antisymmetric)
- #67762 (Add missing links for insecure_time)
- #67783 (Warn for bindings named same as variants when matching against a borrow)
- #67796 (Ensure that we process projections during MIR inlining)
- #67807 (Use drop instead of the toilet closure `|_| ()`)
- #67816 (Clean up err codes)
- #67825 (Minor: change take() docs grammar to match other docs)
Failed merges:
r? @ghost
|
|
Minor: change take() docs grammar to match other docs
Eg. mem::replace()
|
|
Less-than is asymmetric, not antisymmetric
This has bothered me for a while. It's such a small nit, but...
|
|
Revert #65244 for performance reasons
This reverts commit f35517ee861dc012ccc26083dd4520045e2c4f6f.
Revert #65244 so we can see if it is the cause of the performance issue in #67706
cc https://github.com/rust-lang/rust/issues/67644
|
|
Eg. mem::replace()
|
|
Using a pure spin lock for a critical section in a preemptable thread
is always wrong, however short the critical section may be. The thread
might be preempted, which will cause all other threads to hammer
busily at the core for the whole quant. Moreover, if threads have
different priorities, this might lead to a priority inversion problem
and a deadlock. More generally, a spinlock is not more efficient than
a well-written mutex, which typically does several spin iterations at
the start anyway.
The advise about UP vs SMP is also irrelevant in the context of
preemptive threads.
|
|
|
|
This fixes a bug where after calling pad_integral with appropriate flags, the
fill and alignment flags would be set to '0' and 'Right' and left as such even
after exiting pad_integral, which meant that future calls on the same Formatter
would get incorrect flags reported.
This is quite difficult to observe in practice, as almost all formatting
implementations in practice don't call `Display::fmt` directly, but rather use
`write!` or a similar macro, which means that they cannot observe the effects of
the wrong flags (as `write!` creates a fresh Formatter instance). However, we
include a test case.
|
|
This reverts commit f35517ee861dc012ccc26083dd4520045e2c4f6f.
|
|
Constify Result
r? @oli-obk
This is just the `Result`-part of #67494 which I'll resubmit once #66254 has landed.
|
|
|
|
doc: minus (U+2212) instead of dash (U+002D) for negative infinity
The documentation for [`f32::NEG_INFINITY`](https://doc.rust-lang.org/std/f32/constant.NEG_INFINITY.html) contains “-∞” with a dash instead of a minus sign, “−∞” with a proper minus sign looks better with the used Source Serif Pro font. Similarly for [`f64::NEG_INFINITY`](https://doc.rust-lang.org/std/f64/constant.NEG_INFINITY.html).
|
|
This has bothered me for a while. It's such a small nit, but...
|
|
Typo fix
|
|
Clean up const-hack PRs now that const if / match exist.
Closes #67627.
Cleans up these merged PRs tagged with `const-hack`:
- #63810
- #63786
- #61635
- #58044
reverting their contents to have the match or if expressions they originally contained.
r? @oli-obk
There's one more PR in those tagged with `const-hack` that originally wasn't merged (#65107). Reading the thread, it looks like it was originally closed because the `const-hack` for the checked arithmetic non-negligibly hurt performance, and because there was no way to manipulate the returned Option at compile time anyway (with neither const if nor const match). Would you like me to add these changes to the changes from this PR here too, now that we have the necessary features?
|
|
docs: Iterator adapters have unspecified results after a panic
Fixes #58170.
That issue also has rough consensus from 3 members of the library team for this being the behavior we would like to specify.
|
|
|
|
Stabilize the `matches!` macro
Fixes https://github.com/rust-lang/rust/issues/65721
FCP: https://github.com/rust-lang/rust/issues/65721#issuecomment-569118119
|
|
Convert collapsed to shortcut reference links
|
|
Remove redundant link texts
Most of these links are followed by a parenthesized expression. I think that the redundant link texts were added to prevent interpretation as an inline link. This is unnecessary since the closing square bracket and opening parenthesis are separated by whitespace.
|
|
r=Centril
Use issue = "none" instead of "0" in intrinsics
`issue = "0"` was incorrectly used in https://github.com/rust-lang/rust/commit/9ee16e14c51668309f446636e8960b7fbbac066d, the project is moving away from issue 0
|
|
Use NonNull in slice::Iter and slice::IterMut.
`ptr` of `slice::Iter` and `slice::IterMut` can never be null, but this
fact wasn't exploited for layout optimizations. By changing `ptr` from
`*<mutability> T` to `NonNull<T>`, the compiler can now optimize layout
of `Option<Iter<'a, T>>`.
Closes #67228
|
|
|
|
|
|
|
|
|
|
|
|
Fixes https://github.com/rust-lang/rust/issues/65721
FCP: https://github.com/rust-lang/rust/issues/65721#issuecomment-569118119
|
|
`ptr` of `slice::Iter` and `slice::IterMut` can never be null, but this
fact wasn't exploited for layout optimizations. By changing `ptr` from
`*<mutability> T` to `NonNull<T>`, the compiler can now optimize layout
of `Option<Iter<'a, T>>`.
|
|
|
|
|
|
|
|
(Mostly) finish formatting the repository
Silences tidy line length warnings on rustfmt-controlled files.
This leaves two things out of formatting: CloudABI (mostly because it's not really ours to control, it's upstream code that's mostly generated), and tests. The latter is a hard problem and maybe not one to worry too much about, we rarely edit old tests and reformatting them as we go if possible isn't too bad (they're generally small).
|
|
|
|
Differentiate todo! and unimplemented!
This updates the panic message and docs to make it clear that `todo!` is for unfinished code and `unimplemented!` is for partial trait or enum impls.
r? @Centril
|
|
|
|
|
|
Use slice patterns to avoid having to skip bounds checking
|
|
|
|
Document that calling Drop, even after it panics, is UB
Fixes #60822.
r? @gnzlbg
|