| Age | Commit message (Collapse) | Author | Lines |
|
Add ide-assist, generate single field struct From
|
|
examples: add `minimal_lsp.rs` and FIFO test script
|
|
* `examples/minimal_lsp.rs` – compact LSP server showing definition,
completion, hover, rustfmt-based formatting, and dummy diagnostics.
Advertises UTF-8 offset encoding.
* `examples/manual_test.sh` – FIFO script that streams the canonical
nine LSP packets so anyone can validate the server from two terminals.
No new runtime deps; `anyhow` stays under [dev-dependencies].
|
|
Add tailexpr & -> &mut for generate_mut_trait_impl
|
|
|
|
Add AsRef and Borrow for generate_mut_trait_impl
|
|
Add AsMut to minicore prelude::v1
|
|
|
|
|
|
|
|
- AsRef -> AsMut
- Borrow -> BorrowMut
Example
====================
```rust
//- minicore: as_ref
struct Foo(i32);
impl<T> core::convert::AsRef$0<i32> for Foo {
fn as_ref(&self) -> &i32 {
&self.0
}
}
```
->
```rust
struct Foo(i32);
$0impl<T> core::convert::AsMut<i32> for Foo {
fn as_mut(&mut self) -> &mut i32 {
&self.0
}
}
impl<T> core::convert::AsRef<i32> for Foo {
fn as_ref(&self) -> &i32 {
&self.0
}
}
```
|
|
chore: Cleanup cargo config queries
|
|
minor: Sync from downstream
|
|
|
|
|
|
|
|
|
|
|
|
fix: Infer lifetimes for GATs in expression/pattern position
|
|
Port `#[cfg]` to the new attribute parsing infrastructure
Ports `#[cfg]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197
I've split this PR into commits for reviewability, and left some comments to clarify things
|
|
|
|
|
|
|
|
|
|
|
|
|
|
core: Add `BorrowedCursor::with_unfilled_buf`
Implementation of https://github.com/rust-lang/libs-team/issues/367.
This mainly adds `BorrowedCursor::with_unfilled_buf`, with enables using the unfilled part of a cursor as a `BorrowedBuf`.
Note that unlike the ACP, `BorrowedCursor::unfilled_buf` was moved to a `From` conversion. This is more consistent with other ways of creating a `BorrowedBuf` and hides a bit this conversion that requires unsafe code to be used correctly.
Cc rust-lang/rust#78485 rust-lang/rust#117693
|
|
We should not only in type position.
|
|
Clippy subtree update
r? `@Manishearth`
Cargo.lock update due to `ui_test` bump and restructure.
|
|
Rollup of 8 pull requests
Successful merges:
- rust-lang/rust#141809 (Don't call WSACleanup on process exit)
- rust-lang/rust#143710 (Updates to random number generation APIs)
- rust-lang/rust#143848 (Rename `stable_mir` and `rustc_smir`)
- rust-lang/rust#143855 (Port `#[omit_gdb_pretty_printer_section]` to the new attribute parsing)
- rust-lang/rust#143868 (warn on align on fields to avoid breaking changes)
- rust-lang/rust#143870 ([COMPILETEST-UNTANGLE 6/N] Use `TestSuite` enum instead of stringly-typed test suites)
- rust-lang/rust#143901 (Region constraint nits)
- rust-lang/rust#143903 (Fix typos in documentation files)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix typos in documentation files
## Summary
Fix minor typos in documentation files to improve readability.
## Changes
- **tests/mir-opt/pre-codegen/README.md**: Fix typo `condiguration` → `configuration`
- **tests/ui/SUMMARY.md**: Fix typo in RFC link URL (`namepsace ` → `namespace`)
## Type of Change
- [x] Documentation update
- [x] Bug fix (typo correction)
|
|
Region constraint nits
Couple miscellaneous region constraints that have a bit to do with rust-lang/rust#143545 but stand on their own.
|
|
[COMPILETEST-UNTANGLE 6/N] Use `TestSuite` enum instead of stringly-typed test suites
This is part of a patch series to untangle `compiletest` to hopefully nudge it towards being more maintainable.
This PR should contain no functional changes.
|
|
warn on align on fields to avoid breaking changes
r? `@workingjubilee`
|
|
r=jdonszelmann
Port `#[omit_gdb_pretty_printer_section]` to the new attribute parsing
Ports `#[omit_gdb_pretty_printer_section]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971351163
r? ```@jdonszelmann```
|
|
Rename `stable_mir` and `rustc_smir`
This PR only renames the two crate names.
There is no doubt that we want to rename `stable_mir` to `rustc_public`, while it hasn't been discussed yet that what the new name for `rustc_smir` should be.
This PR proposes a new name for `rustc_smir`, that is `rustc_public_shim`, since `rustc_smir` now is mostly a proxy to do calls to rustc queries and the public API of rustc that is invoked by the `rustc_public` crate.
However, I don't think that name is good enough. I hope there would be a way better name.
r? `@oli-obk`
|
|
Updates to random number generation APIs
Updates based on discussions about random number generation.
- Add comment on `RandomSource::fill_bytes` about multiple calls, to allow
efficient implementations for random sources that generate a word at a time.
- Drop the `Random` trait in favor of `Distribution<T>`, which will let people
make calls like random(1..=6), and which allows for future expansion to
non-uniform distributions, as well as floating-point. (For now, this is only
implemented for `RangeFull`, to get the interface in place. Subsequent PRs
will implement it for other range types.)
|
|
Don't call WSACleanup on process exit
This isn't necessary as cleanup will happen when the process exits regardless.
fixes rust-lang/rust#141799
|
|
|
|
Rollup of 10 pull requests
Successful merges:
- rust-lang/rust#143217 (Port #[link_ordinal] to the new attribute parsing infrastructure)
- rust-lang/rust#143681 (bootstrap/miri: avoid rebuilds for test builds)
- rust-lang/rust#143724 (Tidy cleanup)
- rust-lang/rust#143733 (Change bootstrap's `tool.TOOL_NAME.features` to work on any subcommand)
- rust-lang/rust#143850 (Compiletest: Simplify {Html,Json}DocCk directive handling)
- rust-lang/rust#143875 (update issue number for `const_trait_impl`)
- rust-lang/rust#143881 (Use zero for initialized Once state)
- rust-lang/rust#143887 (Run bootstrap tests sooner in the `x test` pipeline)
- rust-lang/rust#143917 (Change "allocated object" to "allocation".)
- rust-lang/rust#143918 (Tier check cleanup)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
Tier check cleanup
clippy cleanup + edition 2024
|
|
r=oli-obk
Change "allocated object" to "allocation".
These seem like they were missed in <https://github.com/rust-lang/rust/pull/141224>
|
|
Run bootstrap tests sooner in the `x test` pipeline
With the recently added bootstrap snapshot tests, and in general with our plans to test more things in bootstrap, I feel like the original comment isn't accurate anymore. Recently, on several occasions I had to wait for 40+ minutes of CI just to find out that the bootstrap snapshot tests have failed. I think we should run bootstrap tests towards the beginning instead now.
r? ```@jieyouxu```
|
|
Use zero for initialized Once state
By re-labeling which integer represents which internal state for `Once` we can ensure that the initialized state is the all-zero state. This is beneficial because some CPU architectures (such as Arm) have specialized instructions to specifically branch on non-zero, and checking for the initialized state is by far the most important operation.
As an example, take this:
```rust
use std::sync::atomic::{AtomicU32, Ordering};
const INIT: u32 = 3;
#[inline(never)]
#[cold]
pub fn slow(state: &AtomicU32) {
state.store(INIT, Ordering::Release);
}
pub fn ensure_init(state: &AtomicU32) {
if state.load(Ordering::Acquire) != INIT {
slow(state)
}
}
```
If `INIT` is 3 (as is currently the state for `Once`), we see the following assembly on `aarch64-apple-darwin`:
```asm
example::ensure_init::h332061368366e313:
ldapr w8, [x0]
cmp w8, #3
b.ne LBB1_2
ret
LBB1_2:
b example::slow::ha042bd6a4f33724e
```
By changing the `INIT` state to zero we get the following:
```asm
example::ensure_init::h332061368366e313:
ldapr w8, [x0]
cbnz w8, LBB1_2
ret
LBB1_2:
b example::slow::ha042bd6a4f33724e
```
So this PR saves 1 instruction every time a `LazyLock` gets accessed on platforms such as these.
|
|
update issue number for `const_trait_impl`
r? project-const-traits
cc rust-lang/rust#67792 rust-lang/rust#143874
|
|
Compiletest: Simplify {Html,Json}DocCk directive handling
So much more maintainable and extensible.
r? ````@jieyouxu```` as discussed
|
|
Change bootstrap's `tool.TOOL_NAME.features` to work on any subcommand
This is a followup to rust-lang/rust#142379 to make the bootstrap option `tool.TOOL_NAME.features` work on any subcommand instead of just build (so also run/test/...). I also made the `TOOL_NAME` comparisons look at the tool path instead of the tool name to determine to which tool a `TOOL_NAME` refers to, so you can specify tools by path like in other places of the bootstrap (e.g. `tool."tools/miri".features`).
|
|
Tidy cleanup
|