It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!
Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034.
6416: Respond with JSON-RPC error if we failed to deserialize request r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Historically, we intentinally violated JSON-RPC spec here by hard
crashing. The idea was to poke both the clients and servers to fix
stuff.
However, this is confusing for server implementors, and falls down in
one important place -- protocol extension are not always backwards
compatible, which causes crashes simply due to version mismatch. We
had once such case with our own extension, and one for semantic
tokens.
So let's be less adventerous and just err on the err side!
6387: do not use associated types placeholder for inlay hint r=flodiebold a=bnjjj
close#6191
Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
6384: add doctest runnables on struct r=lnicola a=bnjjj
I will check for how to do the same on trait implementation on another PR.
#6356
Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
6376: Avoid impls_fnonce to return true when the trait solving is ambiguous r=flodiebold a=GrayJack
This PR should fix#6375
This adds a variation of `method_resolution::implements_trait` called `method_resolution::implements_trait_unique`, that only returns true when the trait solving is unique, and also change `impls_fnonce` to use the later instead.
I also added a test just to be sure.
Co-authored-by: GrayJack <gr41.j4ck@gmail.com>
6351: Organized completions r=popzxc a=popzxc
This PR continues the work on refactoring of the `completions` crate.
In this episode:
- Actual completions methods are encapsulated into `completions` module, so they aren't mixed with the rest of the code.
- Name duplication was removed (`complete_attribute` => `completions::attribute`, `completion_context` => `context`).
- `Completions` structure was moved from `item` module to the `completions`.
- `presentation` module was removed, as it was basically a module with `impl` for `Completions`.
- Code approaches were a bit unified here and there.
Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
6367: Handle #![cfg] in crate root r=jonas-schievink a=jonas-schievink
Now we correctly skip analysis of winapi on non-Windows platforms.
bors r+ 🤖
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
6333: Don't interpret type path as part of visibility. r=matklad a=ArifRoktim
This closes#5902.
I only check that the next token isn't equal to `T![:]`, instead of the next two not being equal to `T![::]`. Is that ok?
Co-authored-by: Arif Roktim <arifrroktim@gmail.com>
6350: Make IncorrectDiagnostic match rustc by copying rustc's code. r=popzxc a=ArifRoktim
This closes#6343 and closes#6345.
The old algorithm which used a `DetectedCase` enum, didn't match how rustc thinks of cases. Some inputs can be interpreted as more than 1 case depending on the situation. For example, to rustc:
- `ABCD`: Can be both camel case and upper snake case
- `X86_64`: Can be both camel case and upper snake case
I could've made `detect_case` return a collection of `DetectedCase` and then modified the other code as such, but I think using the same code rustc uses is simpler and a surefire way to achieve the same diagnostics as rustc.
Co-authored-by: Arif Roktim <arifrroktim@gmail.com>