| Age | Commit message (Collapse) | Author | Lines |
|
Fix #96847
r? `@petrochenkov`
|
|
rustdoc: make item-infos dimmer on dark theme
Previously the item-info background colors were too bright for a dark theme, making a bright rectangle that draws the attention.
Demo:
https://rustdoc.crud.net/jsha/dark-colors/std/os/linux/process/struct.PidFd.html
https://rustdoc.crud.net/jsha/dark-colors/std/error/trait.Error.html#method.description
Before:
<img width=300 src="https://user-images.githubusercontent.com/220205/153565049-f35ee83e-181d-491c-b2af-7cce1baa4912.png">
After:
<img width=300 src="https://user-images.githubusercontent.com/220205/181166727-b4218e96-daf1-46cd-a2df-5fd870eaa857.png">
r? `@GuillaumeGomez`
|
|
Improve `-Zhir-stats`
Add testing, improve coverage, avoid some double counting, and add more detail.
r? `@michaelwoerister`
|
|
Do not consider method call receiver as an argument in AST.
Fixes https://github.com/rust-lang/rust/issues/73663
|
|
Remove duplicated temporaries creating during box derefs elaboration
Temporaries created with `MirPatch::new_temp` will be declared after
patch application. Remove manually created duplicate declarations.
Removing duplicates exposes another issue. Visitor elaborates
terminator twice and attempts to access new, but not yet available,
local declarations. Remove duplicated call to `visit_terminator`.
Extracted from #99946.
|
|
r=scottmcm
Check if enum from foreign crate has any non exhaustive variants when attempting a cast
Fixes #91161
As stated in the issue, this will require a crater run as it might break other people's stuff.
|
|
|
|
Fixes #96847.
|
|
Keep going if normalized projection has unevaluated consts in `QueryNormalizer`
#100312 was the wrong approach, I think this is the right one.
When normalizing a type, if we see that it's a projection, we currently defer to `tcx.normalize_projection_ty`, which normalizes the projections away but doesn't touch the unevaluated constants. So now we just continue to fold the type if it has unevaluated constants so we make sure to evaluate those too, if we can.
Fixes #100217
Fixes #83972
Fixes #84669
Fixes #86710
Fixes #82268
Fixes #73298
|
|
This tells you which variants of the enums are most common, which is
very useful. I've only done it for the AST for now, HIR can be done
later.
|
|
|
|
Currently it's reported as either `TraitItem` or `ImplItem`. This commit
changes it to `AssocItem`, because having the report match the type name
is (a) consistent with other types, and (b) the trait/impl split isn't
that important here.
|
|
This commit:
- Adds a comment explaining which `visit_*` methods should be
implemented.
- Adds and removes some `visit_*` methods accordingly, improving
coverage, and avoiding some double counting.
|
|
This will be very useful in subsequent commits where I will improve the
output.
|
|
Reoptimize layout array
This way it's one check instead of two, so hopefully (cc #99117) it'll be simpler for rustc perf too 🤞
Quick demonstration:
```rust
pub fn demo(n: usize) -> Option<Layout> {
Layout::array::<i32>(n).ok()
}
```
Nightly: <https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=e97bf33508aa03f38968101cdeb5322d>
```nasm
mov rax, rdi
mov ecx, 4
mul rcx
seto cl
movabs rdx, 9223372036854775805
xor esi, esi
cmp rax, rdx
setb sil
shl rsi, 2
xor edx, edx
test cl, cl
cmove rdx, rsi
ret
```
This PR (note no `mul`, in addition to being much shorter):
```nasm
xor edx, edx
lea rax, [4*rcx]
shr rcx, 61
sete dl
shl rdx, 2
ret
```
This is built atop `@CAD97` 's #99136; the new changes are cb8aba66ef6a0e17f08a0574e4820653e31b45a0.
I added a bunch more tests for `Layout::from_size_align` and `Layout::array` too.
|
|
non_exhaustive
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Special-case references to leafs in valtree pretty-printing
Fixes https://github.com/rust-lang/rust/issues/100313
|
|
Refactor: remove a type string comparison
|
|
Add regression test for #93205
Closes #93205.
This issue was most likely fixed by #93805.
|
|
Previously the item-info background colors were too bright for a dark
theme, making a bright rectangle that draws the attention.
|
|
|
|
Resolves all of issue #93240
Reproduces a similar change as #99086, but with improvements
In particular, this PR inlcludes:
* redesigning the crate-search selector so the background color matches its surroundings
* decrease the font of the dropdown menu to a reaonable size
* add a hover effect
* make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element
that can then be transformed using CSS filters to approximate the desired color
* fix the text "in" to match the title font
* remove the "for xyz" in the "Results for xyz in [All crates]" title when
searching for search term "xyz"; you can already see what you're searching for
as it's typed in the search bar!
* in line with #99086, handle super-long crate names appropriately without a long <select>
element escaping the screen area; the improvement is that we also keep the title
within a single line now; uses some flex layout shenanigans...
* the margins / paddings are adjusted so the selected label of the <select> fits within
the rest of that title nicely; also some inconsistency in the way that Firefox renders
a <select> with "appearance: none" (roughly 4px more padding left and right of the text
than e.g. Chrome) is worked around, and it now produces a result that looks (essentially)
identical to Chrome
* the color of the help menu and settings menu border in light theme is made to match with
the color of the corresponding buttons, like they do (match) in the ayu theme
* the casing of "All crates" changes to "all crates"
* the new tests from #99086 are temporarily disabled, until they can be adapted later
|
|
If a primary bundle doesn't contain a message then the fallback bundle
is used. However, if the primary bundle's message is broken (e.g. it
refers to a interpolated variable that the compiler isn't providing)
then this would just result in a compiler panic. While there aren't any
primary bundles right now, this is the type of issue that could come up
once translation is further along.
Signed-off-by: David Wood <david.wood@huawei.com>
|
|
Closes #100106
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #99573 (Stabilize backtrace)
- #100069 (Add error if link_ordinal used with unsupported link kind)
- #100086 (Add more `// unit-test`s to MIR opt tests)
- #100332 (Rename integer log* methods to ilog*)
- #100334 (Suggest a missing semicolon before an array)
- #100340 (Iterate generics_def_id_map in reverse order to fix P-critical issue)
- #100345 (docs: remove repetition in `is_numeric` function docs)
- #100352 (Update cargo)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Iterate generics_def_id_map in reverse order to fix P-critical issue
Closes #100187
Fixes a `P-critical` beta regression.
|
|
r=fee1-dead
Suggest a missing semicolon before an array
fixes #99658
|
|
Rename integer log* methods to ilog*
This reflects the concensus from the libs team as reported at https://github.com/rust-lang/rust/issues/70887#issuecomment-1209513261.
Joint work with `@yoshuawuyts.`
|
|
Add more `// unit-test`s to MIR opt tests
I only changed things which are hopefully completely uninteresting. I plan to submit more PRs that cover more files, but those cases will need some more complicated (and hence possibly controversial) changes, so I'll try and submit those in reasonably sized batches.
r? rust-lang/wg-mir-opt
|
|
Add error if link_ordinal used with unsupported link kind
The `link_ordinal` attribute only has an affect if the `raw-dylib` link kind is used, so add an error if it is used with any other link kind.
|
|
Stabilize backtrace
This PR stabilizes the std::backtrace module. As of #99431, the std::Error::backtrace item has been removed, and so the rest of the backtrace feature is set to be stabilized.
Previous discussion can be found in #72981, #3156.
Stabilized API summary:
```rust
pub mod std {
pub mod backtrace {
pub struct Backtrace { }
pub enum BacktraceStatus {
Unsupported,
Disabled,
Captured,
}
impl fmt::Debug for Backtrace {}
impl Backtrace {
pub fn capture() -> Backtrace;
pub fn force_capture() -> Backtrace;
pub const fn disabled() -> Backtrace;
pub fn status(&self) -> BacktraceStatus;
}
impl fmt::Display for Backtrace {}
}
}
```
`@yaahc`
|
|
For some reason, adding some text to match against makes this test pass.
Before, when it was *more* general, it was failing!
This seems very likely to be a bug in htmldocck, which I'm going to
investigate.
|
|
|
|
|
|
This issue was most likely fixed by #93805.
|
|
|
|
|
|
|
|
[rustdoc] Don't render impl blocks with doc comment if they only contain private items by default
Fixes #100001.
cc `@jhpratt`
r? `@notriddle`
|
|
Mention `unit-test` in MIR opt test README
r? `@RalfJung`
|
|
Set tainted errors bit before emitting coerce suggestions.
Fixes #100246.
#89576 basically got 99% of the way there but the match typechecking code (which calls `coerce_inner`) also needed a similar fix.
|
|
Fail gracefully when const pattern is not structural match.
Fixes https://github.com/rust-lang/rust/issues/82909
|
|
Do not manually craft a span pointing inside a multibyte character.
Fixes https://github.com/rust-lang/rust/issues/92462
|