Skip to content

Commit cbbab05

Browse files
committed
Remove DescendPreference::SameText
1 parent 011e3bb commit cbbab05

File tree

13 files changed

+304
-229
lines changed

13 files changed

+304
-229
lines changed

Diff for: Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ style = { level = "warn", priority = -1 }
184184
suspicious = { level = "warn", priority = -1 }
185185

186186
## allow following lints
187+
# subjective
188+
single_match = "allow"
187189
# () makes a fine error in most cases
188190
result_unit_err = "allow"
189191
# We don't expose public APIs that matter like this

Diff for: crates/hir-expand/src/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ pub enum MacroCallKind {
279279
}
280280

281281
pub trait HirFileIdExt {
282+
fn edition(self, db: &dyn ExpandDatabase) -> Edition;
282283
/// Returns the original file of this macro call hierarchy.
283284
fn original_file(self, db: &dyn ExpandDatabase) -> EditionedFileId;
284285

@@ -293,6 +294,12 @@ pub trait HirFileIdExt {
293294
}
294295

295296
impl HirFileIdExt for HirFileId {
297+
fn edition(self, db: &dyn ExpandDatabase) -> Edition {
298+
match self.repr() {
299+
HirFileIdRepr::FileId(file_id) => file_id.edition(),
300+
HirFileIdRepr::MacroFile(m) => m.macro_call_id.lookup(db).def.edition,
301+
}
302+
}
296303
fn original_file(self, db: &dyn ExpandDatabase) -> EditionedFileId {
297304
let mut file_id = self;
298305
loop {

0 commit comments

Comments
 (0)