Skip to content

⬆️ rust-analyzer 2022-11-28 #105834

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

Closed
wants to merge 101 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
a1f1b95
Merge commit 'e36a20c24f35a4cee82bbdc600289104c9237c22' into ra-sync-…
fasterthanlime Jul 26, 2022
9d2cb42
:arrow_up: rust-analyzer
lnicola Aug 2, 2022
2c7f2c1
proc_macro/bridge: send diagnostics over the bridge as a struct
mystor Jul 25, 2022
22c8c9c
:arrow_up: rust-analyzer
lnicola Aug 9, 2022
8231fee
:arrow_up: rust-analyzer
lnicola Aug 16, 2022
3a1aa37
avoid a `&str` to `String` conversion
TaKO8Ki Aug 16, 2022
1347018
Rollup merge of #100643 - TaKO8Ki:point-at-type-parameter-shadowing-a…
matthiaskrgr Aug 18, 2022
31519bb
:arrow_up: rust-analyzer
lnicola Aug 23, 2022
3e358a6
:arrow_up: rust-analyzer
lnicola Aug 30, 2022
c1918fc
Auto merge of #100210 - mystor:proc_macro_diag_struct, r=eddyb
bors Sep 1, 2022
65e1dc4
:arrow_up: rust-analyzer
lnicola Sep 6, 2022
459bbb4
:arrow_up: rust-analyzer
lnicola Sep 13, 2022
f5fde4d
:arrow_up: rust-analyzer
lnicola Sep 20, 2022
6f13f12
rustc_typeck to rustc_hir_analysis
lcnr Sep 26, 2022
ed532e5
Fix duplicate usage of `a` article.
JarvisCraft Oct 2, 2022
02ae3d5
Auto merge of #2583 - RalfJung:rustup, r=oli-obk
bors Oct 8, 2022
3a57388
update to syn-1.0.102
zertosh Oct 9, 2022
4f55ebb
:arrow_up: rust-analyzer
lnicola Oct 11, 2022
8536eb0
rename rustc_allocator_nounwind to rustc_nounwind
RalfJung Oct 6, 2022
4b61e5e
merge rustc history
RalfJung Oct 12, 2022
a99a48e
:arrow_up: rust-analyzer
lnicola Oct 18, 2022
26a413e
merge rustc history
RalfJung Oct 21, 2022
8807fc4
:arrow_up: rust-analyzer
lnicola Oct 26, 2022
c60b1f6
:arrow_up: rust-analyzer
lnicola Nov 1, 2022
7d2a1ee
Remove `unescape_byte_literal`.
nnethercote Nov 4, 2022
a65ca91
Rollup merge of #103919 - nnethercote:unescaping-cleanups, r=matklad
Dylan-DPC Nov 9, 2022
79923c3
:arrow_up: rust-analyzer
lnicola Nov 9, 2022
61c744d
Rollup merge of #104211 - lnicola:rust-analyzer-2022-11-09, r=lnicola
compiler-errors Nov 10, 2022
f26d548
fix: filter unnecessary completions after colon
yue4u Nov 12, 2022
0ffb361
feat: adds hover hint to ".." in record pattern
kartva Nov 19, 2022
a778203
simplify ancestor climbing to not consider macros
kartva Nov 19, 2022
8b17681
fix formatting
kartva Nov 19, 2022
87658c8
refactor hover
kartva Nov 19, 2022
29951f9
fix formatting
kartva Nov 19, 2022
a6d0e34
Update crates/ide-completion/src/context.rs
yue4u Nov 19, 2022
7a568f7
fix: remove insufficient check for coloncolon
yue4u Nov 19, 2022
23cfe07
fix: tuple to named struct inside macros
nyz93 Nov 19, 2022
427b63b
hir-expand: fix compile_error! expansion not unquoting strings
jhgg Nov 20, 2022
95b4a74
Suppress "Implement default members" inside contained items
Bben01 Nov 7, 2022
ecb15ca
Add assist to generate trait impl's
Nov 9, 2022
0bd11f8
Reduce trigger range of `generate_impl` assist and update tests
Nov 9, 2022
469f620
Combine `generate_impl` and `generate_trait_impl` into a single file
Nov 21, 2022
b116fe9
Fix: Handle empty `checkOnSave/target` values
iredelmeier Nov 21, 2022
a2a1d99
:arrow_up: rust-analyzer
lnicola Nov 23, 2022
2300c9d
Handle sysroot config in detached-files workspaces
Veykril Nov 24, 2022
81d26e7
Auto merge of #13667 - Veykril:detached-files-sysroot, r=Veykril
bors Nov 24, 2022
63a676e
Auto merge of #13576 - Bben01:supress_missing_impl_inside_block, r=jo…
bors Nov 24, 2022
e9f6087
Auto merge of #13661 - iredelmeier:fix-null-checkonsave-target, r=jon…
bors Nov 24, 2022
c8b6fef
Properly implement Drop for JodGroupChild
Veykril Nov 24, 2022
fbc0f7a
Auto merge of #13669 - Veykril:jod-child, r=Veykril
bors Nov 24, 2022
5e3ad5d
Auto merge of #13592 - MihailMihov:trait_impl_assist, r=Veykril
bors Nov 24, 2022
76e2e41
Auto merge of #13652 - jhgg:hir-expand/fix-compile-error-expansion, r…
bors Nov 24, 2022
9fba39f
Add deriveHelper to semanticTokenTypes section of package.json
Veykril Nov 24, 2022
1e6a49a
Auto merge of #13670 - Veykril:derive-helper, r=Veykril
bors Nov 24, 2022
f64feeb
Correct node traversal to look at parent instead
kartva Nov 25, 2022
132d5ff
add back [] in hover documentation
kartva Nov 25, 2022
e86d451
fix token method call
kartva Nov 25, 2022
91e7624
add hover tests
kartva Nov 25, 2022
a26aef9
fix formatting
kartva Nov 25, 2022
6918009
Auto merge of #13638 - DesmondWillowbrook:hover-rest-pat-mvp, r=Veykril
bors Nov 25, 2022
3c794a3
Go to declaration goes to assoc items of trait declarations
Veykril Nov 25, 2022
ae0bdff
Go to declaration goes to field declaration in pattern and expression…
Veykril Nov 24, 2022
99daf23
Auto merge of #13671 - Veykril:goto-decl, r=Veykril
bors Nov 25, 2022
e668eca
Auto merge of #13647 - nyz93:fix/tuple-to-named-struct, r=Veykril
bors Nov 25, 2022
2566e06
Merge commit '8e38833c3674c1be7d81c6069c62e6ed52b18b27' into HEAD
fasterthanlime Nov 25, 2022
db84a00
Merge commit '22c8c9c40' into HEAD
fasterthanlime Nov 25, 2022
03a723e
Merge commit '634cfe3d72e785c843ca5d412b12be137b2e14fb' into HEAD
fasterthanlime Nov 25, 2022
2374c0b
Merge commit '8231fee46' into HEAD
fasterthanlime Nov 25, 2022
797ee29
Merge commit 'b6d59f2bb4fae0ba4f74e2c967b5e2f777f8c860' into HEAD
fasterthanlime Nov 25, 2022
6ac43ec
Merge commit '31519bb39' into HEAD
fasterthanlime Nov 25, 2022
8117027
Merge commit 'a670ff888437f4b6a3d24cc2996e9f969a87cbae' into HEAD
fasterthanlime Nov 25, 2022
ff2b468
Merge commit '3e358a682' into HEAD
fasterthanlime Nov 25, 2022
ae878f2
Merge commit 'e8e598f6415461e7fe957eec1bee6afb55927d59' into HEAD
fasterthanlime Nov 25, 2022
318fdac
Merge commit '65e1dc4d9' into HEAD
fasterthanlime Nov 25, 2022
be2fca9
Merge commit '67920f797511c360b25dab4d30730be304848f32' into HEAD
fasterthanlime Nov 25, 2022
dec148e
Merge commit '459bbb422' into HEAD
fasterthanlime Nov 25, 2022
b355362
Merge commit '2e9f1204ca01c3e20898d4a67c8b84899d394a88' into HEAD
fasterthanlime Nov 25, 2022
969e250
Merge commit 'f5fde4df4' into HEAD
fasterthanlime Nov 25, 2022
bc9b613
Merge commit '187bee0bb100111466a3557c20f80defcc0f4db3' into HEAD
fasterthanlime Nov 25, 2022
e6540cf
Merge commit '4f55ebbd4' into HEAD
fasterthanlime Nov 25, 2022
299c293
Merge commit '61504c8d951c566eb03037dcb300c96f4bd9a8b6' into HEAD
fasterthanlime Nov 25, 2022
251b18a
Merge commit 'a99a48e78' into HEAD
fasterthanlime Nov 25, 2022
2dbda1a
Merge commit '0531aab522f25d6aae30b2cc23a09f4b9257eedc' into HEAD
fasterthanlime Nov 25, 2022
2f65294
Merge commit '8807fc4cc' into HEAD
fasterthanlime Nov 25, 2022
682a4de
Merge commit '43fb9563b2943d6abc5f3552195f3e27ac618966' into HEAD
fasterthanlime Nov 25, 2022
e070dc5
Merge commit 'c60b1f641' into HEAD
fasterthanlime Nov 25, 2022
8514f3f
Merge commit 'ba28e19b7838e3ad4223ae82d074dc3950ef1548' into HEAD
fasterthanlime Nov 25, 2022
ae43043
Merge commit '79923c382' into HEAD
fasterthanlime Nov 25, 2022
d9e16c8
Merge commit 'd03c1c87d4ca2d524646316387d47b12524ac451' into HEAD
fasterthanlime Nov 25, 2022
e96c0b1
Merge commit 'a2a1d9954' into HEAD
fasterthanlime Nov 25, 2022
38c98d1
Merge commit '26562973b3482a635416b2b663a13016d4d90e20' into HEAD
fasterthanlime Nov 25, 2022
b651646
Auto merge of #13676 - fasterthanlime:subtree-fix, r=Veykril
bors Nov 25, 2022
7bf2a25
Encode the variants of `HirFileId` in a u32 with MSB as the tag
Veykril Nov 25, 2022
d2281f0
Auto merge of #13678 - Veykril:hir-file-encode, r=Veykril
bors Nov 25, 2022
822c61f
refactor: remove unnecessary stuff
lowr Nov 26, 2022
8e03f18
fix: check if range contains tail expression
lowr Nov 26, 2022
e1de04d
fix: only special casing 3 colon in a row
yue4u Nov 26, 2022
1ca5cb7
fix: also exclude 2 coloncolon in a row
yue4u Nov 26, 2022
34e2bc6
Auto merge of #13611 - yue4u:fix/completion-after-colon, r=yue4u
bors Nov 26, 2022
6d61be8
Auto merge of #13681 - lowr:fix/extract-function-tail-expr, r=Veykril
bors Nov 27, 2022
46bdefc
:arrow_up: rust-analyzer to 2022-11-28
arcnmx Dec 17, 2022
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
13 changes: 10 additions & 3 deletions src/tools/rust-analyzer/crates/flycheck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,21 +360,28 @@ impl FlycheckActor {
}
}

