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 #125576

Merged
merged 45 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
39a653f
Fix coercion of async block
Kohei316 Apr 26, 2024
dd16cbc
braces around {self} in UseTree are not unnecessary
harrysarson Apr 25, 2024
1287e86
Clear diagnostics only after new ones were received
mladedav May 16, 2024
ea2a16c
fix: resolve extern prelude for local mods in block modules
roife May 17, 2024
9ff4ffb
Update builtin tool list
Veykril May 18, 2024
7045044
Allow hir::Param to refer to other entity params aside from functions
Veykril May 18, 2024
4b3d7f6
Render closure fn trait kind in siganture help
Veykril May 18, 2024
f42e55d
Enable linked locations for closure param inlay hints
Veykril May 18, 2024
6438554
Show fn traits in signature info for trait implementors
Veykril May 18, 2024
719eee2
test: add tests for extern preludes resolving in local mods
roife May 21, 2024
5992af6
fix: Fix general find-path inconsistencies
Veykril May 22, 2024
b29c755
expectify find_path tests
Veykril May 22, 2024
b1830a5
Update assists test fixtures
Veykril May 22, 2024
24bf53d
Auto merge of #17268 - Veykril:signatures, r=Veykril
bors May 22, 2024
39e6032
Auto merge of #17248 - mladedav:dm/delay-clear, r=Veykril
bors May 22, 2024
2ff9bab
fix: Fix format_args lowering passing incorrect parameters to rustc_p…
Veykril May 22, 2024
d9dda8f
Auto merge of #17279 - Veykril:format_args-escape, r=Veykril
bors May 22, 2024
ad810a5
Auto merge of #17277 - Veykril:find-path-fixes, r=Veykril
bors May 22, 2024
4e9b128
fix: check pseudo-block by local_id instead of ModuleOrigin
roife May 22, 2024
7a21dff
internal: refactor `prefer_no_std`/`prefer_prelude` bools into a struct
davidbarsky May 17, 2024
f50f8fb
Simplify
Veykril May 22, 2024
56ce7e0
Auto merge of #17252 - davidbarsky:david/refactor-standalone-bools-in…
bors May 22, 2024
0916e72
Auto merge of #17251 - roife:fix-issue-17057, r=Veykril
bors May 22, 2024
f2c3ef7
fix: ensure implied bounds from associated types are considered in au…
davidbarsky May 22, 2024
ac2708a
Auto merge of #17270 - davidbarsky:david/fix-completions-from-associa…
bors May 22, 2024
68fe34a
Auto merge of #17140 - harrysarson:harry-unused-self, r=Veykril
bors May 23, 2024
425ed6a
Update crates/hir-ty/src/infer/expr.rs
Veykril May 23, 2024
6e8646d
Auto merge of #17174 - Kohei316:fix-infer-async-block-with-tail-retur…
bors May 23, 2024
616fdd0
Use correct toolchain channel when generating builtin type doc links
Veykril May 23, 2024
ecadf37
Auto merge of #17284 - Veykril:doc-links, r=Veykril
bors May 23, 2024
f93256c
Allow sysroots to only consist of the source root dir
Veykril May 23, 2024
6259991
Auto merge of #17287 - Veykril:sysroot-encode-empty, r=Veykril
bors May 23, 2024
d83b267
Add cwd to CargoRunnable
roife May 22, 2024
7b54c82
Revert "Debug use cargo workspace root as cwd. fixes #13022"
roife May 22, 2024
1a37cfb
Use cwd from runnable.args for debugger
roife May 22, 2024
c10bda5
Update docs
roife May 22, 2024
3c7a13d
tests: update test for runnables
roife May 22, 2024
56d77b9
Auto merge of #17275 - roife:fix-issue-17012, r=Veykril
bors May 24, 2024
2315c6b
Use correct format for setting environment variables when debugging w…
0xJonas May 25, 2024
78fe45e
Semicolon
0xJonas May 25, 2024
09677b0
Formatting
0xJonas May 25, 2024
afa8dfc
Avoid clone when constructing runnable label.
mathew-horner May 25, 2024
eb9894f
Removed return
0xJonas May 25, 2024
bd9cc02
Auto merge of #17295 - 0xJonas:fix_passing_env_vars_to_cpptools, r=Ve…
bors May 26, 2024
f7ca8a6
Auto merge of #17296 - mathew-horner:no-clone-target, r=Veykril
bors May 26, 2024
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
3 changes: 0 additions & 3 deletions src/tools/rust-analyzer/crates/hir-def/src/attr/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ use std::sync::OnceLock;

