| Age | Commit message (Collapse) | Author | Lines |
|
|
|
As a secondary benefit, it's also a lot simpler.
|
|
|
|
|
|
Before this PR, the compiler would emit the debuginfo name `slice$<T>`
for all kinds of slices, regardless of whether they are behind a
reference or not and regardless of the kind of reference. As a
consequence, the types `Foo<&[T]>`, `Foo<[T]>`, and `Foo<&mut [T]>`
would end up with the same type name `Foo<slice$<T> >` in debuginfo,
making it impossible to disambiguate between them by name. Similarly,
`&str` would get the name `str` in debuginfo, so the debuginfo name for
`Foo<str>` and `Foo<&str>` would be the same. In contrast,
`*const [bool]` and `*mut [bool]` would be `ptr_const$<slice$<bool> >`
and `ptr_mut$<slice$<bool> >`, i.e. the encoding does not lose
information about the type.
This PR removes all special handling for slices and `str`. The types
`&[bool]`, `&mut [bool]`, and `&str` thus get the names
`ref$<slice2$<bool> >`, `ref_mut$<slice2$<bool> >`, and
`ref$<str$>` respectively -- as one would expect.
|
|
refactor: use grep -E/-F instead of fgrep/egrep
`egrep` and `fgrep` are obsolescent now. This PR updates all `egrep` and `fgrep` commands to `grep -E` and `grep -F`.
Running egrep/fgrep command with grep v3.8 will output the following warning to stderr:
```
egrep: warning: egrep is obsolescent; using grep -E
```
- https://www.phoronix.com/news/GNU-Grep-3.8-Stop-egrep-fgrep
- https://lists.gnu.org/archive/html/info-gnu/2022-09/msg00001.html
|
|
simlay:simlay/update-rust-gdbgui-gdb-args-to-gdb-cmd, r=Mark-Simulacrum
Fix gdb-cmd for rust-gdbgui
With https://github.com/cs01/gdbgui/pull/198, the way that gdbgui arguments were specified changed. I've tested this with program generated from `cargo new --bin` and it worked as gdbgui should.
Closes #76383.
|
|
|
|
|
|
|
|
|
|
|
|
Closes #101489
|
|
Closes #100587
Closes #92945
|
|
This PR will fix some typos detected by [typos].
I only picked the ones I was sure were spelling errors to fix, mostly in
the comments.
[typos]: https://github.com/crate-ci/typos
|
|
Don't --bless in pre-push hook
Running with --bless causes the push to succeed if there are fixable
formatting changes, but the changes don't make it into the push.
We should have the user rerun with --bless (or x.py fmt) and commit the
changes themselves (they might want to amend a particular commit, for
instance).
|
|
Running with --bless causes the push to succeed if there are fixable
formatting changes, but the changes don't make it into the push.
We should have the user rerun with --bless (or x.py fmt) and commit the
changes themselves (they might want to amend a particular commit, for
instance).
|
|
Rustdoc-Json: Retain Stripped Modules when they are imported, not when they have items
Fixes #101103
Fixes #100973
r? `@GuillaumeGomez`
|
|
|
|
Rollup of 13 pull requests
Successful merges:
- #97015 (std::io: migrate ReadBuf to BorrowBuf/BorrowCursor)
- #98301 (Add GDB/LLDB pretty-printers for NonZero types)
- #99570 (Box::from(slice): Clarify that contents are copied)
- #100296 (Add standard C error function aliases to last_os_error)
- #100520 (Add mention of `BufReader` in `Read::bytes` docs)
- #100885 (Export Cancel from std::os::fortanix_sgx::usercalls::raw)
- #100955 (Some papercuts on error::Error)
- #101002 (Provide structured suggestion for `hashmap[idx] = val`)
- #101038 (no alignment check during interning)
- #101055 (Use smaller span for suggestions)
- #101091 (Extend attrs if local_def_id exists)
- #101098 (rustc_middle: Remove `Visibility::Invisible`)
- #101102 (unstable-book-gen: use std::fs::write)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Add GDB/LLDB pretty-printers for NonZero types
Add GDB/LLDB pretty-printers for `NonZero` types.
These pretty-printers were originally implemented for IntelliJ Rust by ```@Kobzol``` in https://github.com/intellij-rust/intellij-rust/pull/5270.
Part of #29392.
|
|
These generally aren't used too much, and I feel like aren't really
helpful for installing the RLS stub.
|
|
|
|
r=wesleywiser
debuginfo: Generalize C++-like encoding for enums.
The updated encoding should be able to handle niche layouts where more than one variant has fields (as introduced in https://github.com/rust-lang/rust/pull/94075).
The new encoding is more uniform as there is no structural difference between direct-tag, niche-tag, and no-tag layouts anymore. The only difference between those cases is that the "dataful" variant in a niche-tag enum will have a `(start, end)` pair denoting the tag range instead of a single value.
The new encoding now also supports 128-bit tags, which occur in at least some standard library types. These tags are represented as `u64` pairs so that debuggers (which don't always have support for 128-bit integers) can reliably deal with them. The downside is that this adds quite a bit of complexity to the encoding and especially to the corresponding NatVis.
The new encoding seems to increase the size of (x86_64-pc-windows-msvc) debuginfo by 10-15%. The size of binaries is not affected (release builds were built with `-Cdebuginfo=2`, numbers are in kilobytes):
EXE | before | after | relative
-- | -- | -- | --
cargo (debug) | 40453 | 40450 | +0%
ripgrep (debug) | 10275 | 10273 | +0%
cargo (release) | 16186 | 16185 | +0%
ripgrep (release) | 4727 | 4726 | +0%
PDB | before | after | relative
-- | -- | -- | --
cargo (debug) | 236524 | 261412 | +11%
ripgrep (debug) | 53140 | 59060 | +11%
cargo (release) | 148516 | 169620 | +14%
ripgrep (release) | 10676 | 11804 | +11%
Given that the new encoding is more general, this is to be expected. Only platforms using C++-like debuginfo are affected -- which currently is only `*-pc-windows-msvc`.
*TODO*
- [x] Properly update documentation
- [x] Add regression tests for new optimized enum layouts as introduced by #94075.
r? `@wesleywiser`
|
|
Rustdoc-Json: Add `Path` type for traits.
Avoids using `Type` for trait fields, as a trait must always be a path, and not any other kind of type.
``@rustbot`` modify labels: +A-rustdoc-json +T-rustdoc
Closes #100106
|
|
|
|
I think `@hasraw` is slightly clearer than `@hastext` since it is
actually matching against the raw HTML, not the text nodes.
|
|
Reasons:
1. It's shorter.
2. `@matches-literal` seems to contradict itself: a regex is
intrinsically not a literal match, while it is still a textual match.
|
|
See #100354 for the rationale.
|
|
debuginfo encoding.
|
|
|
|
WinDbg supports that but Visual Studio doesn't. Pass the value as a parameter instead.
|
|
|
|
|
|
And add more comments about niche tag enum encoding.
|
|
The updated encoding should be able to handle niche layouts where
more than one variant has fields.
|
|
Closes #100106
|
|
Because python doesn't have lexical scope, loop variables
persist after the loop is exited, set to the value of the last
itteration
```
>>> i = 0
>>> for i in range(10): pass
...
>>> i
9
```
This causes the `ty` variable to be changed, causing unexpected crashes on
```
pub type RefFn<'a> = &'a dyn for<'b> Fn(&'a i32) -> i32;
```
|
|
|
|
|
|
update CPU usage script
I've made slight changes to the CPU usage plot script with updated links from the [ci2 aws instance](https://rust-lang-ci2.s3.amazonaws.com/).
|
|
fix tidy checks and correct cpu-usage-over-time-plot script
|
|
rustdoc: remove tuple link on round braces
This is #98069 but for tuples. The reasoning is the same:
* This PR also changes it so that tuples with all-generic elements still link to the primitive.tuple.html page, just like slices. So there still plenty of on-ramps for anybody who doesn't know about it.
* It's too hard to see when round braces are a separate link from the type inside of them.
* It's too hard to click even if you do notice them.
Before:
* impl [ToSocketAddrs](https://doc.rust-lang.org/nightly/std/net/trait.ToSocketAddrs.html) for [(](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)[IpAddr](https://doc.rust-lang.org/nightly/std/net/enum.IpAddr.html), [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html)[)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)
* impl<K, V> [FromIterator](https://notriddle.com/notriddle-rustdoc-test/std/iter/trait.FromIterator.html)<[(](https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html)K, V[)](https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html)> for [BTreeMap](https://notriddle.com/notriddle-rustdoc-test/std/collections/struct.BTreeMap.html)<K, V>
After:
* impl [ToSocketAddrs](https://doc.rust-lang.org/nightly/std/net/trait.ToSocketAddrs.html) for ([IpAddr](https://doc.rust-lang.org/nightly/std/net/enum.IpAddr.html), [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html))
* impl<K, V> [FromIterator](https://notriddle.com/notriddle-rustdoc-test/std/iter/trait.FromIterator.html)<[(K, V)](https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html)> for [BTreeMap](https://notriddle.com/notriddle-rustdoc-test/std/collections/struct.BTreeMap.html)<K, V>
|
|
|
|
|
|
Add empty impl blocks if they have documentation
Fixes https://github.com/rust-lang/rust/issues/90866.
The update for the test script is needed to count the number of impl blocks we have with only the struct. To be noted that with https://github.com/rust-lang/rust/pull/89676 merged, it wouldn't be needed (I don't know what is the status of it btw. cc ```@Mark-Simulacrum).```
It looks like this:

cc ```@jyn514```
r? ```@camelid```
|
|
|
|
@count command
|
|
|
|
|