mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
internal: Remove synstructure const hack support
This commit is contained in:
parent
09b9a921a8
commit
558feeab61
8 changed files with 48 additions and 68 deletions
|
@ -213,7 +213,7 @@ impl TraitImpls {
|
|||
|
||||
// To better support custom derives, collect impls in all unnamed const items.
|
||||
// const _: () = { ... };
|
||||
for konst in module_data.scope.unnamed_consts(db.upcast()) {
|
||||
for konst in module_data.scope.unnamed_consts() {
|
||||
let body = db.body(konst.into());
|
||||
for (_, block_def_map) in body.blocks(db.upcast()) {
|
||||
Self::collect_def_map(db, map, &block_def_map);
|
||||
|
@ -337,7 +337,7 @@ impl InherentImpls {
|
|||
|
||||
// To better support custom derives, collect impls in all unnamed const items.
|
||||
// const _: () = { ... };
|
||||
for konst in module_data.scope.unnamed_consts(db.upcast()) {
|
||||
for konst in module_data.scope.unnamed_consts() {
|
||||
let body = db.body(konst.into());
|
||||
for (_, block_def_map) in body.blocks(db.upcast()) {
|
||||
self.collect_def_map(db, &block_def_map);
|
||||
|
|
|
@ -1461,28 +1461,6 @@ fn f() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn trait_impl_in_synstructure_const() {
|
||||
check_types(
|
||||
r#"
|
||||
struct S;
|
||||
|
||||
trait Tr {
|
||||
fn method(&self) -> u16;
|
||||
}
|
||||
|
||||
const _DERIVE_Tr_: () = {
|
||||
impl Tr for S {}
|
||||
};
|
||||
|
||||
fn f() {
|
||||
S.method();
|
||||
//^^^^^^^^^^ u16
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn inherent_impl_in_unnamed_const() {
|
||||
check_types(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue