Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2ec4b9b
Avoid type unification errors in term search
ChayimFriedman2 Jun 29, 2026
41d005f
Fix parsing of `self::` in fn param list
ChayimFriedman2 Aug 17, 2026
95a793f
fix: accept Self as non-leading path segment in attribute paths
Aditya-PS-05 Aug 28, 2026
fd6ad17
Install cargo tools with locked dependencies
konstin Aug 20, 2026
207b861
Represent doc comments using their own node and not as COMMENT trivia
ChayimFriedman2 Aug 23, 2026
adbeb5e
rename `StoredProjection::lookup` to `StoredProjection::as_slice`
ada4a Aug 31, 2026
911ae19
rename `Place` to `StoredPlace`
ada4a Aug 31, 2026
69fba7f
rename `PlaceRef` to `Place`
ada4a Aug 31, 2026
3d79ea0
Merge pull request #23267 from ada4a/push-xoyurrkmomlv
ChayimFriedman2 Sep 1, 2026
8cc2b1b
render const value in completions label details
BenjaminBrienen Sep 1, 2026
75dd8b3
misc: add an intra-doc link
ada4a Sep 1, 2026
8ba5a18
Fix handling of `#[unsafe()]` attrs without inner meta
ChayimFriedman2 Sep 1, 2026
f737ce3
Merge pull request #23270 from ChayimFriedman2/unsafe-meta-fix
ChayimFriedman2 Sep 1, 2026
9534761
merge `hir_def::hir::Expr::Unsafe` into `Expr::Block`
ada4a Sep 1, 2026
1aa6087
minor: add space after comma in prettify macro expansion
A4-Tacks Sep 1, 2026
a53f45b
Merge pull request #23271 from ada4a/push-xporswkztpmn
ChayimFriedman2 Sep 1, 2026
30fd23d
Merge pull request #23272 from A4-Tacks/pretty-comma-space
A4-Tacks Sep 1, 2026
58efe61
Fix typos, update typos-cli
BenjaminBrienen Sep 1, 2026
bc4bb63
Merge pull request #23275 from BenjaminBrienen/typos
ChayimFriedman2 Sep 1, 2026
e21bd35
Remove FIXME, update docs
BenjaminBrienen Sep 1, 2026
53aa256
Merge pull request #23274 from BenjaminBrienen/rename-base-source
ChayimFriedman2 Sep 1, 2026
f77163c
Merge pull request #23248 from konstin/konsti/cargo-install-locked
ShoyuVanilla Sep 2, 2026
90e8beb
fix: hover `1f64` use float instead of integer
A4-Tacks Sep 2, 2026
b2e35af
Merge pull request #23279 from A4-Tacks/int-float-suf-hover
ChayimFriedman2 Sep 2, 2026
13c017d
Prepare for merging from rust-lang/rust
invalid-email-address Sep 2, 2026
3583e36
Merge ref '59dabe56f7b7' from rust-lang/rust
invalid-email-address Sep 2, 2026
3f57447
Merge pull request #23282 from rust-lang/rustc-pull
lnicola Sep 2, 2026
d7e7755
Merge pull request #23249 from Aditya-PS-05/fix-tool-attr-self-segment
ChayimFriedman2 Sep 3, 2026
1755f64
Merge pull request #23266 from BenjaminBrienen/const-label-details
ChayimFriedman2 Sep 3, 2026
8ef7995
internal: remove redundant disable 'unused_variables'
A4-Tacks Sep 3, 2026
05d1c57
Merge pull request #23283 from A4-Tacks/redundant-unused-var
ChayimFriedman2 Sep 3, 2026
1770deb
Refactor collection of diagnostics in `hir`
ChayimFriedman2 Aug 18, 2026
3a3cb14
Do not relower the signature again in inference, instead fetch it fro…
ChayimFriedman2 Aug 19, 2026
b94de22
Merge pull request #23218 from ChayimFriedman2/doc-comment-no-trivia
ChayimFriedman2 Sep 3, 2026
79d3ddb
Merge pull request #23190 from ChayimFriedman2/no-relowering
ChayimFriedman2 Sep 3, 2026
f375a45
Update contributor guide about `ChangeWithProcMacros`
BenjaminBrienen Sep 3, 2026
4503613
Add missing body diagnostics
BenjaminBrienen Sep 1, 2026
9960cbf
Merge pull request #23284 from BenjaminBrienen/update-guide-change
ChayimFriedman2 Sep 3, 2026
d8e2308
Merge pull request #23262 from BenjaminBrienen/freestanding
ChayimFriedman2 Sep 3, 2026
49fce00
misc: make a FIXME more specific
ada4a Sep 1, 2026
6f265f5
document `ExprCollector::expand_macros_to_string`
ada4a Sep 2, 2026
9133935
use `match_ast!` in `syntax::ast::expr_ext`
ada4a Sep 3, 2026
cee1e08
clean-up `render_variant_after_name`
ada4a Aug 11, 2026
2eb7af1
use correct `what` string in `size_of_sized` calls
ada4a Sep 3, 2026
ac5cf8b
Merge pull request #23285 from ada4a/push-uxovlvqktzsp
ChayimFriedman2 Sep 3, 2026
c5862f3
fix: allow inner attributes on blocks in tuple expressions
Aditya-PS-05 Aug 28, 2026
fac655c
accept inner block attributes in array exprs and arg lists
Aditya-PS-05 Sep 4, 2026
0b30592
Follow symlinks when discovering prebuilt rustc proc-macro dylibs
onlycs Aug 29, 2026
7f73060
Merge pull request #23246 from Aditya-PS-05/block-inner-attrs-tuple
A4-Tacks Sep 5, 2026
25d1870
Merge pull request #23297 from onlycs/follow-symlinks-proc-macro-dylibs
ChayimFriedman2 Sep 5, 2026
f85fa63
tempfile cannot be constructed
BenjaminBrienen Sep 5, 2026
0a706c9
Merge pull request #23292 from BenjaminBrienen/fix-tempfile-new
ChayimFriedman2 Sep 5, 2026
0d7e8dc
Merge pull request #22662 from ChayimFriedman2/term-search-unify
Veykril Sep 6, 2026
e6687dc
Merge pull request #23163 from ChayimFriedman2/isolated-self
Veykril Sep 6, 2026
2ece704
Prepare for merging from rust-lang/rust
invalid-email-address Sep 7, 2026
57401f1
Merge ref '32d94cc9be3f' from rust-lang/rust
invalid-email-address Sep 7, 2026
13c9cca
Merge pull request #23303 from rust-lang/rustc-pull
lnicola Sep 7, 2026
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
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/.github/workflows/autopublish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: rustup update --no-self-update stable

- name: Install cargo-workspaces
run: cargo install cargo-workspaces --version "0.3.6"
run: cargo install --locked cargo-workspaces --version "0.3.6"

- name: Publish Crates
env:
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rust-analyzer/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}

- name: Install rustup-toolchain-install-master
run: cargo install rustup-toolchain-install-master@1.11.0
run: cargo install --locked rustup-toolchain-install-master@1.11.0

# Install a pinned rustc commit to avoid surprises
- name: Install Rust toolchain
Expand Down Expand Up @@ -317,7 +317,7 @@ jobs:
timeout-minutes: 10
env:
FORCE_COLOR: 1
TYPOS_VERSION: v1.38.1
TYPOS_VERSION: v1.50.0
steps:
- name: download typos
run: curl -LsSf https://github.com/crate-ci/typos/releases/download/$TYPOS_VERSION/typos-$TYPOS_VERSION-x86_64-unknown-linux-musl.tar.gz | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/.github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ jobs:

- name: Build fuzzers
run: |
cargo install cargo-fuzz
cargo install --locked cargo-fuzz
cd crates/syntax
cargo +nightly fuzz build
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: rustup update --no-self-update stable

- name: Install cargo-workspaces
run: cargo install cargo-workspaces --version "0.3.6"
run: cargo install --locked cargo-workspaces --version "0.3.6"

- name: Publish Crates
env:
Expand Down
2 changes: 2 additions & 0 deletions src/tools/rust-analyzer/.typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,7 @@ inh = "inh"
anc = "anc"
datas = "datas"
impl_froms = "impl_froms"
implicits = "implicits"
selfs = "selfs"
taits = "taits"
verifys = "verifys"
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/base-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "base-db"
version = "0.0.0"
repository.workspace = true
description = "Basic database traits for rust-analyzer. The concrete DB is defined by `ide` (aka `ra_ap_ide`)."
description = "Basic database trait and infra for rust-analyzer's crate and source root inputs. The concrete DB is defined by `ide` (aka `ra_ap_ide`)."

authors.workspace = true
edition.workspace = true
Expand Down
9 changes: 5 additions & 4 deletions src/tools/rust-analyzer/crates/base-db/src/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,10 @@ impl fmt::Display for LangCrateOrigin {

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CrateDisplayName {
// The name we use to display various paths (with `_`).
/// The name we use to display various paths (with `_`).
crate_name: CrateName,
// The name as specified in Cargo.toml (with `-`).
/// The name as self-declared by the crate. For example, the name declared in the manifest of
/// the crate. This may contain dashes `-`.
canonical_name: Symbol,
}

Expand Down Expand Up @@ -936,8 +937,8 @@ impl<'a> IntoIterator for &'a Env {
///
/// ## dev-dependencies
///
/// Note that it's actually legal for a cargo package (i.e. a thing
/// with a Cargo.toml) to depend on itself in dev-dependencies. This
/// Note that it's actually legal for a Cargo package (i.e. a thing
/// with a `Cargo.toml`) to depend on itself in dev-dependencies. This
/// can enable additional features, and is typically used when a
/// project wants features to be enabled in tests. Dev-dependencies
/// are not propagated, so they aren't visible to package that depend
Expand Down
5 changes: 3 additions & 2 deletions src/tools/rust-analyzer/crates/base-db/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
//! base_db defines basic database traits. The concrete DB is defined by ide.
// FIXME: Rename this crate, base db is non descriptive
//! This crate defines the basic database trait for interacting with source code using [`salsa`].
//!
//! The concrete implementation DB is defined by ide.

#![cfg_attr(feature = "in-rust-tree", feature(rustc_private))]

Expand Down
37 changes: 16 additions & 21 deletions src/tools/rust-analyzer/crates/hir-def/src/attrs/docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ use hir_expand::{
};
use span::AstIdMap;
use syntax::{
AstNode, AstToken, SyntaxNode,
ast::{self, AttrDocCommentIter, IsString},
AstNode, SyntaxNode,
ast::{self, IsString},
};
use thin_vec::ThinVec;
use tt::{TextRange, TextSize};
Expand Down Expand Up @@ -213,15 +213,10 @@ impl Docs {
));
}

fn extend_with_doc_comment(&mut self, comment: ast::Comment, indent: &mut Indent) {
let Some((doc, offset)) = comment.doc_comment() else { return };
let offset = comment.syntax().text_range().start() + offset;
self.extend_with_doc_str(
doc,
offset,
DocCommentKind::Sugared(comment.kind().shape),
indent,
);
fn extend_with_doc_comment(&mut self, comment: ast::DocComment, indent: &mut Indent) {
let doc = comment.text();
let offset = comment.syntax().text_range().start() + ast::DocComment::PREFIX_LEN;
self.extend_with_doc_str(doc, offset, DocCommentKind::Sugared(comment.shape()), indent);
}

fn extend_with_doc_attr(&mut self, value: ast::String, indent: &mut Indent) {
Expand Down Expand Up @@ -662,13 +657,13 @@ fn extend_with_attrs<'a, 'db>(
let mut expander = None;

expand_cfg_attr_with_doc_comments::<_, Infallible>(
AttrDocCommentIter::from_syntax_node(node).filter(|attr| match attr {
Either::Left(attr) => attr.kind().is_inner() == expect_inner_attrs,
Either::Right(comment) => comment
.kind()
.doc
.is_some_and(|kind| (kind == ast::CommentPlacement::Inner) == expect_inner_attrs),
}),
node.children()
.filter_map(ast::AnyAttr::cast)
.filter(|attr| attr.kind().is_inner() == expect_inner_attrs)
.map(|attr| match attr {
ast::AnyAttr::Attr(it) => Either::Left(it),
ast::AnyAttr::DocComment(it) => Either::Right(it),
}),
|| *cfg_options.get_or_insert_with(get_cfg_options),
|attr| {
match attr {
Expand Down Expand Up @@ -795,7 +790,7 @@ pub(crate) fn extract_docs<'a, 'db>(
mod tests {
use expect_test::expect;
use hir_expand::InFile;
use syntax::{AstToken, ast};
use syntax::{AstNode, ast};
use test_fixture::WithFixture;
use thin_vec::ThinVec;
use tt::{TextRange, TextSize};
Expand Down Expand Up @@ -1016,8 +1011,8 @@ mod tests {
let comment = syntax::SourceFile::parse(source, span::Edition::CURRENT)
.syntax_node()
.descendants_with_tokens()
.filter_map(|it| it.into_token())
.find_map(ast::Comment::cast)
.filter_map(|it| it.into_node())
.find_map(ast::DocComment::cast)
.expect("no comment in the fixture");
let mut docs = Docs {
docs: String::new(),
Expand Down
15 changes: 12 additions & 3 deletions src/tools/rust-analyzer/crates/hir-def/src/expr_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ struct ExpressionOnlyStore {

/// A map from an variable usages to their hygiene ID.
///
/// Expressions (and destructuing patterns) that can be recorded here are single segment path, although not all single segments path refer
/// Expressions (and destructuring patterns) that can be recorded here are single segment path, although not all single segments path refer
/// to variables and have hygiene (some refer to items, we don't know at this stage).
ident_hygiene: FxHashMap<ExprOrPatIdPacked, HygieneId>,

Expand Down Expand Up @@ -321,6 +321,15 @@ struct FormatTemplate {
implicit_capture_to_source: FxHashMap<ExprId, InFile<(ExprPtr, TextRange)>>,
}

#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash)]
pub enum MissingBodyItemKind {
AssocConst,
AssocType,
Const,
Static,
TypeAlias,
}

#[derive(Debug, Eq, PartialEq)]
pub enum ExpressionStoreDiagnostics {
InactiveCode { node: InFile<SyntaxNodePtr>, cfg: CfgExpr, opts: CfgOptions },
Expand All @@ -330,6 +339,7 @@ pub enum ExpressionStoreDiagnostics {
UndeclaredLabel { node: InFile<AstPtr<ast::Lifetime>>, name: Name },
PatternArgInExternFn { node: InFile<AstPtr<ast::Pat>> },
FruInDestructuringAssignment { node: InFile<AstPtr<ast::Expr>> },
MissingBody { node: InFile<SyntaxNodePtr>, kind: MissingBodyItemKind },
}

impl ExpressionStoreBuilder {
Expand Down Expand Up @@ -689,8 +699,7 @@ impl ExpressionStore {
visitor.on_pat(*pat);
visitor.on_expr(*expr);
}
Expr::Block { statements, tail, id: _, label: _ }
| Expr::Unsafe { statements, tail, id: _ } => {
Expr::Block { statements, tail, id: _, label: _, unsafe_: _ } => {
for stmt in statements {
match stmt {
Statement::Let { initializer, else_branch, pat, type_ref } => {
Expand Down
18 changes: 11 additions & 7 deletions src/tools/rust-analyzer/crates/hir-def/src/expr_store/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::ops;
use base_db::SourceDatabase;
use hir_expand::{InFile, Lookup};
use span::Edition;
use syntax::ast;
use syntax::{SyntaxNodePtr, ast};
use triomphe::Arc;

use crate::{
Expand Down Expand Up @@ -96,36 +96,40 @@ impl Body {

let mut is_async_fn = false;
let mut is_gen_fn = false;
let InFile { file_id, value: body } = {
let (InFile { file_id, value: body }, syntax_node) = {
match def {
DefWithBodyId::FunctionId(f) => {
let f = f.lookup(db);
let src = f.source(db);
params = src.value.param_list();
is_async_fn = src.value.async_token().is_some();
is_gen_fn = src.value.gen_token().is_some();
src.map(|it| it.body().map(ast::Expr::from))
let syntax_node = SyntaxNodePtr::new(src.syntax().value);
(src.map(|it| it.body().map(ast::Expr::from)), syntax_node)
}
DefWithBodyId::ConstId(c) => {
let c = c.lookup(db);
let src = c.source(db);
src.map(|it| it.body())
let syntax_node = SyntaxNodePtr::new(src.syntax().value);
(src.map(|it| it.body()), syntax_node)
}
DefWithBodyId::StaticId(s) => {
let s = s.lookup(db);
let src = s.source(db);
src.map(|it| it.body())
let syntax_node = SyntaxNodePtr::new(src.syntax().value);
(src.map(|it| it.body()), syntax_node)
}
DefWithBodyId::VariantId(v) => {
let s = v.lookup(db);
let src = s.source(db);
src.map(|it| it.const_arg()?.expr())
let syntax_node = SyntaxNodePtr::new(src.syntax().value);
(src.map(|it| it.const_arg()?.expr()), syntax_node)
}
}
};
let module = def.module(db);
let (body, source_map) =
lower_body(db, def, file_id, module, params, body, is_async_fn, is_gen_fn);
lower_body(db, def, syntax_node, file_id, module, params, body, is_async_fn, is_gen_fn);

(Arc::new(body), source_map)
}
Expand Down
Loading
Loading