Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
784ec22
Run esbuild on the crate graph code
lnicola Nov 2, 2026
7b9bd4a
minor: inherit const fn for generate_is_empty_from_len
A4-Tacks Nov 7, 2026
9bdaaad
Fill tests
A4-Tacks Nov 7, 2026
2679a78
Back to string implement
A4-Tacks Nov 7, 2026
591f8fc
Remove unused syntax_factory proxy and unsafe projection
A4-Tacks Nov 9, 2026
c833132
Merge pull request #23630 from A4-Tacks/gen-const-is-empty
ChayimFriedman2 Nov 9, 2026
6644813
fix: Don't complete transparent after repr(align(...)) or repr(packed)
Wilfred Nov 3, 2026
4ec9d6b
internal: Add `--num-threads` to `lsif`
antoinebrault Nov 9, 2026
92872eb
Merge pull request #23635 from antoinebrault/lsif-num-threads
ChayimFriedman2 Nov 9, 2026
5eb5928
fix: Panic on `for<'a>` on types using `#[derive()]`
Wilfred Sep 14, 2026
a6d37f9
Merge pull request #23636 from Wilfred/transparent_completion
ChayimFriedman2 Nov 9, 2026
5270abe
Merge pull request #23543 from Wilfred/panic_derive_macros
ShoyuVanilla Nov 9, 2026
4e67149
fix: Add macOS, iOS, Android and musl to cfg completion
Wilfred Nov 4, 2026
2319bae
Merge pull request #23637 from Wilfred/cfg_macos
lnicola Nov 9, 2026
4379834
fix: Large u128 values should not const eval to negative floats
Wilfred Nov 3, 2026
5c7b627
parser: add support for final associated functions and corresponding …
ddevilz Nov 1, 2026
f04fe99
Merge pull request #23585 from ddevilz/fix/parse-final-assoc-fn
A4-Tacks Nov 10, 2026
91accbd
Merge pull request #23599 from lnicola/bundle-crate-graph
lnicola Nov 10, 2026
4e38ebf
Disallow ZSTs in `ThinMap`.
martinboehme Nov 10, 2026
f086128
Bump node and vs code dependencies
lnicola Nov 10, 2026
b2a9edc
Merge pull request #23639 from lnicola/bump-vscode
lnicola Nov 10, 2026
6f57ac4
Merge pull request #23640 from martinboehme/thin_map_no_zst
ChayimFriedman2 Nov 10, 2026
64f256f
Explicitly enable features for `syn` dep in `macros` crate
ShoyuVanilla Nov 12, 2026
560085f
Merge pull request #23646 from ShoyuVanilla/yet-another-toml-churn
ShoyuVanilla Nov 12, 2026
76f687e
fix: complete `fn` `unsafe` after `const`
A4-Tacks Nov 12, 2026
e1336ad
Merge pull request #23647 from A4-Tacks/comp-const-fn
ChayimFriedman2 Nov 12, 2026
e41a5fe
Fix TypeAnchor children api
A4-Tacks Nov 12, 2026
1991a55
fix: do not complete types when trait in type anchor
A4-Tacks Nov 12, 2026
e923f85
Remove duplicated api 'qualifying_trait'
A4-Tacks Nov 12, 2026
6d02684
Merge pull request #23649 from A4-Tacks/type-anchor-loc
ChayimFriedman2 Nov 12, 2026
890183f
minor: fix clippy
A4-Tacks Nov 13, 2026
ff57bdd
Merge pull request #23652 from A4-Tacks/clippy
ShoyuVanilla Nov 13, 2026
3a733bf
feat: `.for` add ref when only ref impls into-iter
A4-Tacks Nov 13, 2026
3523d86
misc: fix comment
ada4a Nov 13, 2026
b85e46f
Move `ScalarInt` definition to `hir_ty::next_solver::consts::int`
ada4a Nov 13, 2026
a0dd4f4
update `consts::{int,valtree}`
ada4a Nov 13, 2026
293ac5c
Merge pull request #23657 from ada4a/push-rponnvnxukkn
ChayimFriedman2 Nov 14, 2026
2bb972f
Merge pull request #23638 from Wilfred/float_casts
ChayimFriedman2 Nov 14, 2026
ed10f1d
Merge pull request #23654 from A4-Tacks/for-ref-postfix
ChayimFriedman2 Nov 14, 2026
ebc057f
internal: update generated lints and target features
workflows-rust-analyzer[bot] Nov 14, 2026
8e11ba1
Replace `builtin #` with forced keywords
jeffs Nov 6, 2026
0bfbe7e
Restore support for old `builtin #` syntax
ChayimFriedman2 Nov 15, 2026
91d0b09
Merge pull request #23665 from ChayimFriedman2/fix-23622-forced-keywords
ChayimFriedman2 Nov 15, 2026
077a3f5
Merge pull request #23663 from rust-lang/ci/gen-sync
lnicola Nov 15, 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
Original file line number Diff line number Diff line change
Expand Up @@ -545,10 +545,10 @@ impl Printer<'_> {
match expr {
Expr::Missing => w!(self, "�"),
Expr::Underscore => w!(self, "_"),
Expr::InlineAsm(_) => w!(self, "builtin#asm(_)"),
Expr::InlineAsm(_) => w!(self, "k#asm(_)"),
Expr::IncludeBytes => w!(self, "include_bytes!(_)"),
Expr::OffsetOf(offset_of) => {
w!(self, "builtin#offset_of(");
w!(self, "k#offset_of(");
self.print_type_ref(offset_of.container);
let edition = self.edition;
w!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ fn f(param: usize) {
r#"
fn f(param: usize) {
let local = 0;
let _: builtin#pattern_type (usize is 0..=$0) = 0;
let _: k#pattern_type (usize is 0..=$0) = 0;
}
"#,
&["param"],
Expand All @@ -510,7 +510,7 @@ fn f(param: usize) {
r#"
fn f(param: usize) {
let local = 0;
let _ = |_: builtin#pattern_type (usize is 0..=$0)| {};
let _ = |_: k#pattern_type (usize is 0..=$0)| {};
}
"#,
&["param"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ fn desugar_builtin_format_args() {
fn main() {
let are = "are";
let count = 10;
builtin#format_args("\u{1b}hello {count:02} {} friends, we {are:?} {0}{last}", "fancy", orphan = (), last = "!");
builtin#format_args("hello world");
builtin#format_args("hello world", orphan = ());
k#format_args("\u{1b}hello {count:02} {} friends, we {are:?} {0}{last}", "fancy", orphan = (), last = "!");
k#format_args("hello world");
k#format_args("hello world", orphan = ());
}
"#,
expect![[r#"
Expand Down Expand Up @@ -643,7 +643,7 @@ fn foo() {
Foo(#[cfg(false)] 1);
(|#[cfg(false)] a| {})();

builtin # asm(
k#asm(
"",
#[cfg(false)] x = const 4,
#[cfg(false)] options(),
Expand All @@ -662,7 +662,7 @@ fn foo() {
[];
Foo();
(|| {})();
builtin#asm(_);
k#asm(_);
}"#]],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ macro_rules! global_asm {() => {}}
#[rustc_builtin_macro]
macro_rules! naked_asm {() => {}}

builtin #global_asm ("")
k#global_asm ("")

#[unsafe(naked)]
extern "C" fn foo() {
builtin #naked_asm ("");
k#naked_asm ("");
}

fn main() {
let i: u64 = 3;
let o: u64;
unsafe {
builtin #asm ("mov {0}, {1}", "add {0}, 5", out (reg)o, in (reg)i, );
k#asm ("mov {0}, {1}", "add {0}, 5", out (reg)o, in (reg)i, );
}
}
"##]],
Expand Down Expand Up @@ -290,7 +290,7 @@ macro_rules! format_args {
}

fn main() {
builtin #format_args ("{} {:?}", arg1(a, b, c), arg2);
k#format_args ("{} {:?}", arg1(a, b, c), arg2);
}
"##]],
);
Expand Down Expand Up @@ -323,17 +323,17 @@ macro_rules! format_args {
}

fn main() {
builtin #format_args (x = 2);
k#format_args (x = 2);
/* parse error: expected expression */
builtin #format_args (x = );
k#format_args (x = );
/* parse error: expected expression */
builtin #format_args (x = , x = 2);
k#format_args (x = , x = 2);
/* parse error: expected expression */
builtin #format_args ("{}", x = );
k#format_args ("{}", x = );
/* parse error: expected expression */
/* parse error: expected expression */
builtin #format_args ( = , "{}", x = );
builtin #format_args (x = 2, "{}", 5);
k#format_args ( = , "{}", x = );
k#format_args (x = 2, "{}", 5);
}
"##]],
);
Expand Down Expand Up @@ -361,7 +361,7 @@ macro_rules! format_args {
}

fn main() {
builtin #format_args ("{} {:?}", a::<A, B>(), b);
k#format_args ("{} {:?}", a::<A, B>(), b);
}
"##]],
);
Expand Down Expand Up @@ -394,7 +394,7 @@ macro_rules! format_args {
}

fn main() {
builtin #format_args (r#"{},mismatch,"{}","{}""#, location_csv_pat(db, &analysis, vfs, &sm, pat_id), mismatch.expected.display(db), mismatch.actual.display(db));
k#format_args (r#"{},mismatch,"{}","{}""#, location_csv_pat(db, &analysis, vfs, &sm, pat_id), mismatch.expected.display(db), mismatch.actual.display(db));
}
"##]],
);
Expand Down Expand Up @@ -428,7 +428,7 @@ macro_rules! format_args {
}

fn main() {
builtin #format_args (concat!("xxx{}y", "{:?}zzz"), 2, b);
k#format_args (concat!("xxx{}y", "{:?}zzz"), 2, b);
}
"##]],
);
Expand Down Expand Up @@ -459,7 +459,7 @@ macro_rules! format_args {
fn main() {
let _ =
/* parse error: expected field name or number */
builtin #format_args ("{} {:?}", a.);
k#format_args ("{} {:?}", a.);
}
"##]],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ macro_rules! format_args {}

fn main() {
/* parse error: expected field name or number */
builtin #format_args ("{}", line.1.);
k#format_args ("{}", line.1.);
}

"##]],
Expand Down Expand Up @@ -1061,7 +1061,7 @@ fn main() {
/* parse error: expected R_PAREN */
/* parse error: expected expression, item or let statement */
/* parse error: expected expression, item or let statement */
builtin #format_args ("{}", &[0 2]);
k#format_args ("{}", &[0 2]);
}

"##]],
Expand Down
36 changes: 18 additions & 18 deletions src/tools/rust-analyzer/crates/hir-expand/src/builtin/fn_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ register_builtin! {
(option_env, OptionEnv) => option_env_expand,
}

fn mk_pound(span: Span) -> tt::Leaf {
crate::tt::Leaf::Punct(crate::tt::Punct { char: '#', spacing: crate::tt::Spacing::Alone, span })
fn mk_forced_kw(span: Span, sym: Symbol) -> tt::Leaf {
crate::tt::Leaf::Ident(tt::Ident { sym, span, kind: tt::IdentKind::ForcedKeyword })
}

fn module_path_expand(
Expand Down Expand Up @@ -263,11 +263,11 @@ fn format_args_expand(
tt: &tt::TopSubtree,
span: Span,
) -> ExpandResult<tt::TopSubtree> {
let pound = mk_pound(span);
let kw = mk_forced_kw(span, sym::format_args);
let mut tt = tt.clone();
tt.set_top_subtree_delimiter_kind(tt::DelimiterKind::Parenthesis);
ExpandResult::ok(quote! {span =>
builtin #pound format_args #tt
#kw #tt
})
}

Expand All @@ -277,7 +277,7 @@ fn format_args_nl_expand(
tt: &tt::TopSubtree,
span: Span,
) -> ExpandResult<tt::TopSubtree> {
let pound = mk_pound(span);
let kw = mk_forced_kw(span, sym::format_args);
let mut tt = tt.clone();
tt.set_top_subtree_delimiter_kind(tt::DelimiterKind::Parenthesis);
let lit = tt.as_token_trees().iter_flat_tokens().nth(1);
Expand All @@ -290,7 +290,7 @@ fn format_args_nl_expand(
tt.set_token(1, lit.into());
}
ExpandResult::ok(quote! {span =>
builtin #pound format_args #tt
#kw #tt
})
}

Expand All @@ -302,9 +302,9 @@ fn asm_expand(
) -> ExpandResult<tt::TopSubtree> {
let mut tt = tt.clone();
tt.set_top_subtree_delimiter_kind(tt::DelimiterKind::Parenthesis);
let pound = mk_pound(span);
let kw = mk_forced_kw(span, sym::asm);
let expanded = quote! {span =>
builtin #pound asm #tt
#kw #tt
};
ExpandResult::ok(expanded)
}
Expand All @@ -317,9 +317,9 @@ fn global_asm_expand(
) -> ExpandResult<tt::TopSubtree> {
let mut tt = tt.clone();
tt.set_top_subtree_delimiter_kind(tt::DelimiterKind::Parenthesis);
let pound = mk_pound(span);
let kw = mk_forced_kw(span, sym::global_asm);
let expanded = quote! {span =>
builtin #pound global_asm #tt
#kw #tt
};
ExpandResult::ok(expanded)
}
Expand All @@ -332,9 +332,9 @@ fn naked_asm_expand(
) -> ExpandResult<tt::TopSubtree> {
let mut tt = tt.clone();
tt.set_top_subtree_delimiter_kind(tt::DelimiterKind::Parenthesis);
let pound = mk_pound(span);
let kw = mk_forced_kw(span, sym::naked_asm);
let expanded = quote! {span =>
builtin #pound naked_asm #tt
#kw #tt
};
ExpandResult::ok(expanded)
}
Expand Down Expand Up @@ -434,11 +434,11 @@ fn cfg_expand(
tt: &tt::TopSubtree,
span: Span,
) -> ExpandResult<tt::TopSubtree> {
let pound = mk_pound(span);
let kw = mk_forced_kw(span, sym::cfg);
// Support ide features, like completion and hover
// This implementation should not be used for 'cfg_select' because 'cfg_select' expands any token.
let expanded = quote! {span =>
builtin #pound cfg #tt
#kw #tt
};
ExpandResult::ok(expanded)
}
Expand Down Expand Up @@ -864,9 +864,9 @@ fn include_bytes_expand(
span: Span,
) -> ExpandResult<tt::TopSubtree> {
// FIXME: actually read the file here if the user asked for macro expansion
let pound = mk_pound(span);
let kw = mk_forced_kw(span, sym::include_bytes);
let res = quote! {span =>
builtin #pound include_bytes
#kw
};
ExpandResult::ok(res)
}
Expand Down Expand Up @@ -1008,6 +1008,6 @@ fn pattern_type_expand(
) -> ExpandResult<tt::TopSubtree> {
let mut tt = tt.clone();
tt.set_top_subtree_delimiter_kind(tt::DelimiterKind::Invisible);
let pound = mk_pound(call_site);
ExpandResult::ok(quote! {call_site => builtin #pound pattern_type ( #tt ) })
let kw = mk_forced_kw(call_site, sym::pattern_type);
ExpandResult::ok(quote! {call_site => #kw ( #tt ) })
}
16 changes: 16 additions & 0 deletions src/tools/rust-analyzer/crates/hir-ide/src/tests/consteval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,22 @@ fn floating_point_casts() {
check_number(r#"const GOAL: i64 = 1e18f64 as f32 as i64"#, 999999984306749440);
}

#[test]
fn u128_to_float_casts() {
check_number(
r#"
const GOAL: bool = ((1u128 << 127) as f32) == 170141183460469231731687303715884105728.0f32;
"#,
1,
);
check_number(
r#"
const GOAL: bool = ((1u128 << 127) as f64) == 170141183460469231731687303715884105728.0f64;
"#,
1,
);
}

#[test]
fn raw_pointer_equality() {
check_number(
Expand Down
24 changes: 12 additions & 12 deletions src/tools/rust-analyzer/crates/hir-ide/src/tests/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1489,26 +1489,26 @@ fn main() {
}
"#,
expect![[r#"
!0..122 'builti...muto,)': ()
!0..136 'builti...tack))': ()
!0..449 'builti...urn),)': !
!0..116 'k#asm(...muto,)': ()
!0..130 'k#asm(...tack))': ()
!0..443 'k#asm(...urn),)': !
10..1236 '{ ... } }': ()
16..1234 'unsafe... }': !
37..40 'foo': i32
43..44 '1': i32
58..63 'mut o': i32
66..67 '0': i32
!95..104 'thread_id': usize
!103..107 '&foo': &'? i32
!104..107 'foo': i32
!115..120 '&muto': &'? mut i32
!119..120 'o': i32
!89..98 'thread_id': usize
!97..101 '&foo': &'? i32
!98..101 'foo': i32
!109..114 '&muto': &'? mut i32
!113..114 'o': i32
293..294 'o': i32
!308..314 'OffPtr': usize
308..317 'thread_id': usize
!314..320 'OffPtr': usize
!333..338 'OffFn': usize
!354..355 '0': i32
!371..382 'MEM_RELEASE': usize
!327..332 'OffFn': usize
!348..349 '0': i32
!365..376 'MEM_RELEASE': usize
"#]],
)
}
6 changes: 3 additions & 3 deletions src/tools/rust-analyzer/crates/hir-ide/src/tests/patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1316,9 +1316,9 @@ fn foo(v: &Box<Foo<i32>>) {
333..356 '{ ... }': &'? [T]
343..350 'loop {}': !
348..350 '{}': ()
!0..20 'builti...inner)': Foo<i32>
!0..28 'builti...nner))': Box<Foo<i32>>
!14..19 'inner': &'? [i32]
!0..14 'k#deref(inner)': Foo<i32>
!0..22 'k#dere...nner))': Box<Foo<i32>>
!8..13 'inner': &'? [i32]
399..400 'v': &'? Box<Foo<i32>>
418..493 '{ ... } }': ()
424..491 'match ... }': ()
Expand Down
Loading
Loading