Rollup merge of #132941 - lnicola:sync-from-ra2, r=lnicola
Subtree update of `rust-analyzer` r? `@ghost`
This commit is contained in:
commit
38c2db4020
26 changed files with 294 additions and 249 deletions
|
@ -53,7 +53,6 @@ jobs:
|
||||||
cargo workspaces rename --from project-model project_model
|
cargo workspaces rename --from project-model project_model
|
||||||
cargo workspaces rename --from test-fixture test_fixture
|
cargo workspaces rename --from test-fixture test_fixture
|
||||||
cargo workspaces rename --from test-utils test_utils
|
cargo workspaces rename --from test-utils test_utils
|
||||||
cargo workspaces rename --from text-edit text_edit
|
|
||||||
# Remove library crates from the workspaces so we don't auto-publish them as well
|
# Remove library crates from the workspaces so we don't auto-publish them as well
|
||||||
sed -i 's/ "lib\/\*",//' ./Cargo.toml
|
sed -i 's/ "lib\/\*",//' ./Cargo.toml
|
||||||
cargo workspaces rename ra_ap_%n
|
cargo workspaces rename ra_ap_%n
|
||||||
|
|
|
@ -13,7 +13,6 @@ use syntax::{ast, Parse};
|
||||||
use triomphe::Arc;
|
use triomphe::Arc;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
attr::Attrs,
|
|
||||||
db::DefDatabase,
|
db::DefDatabase,
|
||||||
expander::{Expander, Mark},
|
expander::{Expander, Mark},
|
||||||
item_tree::{self, AssocItem, FnFlags, ItemTree, ItemTreeId, MacroCall, ModItem, TreeId},
|
item_tree::{self, AssocItem, FnFlags, ItemTree, ItemTreeId, MacroCall, ModItem, TreeId},
|
||||||
|
@ -37,8 +36,6 @@ pub struct FunctionData {
|
||||||
pub name: Name,
|
pub name: Name,
|
||||||
pub params: Box<[TypeRefId]>,
|
pub params: Box<[TypeRefId]>,
|
||||||
pub ret_type: TypeRefId,
|
pub ret_type: TypeRefId,
|
||||||
// FIXME: why are these stored here? They should be accessed via the query
|
|
||||||
pub attrs: Attrs,
|
|
||||||
pub visibility: RawVisibility,
|
pub visibility: RawVisibility,
|
||||||
pub abi: Option<Symbol>,
|
pub abi: Option<Symbol>,
|
||||||
pub legacy_const_generics_indices: Option<Box<Box<[u32]>>>,
|
pub legacy_const_generics_indices: Option<Box<Box<[u32]>>>,
|
||||||
|
@ -115,7 +112,6 @@ impl FunctionData {
|
||||||
.filter_map(|(_, param)| param.type_ref)
|
.filter_map(|(_, param)| param.type_ref)
|
||||||
.collect(),
|
.collect(),
|
||||||
ret_type: func.ret_type,
|
ret_type: func.ret_type,
|
||||||
attrs: item_tree.attrs(db, krate, ModItem::from(loc.id.value).into()),
|
|
||||||
visibility,
|
visibility,
|
||||||
abi: func.abi.clone(),
|
abi: func.abi.clone(),
|
||||||
legacy_const_generics_indices,
|
legacy_const_generics_indices,
|
||||||
|
|
|
@ -632,6 +632,19 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
rustc_safe_intrinsic, Normal, template!(Word), WarnFollowing,
|
rustc_safe_intrinsic, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe"
|
"the `#[rustc_safe_intrinsic]` attribute is used internally to mark intrinsics as safe"
|
||||||
),
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_intrinsic, Normal, template!(Word), ErrorFollowing,
|
||||||
|
"the `#[rustc_intrinsic]` attribute is used to declare intrinsics with function bodies",
|
||||||
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_no_mir_inline, Normal, template!(Word), WarnFollowing,
|
||||||
|
"#[rustc_no_mir_inline] prevents the MIR inliner from inlining a function while not affecting codegen"
|
||||||
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_intrinsic_must_be_overridden, Normal, template!(Word), ErrorFollowing,
|
||||||
|
"the `#[rustc_intrinsic_must_be_overridden]` attribute is used to declare intrinsics without real bodies",
|
||||||
|
),
|
||||||
|
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_deprecated_safe_2024, Normal, template!(Word), WarnFollowing,
|
rustc_deprecated_safe_2024, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[rustc_safe_intrinsic]` marks functions as unsafe in Rust 2024",
|
"the `#[rustc_safe_intrinsic]` marks functions as unsafe in Rust 2024",
|
||||||
|
|
|
@ -381,8 +381,9 @@ impl chalk_solve::RustIrDatabase<Interner> for ChalkContext<'_> {
|
||||||
TyKind::Error.intern(Interner)
|
TyKind::Error.intern(Interner)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// object safety was renamed to dyn-compatibility but still remains here in chalk.
|
||||||
|
// This will be removed since we are going to migrate to next-gen trait solver.
|
||||||
fn is_object_safe(&self, trait_id: chalk_ir::TraitId<Interner>) -> bool {
|
fn is_object_safe(&self, trait_id: chalk_ir::TraitId<Interner>) -> bool {
|
||||||
// FIXME: When cargo is updated, change to dyn_compatibility
|
|
||||||
let trait_ = from_chalk_trait_id(trait_id);
|
let trait_ = from_chalk_trait_id(trait_id);
|
||||||
crate::dyn_compatibility::dyn_compatibility(self.db, trait_).is_none()
|
crate::dyn_compatibility::dyn_compatibility(self.db, trait_).is_none()
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,8 @@ use super::*;
|
||||||
fn size_of() {
|
fn size_of() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn size_of<T>() -> usize;
|
pub fn size_of<T>() -> usize;
|
||||||
}
|
|
||||||
|
|
||||||
const GOAL: usize = size_of::<i32>();
|
const GOAL: usize = size_of::<i32>();
|
||||||
"#,
|
"#,
|
||||||
|
@ -19,9 +18,8 @@ fn size_of_val() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
//- minicore: coerce_unsized
|
//- minicore: coerce_unsized
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
||||||
}
|
|
||||||
|
|
||||||
struct X(i32, u8);
|
struct X(i32, u8);
|
||||||
|
|
||||||
|
@ -32,9 +30,8 @@ fn size_of_val() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
//- minicore: coerce_unsized
|
//- minicore: coerce_unsized
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
||||||
}
|
|
||||||
|
|
||||||
const GOAL: usize = {
|
const GOAL: usize = {
|
||||||
let it: &[i32] = &[1, 2, 3];
|
let it: &[i32] = &[1, 2, 3];
|
||||||
|
@ -48,9 +45,8 @@ fn size_of_val() {
|
||||||
//- minicore: coerce_unsized, transmute
|
//- minicore: coerce_unsized, transmute
|
||||||
use core::mem::transmute;
|
use core::mem::transmute;
|
||||||
|
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
||||||
}
|
|
||||||
|
|
||||||
struct X {
|
struct X {
|
||||||
x: i64,
|
x: i64,
|
||||||
|
@ -70,9 +66,8 @@ fn size_of_val() {
|
||||||
//- minicore: coerce_unsized, transmute
|
//- minicore: coerce_unsized, transmute
|
||||||
use core::mem::transmute;
|
use core::mem::transmute;
|
||||||
|
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
||||||
}
|
|
||||||
|
|
||||||
struct X {
|
struct X {
|
||||||
x: i32,
|
x: i32,
|
||||||
|
@ -90,9 +85,8 @@ fn size_of_val() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
//- minicore: coerce_unsized, fmt, builtin_impls, dispatch_from_dyn
|
//- minicore: coerce_unsized, fmt, builtin_impls, dispatch_from_dyn
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
||||||
}
|
|
||||||
|
|
||||||
const GOAL: usize = {
|
const GOAL: usize = {
|
||||||
let x: &i16 = &5;
|
let x: &i16 = &5;
|
||||||
|
@ -106,9 +100,8 @@ fn size_of_val() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
//- minicore: coerce_unsized
|
//- minicore: coerce_unsized
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
pub fn size_of_val<T: ?Sized>(_: *const T) -> usize;
|
||||||
}
|
|
||||||
|
|
||||||
const GOAL: usize = {
|
const GOAL: usize = {
|
||||||
size_of_val("salam")
|
size_of_val("salam")
|
||||||
|
@ -123,9 +116,8 @@ fn min_align_of_val() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
//- minicore: coerce_unsized
|
//- minicore: coerce_unsized
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
|
pub fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
|
||||||
}
|
|
||||||
|
|
||||||
struct X(i32, u8);
|
struct X(i32, u8);
|
||||||
|
|
||||||
|
@ -136,9 +128,8 @@ fn min_align_of_val() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
//- minicore: coerce_unsized
|
//- minicore: coerce_unsized
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
|
pub fn min_align_of_val<T: ?Sized>(_: *const T) -> usize;
|
||||||
}
|
|
||||||
|
|
||||||
const GOAL: usize = {
|
const GOAL: usize = {
|
||||||
let x: &[i32] = &[1, 2, 3];
|
let x: &[i32] = &[1, 2, 3];
|
||||||
|
@ -153,9 +144,8 @@ fn min_align_of_val() {
|
||||||
fn type_name() {
|
fn type_name() {
|
||||||
check_str(
|
check_str(
|
||||||
r#"
|
r#"
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn type_name<T: ?Sized>() -> &'static str;
|
pub fn type_name<T: ?Sized>() -> &'static str;
|
||||||
}
|
|
||||||
|
|
||||||
const GOAL: &str = type_name::<i32>();
|
const GOAL: &str = type_name::<i32>();
|
||||||
"#,
|
"#,
|
||||||
|
@ -163,9 +153,8 @@ fn type_name() {
|
||||||
);
|
);
|
||||||
check_str(
|
check_str(
|
||||||
r#"
|
r#"
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn type_name<T: ?Sized>() -> &'static str;
|
pub fn type_name<T: ?Sized>() -> &'static str;
|
||||||
}
|
|
||||||
|
|
||||||
mod mod1 {
|
mod mod1 {
|
||||||
pub mod mod2 {
|
pub mod mod2 {
|
||||||
|
@ -183,9 +172,8 @@ fn type_name() {
|
||||||
fn transmute() {
|
fn transmute() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn transmute<T, U>(e: T) -> U;
|
pub fn transmute<T, U>(e: T) -> U;
|
||||||
}
|
|
||||||
|
|
||||||
const GOAL: i32 = transmute((1i16, 1i16));
|
const GOAL: i32 = transmute((1i16, 1i16));
|
||||||
"#,
|
"#,
|
||||||
|
@ -197,10 +185,10 @@ fn transmute() {
|
||||||
fn read_via_copy() {
|
fn read_via_copy() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn read_via_copy<T>(e: *const T) -> T;
|
pub fn read_via_copy<T>(e: *const T) -> T;
|
||||||
|
#[rustc_intrinsic]
|
||||||
pub fn volatile_load<T>(e: *const T) -> T;
|
pub fn volatile_load<T>(e: *const T) -> T;
|
||||||
}
|
|
||||||
|
|
||||||
const GOAL: i32 = {
|
const GOAL: i32 = {
|
||||||
let x = 2;
|
let x = 2;
|
||||||
|
@ -399,9 +387,14 @@ fn discriminant_value() {
|
||||||
fn likely() {
|
fn likely() {
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn likely(b: bool) -> bool;
|
pub const fn likely(b: bool) -> bool {
|
||||||
pub fn unlikely(b: bool) -> bool;
|
b
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rustc_intrinsic]
|
||||||
|
pub const fn unlikely(b: bool) -> bool {
|
||||||
|
b
|
||||||
}
|
}
|
||||||
|
|
||||||
const GOAL: bool = likely(true) && unlikely(true) && !likely(false) && !unlikely(false);
|
const GOAL: bool = likely(true) && unlikely(true) && !likely(false) && !unlikely(false);
|
||||||
|
@ -704,9 +697,8 @@ fn rotate() {
|
||||||
);
|
);
|
||||||
check_number(
|
check_number(
|
||||||
r#"
|
r#"
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn rotate_right<T: Copy>(x: T, y: T) -> T;
|
pub fn rotate_right<T: Copy>(x: T, y: T) -> T;
|
||||||
}
|
|
||||||
|
|
||||||
const GOAL: i32 = rotate_right(10006016, 1020315);
|
const GOAL: i32 = rotate_right(10006016, 1020315);
|
||||||
"#,
|
"#,
|
||||||
|
@ -721,9 +713,8 @@ fn simd() {
|
||||||
pub struct i8x16(
|
pub struct i8x16(
|
||||||
i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,
|
i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,
|
||||||
);
|
);
|
||||||
extern "platform-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn simd_bitmask<T, U>(x: T) -> U;
|
pub fn simd_bitmask<T, U>(x: T) -> U;
|
||||||
}
|
|
||||||
const GOAL: u16 = simd_bitmask(i8x16(
|
const GOAL: u16 = simd_bitmask(i8x16(
|
||||||
0, 1, 0, 0, 2, 255, 100, 0, 50, 0, 1, 1, 0, 0, 0, 0
|
0, 1, 0, 0, 2, 255, 100, 0, 50, 0, 1, 1, 0, 0, 0, 0
|
||||||
));
|
));
|
||||||
|
@ -735,10 +726,10 @@ fn simd() {
|
||||||
pub struct i8x16(
|
pub struct i8x16(
|
||||||
i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,
|
i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,i8,
|
||||||
);
|
);
|
||||||
extern "platform-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn simd_lt<T, U>(x: T, y: T) -> U;
|
pub fn simd_lt<T, U>(x: T, y: T) -> U;
|
||||||
|
#[rustc_intrinsic]
|
||||||
pub fn simd_bitmask<T, U>(x: T) -> U;
|
pub fn simd_bitmask<T, U>(x: T) -> U;
|
||||||
}
|
|
||||||
const GOAL: u16 = simd_bitmask(simd_lt::<i8x16, i8x16>(
|
const GOAL: u16 = simd_bitmask(simd_lt::<i8x16, i8x16>(
|
||||||
i8x16(
|
i8x16(
|
||||||
-105, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
|
-105, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
|
||||||
|
|
|
@ -201,7 +201,7 @@ impl<'a> DeclValidator<'a> {
|
||||||
|
|
||||||
// Don't run the lint on extern "[not Rust]" fn items with the
|
// Don't run the lint on extern "[not Rust]" fn items with the
|
||||||
// #[no_mangle] attribute.
|
// #[no_mangle] attribute.
|
||||||
let no_mangle = data.attrs.by_key(&sym::no_mangle).exists();
|
let no_mangle = self.db.attrs(func.into()).by_key(&sym::no_mangle).exists();
|
||||||
if no_mangle && data.abi.as_ref().is_some_and(|abi| *abi != sym::Rust) {
|
if no_mangle && data.abi.as_ref().is_some_and(|abi| *abi != sym::Rust) {
|
||||||
cov_mark::hit!(extern_func_no_mangle_ignored);
|
cov_mark::hit!(extern_func_no_mangle_ignored);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -472,7 +472,7 @@ fn receiver_is_dispatchable(
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
// `self: Self` can't be dispatched on, but this is already considered dyn compatible
|
// `self: Self` can't be dispatched on, but this is already considered dyn-compatible
|
||||||
// See rustc's comment on https://github.com/rust-lang/rust/blob/3f121b9461cce02a703a0e7e450568849dfaa074/compiler/rustc_trait_selection/src/traits/object_safety.rs#L433-L437
|
// See rustc's comment on https://github.com/rust-lang/rust/blob/3f121b9461cce02a703a0e7e450568849dfaa074/compiler/rustc_trait_selection/src/traits/object_safety.rs#L433-L437
|
||||||
if sig
|
if sig
|
||||||
.skip_binders()
|
.skip_binders()
|
||||||
|
|
|
@ -66,7 +66,7 @@ fn check_dyn_compatibility<'a>(
|
||||||
});
|
});
|
||||||
ControlFlow::Continue(())
|
ControlFlow::Continue(())
|
||||||
});
|
});
|
||||||
assert_eq!(osvs, expected, "Dyn Compatibility violations for `{name}` do not match;");
|
assert_eq!(osvs, expected, "dyn-compatibility violations for `{name}` do not match;");
|
||||||
}
|
}
|
||||||
|
|
||||||
let remains: Vec<_> = expected.keys().collect();
|
let remains: Vec<_> = expected.keys().collect();
|
||||||
|
|
|
@ -98,7 +98,7 @@ pub use mapping::{
|
||||||
};
|
};
|
||||||
pub use method_resolution::check_orphan_rules;
|
pub use method_resolution::check_orphan_rules;
|
||||||
pub use traits::TraitEnvironment;
|
pub use traits::TraitEnvironment;
|
||||||
pub use utils::{all_super_traits, is_fn_unsafe_to_call};
|
pub use utils::{all_super_traits, direct_super_traits, is_fn_unsafe_to_call};
|
||||||
|
|
||||||
pub use chalk_ir::{
|
pub use chalk_ir::{
|
||||||
cast::Cast,
|
cast::Cast,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use hir_def::{
|
||||||
resolver::HasResolver,
|
resolver::HasResolver,
|
||||||
};
|
};
|
||||||
use hir_expand::name::Name;
|
use hir_expand::name::Name;
|
||||||
use intern::sym;
|
use intern::{sym, Symbol};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
error_lifetime,
|
error_lifetime,
|
||||||
|
@ -54,7 +54,10 @@ impl Evaluator<'_> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let function_data = self.db.function_data(def);
|
let function_data = self.db.function_data(def);
|
||||||
let is_intrinsic = match &function_data.abi {
|
let attrs = self.db.attrs(def.into());
|
||||||
|
let is_intrinsic = attrs.by_key(&sym::rustc_intrinsic).exists()
|
||||||
|
// Keep this around for a bit until extern "rustc-intrinsic" abis are no longer used
|
||||||
|
|| (match &function_data.abi {
|
||||||
Some(abi) => *abi == sym::rust_dash_intrinsic,
|
Some(abi) => *abi == sym::rust_dash_intrinsic,
|
||||||
None => match def.lookup(self.db.upcast()).container {
|
None => match def.lookup(self.db.upcast()).container {
|
||||||
hir_def::ItemContainerId::ExternBlockId(block) => {
|
hir_def::ItemContainerId::ExternBlockId(block) => {
|
||||||
|
@ -64,39 +67,19 @@ impl Evaluator<'_> {
|
||||||
}
|
}
|
||||||
_ => false,
|
_ => false,
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
|
|
||||||
if is_intrinsic {
|
if is_intrinsic {
|
||||||
self.exec_intrinsic(
|
return self.exec_intrinsic(
|
||||||
function_data.name.as_str(),
|
function_data.name.as_str(),
|
||||||
args,
|
args,
|
||||||
generic_args,
|
generic_args,
|
||||||
destination,
|
destination,
|
||||||
locals,
|
locals,
|
||||||
span,
|
span,
|
||||||
)?;
|
!function_data.has_body()
|
||||||
return Ok(true);
|
|| attrs.by_key(&sym::rustc_intrinsic_must_be_overridden).exists(),
|
||||||
}
|
);
|
||||||
let is_platform_intrinsic = match &function_data.abi {
|
|
||||||
Some(abi) => *abi == sym::platform_dash_intrinsic,
|
|
||||||
None => match def.lookup(self.db.upcast()).container {
|
|
||||||
hir_def::ItemContainerId::ExternBlockId(block) => {
|
|
||||||
let id = block.lookup(self.db.upcast()).id;
|
|
||||||
id.item_tree(self.db.upcast())[id.value].abi.as_ref()
|
|
||||||
== Some(&sym::platform_dash_intrinsic)
|
|
||||||
}
|
|
||||||
_ => false,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
if is_platform_intrinsic {
|
|
||||||
self.exec_platform_intrinsic(
|
|
||||||
function_data.name.as_str(),
|
|
||||||
args,
|
|
||||||
generic_args,
|
|
||||||
destination,
|
|
||||||
locals,
|
|
||||||
span,
|
|
||||||
)?;
|
|
||||||
return Ok(true);
|
|
||||||
}
|
}
|
||||||
let is_extern_c = match def.lookup(self.db.upcast()).container {
|
let is_extern_c = match def.lookup(self.db.upcast()).container {
|
||||||
hir_def::ItemContainerId::ExternBlockId(block) => {
|
hir_def::ItemContainerId::ExternBlockId(block) => {
|
||||||
|
@ -106,27 +89,25 @@ impl Evaluator<'_> {
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
if is_extern_c {
|
if is_extern_c {
|
||||||
self.exec_extern_c(
|
return self
|
||||||
|
.exec_extern_c(
|
||||||
function_data.name.as_str(),
|
function_data.name.as_str(),
|
||||||
args,
|
args,
|
||||||
generic_args,
|
generic_args,
|
||||||
destination,
|
destination,
|
||||||
locals,
|
locals,
|
||||||
span,
|
span,
|
||||||
)?;
|
)
|
||||||
return Ok(true);
|
.map(|()| true);
|
||||||
}
|
}
|
||||||
let alloc_fn = function_data
|
|
||||||
.attrs
|
let alloc_fn =
|
||||||
.iter()
|
attrs.iter().filter_map(|it| it.path().as_ident()).map(|it| it.symbol()).find(|it| {
|
||||||
.filter_map(|it| it.path().as_ident())
|
|
||||||
.map(|it| it.as_str())
|
|
||||||
.find(|it| {
|
|
||||||
[
|
[
|
||||||
"rustc_allocator",
|
&sym::rustc_allocator,
|
||||||
"rustc_deallocator",
|
&sym::rustc_deallocator,
|
||||||
"rustc_reallocator",
|
&sym::rustc_reallocator,
|
||||||
"rustc_allocator_zeroed",
|
&sym::rustc_allocator_zeroed,
|
||||||
]
|
]
|
||||||
.contains(it)
|
.contains(it)
|
||||||
});
|
});
|
||||||
|
@ -270,12 +251,12 @@ impl Evaluator<'_> {
|
||||||
|
|
||||||
fn exec_alloc_fn(
|
fn exec_alloc_fn(
|
||||||
&mut self,
|
&mut self,
|
||||||
alloc_fn: &str,
|
alloc_fn: &Symbol,
|
||||||
args: &[IntervalAndTy],
|
args: &[IntervalAndTy],
|
||||||
destination: Interval,
|
destination: Interval,
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
match alloc_fn {
|
match alloc_fn {
|
||||||
"rustc_allocator_zeroed" | "rustc_allocator" => {
|
_ if *alloc_fn == sym::rustc_allocator_zeroed || *alloc_fn == sym::rustc_allocator => {
|
||||||
let [size, align] = args else {
|
let [size, align] = args else {
|
||||||
return Err(MirEvalError::InternalError(
|
return Err(MirEvalError::InternalError(
|
||||||
"rustc_allocator args are not provided".into(),
|
"rustc_allocator args are not provided".into(),
|
||||||
|
@ -286,8 +267,8 @@ impl Evaluator<'_> {
|
||||||
let result = self.heap_allocate(size, align)?;
|
let result = self.heap_allocate(size, align)?;
|
||||||
destination.write_from_bytes(self, &result.to_bytes())?;
|
destination.write_from_bytes(self, &result.to_bytes())?;
|
||||||
}
|
}
|
||||||
"rustc_deallocator" => { /* no-op for now */ }
|
_ if *alloc_fn == sym::rustc_deallocator => { /* no-op for now */ }
|
||||||
"rustc_reallocator" => {
|
_ if *alloc_fn == sym::rustc_reallocator => {
|
||||||
let [ptr, old_size, align, new_size] = args else {
|
let [ptr, old_size, align, new_size] = args else {
|
||||||
return Err(MirEvalError::InternalError(
|
return Err(MirEvalError::InternalError(
|
||||||
"rustc_allocator args are not provided".into(),
|
"rustc_allocator args are not provided".into(),
|
||||||
|
@ -603,21 +584,6 @@ impl Evaluator<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn exec_platform_intrinsic(
|
|
||||||
&mut self,
|
|
||||||
name: &str,
|
|
||||||
args: &[IntervalAndTy],
|
|
||||||
generic_args: &Substitution,
|
|
||||||
destination: Interval,
|
|
||||||
locals: &Locals,
|
|
||||||
span: MirSpan,
|
|
||||||
) -> Result<()> {
|
|
||||||
if let Some(name) = name.strip_prefix("simd_") {
|
|
||||||
return self.exec_simd_intrinsic(name, args, generic_args, destination, locals, span);
|
|
||||||
}
|
|
||||||
not_supported!("unknown platform intrinsic {name}");
|
|
||||||
}
|
|
||||||
|
|
||||||
fn exec_intrinsic(
|
fn exec_intrinsic(
|
||||||
&mut self,
|
&mut self,
|
||||||
name: &str,
|
name: &str,
|
||||||
|
@ -626,9 +592,17 @@ impl Evaluator<'_> {
|
||||||
destination: Interval,
|
destination: Interval,
|
||||||
locals: &Locals,
|
locals: &Locals,
|
||||||
span: MirSpan,
|
span: MirSpan,
|
||||||
) -> Result<()> {
|
needs_override: bool,
|
||||||
|
) -> Result<bool> {
|
||||||
if let Some(name) = name.strip_prefix("atomic_") {
|
if let Some(name) = name.strip_prefix("atomic_") {
|
||||||
return self.exec_atomic_intrinsic(name, args, generic_args, destination, locals, span);
|
return self
|
||||||
|
.exec_atomic_intrinsic(name, args, generic_args, destination, locals, span)
|
||||||
|
.map(|()| true);
|
||||||
|
}
|
||||||
|
if let Some(name) = name.strip_prefix("simd_") {
|
||||||
|
return self
|
||||||
|
.exec_simd_intrinsic(name, args, generic_args, destination, locals, span)
|
||||||
|
.map(|()| true);
|
||||||
}
|
}
|
||||||
// FIXME(#17451): Add `f16` and `f128` intrinsics.
|
// FIXME(#17451): Add `f16` and `f128` intrinsics.
|
||||||
if let Some(name) = name.strip_suffix("f64") {
|
if let Some(name) = name.strip_suffix("f64") {
|
||||||
|
@ -701,7 +675,7 @@ impl Evaluator<'_> {
|
||||||
}
|
}
|
||||||
_ => not_supported!("unknown f64 intrinsic {name}"),
|
_ => not_supported!("unknown f64 intrinsic {name}"),
|
||||||
};
|
};
|
||||||
return destination.write_from_bytes(self, &result.to_le_bytes());
|
return destination.write_from_bytes(self, &result.to_le_bytes()).map(|()| true);
|
||||||
}
|
}
|
||||||
if let Some(name) = name.strip_suffix("f32") {
|
if let Some(name) = name.strip_suffix("f32") {
|
||||||
let result = match name {
|
let result = match name {
|
||||||
|
@ -773,7 +747,7 @@ impl Evaluator<'_> {
|
||||||
}
|
}
|
||||||
_ => not_supported!("unknown f32 intrinsic {name}"),
|
_ => not_supported!("unknown f32 intrinsic {name}"),
|
||||||
};
|
};
|
||||||
return destination.write_from_bytes(self, &result.to_le_bytes());
|
return destination.write_from_bytes(self, &result.to_le_bytes()).map(|()| true);
|
||||||
}
|
}
|
||||||
match name {
|
match name {
|
||||||
"size_of" => {
|
"size_of" => {
|
||||||
|
@ -1146,12 +1120,6 @@ impl Evaluator<'_> {
|
||||||
};
|
};
|
||||||
destination.write_from_interval(self, arg.interval)
|
destination.write_from_interval(self, arg.interval)
|
||||||
}
|
}
|
||||||
"likely" | "unlikely" => {
|
|
||||||
let [arg] = args else {
|
|
||||||
return Err(MirEvalError::InternalError("likely arg is not provided".into()));
|
|
||||||
};
|
|
||||||
destination.write_from_interval(self, arg.interval)
|
|
||||||
}
|
|
||||||
"ctpop" => {
|
"ctpop" => {
|
||||||
let [arg] = args else {
|
let [arg] = args else {
|
||||||
return Err(MirEvalError::InternalError("ctpop arg is not provided".into()));
|
return Err(MirEvalError::InternalError("ctpop arg is not provided".into()));
|
||||||
|
@ -1296,7 +1264,7 @@ impl Evaluator<'_> {
|
||||||
None,
|
None,
|
||||||
span,
|
span,
|
||||||
)?;
|
)?;
|
||||||
return Ok(());
|
return Ok(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
not_supported!("FnOnce was not available for executing const_eval_select");
|
not_supported!("FnOnce was not available for executing const_eval_select");
|
||||||
|
@ -1349,8 +1317,10 @@ impl Evaluator<'_> {
|
||||||
self.write_memory_using_ref(dst, size)?.fill(val);
|
self.write_memory_using_ref(dst, size)?.fill(val);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
_ => not_supported!("unknown intrinsic {name}"),
|
_ if needs_override => not_supported!("intrinsic {name} is not implemented"),
|
||||||
|
_ => return Ok(false),
|
||||||
}
|
}
|
||||||
|
.map(|()| true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn size_align_of_unsized(
|
fn size_align_of_unsized(
|
||||||
|
|
|
@ -43,6 +43,17 @@ pub(crate) fn fn_traits(
|
||||||
.flat_map(|it| it.as_trait())
|
.flat_map(|it| it.as_trait())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns an iterator over the direct super traits (including the trait itself).
|
||||||
|
pub fn direct_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> SmallVec<[TraitId; 4]> {
|
||||||
|
let mut result = smallvec![trait_];
|
||||||
|
direct_super_traits_cb(db, trait_, |tt| {
|
||||||
|
if !result.contains(&tt) {
|
||||||
|
result.push(tt);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
result
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns an iterator over the whole super trait hierarchy (including the
|
/// Returns an iterator over the whole super trait hierarchy (including the
|
||||||
/// trait itself).
|
/// trait itself).
|
||||||
pub fn all_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> SmallVec<[TraitId; 4]> {
|
pub fn all_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> SmallVec<[TraitId; 4]> {
|
||||||
|
@ -54,7 +65,7 @@ pub fn all_super_traits(db: &dyn DefDatabase, trait_: TraitId) -> SmallVec<[Trai
|
||||||
while let Some(&t) = result.get(i) {
|
while let Some(&t) = result.get(i) {
|
||||||
// yeah this is quadratic, but trait hierarchies should be flat
|
// yeah this is quadratic, but trait hierarchies should be flat
|
||||||
// enough that this doesn't matter
|
// enough that this doesn't matter
|
||||||
direct_super_traits(db, t, |tt| {
|
direct_super_traits_cb(db, t, |tt| {
|
||||||
if !result.contains(&tt) {
|
if !result.contains(&tt) {
|
||||||
result.push(tt);
|
result.push(tt);
|
||||||
}
|
}
|
||||||
|
@ -153,7 +164,7 @@ impl Iterator for ClauseElaborator<'_> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn direct_super_traits(db: &dyn DefDatabase, trait_: TraitId, cb: impl FnMut(TraitId)) {
|
fn direct_super_traits_cb(db: &dyn DefDatabase, trait_: TraitId, cb: impl FnMut(TraitId)) {
|
||||||
let resolver = trait_.resolver(db);
|
let resolver = trait_.resolver(db);
|
||||||
let generic_params = db.generic_params(trait_.into());
|
let generic_params = db.generic_params(trait_.into());
|
||||||
let trait_self = generic_params.trait_self_param();
|
let trait_self = generic_params.trait_self_param();
|
||||||
|
@ -259,25 +270,25 @@ pub fn is_fn_unsafe_to_call(db: &dyn HirDatabase, func: FunctionId) -> bool {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let is_intrinsic = db.attrs(func.into()).by_key(&sym::rustc_intrinsic).exists()
|
||||||
|
|| data.abi.as_ref() == Some(&sym::rust_dash_intrinsic);
|
||||||
|
|
||||||
let loc = func.lookup(db.upcast());
|
let loc = func.lookup(db.upcast());
|
||||||
match loc.container {
|
match loc.container {
|
||||||
hir_def::ItemContainerId::ExternBlockId(block) => {
|
hir_def::ItemContainerId::ExternBlockId(block) => {
|
||||||
// Function in an `extern` block are always unsafe to call, except when
|
if is_intrinsic || {
|
||||||
// it is marked as `safe` or it has `"rust-intrinsic"` ABI there are a
|
|
||||||
// few exceptions.
|
|
||||||
let id = block.lookup(db.upcast()).id;
|
let id = block.lookup(db.upcast()).id;
|
||||||
|
id.item_tree(db.upcast())[id.value].abi.as_ref() == Some(&sym::rust_dash_intrinsic)
|
||||||
let is_intrinsic =
|
} {
|
||||||
id.item_tree(db.upcast())[id.value].abi.as_ref() == Some(&sym::rust_dash_intrinsic);
|
|
||||||
|
|
||||||
if is_intrinsic {
|
|
||||||
// Intrinsics are unsafe unless they have the rustc_safe_intrinsic attribute
|
// Intrinsics are unsafe unless they have the rustc_safe_intrinsic attribute
|
||||||
!data.attrs.by_key(&sym::rustc_safe_intrinsic).exists()
|
!db.attrs(func.into()).by_key(&sym::rustc_safe_intrinsic).exists()
|
||||||
} else {
|
} else {
|
||||||
// Extern items without `safe` modifier are always unsafe
|
// Function in an `extern` block are always unsafe to call, except when
|
||||||
|
// it is marked as `safe`.
|
||||||
!data.is_safe()
|
!data.is_safe()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
_ if is_intrinsic => !db.attrs(func.into()).by_key(&sym::rustc_safe_intrinsic).exists(),
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ use hir_ty::{
|
||||||
all_super_traits, autoderef, check_orphan_rules,
|
all_super_traits, autoderef, check_orphan_rules,
|
||||||
consteval::{try_const_usize, unknown_const_as_generic, ConstExt},
|
consteval::{try_const_usize, unknown_const_as_generic, ConstExt},
|
||||||
diagnostics::BodyValidationDiagnostic,
|
diagnostics::BodyValidationDiagnostic,
|
||||||
error_lifetime, known_const_to_ast,
|
direct_super_traits, error_lifetime, known_const_to_ast,
|
||||||
layout::{Layout as TyLayout, RustcEnumVariantIdx, RustcFieldIdx, TagEncoding},
|
layout::{Layout as TyLayout, RustcEnumVariantIdx, RustcFieldIdx, TagEncoding},
|
||||||
method_resolution,
|
method_resolution,
|
||||||
mir::{interpret_mir, MutBorrowKind},
|
mir::{interpret_mir, MutBorrowKind},
|
||||||
|
@ -2246,35 +2246,33 @@ impl Function {
|
||||||
|
|
||||||
/// Does this function have `#[test]` attribute?
|
/// Does this function have `#[test]` attribute?
|
||||||
pub fn is_test(self, db: &dyn HirDatabase) -> bool {
|
pub fn is_test(self, db: &dyn HirDatabase) -> bool {
|
||||||
db.function_data(self.id).attrs.is_test()
|
db.attrs(self.id.into()).is_test()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// is this a `fn main` or a function with an `export_name` of `main`?
|
/// is this a `fn main` or a function with an `export_name` of `main`?
|
||||||
pub fn is_main(self, db: &dyn HirDatabase) -> bool {
|
pub fn is_main(self, db: &dyn HirDatabase) -> bool {
|
||||||
let data = db.function_data(self.id);
|
db.attrs(self.id.into()).export_name() == Some(&sym::main)
|
||||||
data.attrs.export_name() == Some(&sym::main)
|
|| self.module(db).is_crate_root() && db.function_data(self.id).name == sym::main
|
||||||
|| self.module(db).is_crate_root() && data.name == sym::main
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is this a function with an `export_name` of `main`?
|
/// Is this a function with an `export_name` of `main`?
|
||||||
pub fn exported_main(self, db: &dyn HirDatabase) -> bool {
|
pub fn exported_main(self, db: &dyn HirDatabase) -> bool {
|
||||||
let data = db.function_data(self.id);
|
db.attrs(self.id.into()).export_name() == Some(&sym::main)
|
||||||
data.attrs.export_name() == Some(&sym::main)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Does this function have the ignore attribute?
|
/// Does this function have the ignore attribute?
|
||||||
pub fn is_ignore(self, db: &dyn HirDatabase) -> bool {
|
pub fn is_ignore(self, db: &dyn HirDatabase) -> bool {
|
||||||
db.function_data(self.id).attrs.is_ignore()
|
db.attrs(self.id.into()).is_ignore()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Does this function have `#[bench]` attribute?
|
/// Does this function have `#[bench]` attribute?
|
||||||
pub fn is_bench(self, db: &dyn HirDatabase) -> bool {
|
pub fn is_bench(self, db: &dyn HirDatabase) -> bool {
|
||||||
db.function_data(self.id).attrs.is_bench()
|
db.attrs(self.id.into()).is_bench()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Is this function marked as unstable with `#[feature]` attribute?
|
/// Is this function marked as unstable with `#[feature]` attribute?
|
||||||
pub fn is_unstable(self, db: &dyn HirDatabase) -> bool {
|
pub fn is_unstable(self, db: &dyn HirDatabase) -> bool {
|
||||||
db.function_data(self.id).attrs.is_unstable()
|
db.attrs(self.id.into()).is_unstable()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_unsafe_to_call(self, db: &dyn HirDatabase) -> bool {
|
pub fn is_unsafe_to_call(self, db: &dyn HirDatabase) -> bool {
|
||||||
|
@ -2289,8 +2287,7 @@ impl Function {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn as_proc_macro(self, db: &dyn HirDatabase) -> Option<Macro> {
|
pub fn as_proc_macro(self, db: &dyn HirDatabase) -> Option<Macro> {
|
||||||
let function_data = db.function_data(self.id);
|
let attrs = db.attrs(self.id.into());
|
||||||
let attrs = &function_data.attrs;
|
|
||||||
// FIXME: Store this in FunctionData flags?
|
// FIXME: Store this in FunctionData flags?
|
||||||
if !(attrs.is_proc_macro()
|
if !(attrs.is_proc_macro()
|
||||||
|| attrs.is_proc_macro_attribute()
|
|| attrs.is_proc_macro_attribute()
|
||||||
|
@ -2707,13 +2704,22 @@ impl Trait {
|
||||||
db.trait_data(self.id).name.clone()
|
db.trait_data(self.id).name.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn direct_supertraits(self, db: &dyn HirDatabase) -> Vec<Trait> {
|
||||||
|
let traits = direct_super_traits(db.upcast(), self.into());
|
||||||
|
traits.iter().map(|tr| Trait::from(*tr)).collect()
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn all_supertraits(self, db: &dyn HirDatabase) -> Vec<Trait> {
|
||||||
|
let traits = all_super_traits(db.upcast(), self.into());
|
||||||
|
traits.iter().map(|tr| Trait::from(*tr)).collect()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn items(self, db: &dyn HirDatabase) -> Vec<AssocItem> {
|
pub fn items(self, db: &dyn HirDatabase) -> Vec<AssocItem> {
|
||||||
db.trait_data(self.id).items.iter().map(|(_name, it)| (*it).into()).collect()
|
db.trait_data(self.id).items.iter().map(|(_name, it)| (*it).into()).collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn items_with_supertraits(self, db: &dyn HirDatabase) -> Vec<AssocItem> {
|
pub fn items_with_supertraits(self, db: &dyn HirDatabase) -> Vec<AssocItem> {
|
||||||
let traits = all_super_traits(db.upcast(), self.into());
|
self.all_supertraits(db).into_iter().flat_map(|tr| tr.items(db)).collect()
|
||||||
traits.iter().flat_map(|tr| Trait::from(*tr).items(db)).collect()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_auto(self, db: &dyn HirDatabase) -> bool {
|
pub fn is_auto(self, db: &dyn HirDatabase) -> bool {
|
||||||
|
|
|
@ -19,6 +19,7 @@ pub struct StructureNode {
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
|
||||||
pub enum StructureNodeKind {
|
pub enum StructureNodeKind {
|
||||||
SymbolKind(SymbolKind),
|
SymbolKind(SymbolKind),
|
||||||
|
ExternBlock,
|
||||||
Region,
|
Region,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,6 +159,7 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
|
||||||
ast::Trait(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::Trait)),
|
ast::Trait(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::Trait)),
|
||||||
ast::TraitAlias(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::TraitAlias)),
|
ast::TraitAlias(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::TraitAlias)),
|
||||||
ast::Module(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::Module)),
|
ast::Module(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::Module)),
|
||||||
|
ast::Macro(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::Macro)),
|
||||||
ast::TypeAlias(it) => decl_with_type_ref(&it, it.ty(), StructureNodeKind::SymbolKind(SymbolKind::TypeAlias)),
|
ast::TypeAlias(it) => decl_with_type_ref(&it, it.ty(), StructureNodeKind::SymbolKind(SymbolKind::TypeAlias)),
|
||||||
ast::RecordField(it) => decl_with_type_ref(&it, it.ty(), StructureNodeKind::SymbolKind(SymbolKind::Field)),
|
ast::RecordField(it) => decl_with_type_ref(&it, it.ty(), StructureNodeKind::SymbolKind(SymbolKind::Field)),
|
||||||
ast::Const(it) => decl_with_type_ref(&it, it.ty(), StructureNodeKind::SymbolKind(SymbolKind::Const)),
|
ast::Const(it) => decl_with_type_ref(&it, it.ty(), StructureNodeKind::SymbolKind(SymbolKind::Const)),
|
||||||
|
@ -205,7 +207,23 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
|
||||||
|
|
||||||
Some(node)
|
Some(node)
|
||||||
},
|
},
|
||||||
ast::Macro(it) => decl(it, StructureNodeKind::SymbolKind(SymbolKind::Macro)),
|
ast::ExternBlock(it) => {
|
||||||
|
let mut label = "extern".to_owned();
|
||||||
|
let abi = it.abi()?;
|
||||||
|
if let Some(abi) = abi.string_token() {
|
||||||
|
label.push(' ');
|
||||||
|
label.push_str(abi.text());
|
||||||
|
}
|
||||||
|
Some(StructureNode {
|
||||||
|
parent: None,
|
||||||
|
label,
|
||||||
|
navigation_range: abi.syntax().text_range(),
|
||||||
|
node_range: it.syntax().text_range(),
|
||||||
|
kind: StructureNodeKind::ExternBlock,
|
||||||
|
detail: None,
|
||||||
|
deprecated: false,
|
||||||
|
})
|
||||||
|
},
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -327,6 +345,8 @@ fn f() {}
|
||||||
fn g() {}
|
fn g() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" {}
|
||||||
|
|
||||||
fn let_statements() {
|
fn let_statements() {
|
||||||
let x = 42;
|
let x = 42;
|
||||||
let mut y = x;
|
let mut y = x;
|
||||||
|
@ -662,11 +682,20 @@ fn let_statements() {
|
||||||
),
|
),
|
||||||
deprecated: false,
|
deprecated: false,
|
||||||
},
|
},
|
||||||
|
StructureNode {
|
||||||
|
parent: None,
|
||||||
|
label: "extern \"C\"",
|
||||||
|
navigation_range: 638..648,
|
||||||
|
node_range: 638..651,
|
||||||
|
kind: ExternBlock,
|
||||||
|
detail: None,
|
||||||
|
deprecated: false,
|
||||||
|
},
|
||||||
StructureNode {
|
StructureNode {
|
||||||
parent: None,
|
parent: None,
|
||||||
label: "let_statements",
|
label: "let_statements",
|
||||||
navigation_range: 641..655,
|
navigation_range: 656..670,
|
||||||
node_range: 638..798,
|
node_range: 653..813,
|
||||||
kind: SymbolKind(
|
kind: SymbolKind(
|
||||||
Function,
|
Function,
|
||||||
),
|
),
|
||||||
|
@ -677,11 +706,11 @@ fn let_statements() {
|
||||||
},
|
},
|
||||||
StructureNode {
|
StructureNode {
|
||||||
parent: Some(
|
parent: Some(
|
||||||
26,
|
27,
|
||||||
),
|
),
|
||||||
label: "x",
|
label: "x",
|
||||||
navigation_range: 668..669,
|
navigation_range: 683..684,
|
||||||
node_range: 664..675,
|
node_range: 679..690,
|
||||||
kind: SymbolKind(
|
kind: SymbolKind(
|
||||||
Local,
|
Local,
|
||||||
),
|
),
|
||||||
|
@ -690,11 +719,11 @@ fn let_statements() {
|
||||||
},
|
},
|
||||||
StructureNode {
|
StructureNode {
|
||||||
parent: Some(
|
parent: Some(
|
||||||
26,
|
27,
|
||||||
),
|
),
|
||||||
label: "mut y",
|
label: "mut y",
|
||||||
navigation_range: 684..689,
|
navigation_range: 699..704,
|
||||||
node_range: 680..694,
|
node_range: 695..709,
|
||||||
kind: SymbolKind(
|
kind: SymbolKind(
|
||||||
Local,
|
Local,
|
||||||
),
|
),
|
||||||
|
@ -703,11 +732,11 @@ fn let_statements() {
|
||||||
},
|
},
|
||||||
StructureNode {
|
StructureNode {
|
||||||
parent: Some(
|
parent: Some(
|
||||||
26,
|
27,
|
||||||
),
|
),
|
||||||
label: "Foo { .. }",
|
label: "Foo { .. }",
|
||||||
navigation_range: 703..725,
|
navigation_range: 718..740,
|
||||||
node_range: 699..738,
|
node_range: 714..753,
|
||||||
kind: SymbolKind(
|
kind: SymbolKind(
|
||||||
Local,
|
Local,
|
||||||
),
|
),
|
||||||
|
@ -716,11 +745,11 @@ fn let_statements() {
|
||||||
},
|
},
|
||||||
StructureNode {
|
StructureNode {
|
||||||
parent: Some(
|
parent: Some(
|
||||||
26,
|
27,
|
||||||
),
|
),
|
||||||
label: "_",
|
label: "_",
|
||||||
navigation_range: 788..789,
|
navigation_range: 803..804,
|
||||||
node_range: 784..796,
|
node_range: 799..811,
|
||||||
kind: SymbolKind(
|
kind: SymbolKind(
|
||||||
Local,
|
Local,
|
||||||
),
|
),
|
||||||
|
|
|
@ -1009,10 +1009,10 @@ fn render_dyn_compatibility(
|
||||||
safety: Option<DynCompatibilityViolation>,
|
safety: Option<DynCompatibilityViolation>,
|
||||||
) {
|
) {
|
||||||
let Some(osv) = safety else {
|
let Some(osv) = safety else {
|
||||||
buf.push_str("Is Dyn compatible");
|
buf.push_str("Is dyn-compatible");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
buf.push_str("Is not Dyn compatible due to ");
|
buf.push_str("Is not dyn-compatible due to ");
|
||||||
match osv {
|
match osv {
|
||||||
DynCompatibilityViolation::SizedSelf => {
|
DynCompatibilityViolation::SizedSelf => {
|
||||||
buf.push_str("having a `Self: Sized` bound");
|
buf.push_str("having a `Self: Sized` bound");
|
||||||
|
@ -1055,7 +1055,7 @@ fn render_dyn_compatibility(
|
||||||
}
|
}
|
||||||
DynCompatibilityViolation::HasNonCompatibleSuperTrait(super_trait) => {
|
DynCompatibilityViolation::HasNonCompatibleSuperTrait(super_trait) => {
|
||||||
let name = hir::Trait::from(super_trait).name(db);
|
let name = hir::Trait::from(super_trait).name(db);
|
||||||
format_to!(buf, "having a dyn incompatible supertrait `{}`", name.as_str());
|
format_to!(buf, "having a dyn-incompatible supertrait `{}`", name.as_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9371,7 +9371,7 @@ trait Compat$0 {}
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Is Dyn compatible
|
Is dyn-compatible
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
check(
|
check(
|
||||||
|
@ -9393,7 +9393,7 @@ trait UnCompat$0 {
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Is not Dyn compatible due to having a method `f` that is not dispatchable due to missing a receiver
|
Is not dyn-compatible due to having a method `f` that is not dispatchable due to missing a receiver
|
||||||
"#]],
|
"#]],
|
||||||
);
|
);
|
||||||
check(
|
check(
|
||||||
|
|
|
@ -392,18 +392,22 @@ define_symbols! {
|
||||||
rust_2024,
|
rust_2024,
|
||||||
rust_analyzer,
|
rust_analyzer,
|
||||||
Rust,
|
Rust,
|
||||||
|
rustc_allocator_zeroed,
|
||||||
|
rustc_allocator,
|
||||||
rustc_allow_incoherent_impl,
|
rustc_allow_incoherent_impl,
|
||||||
rustc_builtin_macro,
|
rustc_builtin_macro,
|
||||||
rustc_coherence_is_core,
|
rustc_coherence_is_core,
|
||||||
rustc_const_panic_str,
|
rustc_const_panic_str,
|
||||||
|
rustc_deallocator,
|
||||||
rustc_deprecated_safe_2024,
|
rustc_deprecated_safe_2024,
|
||||||
rustc_has_incoherent_inherent_impls,
|
rustc_has_incoherent_inherent_impls,
|
||||||
rustc_intrinsic,
|
|
||||||
rustc_intrinsic_must_be_overridden,
|
rustc_intrinsic_must_be_overridden,
|
||||||
|
rustc_intrinsic,
|
||||||
rustc_layout_scalar_valid_range_end,
|
rustc_layout_scalar_valid_range_end,
|
||||||
rustc_layout_scalar_valid_range_start,
|
rustc_layout_scalar_valid_range_start,
|
||||||
rustc_legacy_const_generics,
|
rustc_legacy_const_generics,
|
||||||
rustc_macro_transparency,
|
rustc_macro_transparency,
|
||||||
|
rustc_reallocator,
|
||||||
rustc_reservation_impl,
|
rustc_reservation_impl,
|
||||||
rustc_safe_intrinsic,
|
rustc_safe_intrinsic,
|
||||||
rustc_skip_array_during_method_dispatch,
|
rustc_skip_array_during_method_dispatch,
|
||||||
|
|
|
@ -1131,7 +1131,7 @@ pub(crate) fn handle_completion_resolve(
|
||||||
else {
|
else {
|
||||||
return Ok(original_completion);
|
return Ok(original_completion);
|
||||||
};
|
};
|
||||||
let resolved_completions = to_proto::completion_items(
|
let mut resolved_completions = to_proto::completion_items(
|
||||||
&snap.config,
|
&snap.config,
|
||||||
&forced_resolve_completions_config.fields_to_resolve,
|
&forced_resolve_completions_config.fields_to_resolve,
|
||||||
&line_index,
|
&line_index,
|
||||||
|
@ -1140,13 +1140,11 @@ pub(crate) fn handle_completion_resolve(
|
||||||
resolve_data.trigger_character,
|
resolve_data.trigger_character,
|
||||||
resolved_completions,
|
resolved_completions,
|
||||||
);
|
);
|
||||||
let Some(mut resolved_completion) = resolved_completions.into_iter().find(|completion| {
|
|
||||||
completion.label == original_completion.label
|
let mut resolved_completion =
|
||||||
&& completion.kind == original_completion.kind
|
if resolved_completions.get(resolve_data.completion_item_index).is_some() {
|
||||||
&& completion.deprecated == original_completion.deprecated
|
resolved_completions.swap_remove(resolve_data.completion_item_index)
|
||||||
&& completion.preselect == original_completion.preselect
|
} else {
|
||||||
&& completion.sort_text == original_completion.sort_text
|
|
||||||
}) else {
|
|
||||||
return Ok(original_completion);
|
return Ok(original_completion);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -826,6 +826,7 @@ pub struct CompletionResolveData {
|
||||||
pub imports: Vec<CompletionImport>,
|
pub imports: Vec<CompletionImport>,
|
||||||
pub version: Option<i32>,
|
pub version: Option<i32>,
|
||||||
pub trigger_character: Option<char>,
|
pub trigger_character: Option<char>,
|
||||||
|
pub completion_item_index: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
|
|
@ -88,6 +88,7 @@ pub(crate) fn structure_node_kind(kind: StructureNodeKind) -> lsp_types::SymbolK
|
||||||
match kind {
|
match kind {
|
||||||
StructureNodeKind::SymbolKind(symbol) => symbol_kind(symbol),
|
StructureNodeKind::SymbolKind(symbol) => symbol_kind(symbol),
|
||||||
StructureNodeKind::Region => lsp_types::SymbolKind::NAMESPACE,
|
StructureNodeKind::Region => lsp_types::SymbolKind::NAMESPACE,
|
||||||
|
StructureNodeKind::ExternBlock => lsp_types::SymbolKind::NAMESPACE,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,18 +392,36 @@ fn completion_item(
|
||||||
} else {
|
} else {
|
||||||
Vec::new()
|
Vec::new()
|
||||||
};
|
};
|
||||||
if something_to_resolve || !imports.is_empty() {
|
let (ref_resolve_data, resolve_data) = if something_to_resolve || !imports.is_empty() {
|
||||||
let data = lsp_ext::CompletionResolveData {
|
let mut item_index = acc.len();
|
||||||
|
let ref_resolve_data = if ref_match.is_some() {
|
||||||
|
let ref_resolve_data = lsp_ext::CompletionResolveData {
|
||||||
|
position: tdpp.clone(),
|
||||||
|
imports: Vec::new(),
|
||||||
|
version,
|
||||||
|
trigger_character: completion_trigger_character,
|
||||||
|
completion_item_index: item_index,
|
||||||
|
};
|
||||||
|
item_index += 1;
|
||||||
|
Some(to_value(ref_resolve_data).unwrap())
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
let resolve_data = lsp_ext::CompletionResolveData {
|
||||||
position: tdpp.clone(),
|
position: tdpp.clone(),
|
||||||
imports,
|
imports,
|
||||||
version,
|
version,
|
||||||
trigger_character: completion_trigger_character,
|
trigger_character: completion_trigger_character,
|
||||||
|
completion_item_index: item_index,
|
||||||
|
};
|
||||||
|
(ref_resolve_data, Some(to_value(resolve_data).unwrap()))
|
||||||
|
} else {
|
||||||
|
(None, None)
|
||||||
};
|
};
|
||||||
lsp_item.data = Some(to_value(data).unwrap());
|
|
||||||
}
|
|
||||||
|
|
||||||
if let Some((label, indel, relevance)) = ref_match {
|
if let Some((label, indel, relevance)) = ref_match {
|
||||||
let mut lsp_item_with_ref = lsp_types::CompletionItem { label, ..lsp_item.clone() };
|
let mut lsp_item_with_ref =
|
||||||
|
lsp_types::CompletionItem { label, data: ref_resolve_data, ..lsp_item.clone() };
|
||||||
lsp_item_with_ref
|
lsp_item_with_ref
|
||||||
.additional_text_edits
|
.additional_text_edits
|
||||||
.get_or_insert_with(Default::default)
|
.get_or_insert_with(Default::default)
|
||||||
|
@ -411,6 +430,7 @@ fn completion_item(
|
||||||
acc.push(lsp_item_with_ref);
|
acc.push(lsp_item_with_ref);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lsp_item.data = resolve_data;
|
||||||
acc.push(lsp_item);
|
acc.push(lsp_item);
|
||||||
|
|
||||||
fn set_score(
|
fn set_score(
|
||||||
|
|
|
@ -370,15 +370,13 @@ pub mod mem {
|
||||||
// endregion:drop
|
// endregion:drop
|
||||||
|
|
||||||
// region:transmute
|
// region:transmute
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn transmute<Src, Dst>(src: Src) -> Dst;
|
pub fn transmute<Src, Dst>(src: Src) -> Dst;
|
||||||
}
|
|
||||||
// endregion:transmute
|
// endregion:transmute
|
||||||
|
|
||||||
// region:size_of
|
// region:size_of
|
||||||
extern "rust-intrinsic" {
|
#[rustc_intrinsic]
|
||||||
pub fn size_of<T>() -> usize;
|
pub fn size_of<T>() -> usize;
|
||||||
}
|
|
||||||
// endregion:size_of
|
// endregion:size_of
|
||||||
|
|
||||||
// region:discriminant
|
// region:discriminant
|
||||||
|
|
|
@ -47,7 +47,7 @@ https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer
|
||||||
Each triaged issue should have one of these labels.
|
Each triaged issue should have one of these labels.
|
||||||
* [fun](https://github.com/rust-lang/rust-analyzer/issues?q=is%3Aopen+is%3Aissue+label%3Afun)
|
* [fun](https://github.com/rust-lang/rust-analyzer/issues?q=is%3Aopen+is%3Aissue+label%3Afun)
|
||||||
is for cool, but probably hard stuff.
|
is for cool, but probably hard stuff.
|
||||||
* [Design](https://github.com/rust-lang/rust-analyzer/issues?q=is%3Aopen+is%3Aissue+label%Design)
|
* [C-Architecture](https://github.com/rust-lang/rust-analyzer/issues?q=is%3Aissue%20state%3Aopen%20label%3AC-Architecture)
|
||||||
is for moderate/large scale architecture discussion.
|
is for moderate/large scale architecture discussion.
|
||||||
Also a kind of fun.
|
Also a kind of fun.
|
||||||
These issues should generally include a link to a Zulip discussion thread.
|
These issues should generally include a link to a Zulip discussion thread.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<!---
|
<!---
|
||||||
lsp/ext.rs hash: 90cf7718d54fe3c2
|
lsp/ext.rs hash: 96f88b7a5d0080c6
|
||||||
|
|
||||||
If you need to change the above hash to make the test pass, please check if you
|
If you need to change the above hash to make the test pass, please check if you
|
||||||
need to adjust this doc as well and ping this issue:
|
need to adjust this doc as well and ping this issue:
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
"anser": "^2.1.1",
|
"anser": "^2.1.1",
|
||||||
"d3": "^7.8.5",
|
"d3": "^7.8.5",
|
||||||
"d3-graphviz": "^5.0.2",
|
"d3-graphviz": "^5.0.2",
|
||||||
"vscode-languageclient": "^8.1.0"
|
"vscode-languageclient": "^9.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/strictest": "^2.0.1",
|
"@tsconfig/strictest": "^2.0.1",
|
||||||
"@types/node": "~16.11.7",
|
"@types/node": "~16.11.7",
|
||||||
"@types/vscode": "~1.78.1",
|
"@types/vscode": "~1.83",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||||
"@typescript-eslint/parser": "^6.0.0",
|
"@typescript-eslint/parser": "^6.0.0",
|
||||||
"@vscode/test-electron": "^2.3.8",
|
"@vscode/test-electron": "^2.3.8",
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
"typescript": "^5.6.0"
|
"typescript": "^5.6.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.78.0"
|
"vscode": "^1.83.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aashutoshrathi/word-wrap": {
|
"node_modules/@aashutoshrathi/word-wrap": {
|
||||||
|
@ -880,9 +880,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@types/vscode": {
|
"node_modules/@types/vscode": {
|
||||||
"version": "1.78.1",
|
"version": "1.83.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.78.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.83.3.tgz",
|
||||||
"integrity": "sha512-wEA+54axejHu7DhcUfnFBan1IqFD1gBDxAFz8LoX06NbNDMRJv/T6OGthOs52yZccasKfN588EyffHWABkR0fg==",
|
"integrity": "sha512-ZPp5+OQNYrCSFoT4jWOZKdcuXijj+JdN2BJNDhWH4pPbVL6PRQycG9NT8C4a94oul1tFMbkVbXXa9HasI7cLUg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
|
@ -5059,24 +5059,24 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vscode-jsonrpc": {
|
"node_modules/vscode-jsonrpc": {
|
||||||
"version": "8.1.0",
|
"version": "8.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.2.0.tgz",
|
||||||
"integrity": "sha512-6TDy/abTQk+zDGYazgbIPc+4JoXdwC8NHU9Pbn4UJP1fehUyZmM4RHp5IthX7A6L5KS30PRui+j+tbbMMMafdw==",
|
"integrity": "sha512-C+r0eKJUIfiDIfwJhria30+TYWPtuHJXHtI7J0YlOmKAo7ogxP20T0zxB7HZQIFhIyvoBPwWskjxrvAtfjyZfA==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vscode-languageclient": {
|
"node_modules/vscode-languageclient": {
|
||||||
"version": "8.1.0",
|
"version": "9.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-9.0.1.tgz",
|
||||||
"integrity": "sha512-GL4QdbYUF/XxQlAsvYWZRV3V34kOkpRlvV60/72ghHfsYFnS/v2MANZ9P6sHmxFcZKOse8O+L9G7Czg0NUWing==",
|
"integrity": "sha512-JZiimVdvimEuHh5olxhxkht09m3JzUGwggb5eRUkzzJhZ2KjCN0nh55VfiED9oez9DyF8/fz1g1iBV3h+0Z2EA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimatch": "^5.1.0",
|
"minimatch": "^5.1.0",
|
||||||
"semver": "^7.3.7",
|
"semver": "^7.3.7",
|
||||||
"vscode-languageserver-protocol": "3.17.3"
|
"vscode-languageserver-protocol": "3.17.5"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.67.0"
|
"vscode": "^1.82.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vscode-languageclient/node_modules/brace-expansion": {
|
"node_modules/vscode-languageclient/node_modules/brace-expansion": {
|
||||||
|
@ -5099,18 +5099,18 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vscode-languageserver-protocol": {
|
"node_modules/vscode-languageserver-protocol": {
|
||||||
"version": "3.17.3",
|
"version": "3.17.5",
|
||||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.3.tgz",
|
"resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.5.tgz",
|
||||||
"integrity": "sha512-924/h0AqsMtA5yK22GgMtCYiMdCOtWTSGgUOkgEDX+wk2b0x4sAfLiO4NxBxqbiVtz7K7/1/RgVrVI0NClZwqA==",
|
"integrity": "sha512-mb1bvRJN8SVznADSGWM9u/b07H7Ecg0I3OgXDuLdn307rl/J3A9YD6/eYOssqhecL27hK1IPZAsaqh00i/Jljg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vscode-jsonrpc": "8.1.0",
|
"vscode-jsonrpc": "8.2.0",
|
||||||
"vscode-languageserver-types": "3.17.3"
|
"vscode-languageserver-types": "3.17.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vscode-languageserver-types": {
|
"node_modules/vscode-languageserver-types": {
|
||||||
"version": "3.17.3",
|
"version": "3.17.5",
|
||||||
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.3.tgz",
|
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz",
|
||||||
"integrity": "sha512-SYU4z1dL0PyIMd4Vj8YOqFvHu7Hz/enbWtpfnVbJHU4Nd1YNYx8u0ennumc6h48GQNeOLxmwySmnADouT/AuZA=="
|
"integrity": "sha512-Ld1VelNuX9pdF39h2Hgaeb5hEZM2Z3jUrrMgWQAu82jMtZp7p3vJT3BzToKtZI7NgQssZje5o0zryOrhQvzQAg=="
|
||||||
},
|
},
|
||||||
"node_modules/which": {
|
"node_modules/which": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.78.0"
|
"vscode": "^1.83.0"
|
||||||
},
|
},
|
||||||
"enabledApiProposals": [],
|
"enabledApiProposals": [],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -49,12 +49,12 @@
|
||||||
"anser": "^2.1.1",
|
"anser": "^2.1.1",
|
||||||
"d3": "^7.8.5",
|
"d3": "^7.8.5",
|
||||||
"d3-graphviz": "^5.0.2",
|
"d3-graphviz": "^5.0.2",
|
||||||
"vscode-languageclient": "^8.1.0"
|
"vscode-languageclient": "^9.0.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@tsconfig/strictest": "^2.0.1",
|
"@tsconfig/strictest": "^2.0.1",
|
||||||
"@types/node": "~16.11.7",
|
"@types/node": "~16.11.7",
|
||||||
"@types/vscode": "~1.78.1",
|
"@types/vscode": "~1.83",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
||||||
"@typescript-eslint/parser": "^6.0.0",
|
"@typescript-eslint/parser": "^6.0.0",
|
||||||
"@vscode/test-electron": "^2.3.8",
|
"@vscode/test-electron": "^2.3.8",
|
||||||
|
@ -490,15 +490,19 @@
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"auto",
|
"auto",
|
||||||
|
"llvm-vs-code-extensions.lldb-dap",
|
||||||
"vadimcn.vscode-lldb",
|
"vadimcn.vscode-lldb",
|
||||||
"ms-vscode.cpptools"
|
"ms-vscode.cpptools",
|
||||||
|
"webfreak.debug"
|
||||||
],
|
],
|
||||||
"default": "auto",
|
"default": "auto",
|
||||||
"description": "Preferred debug engine.",
|
"description": "Preferred debug engine.",
|
||||||
"markdownEnumDescriptions": [
|
"markdownEnumDescriptions": [
|
||||||
"First try to use [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb), if it's not installed try to use [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).",
|
"Use the first available extension out of [LLDB DAP](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.lldb-dap), [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb), [C/C++ for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools), and [Native Debug](https://marketplace.visualstudio.com/items?itemName=webfreak.debug).",
|
||||||
|
"Use [LLDB DAP](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.lldb-dap)",
|
||||||
"Use [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)",
|
"Use [CodeLLDB](https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb)",
|
||||||
"Use [MS C++ tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)"
|
"Use [C/C++ for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools)",
|
||||||
|
"Use [Native Debug](https://marketplace.visualstudio.com/items?itemName=webfreak.debug)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"rust-analyzer.debug.sourceFileMap": {
|
"rust-analyzer.debug.sourceFileMap": {
|
||||||
|
|
|
@ -350,6 +350,7 @@ class ExperimentalFeatures implements lc.StaticFeature {
|
||||||
_documentSelector: lc.DocumentSelector | undefined,
|
_documentSelector: lc.DocumentSelector | undefined,
|
||||||
): void {}
|
): void {}
|
||||||
dispose(): void {}
|
dispose(): void {}
|
||||||
|
clear(): void {}
|
||||||
}
|
}
|
||||||
|
|
||||||
class OverrideFeatures implements lc.StaticFeature {
|
class OverrideFeatures implements lc.StaticFeature {
|
||||||
|
@ -369,6 +370,7 @@ class OverrideFeatures implements lc.StaticFeature {
|
||||||
_documentSelector: lc.DocumentSelector | undefined,
|
_documentSelector: lc.DocumentSelector | undefined,
|
||||||
): void {}
|
): void {}
|
||||||
dispose(): void {}
|
dispose(): void {}
|
||||||
|
clear(): void {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isCodeActionWithoutEditsAndCommands(value: any): boolean {
|
function isCodeActionWithoutEditsAndCommands(value: any): boolean {
|
||||||
|
|
|
@ -19,3 +19,5 @@ exclude_titles = [ # exclude syncs from subtree in rust-lang/rust
|
||||||
"sync from rust",
|
"sync from rust",
|
||||||
]
|
]
|
||||||
labels = ["has-merge-commits", "S-waiting-on-author"]
|
labels = ["has-merge-commits", "S-waiting-on-author"]
|
||||||
|
|
||||||
|
[transfer]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue