Skip to content

Commit 4e59657

Browse files
authored
Merge branch 'master' into all_remove_duplicate_module_adt
2 parents 0e1fa97 + 35181e1 commit 4e59657

File tree

43 files changed

+464
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+464
-153
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PRIVACY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
See the [Privacy](https://rust-analyzer.github.io/manual.html#privacy) section of the user manual.
1+
See the [Privacy](https://rust-analyzer.github.io/book/privacy.html) section of the user manual.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ It is a part of a larger rls-2.0 effort to create excellent IDE support for Rust
99

1010
## Quick Start
1111

12-
https://rust-analyzer.github.io/manual.html#installation
12+
https://rust-analyzer.github.io/book/installation.html
1313

1414
## Documentation
1515

@@ -18,12 +18,13 @@ if you are just curious about how things work under the hood, check the [./docs/
1818
folder.
1919

2020
If you want to **use** rust-analyzer's language server with your editor of
21-
choice, check [the manual](https://rust-analyzer.github.io/manual.html) folder.
21+
choice, check [the manual](https://rust-analyzer.github.io/book/).
2222
It also contains some tips & tricks to help you be more productive when using rust-analyzer.
2323

2424
## Security and Privacy
2525

26-
See the corresponding sections of [the manual](https://rust-analyzer.github.io/manual.html#security).
26+
See the [security](https://rust-analyzer.github.io/book/security.html) and
27+
[privacy](https://rust-analyzer.github.io/book/privacy.html) sections of the manual.
2728

2829
## Communication
2930

crates/base-db/src/input.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ impl fmt::Display for CrateName {
129129
}
130130

131131
impl ops::Deref for CrateName {
132-
type Target = str;
133-
fn deref(&self) -> &str {
134-
self.0.as_str()
132+
type Target = Symbol;
133+
fn deref(&self) -> &Symbol {
134+
&self.0
135135
}
136136
}
137137

@@ -230,8 +230,8 @@ impl fmt::Display for CrateDisplayName {
230230
}
231231

232232
impl ops::Deref for CrateDisplayName {
233-
type Target = str;
234-
fn deref(&self) -> &str {
233+
type Target = Symbol;
234+
fn deref(&self) -> &Symbol {
235235
&self.crate_name
236236
}
237237
}

crates/hir-def/src/import_map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ mod tests {
519519
crate_graph[krate]
520520
.display_name
521521
.as_ref()
522-
.is_some_and(|it| &**it.crate_name() == crate_name)
522+
.is_some_and(|it| it.crate_name().as_str() == crate_name)
523523
})
524524
.expect("could not find crate");
525525

crates/hir-def/src/nameres.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ impl DefMap {
337337
pub(crate) fn crate_def_map_query(db: &dyn DefDatabase, crate_id: CrateId) -> Arc<DefMap> {
338338
let crate_graph = db.crate_graph();
339339
let krate = &crate_graph[crate_id];
340-
let name = krate.display_name.as_deref().unwrap_or_default();
340+
let name = krate.display_name.as_deref().map(Symbol::as_str).unwrap_or_default();
341341
let _p = tracing::info_span!("crate_def_map_query", ?name).entered();
342342

343343
let module_data = ModuleData::new(

crates/hir-expand/src/name.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,6 @@ impl AsName for ast::FieldKind {
262262

263263
impl AsName for base_db::Dependency {
264264
fn as_name(&self) -> Name {
265-
Name::new_root(&self.name)
265+
Name::new_symbol_root((*self.name).clone())
266266
}
267267
}

crates/hir-expand/src/prettify_macro_expansion_.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ pub fn prettify_macro_expansion(
4141
} else if let Some(dep) =
4242
target_crate.dependencies.iter().find(|dep| dep.crate_id == macro_def_crate)
4343
{
44-
make::tokens::ident(&dep.name)
44+
make::tokens::ident(dep.name.as_str())
4545
} else if let Some(crate_name) = &crate_graph[macro_def_crate].display_name {
46-
make::tokens::ident(crate_name.crate_name())
46+
make::tokens::ident(crate_name.crate_name().as_str())
4747
} else {
4848
return dollar_crate.clone();
4949
}

crates/hir-ty/src/consteval.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ pub(crate) fn path_to_const<'g>(
124124
ConstScalar::UnevaluatedConst(c.into(), Substitution::empty(Interner)),
125125
expected_ty,
126126
)),
127+
// FIXME: With feature(adt_const_params), we also need to consider other things here, e.g. struct constructors.
127128
_ => None,
128129
}
129130
}

crates/hir-ty/src/infer/cast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ enum PointerKind {
374374

375375
fn pointer_kind(ty: &Ty, table: &mut InferenceTable<'_>) -> Result<Option<PointerKind>, ()> {
376376
let ty = table.resolve_ty_shallow(ty);
377+
let ty = table.normalize_associated_types_in(ty);
377378

378379
if table.is_sized(&ty) {
379380
return Ok(Some(PointerKind::Thin));

0 commit comments

Comments
 (0)