Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f5579e6
Support else-branch for move_guard
A4-Tacks Jan 22, 2026
da57703
Add selection test case
A4-Tacks Jan 22, 2026
8321b25
Add test case for select non-first branch
A4-Tacks Jan 26, 2026
5a568d5
fix linking of postcard test
Shourya742 Jan 27, 2026
c99fca1
feat: fallback let postfix completions in condition
A4-Tacks Jan 30, 2026
4e5b645
fix: Fix more glob issues
Veykril Jan 31, 2026
41577bc
refactor: Remove unused comments related to SyntaxErrorKind
Feb 1, 2026
edf20f0
Merge pull request #21561 from Veykril/push-xvymvmuvzuyn
Veykril Feb 2, 2026
c53d127
Merge pull request #21565 from abdul2801/master
Veykril Feb 2, 2026
c836e24
Cover more cases where we need parentheses in `&(impl Trait1 + Trait2)`
ChayimFriedman2 Feb 2, 2026
dbb9b62
internal: Clarify that CargoCheck applies to all check commands
Wilfred Jan 30, 2026
df2a3f8
internal: Document and rename DiagnosticsReceived variants
Wilfred Jan 30, 2026
93dece9
fix: Stale diagnostics with rust-project.json and rustc JSON
Wilfred Feb 2, 2026
301ff3f
Infer the expected len in `include_bytes!()`, to avoid mismatches
ChayimFriedman2 Feb 3, 2026
dc1ac63
Parse `try bikeshed T {}` syntax
goffrie Feb 2, 2026
07213f0
Add Residual, residual_into_try_type to minicore
goffrie Feb 2, 2026
383eb25
Implement homogeneous & heterogeneous try blocks
goffrie Feb 2, 2026
9415ddd
Remove unnecessary `unsafe(non_update_types)`
ChayimFriedman2 Feb 3, 2026
ed58edc
Merge pull request #21572 from goffrie/try
ChayimFriedman2 Feb 3, 2026
8e3c55b
Merge pull request #21576 from ChayimFriedman2/remove-non-update
ChayimFriedman2 Feb 3, 2026
2afde4e
Merge pull request #21557 from A4-Tacks/let-postfix-in-cond
ChayimFriedman2 Feb 3, 2026
492e302
Merge pull request #21508 from A4-Tacks/move-guard-else-if
ChayimFriedman2 Feb 3, 2026
3988689
Use `display_source_code()` in `ReferenceConversion`
ChayimFriedman2 Feb 3, 2026
b4f36ce
Prevent cycles when lowering from supertrait elaboration
ChayimFriedman2 Feb 3, 2026
4c3600c
Provide a cycle handler for `GenericPredicates`
ChayimFriedman2 Feb 3, 2026
b83b375
fix: Fix not complete `.not` in condition
A4-Tacks Jan 26, 2026
34ca201
fix: Truncate display version of commands consistently
Wilfred Feb 3, 2026
51abdca
docs: remove shell prompt symbols and fix code block languages
Act0r1 Feb 4, 2026
9ecd626
docs: additional improvements
Act0r1 Feb 4, 2026
ec6d039
Merge pull request #21526 from A4-Tacks/comp-not-in-cond
ChayimFriedman2 Feb 4, 2026
a72f7fe
docs: use triple backticks for pacman command
Act0r1 Feb 4, 2026
0a4871c
Merge pull request #21585 from Act0r1/docs/improve-documentation
Veykril Feb 5, 2026
e21584e
Merge pull request #21580 from Wilfred/display_command_shortened
Veykril Feb 5, 2026
934eebd
Merge pull request #21579 from ChayimFriedman2/cycle
Veykril Feb 5, 2026
5300804
Merge pull request #21578 from ChayimFriedman2/reparse-unknown
Veykril Feb 5, 2026
82941ed
Merge pull request #21573 from ChayimFriedman2/include-bytes-len
Veykril Feb 5, 2026
a2b126b
Merge pull request #21569 from ChayimFriedman2/parens-multi-impl-trait
Veykril Feb 5, 2026
6fde77c
internal: Simplify binding hash computation in syntax highlighting
Veykril Feb 7, 2026
86cdf24
Merge pull request #21599 from Veykril/push-oqmszvwttzsz
Veykril Feb 7, 2026
3ee0286
internal: Remove `Edition::CURRENT_FIXME`
Veykril Jan 18, 2026
c91e70e
Merge pull request #21488 from Veykril/push-ptvulypwwmvz
Veykril Feb 7, 2026
63eefa9
Bump time from 0.3.44 to 0.3.47
dependabot[bot] Feb 7, 2026
c14eb7f
Merge pull request #21593 from rust-lang/dependabot/cargo/time-0.3.47
Veykril Feb 7, 2026
729f384
Bump salsa
Veykril Feb 7, 2026
84c2a53
Correctly implement client side request cancellation support
Veykril Jan 1, 2026
abc2fc0
Merge pull request #21380 from Veykril/push-nolvxuourwru
Veykril Feb 7, 2026
cfe2461
Merge pull request #21570 from Wilfred/clarify_check_struct
Veykril Feb 7, 2026
36058bf
Merge pull request #21571 from Wilfred/check_type_names
Veykril Feb 7, 2026
f394d1e
Fix lockfile
lnicola Feb 9, 2026
0e022db
Merge pull request #21607 from lnicola/fix-lockfile
lnicola Feb 9, 2026
5ad44f2
Merge pull request #21538 from Shourya742/2026-01-28-fix-linking-of-p…
lnicola Feb 9, 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
30 changes: 15 additions & 15 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1614,9 +1614,9 @@ dependencies = [

[[package]]
name = "num-conv"
version = "0.1.0"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050"

[[package]]
name = "num-traits"
Expand Down Expand Up @@ -2453,9 +2453,9 @@ checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"

[[package]]
name = "salsa"
version = "0.25.2"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e2aa2fca57727371eeafc975acc8e6f4c52f8166a78035543f6ee1c74c2dcc"
checksum = "f77debccd43ba198e9cee23efd7f10330ff445e46a98a2b107fed9094a1ee676"
dependencies = [
"boxcar",
"crossbeam-queue",
Expand All @@ -2478,15 +2478,15 @@ dependencies = [

[[package]]
name = "salsa-macro-rules"
version = "0.25.2"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bfc2a1e7bf06964105515451d728f2422dedc3a112383324a00b191a5c397a3"
checksum = "ea07adbf42d91cc076b7daf3b38bc8168c19eb362c665964118a89bc55ef19a5"

[[package]]
name = "salsa-macros"
version = "0.25.2"
version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d844c1aa34946da46af683b5c27ec1088a3d9d84a2b837a108223fd830220e1"
checksum = "d16d4d8b66451b9c75ddf740b7fc8399bc7b8ba33e854a5d7526d18708f67b05"
dependencies = [
"proc-macro2",
"quote",
Expand Down Expand Up @@ -2914,32 +2914,32 @@ dependencies = [

[[package]]
name = "time"
version = "0.3.44"
version = "0.3.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91e7d9e3bb61134e77bde20dd4825b97c010155709965fedf0f49bb138e52a9d"
checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c"
dependencies = [
"deranged",
"itoa",
"libc",
"num-conv",
"num_threads",
"powerfmt",
"serde",
"serde_core",
"time-core",
"time-macros",
]

[[package]]
name = "time-core"
version = "0.1.6"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40868e7c1d2f0b8d73e4a8c7f0ff63af4f6d19be117e90bd73eb1d62cf831c6b"
checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca"

[[package]]
name = "time-macros"
version = "0.2.24"
version = "0.2.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30cfb0125f12d9c277f35663a0a33f8c30190f4e4574868a330595412d34ebf3"
checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215"
dependencies = [
"num-conv",
"time-core",
Expand Down
6 changes: 2 additions & 4 deletions src/tools/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ rayon = "1.10.0"
rowan = "=0.15.17"
# Ideally we'd not enable the macros feature but unfortunately the `tracked` attribute does not work
# on impls without it
salsa = { version = "0.25.2", default-features = false, features = [
salsa = { version = "0.26", default-features = false, features = [
"rayon",
"salsa_unstable",
"macros",
"inventory",
] }
salsa-macros = "0.25.2"
salsa-macros = "0.26"
semver = "1.0.26"
serde = { version = "1.0.219" }
serde_derive = { version = "1.0.219" }
Expand Down Expand Up @@ -192,8 +192,6 @@ unused_lifetimes = "warn"
unreachable_pub = "warn"

[workspace.lints.clippy]
# FIXME Remove the tidy test once the lint table is stable

## lint groups
complexity = { level = "warn", priority = -1 }
correctness = { level = "deny", priority = -1 }
Expand Down
18 changes: 1 addition & 17 deletions src/tools/rust-analyzer/bench_data/glorious_old_parser
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ impl<'a> Parser<'a> {
// {foo(bar {}}
// - ^
// | |
// | help: `)` may belong here (FIXME: #58270)
// | help: `)` may belong here
// |
// unclosed delimiter
if let Some(sp) = unmatched.unclosed_span {
Expand Down Expand Up @@ -3217,7 +3217,6 @@ impl<'a> Parser<'a> {

}
_ => {
// FIXME Could factor this out into non_fatal_unexpected or something.
let actual = self.this_token_to_string();
self.span_err(self.span, &format!("unexpected token: `{}`", actual));
}
Expand Down Expand Up @@ -5250,7 +5249,6 @@ impl<'a> Parser<'a> {
}
}
} else {
// FIXME: Bad copy of attrs
let old_directory_ownership =
mem::replace(&mut self.directory.ownership, DirectoryOwnership::UnownedViaBlock);
let item = self.parse_item_(attrs.clone(), false, true)?;
Expand Down Expand Up @@ -5953,23 +5951,14 @@ impl<'a> Parser<'a> {
});
assoc_ty_bindings.push(span);
} else if self.check_const_arg() {
// FIXME(const_generics): to distinguish between idents for types and consts,
// we should introduce a GenericArg::Ident in the AST and distinguish when
// lowering to the HIR. For now, idents for const args are not permitted.

// Parse const argument.
let expr = if let token::OpenDelim(token::Brace) = self.token {
self.parse_block_expr(None, self.span, BlockCheckMode::Default, ThinVec::new())?
} else if self.token.is_ident() {
// FIXME(const_generics): to distinguish between idents for types and consts,
// we should introduce a GenericArg::Ident in the AST and distinguish when
// lowering to the HIR. For now, idents for const args are not permitted.
return Err(
self.fatal("identifiers may currently not be used for const generics")
);
} else {
// FIXME(const_generics): this currently conflicts with emplacement syntax
// with negative integer literals.
self.parse_literal_maybe_minus()?
};
let value = AnonConst {
Expand All @@ -5991,9 +5980,6 @@ impl<'a> Parser<'a> {
}
}

// FIXME: we would like to report this in ast_validation instead, but we currently do not
// preserve ordering of generic parameters with respect to associated type binding, so we
// lose that information after parsing.
if misplaced_assoc_ty_bindings.len() > 0 {
let mut err = self.struct_span_err(
args_lo.to(self.prev_span),
Expand Down Expand Up @@ -6079,8 +6065,6 @@ impl<'a> Parser<'a> {
bounds,
}
));
// FIXME: Decide what should be used here, `=` or `==`.
// FIXME: We are just dropping the binders in lifetime_defs on the floor here.
} else if self.eat(&token::Eq) || self.eat(&token::EqEq) {
let rhs_ty = self.parse_ty()?;
where_clause.predicates.push(ast::WherePredicate::EqPredicate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const _: () = {
}
}

impl zalsa_struct_::HashEqLike<WithoutCrate> for EditionedFileIdData {
impl zalsa_::HashEqLike<WithoutCrate> for EditionedFileIdData {
#[inline]
fn hash<H: Hasher>(&self, state: &mut H) {
Hash::hash(self, state);
Expand Down
2 changes: 0 additions & 2 deletions src/tools/rust-analyzer/crates/edition/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ impl Edition {
pub const DEFAULT: Edition = Edition::Edition2015;
pub const LATEST: Edition = Edition::Edition2024;
pub const CURRENT: Edition = Edition::Edition2024;
/// The current latest stable edition, note this is usually not the right choice in code.
pub const CURRENT_FIXME: Edition = Edition::Edition2024;

pub fn from_u32(u32: u32) -> Edition {
match u32 {
Expand Down
82 changes: 68 additions & 14 deletions src/tools/rust-analyzer/crates/hir-def/src/expr_store/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ pub struct ExprCollector<'db> {
/// and we need to find the current definition. So we track the number of definitions we saw.
current_block_legacy_macro_defs_count: FxHashMap<Name, usize>,

current_try_block_label: Option<LabelId>,
current_try_block: Option<TryBlock>,

label_ribs: Vec<LabelRib>,
unowned_bindings: Vec<BindingId>,
Expand Down Expand Up @@ -472,6 +472,13 @@ enum Awaitable {
No(&'static str),
}

enum TryBlock {
// `try { ... }`
Homogeneous { label: LabelId },
// `try bikeshed Ty { ... }`
Heterogeneous { label: LabelId },
}

#[derive(Debug, Default)]
struct BindingList {
map: FxHashMap<(Name, HygieneId), BindingId>,
Expand Down Expand Up @@ -532,7 +539,7 @@ impl<'db> ExprCollector<'db> {
lang_items: OnceCell::new(),
store: ExpressionStoreBuilder::default(),
expander,
current_try_block_label: None,
current_try_block: None,
is_lowering_coroutine: false,
label_ribs: Vec::new(),
unowned_bindings: Vec::new(),
Expand Down Expand Up @@ -1069,7 +1076,9 @@ impl<'db> ExprCollector<'db> {
self.alloc_expr(Expr::Let { pat, expr }, syntax_ptr)
}
ast::Expr::BlockExpr(e) => match e.modifier() {
Some(ast::BlockModifier::Try(_)) => self.desugar_try_block(e),
Some(ast::BlockModifier::Try { try_token: _, bikeshed_token: _, result_type }) => {
self.desugar_try_block(e, result_type)
}
Some(ast::BlockModifier::Unsafe(_)) => {
self.collect_block_(e, |id, statements, tail| Expr::Unsafe {
id,
Expand Down Expand Up @@ -1344,7 +1353,7 @@ impl<'db> ExprCollector<'db> {
.map(|it| this.lower_type_ref_disallow_impl_trait(it));

let prev_is_lowering_coroutine = mem::take(&mut this.is_lowering_coroutine);
let prev_try_block_label = this.current_try_block_label.take();
let prev_try_block = this.current_try_block.take();

let awaitable = if e.async_token().is_some() {
Awaitable::Yes
Expand All @@ -1369,7 +1378,7 @@ impl<'db> ExprCollector<'db> {
let capture_by =
if e.move_token().is_some() { CaptureBy::Value } else { CaptureBy::Ref };
this.is_lowering_coroutine = prev_is_lowering_coroutine;
this.current_try_block_label = prev_try_block_label;
this.current_try_block = prev_try_block;
this.alloc_expr(
Expr::Closure {
args: args.into(),
Expand Down Expand Up @@ -1686,11 +1695,15 @@ impl<'db> ExprCollector<'db> {
/// Desugar `try { <stmts>; <expr> }` into `'<new_label>: { <stmts>; ::std::ops::Try::from_output(<expr>) }`,
/// `try { <stmts>; }` into `'<new_label>: { <stmts>; ::std::ops::Try::from_output(()) }`
/// and save the `<new_label>` to use it as a break target for desugaring of the `?` operator.
fn desugar_try_block(&mut self, e: BlockExpr) -> ExprId {
fn desugar_try_block(&mut self, e: BlockExpr, result_type: Option<ast::Type>) -> ExprId {
let try_from_output = self.lang_path(self.lang_items().TryTraitFromOutput);
let label = self.generate_new_name();
let label = self.alloc_label_desugared(Label { name: label }, AstPtr::new(&e).wrap_right());
let old_label = self.current_try_block_label.replace(label);
let try_block_info = match result_type {
Some(_) => TryBlock::Heterogeneous { label },
None => TryBlock::Homogeneous { label },
};
let old_try_block = self.current_try_block.replace(try_block_info);

let ptr = AstPtr::new(&e).upcast();
let (btail, expr_id) = self.with_labeled_rib(label, HygieneId::ROOT, |this| {
Expand Down Expand Up @@ -1720,8 +1733,38 @@ impl<'db> ExprCollector<'db> {
unreachable!("block was lowered to non-block");
};
*tail = Some(next_tail);
self.current_try_block_label = old_label;
expr_id
self.current_try_block = old_try_block;
match result_type {
Some(ty) => {
// `{ let <name>: <ty> = <expr>; <name> }`
let name = self.generate_new_name();
let type_ref = self.lower_type_ref_disallow_impl_trait(ty);
let binding = self.alloc_binding(
name.clone(),
BindingAnnotation::Unannotated,
HygieneId::ROOT,
);
let pat = self.alloc_pat_desugared(Pat::Bind { id: binding, subpat: None });
self.add_definition_to_binding(binding, pat);
let tail_expr =
self.alloc_expr_desugared_with_ptr(Expr::Path(Path::from(name)), ptr);
self.alloc_expr_desugared_with_ptr(
Expr::Block {
id: None,
statements: Box::new([Statement::Let {
pat,
type_ref: Some(type_ref),
initializer: Some(expr_id),
else_branch: None,
}]),
tail: Some(tail_expr),
label: None,
},
ptr,
)
}
None => expr_id,
}
}

/// Desugar `ast::WhileExpr` from: `[opt_ident]: while <cond> <body>` into:
Expand Down Expand Up @@ -1863,6 +1906,8 @@ impl<'db> ExprCollector<'db> {
/// ControlFlow::Continue(val) => val,
/// ControlFlow::Break(residual) =>
/// // If there is an enclosing `try {...}`:
/// break 'catch_target Residual::into_try_type(residual),
/// // If there is an enclosing `try bikeshed Ty {...}`:
/// break 'catch_target Try::from_residual(residual),
/// // Otherwise:
/// return Try::from_residual(residual),
Expand All @@ -1873,7 +1918,6 @@ impl<'db> ExprCollector<'db> {
let try_branch = self.lang_path(lang_items.TryTraitBranch);
let cf_continue = self.lang_path(lang_items.ControlFlowContinue);
let cf_break = self.lang_path(lang_items.ControlFlowBreak);
let try_from_residual = self.lang_path(lang_items.TryTraitFromResidual);
let operand = self.collect_expr_opt(e.expr());
let try_branch = self.alloc_expr(try_branch.map_or(Expr::Missing, Expr::Path), syntax_ptr);
let expr = self
Expand Down Expand Up @@ -1910,13 +1954,23 @@ impl<'db> ExprCollector<'db> {
guard: None,
expr: {
let it = self.alloc_expr(Expr::Path(Path::from(break_name)), syntax_ptr);
let callee = self
.alloc_expr(try_from_residual.map_or(Expr::Missing, Expr::Path), syntax_ptr);
let convert_fn = match self.current_try_block {
Some(TryBlock::Homogeneous { .. }) => {
self.lang_path(lang_items.ResidualIntoTryType)
}
Some(TryBlock::Heterogeneous { .. }) | None => {
self.lang_path(lang_items.TryTraitFromResidual)
}
};
let callee =
self.alloc_expr(convert_fn.map_or(Expr::Missing, Expr::Path), syntax_ptr);
let result =
self.alloc_expr(Expr::Call { callee, args: Box::new([it]) }, syntax_ptr);
self.alloc_expr(
match self.current_try_block_label {
Some(label) => Expr::Break { expr: Some(result), label: Some(label) },
match self.current_try_block {
Some(
TryBlock::Heterogeneous { label } | TryBlock::Homogeneous { label },
) => Expr::Break { expr: Some(result), label: Some(label) },
None => Expr::Return { expr: Some(result) },
},
syntax_ptr,
Expand Down
18 changes: 18 additions & 0 deletions src/tools/rust-analyzer/crates/hir-def/src/item_scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,24 @@ impl ItemScope {
self.macros.get_mut(name).expect("tried to update visibility of non-existent macro");
res.vis = vis;
}

pub(crate) fn update_def_types(&mut self, name: &Name, def: ModuleDefId, vis: Visibility) {
let res = self.types.get_mut(name).expect("tried to update def of non-existent type");
res.def = def;
res.vis = vis;
}

pub(crate) fn update_def_values(&mut self, name: &Name, def: ModuleDefId, vis: Visibility) {
let res = self.values.get_mut(name).expect("tried to update def of non-existent value");
res.def = def;
res.vis = vis;
}

pub(crate) fn update_def_macros(&mut self, name: &Name, def: MacroId, vis: Visibility) {
let res = self.macros.get_mut(name).expect("tried to update def of non-existent macro");
res.def = def;
res.vis = vis;
}
}

impl PerNs {
Expand Down
1 change: 1 addition & 0 deletions src/tools/rust-analyzer/crates/hir-def/src/lang_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ language_item_table! { LangItems =>
TryTraitFromOutput, sym::from_output, FunctionId;
TryTraitBranch, sym::branch, FunctionId;
TryTraitFromYeet, sym::from_yeet, FunctionId;
ResidualIntoTryType, sym::into_try_type, FunctionId;

PointerLike, sym::pointer_like, TraitId;

Expand Down
Loading
Loading