Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtree update of rust-analyzer #137921

Merged
merged 78 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d1fb18e
Calculate drop glue and show it on hover
ChayimFriedman2 Jan 20, 2025
629fa76
feat: update insta inline snapshot when clicks 'Update Test' runnable
andylokandy Feb 21, 2025
2b6ea13
fix
andylokandy Feb 21, 2025
a0c69fd
Allow "package/feature" format feature flag
kazatsuyu Feb 22, 2025
4ab9329
Include private items in completions for local crates
Timmmm Feb 21, 2025
e2a7731
Downgrade to ubuntu-22.04 for aarch64-unknown-linux-gnu and arm-unkno…
lnicola Feb 24, 2025
5397431
Fix event_name check in workflows
lnicola Feb 24, 2025
dac3460
Merge pull request #19216 from lnicola/ubuntu-22.04
lnicola Feb 24, 2025
af83f2f
Merge pull request #19217 from lnicola/event-name
lnicola Feb 24, 2025
7bba76e
Disable incremental on release builds
Veykril Feb 24, 2025
d761f9b
Vendor always-assert
Veykril Feb 24, 2025
a4bd32c
Merge pull request #19218 from Veykril/push-vqsronpuvrnx
Veykril Feb 24, 2025
49116c6
Merge pull request #19197 from andylokandy/insta
Veykril Feb 24, 2025
6e2abbf
Merge pull request #19211 from Timmmm/user/timh/import_private
Veykril Feb 24, 2025
18c6f22
Merge pull request #19219 from Veykril/push-rvosplwpwqqt
Veykril Feb 24, 2025
67a99a3
Migrate some leftovers in `add_missing_match_arms`
ShoyuVanilla Feb 17, 2025
756f213
Migrate `apply_demorgan` to `SyntaxEditor`
ShoyuVanilla Feb 17, 2025
1c2225b
Add `take()` method to `SyntaxEditor`
ShoyuVanilla Feb 18, 2025
32e4049
Merge pull request #18987 from ChayimFriedman2/drop-glue
Veykril Feb 24, 2025
a9dbd49
Merge pull request #19171 from ShoyuVanilla/migrate-de-morgan-assist
Veykril Feb 24, 2025
1ff2593
minor: Add tabstop to impl body in `generate_trait_impl` assist
Giga-Bowser Feb 24, 2025
e6bb047
Merge pull request #19221 from Giga-Bowser/generate-trait-impl-tabstop
lnicola Feb 24, 2025
91ff420
doc: remove nit from setup.md
Shourya742 Feb 24, 2025
d5a85af
Support target features implications in target_feature 1.1
ChayimFriedman2 Feb 25, 2025
5c654dc
Disable typos checker for the target feature names
ChayimFriedman2 Feb 25, 2025
16402de
Merge pull request #19223 from ChayimFriedman2/implied-target-feature
Veykril Feb 25, 2025
f7adafc
internal: Improve reporting of intersecting changes
Giga-Bowser Jan 10, 2025
cac5153
internal: Migrate `remove_mut` assist to `SyntaxEditor`
Giga-Bowser Nov 30, 2024
8036e84
internal: Migrate `remove_parentheses` assist to `SyntaxEditor`
Giga-Bowser Dec 5, 2024
1d5f831
fix: Properly handle removals in `SyntaxEditor`
Giga-Bowser Dec 5, 2024
6e6e7e9
internal: Migrate `remove_unused_param` assist to `SyntaxEditor`
Giga-Bowser Dec 5, 2024
3b4e268
Merge pull request #19204 from kazatsuyu/allow-package-specific-feature
ChayimFriedman2 Feb 26, 2025
aa32933
Merge pull request #19225 from Giga-Bowser/remove-assists
Veykril Feb 26, 2025
fae88f2
Use cargo zigbuild for releases
lnicola Feb 26, 2025
444ce09
Merge pull request #19220 from Shourya742/2025-02-24-nit-setup-doc
lnicola Feb 26, 2025
faaba55
Allow rust-project.json to specify sysroot workspace
darichey Feb 4, 2025
5109c0b
Drop support for stitched sysroot
darichey Feb 6, 2025
dae664d
Cofigurate out ohos target to avoid compilation crashes
LuuuXXX Feb 27, 2025
230ce20
Merge pull request #19239 from LuuuXXX/add-support-for-ohos
lnicola Feb 27, 2025
e162475
Merge pull request #19096 from darichey/rust-project-sysroot
Veykril Feb 27, 2025
d4b92f4
Merge pull request #19230 from lnicola/zig
lnicola Feb 27, 2025
cabb08d
Fix sysroot crate-graph construction not mapping crate-ids for proc-m…
Veykril Feb 27, 2025
494192b
Merge pull request #19241 from Veykril/push-lqumoruvuyvo
Veykril Feb 27, 2025
8c16ded
enable doctest
BenjaminBrienen Feb 26, 2025
df903a5
fix doc tests
BenjaminBrienen Feb 26, 2025
0404156
ignore doc test that only fails on windows
BenjaminBrienen Feb 27, 2025
1b6c4b7
ignore another test that fails on windows
BenjaminBrienen Feb 27, 2025
239a686
Merge pull request #19237 from BenjaminBrienen/doc-tests
lnicola Feb 27, 2025
d6f5377
Update Node.js, vscode, and ts deps
BenjaminBrienen Feb 26, 2025
13eb834
Merge pull request #19194 from BenjaminBrienen/node
lnicola Feb 27, 2025
af0c8b7
Add anchor for intra-doc links to associated items
ncrothers Feb 27, 2025
7348844
Avoid suggesting redundant borrowing in completion results
Shourya742 Feb 26, 2025
2071cc2
add test
Shourya742 Feb 26, 2025
bd8b58d
Merge pull request #19246 from ncrothers/add-anchor-for-associated-items
Veykril Feb 28, 2025
637dbe5
Fix prefix adjustment hints unnecessarily introducing parens
Veykril Feb 28, 2025
fd1f2e3
Merge pull request #19249 from Veykril/push-noosrywrsuvn
Veykril Feb 28, 2025
ff7de58
Have inline_local_variable use precedence calculation for parentheses
Veykril Feb 28, 2025
e862daf
Merge pull request #19250 from Veykril/push-tmrnrlotwtmr
Veykril Feb 28, 2025
dfb2e35
Migrate `convert_bool_then` to `SyntaxEditor`
ShoyuVanilla Feb 28, 2025
08eeb8f
Cleanup highlighting macro-def handling
Veykril Mar 1, 2025
b0e3526
More precise macro modifiers for syntax highlighting
Veykril Mar 1, 2025
497f140
Cleanup string handling in syntax highlighting
Veykril Mar 1, 2025
28a5eeb
Fix `test_keyword_highlighting` test
Veykril Mar 1, 2025
629baf2
Remove syntax editing from parenthesis computation
Veykril Feb 28, 2025
a565f7f
Merge pull request #19257 from Veykril/push-myvwxskworsn
Veykril Mar 1, 2025
e6a0fc5
Merge pull request #19251 from Veykril/push-tkmpqtzxynxk
Veykril Mar 1, 2025
1b85bef
Add flip or-pattern assist
Veykril Mar 2, 2025
7d8e958
Merge pull request #19253 from ShoyuVanilla/migrate-convert-bool-then
Veykril Mar 2, 2025
768749f
Merge pull request #19259 from Veykril/push-skmvrmtorqso
Veykril Mar 2, 2025
6c1e5b4
Fix transparent diagnostics
lnicola Mar 2, 2025
5c124a3
Merge pull request #19264 from lnicola/theme-color
lnicola Mar 2, 2025
1c00d8f
Add `identifier` to pull diagnostic LSP capabilities
the-mikedavis Mar 2, 2025
a43a5f9
Merge pull request #19266 from the-mikedavis/lsp-pull-diagnostics-ide…
lnicola Mar 2, 2025
c6a7251
Merge pull request #19226 from Shourya742/2025-02-25-fix-completion-r…
ChayimFriedman2 Mar 3, 2025
969868b
Preparing for merge from rust-lang/rust
lnicola Mar 3, 2025
dd3a5f9
Merge from rust-lang/rust
lnicola Mar 3, 2025
24c480e
Bump rustc crates
lnicola Mar 3, 2025
015e81d
Merge pull request #19269 from lnicola/sync-from-rust
lnicola Mar 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ name = "always-assert"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1078fa1ce1e34b1872d8611ad921196d76bdd7027e949fbe31231abde201892"
dependencies = [
"tracing",
]

[[package]]
name = "anyhow"
Expand Down Expand Up @@ -1940,13 +1937,13 @@ dependencies = [
name = "stdx"
version = "0.0.0"
dependencies = [
"always-assert",
"backtrace",
"crossbeam-channel",
"itertools",
"jod-thread",
"libc",
"miow",
"tracing",
"windows-sys 0.59.0",
]

Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ syntax-bridge.workspace = true

[features]
jemalloc = ["jemallocator", "profile/jemalloc"]
force-always-assert = ["always-assert/force"]
force-always-assert = ["stdx/force-always-assert"]
sysroot-abi = []
in-rust-tree = [
"sysroot-abi",
Expand Down
3 changes: 2 additions & 1 deletion src/tools/rust-analyzer/crates/stdx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ doctest = false

[dependencies]
backtrace = { version = "0.3.67", optional = true }
always-assert = { version = "0.2.0", features = ["tracing"] }
jod-thread = "0.1.2"
libc.workspace = true
crossbeam-channel.workspace = true
itertools.workspace = true
tracing.workspace = true
# Think twice before adding anything here

[target.'cfg(windows)'.dependencies]
Expand All @@ -28,6 +28,7 @@ windows-sys = { version = "0.59", features = ["Win32_Foundation"] }
[features]
# Uncomment to enable for the whole crate graph
# default = [ "backtrace" ]
force-always-assert = []

[lints]
workspace = true
115 changes: 115 additions & 0 deletions src/tools/rust-analyzer/crates/stdx/src/assert.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// Vendored from https://github.com/matklad/always-assert/commit/4cf564eea6fcf18b30c3c3483a611004dc03afbb
//! Recoverable assertions, inspired by [the use of `assert()` in
//! SQLite](https://www.sqlite.org/assert.html).
//!
//! `never!` and `always!` return the actual value of the condition if
//! `debug_assertions` are disabled.
//!
//! Use them when terminating on assertion failure is worse than continuing.
//!
//! One example would be a critical application like a database:
//!
//! ```ignore
//! use stdx::never;
//!
//! fn apply_transaction(&mut self, tx: Transaction) -> Result<(), TransactionAborted> {
//! let delta = self.compute_delta(&tx);
//!
//! if never!(!self.check_internal_invariant(&delta)) {
//! // Ok, something in this transaction messed up our internal state.
//! // This really shouldn't be happening, and this signifies a bug.
//! // Luckily, we can recover by just rejecting the transaction.
//! return abort_transaction(tx);
//! }
//! self.commit(delta);
//! Ok(())
//! }
//! ```
//!
//! Another example is assertions about non-critical functionality in usual apps
//!
//! ```ignore
//! use stdx::never;
//!
//! let english_message = "super app installed!"
//! let mut local_message = localize(english_message);
//! if never!(local_message.is_empty(), "missing localization for {}", english_message) {
//! // We localized all the messages but this one slipper through the cracks?
//! // Better to show the english one then than to fail outright;
//! local_message = english_message;
//! }
//! println!("{}", local_message);
//! ```

/// Asserts that the condition is always true and returns its actual value.
///
/// If the condition is true does nothing and and evaluates to true.
///
/// If the condition is false:
/// * panics if `force` feature or `debug_assertions` are enabled,
/// * logs an error if the `tracing` feature is enabled,
/// * evaluates to false.
///
/// Accepts `format!` style arguments.
#[macro_export]
macro_rules! always {
($cond:expr) => {
$crate::always!($cond, "assertion failed: {}", stringify!($cond))
};

($cond:expr, $fmt:literal $($arg:tt)*) => {{
let cond = $cond;
if cfg!(debug_assertions) || $crate::assert::__FORCE {
assert!(cond, $fmt $($arg)*);
}
if !cond {
$crate::assert::__tracing_error!($fmt $($arg)*);
}
cond
}};
}

/// Asserts that the condition is never true and returns its actual value.
///
/// If the condition is false does nothing and and evaluates to false.
///
/// If the condition is true:
/// * panics if `force` feature or `debug_assertions` are enabled,
/// * logs an error if the `tracing` feature is enabled,
/// * evaluates to true.
///
/// Accepts `format!` style arguments.
///
/// Empty condition is equivalent to false:
///
/// ```ignore
/// never!("oups") ~= unreachable!("oups")
/// ```
#[macro_export]
macro_rules! never {
(true $($tt:tt)*) => { $crate::never!((true) $($tt)*) };
(false $($tt:tt)*) => { $crate::never!((false) $($tt)*) };
() => { $crate::never!("assertion failed: entered unreachable code") };
($fmt:literal $(, $($arg:tt)*)?) => {{
if cfg!(debug_assertions) || $crate::assert::__FORCE {
unreachable!($fmt $(, $($arg)*)?);
}
$crate::assert::__tracing_error!($fmt $(, $($arg)*)?);
}};

($cond:expr) => {{
let cond = !$crate::always!(!$cond);
cond
}};

($cond:expr, $fmt:literal $($arg:tt)*) => {{
let cond = !$crate::always!(!$cond, $fmt $($arg)*);
cond
}};
}

#[doc(hidden)]
pub use tracing::error as __tracing_error;

#[doc(hidden)]
pub const __FORCE: bool = cfg!(feature = "force-always-assert");
5 changes: 3 additions & 2 deletions src/tools/rust-analyzer/crates/stdx/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ use std::io as sio;
use std::process::Command;
use std::{cmp::Ordering, ops, time::Instant};

pub mod anymap;
mod macros;

pub mod anymap;
pub mod assert;
pub mod non_empty_vec;
pub mod panic_context;
pub mod process;
pub mod rand;
pub mod thin_vec;
pub mod thread;

pub use always_assert::{always, never};
pub use itertools;

#[inline(always)]
Expand Down