use rustc_hash::FxHashMap;

/// Ignored attribute namespaces used by tools.
pub const TOOL_MODULES: &[&str] = &["rustfmt", "clippy"];

pub struct BuiltinAttribute {
pub name: &'static str,
pub template: AttributeTemplate,
Expand Down
10 changes: 8 additions & 2 deletions src/tools/rust-analyzer/crates/hir-def/src/body/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use syntax::{
self, ArrayExprKind, AstChildren, BlockExpr, HasArgList, HasAttrs, HasLoopBody, HasName,
RangeItem, SlicePatComponents,
},
AstNode, AstPtr, SyntaxNodePtr,
AstNode, AstPtr, AstToken as _, SyntaxNodePtr,
};
use triomphe::Arc;

Expand Down Expand Up @@ -1577,7 +1577,13 @@ impl ExprCollector<'_> {
});
});
let template = f.template();
let fmt_snippet = template.as_ref().map(ToString::to_string);
let fmt_snippet = template.as_ref().and_then(|it| match it {
ast::Expr::Literal(literal) => match literal.kind() {
ast::LiteralKind::String(s) => Some(s.text().to_owned()),
_ => None,
},
_ => None,
});
let mut mappings = vec![];
let fmt = match template.and_then(|it| self.expand_macros_to_string(it)) {
Some((s, is_direct_literal)) => format_args::parse(
Expand Down
4 changes: 2 additions & 2 deletions src/tools/rust-analyzer/crates/hir-def/src/body/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ fn desugar_builtin_format_args() {
fn main() {
let are = "are";
let count = 10;
builtin#format_args("hello {count:02} {} friends, we {are:?} {0}{last}", "fancy", last = "!");
builtin#format_args("\u{1b}hello {count:02} {} friends, we {are:?} {0}{last}", "fancy", last = "!");
}
"#,
);
Expand All @@ -161,7 +161,7 @@ fn main() {
let count = 10;
builtin#lang(Arguments::new_v1_formatted)(
&[
"hello ", " ", " friends, we ", " ", "",
"\u{1b}hello ", " ", " friends, we ", " ", "",
],
&[
builtin#lang(Argument::new_display)(
Expand Down
62 changes: 62 additions & 0 deletions src/tools/rust-analyzer/crates/hir-def/src/body/tests/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,3 +528,65 @@ fn f() {$0
"#]],
)
}

#[test]
fn resolve_extern_prelude_in_block() {
check_at(
r#"
//- /main.rs crate:main deps:core
fn main() {
mod f {
use core::S;
$0
}
}
//- /core.rs crate:core
pub struct S;
"#,
expect![[r#"
block scope
f: t
block scope::f
S: ti vi
crate
main: v
"#]],
)
}

#[test]
fn shadow_extern_prelude_in_block() {
check_at(
r#"
//- /main.rs crate:main deps:core
fn main() {
mod core { pub struct S; }
{
fn inner() {} // forces a block def map
use core::S; // should resolve to the local one
$0
}
}
//- /core.rs crate:core
pub const S;
"#,
expect![[r#"
block scope
S: ti vi
inner: v
block scope
core: t
block scope::core
S: t v
crate
main: v
"#]],
)
}
Loading
Loading