| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Prevent crash when a path is not resolved in intra-doc link
Fixes https://github.com/rust-lang/rust/issues/111189.
cc `@petrochenkov`
r? `@notriddle`
|
|
|
|
|
|
Better diagnostic for `use Self::..`
Fixes #111627
cc `@petrochenkov,` you might have thoughts on a better way to handle this (https://github.com/rust-lang/rust/issues/63720#issuecomment-591597466)
|
|
fix(resolve): replace bindings to dummy for unresolved imports
close #109343
In #109343, `f` in `pub use f as g` points to:
|namespace| binding|
|-|-|
|type| `external crate f`|
|value| `None` |
|macro| `None` |
When resolve `value_ns` during `resolve_doc_links`, the value of the binding of single_import `pub use f as g` goes to `pub use inner::f`, and since it does not satisfy [!self.is_accessible_from(binding.vis, single_import.parent_scope.module)](https://github.com/rust-lang/rust/blob/master/compiler/rustc_resolve/src/ident.rs#L971) and returns `Err(Undetermined)`, which eventually goes to `PathResult::Indeterminate => unreachable!`.
This PR replace all namespace binding to `dummy_binding` for indeterminate import, so, the bindings of `pub use f as g` had been changed to followings after finalize:
|namespace| binding|
|-|-|
|type| `dummy`|
|value| `dummy` |
|macro| `dummy` |
r?`@petrochenkov`
|
|
|
|
|
|
Revert "Validate resolution for SelfCtor too."
This reverts commit 83453408a0ce91b9e3d3ae6e7f117b1fd28b487d.
That PR introduced a breaking change.
Fixes https://github.com/rust-lang/rust/issues/111541
Reopens https://github.com/rust-lang/rust/issues/89868
r? `@petrochenkov`
|
|
|
|
refactor(resolve): clean up the early error return caused by non-call
closes https://github.com/rust-lang/rust/issues/109250
It seems no bad happened, r? ``@Nilstrieb``
|
|
|
|
This reverts commit 83453408a0ce91b9e3d3ae6e7f117b1fd28b487d.
|
|
Populate effective visibilities in `rustc_privacy` (take 2)
Same as https://github.com/rust-lang/rust/pull/110907 + regressions fixes.
Fixes https://github.com/rust-lang/rust/issues/111359.
r? `@petrochenkov`
|
|
Improve suggestion for `self: Box<self>`
Fixes #110642
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Do not recurse into const generic args when resolving self lifetime elision.
Fixes https://github.com/rust-lang/rust/issues/110899
r? `@petrochenkov`
|
|
Don't suffix `RibKind` variants
This PR
- Removes `use RibKind::*`
- Renames `RibKind::{SomethingRibKind => Something}`
It seems unnecessary to have "RibKind" in the end of all variants, if we can just use it as a normal enum. Additionally previously it was weird that `MacroDefinition` is the only unsuffixed variant.
|
|
Validate resolution for SelfCtor too.
Fixes https://github.com/rust-lang/rust/issues/89868
r? `@petrochenkov`
|
|
resolve: One more attempt to simplify `module_children`
If the next step is performed and `fn module_children_local` is merged with the `module_children` query, then it causes perf regressions, regardless of whether query result feeding is [used](https://perf.rust-lang.org/compare.html?start=43a78029b4f4d92978b8fde0a677ea300b113c41&end=2eb5bcc5068b9d92f74bcb1797da664865d6981d&stat=instructions:u) or [not](https://perf.rust-lang.org/compare.html?start=2fce2290865f012391b8f3e581c3852a248031fa&end=2a33d6cd99481d1712037a79e7d66a8aefadbf72&stat=instructions:u).
|
|
|
|
|
|
Currently a `{D,Subd}iagnosticMessage` can be created from any type that
impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static,
str>`, which are reasonable. It also includes `&String`, which is pretty
weird, and results in many places making unnecessary allocations for
patterns like this:
```
self.fatal(&format!(...))
```
This creates a string with `format!`, takes a reference, passes the
reference to `fatal`, which does an `into()`, which clones the
reference, doing a second allocation. Two allocations for a single
string, bleh.
This commit changes the `From` impls so that you can only create a
`{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static,
str>`. This requires changing all the places that currently create one
from a `&String`. Most of these are of the `&format!(...)` form
described above; each one removes an unnecessary static `&`, plus an
allocation when executed. There are also a few places where the existing
use of `&String` was more reasonable; these now just use `clone()` at
the call site.
As well as making the code nicer and more efficient, this is a step
towards possibly using `Cow<'static, str>` in
`{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing
the `From<&'a str>` impls to `From<&'static str>`, which is doable, but
I'm not yet sure if it's worthwhile.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
My type ascription
Oh rip it out
Ah
If you think we live too much then
You can sacrifice diagnostics
Don't mix your garbage
Into my syntax
So many weird hacks keep diagnostics alive
Yet I don't even step outside
So many bad diagnostics keep tyasc alive
Yet tyasc doesn't even bother to survive!
|
|
Do not resolve anonymous lifetimes in consts to be static.
Fixes https://github.com/rust-lang/rust/issues/110931
|
|
|
|
|
|
|
|
|
|
Suggest using integration tests for test crate using own proc-macro
cc #110247
|
|
Rollup of 5 pull requests
Successful merges:
- #110333 (rustc_metadata: Split `children` into multiple tables)
- #110501 (rustdoc: fix ICE from rustc_resolve and librustdoc parse divergence)
- #110608 (Specialize some `io::Read` and `io::Write` methods for `VecDeque<u8>` and `&[u8]`)
- #110632 (Panic instead of truncating if the incremental on-disk cache is too big)
- #110633 (More `mem::take` in `library`)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
rustdoc: fix ICE from rustc_resolve and librustdoc parse divergence
Fixes #110495
|
|
|
|
Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
|
|
rustc_metadata: Remove `Span` from `ModChild`
It can be decoded on demand from regular `def_span` tables.
Partially mitigates perf regressions from https://github.com/rust-lang/rust/pull/109500.
|
|
|