struct JodChild(GroupChild);
struct JodGroupChild(GroupChild);

impl Drop for JodGroupChild {
fn drop(&mut self) {
_ = self.0.kill();
_ = self.0.wait();
}
}

/// A handle to a cargo process used for fly-checking.
struct CargoHandle {
/// The handle to the actual cargo process. As we cannot cancel directly from with
/// a read syscall dropping and therefore terminating the process is our best option.
child: JodChild,
child: JodGroupChild,
thread: jod_thread::JoinHandle<io::Result<(bool, String)>>,
receiver: Receiver<CargoMessage>,
}

impl CargoHandle {
fn spawn(mut command: Command) -> std::io::Result<CargoHandle> {
command.stdout(Stdio::piped()).stderr(Stdio::piped()).stdin(Stdio::null());
let mut child = command.group_spawn().map(JodChild)?;
let mut child = command.group_spawn().map(JodGroupChild)?;

let stdout = child.0.inner().stdout.take().unwrap();
let stderr = child.0.inner().stderr.take().unwrap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ macro_rules! compile_error {
}

// This expands to nothing (since it's in item position), but emits an error.
compile_error!("error!");
compile_error!("error, with an escaped quote: \"");
compile_error!(r"this is a raw string");
"#,
expect![[r##"
#[rustc_builtin_macro]
Expand All @@ -172,7 +173,8 @@ macro_rules! compile_error {
($msg:expr,) => ({ /* compiler built-in */ })
}

/* error: error! */
/* error: error, with an escaped quote: " */
/* error: this is a raw string */
"##]],
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,10 @@ fn compile_error_expand(
tt: &tt::Subtree,
) -> ExpandResult<ExpandedEager> {
let err = match &*tt.token_trees {
[tt::TokenTree::Leaf(tt::Leaf::Literal(it))] => {
let text = it.text.as_str();
if text.starts_with('"') && text.ends_with('"') {
// FIXME: does not handle raw strings
ExpandError::Other(text[1..text.len() - 1].into())
} else {
ExpandError::Other("`compile_error!` argument must be a string".into())
}
}
[tt::TokenTree::Leaf(tt::Leaf::Literal(it))] => match unquote_str(it) {
Some(unquoted) => ExpandError::Other(unquoted.into()),
None => ExpandError::Other("`compile_error!` argument must be a string".into()),
},
_ => ExpandError::Other("`compile_error!` argument must be a string".into()),
};

Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/crates/hir-expand/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ fn ast_id_map(db: &dyn AstDatabase, file_id: HirFileId) -> Arc<AstIdMap> {
}

fn parse_or_expand(db: &dyn AstDatabase, file_id: HirFileId) -> Option<SyntaxNode> {
match file_id.0 {
match file_id.repr() {
HirFileIdRepr::FileId(file_id) => Some(db.parse(file_id).tree().syntax().clone()),
HirFileIdRepr::MacroFile(macro_file) => {
// FIXME: Note how we convert from `Parse` to `SyntaxNode` here,
Expand Down
8 changes: 4 additions & 4 deletions src/tools/rust-analyzer/crates/hir-expand/src/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use crate::{
db::{self, AstDatabase},
fixup,
name::{AsName, Name},
HirFileId, HirFileIdRepr, InFile, MacroCallKind, MacroCallLoc, MacroDefKind, MacroFile,
HirFileId, InFile, MacroCallKind, MacroCallLoc, MacroDefKind, MacroFile,
};

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -216,9 +216,9 @@ fn make_hygiene_info(

impl HygieneFrame {
pub(crate) fn new(db: &dyn AstDatabase, file_id: HirFileId) -> HygieneFrame {
let (info, krate, local_inner) = match file_id.0 {
HirFileIdRepr::FileId(_) => (None, None, false),
HirFileIdRepr::MacroFile(macro_file) => {
let (info, krate, local_inner) = match file_id.macro_file() {
None => (None, None, false),
Some(macro_file) => {
let loc = db.lookup_intern_macro_call(macro_file.macro_call_id);
let info =
make_hygiene_info(db, macro_file, &loc).map(|info| (loc.kind.file_id(), info));
Expand Down
Loading