Skip to content

internal: Switch to Rust 1.86.0 #19559

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

Merged
merged 2 commits into from
Apr 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exclude = ["crates/proc-macro-srv/proc-macro-test/imp"]
resolver = "2"

[workspace.package]
rust-version = "1.85"
rust-version = "1.86"
edition = "2024"
license = "MIT OR Apache-2.0"
authors = ["rust-analyzer team"]
Expand Down
4 changes: 0 additions & 4 deletions crates/base-db/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ macro_rules! impl_intern_key {
};
}

pub trait Upcast<T: ?Sized> {
fn upcast(&self) -> &T;
}

pub const DEFAULT_FILE_TEXT_LRU_CAP: u16 = 16;
pub const DEFAULT_PARSE_LRU_CAP: u16 = 128;
pub const DEFAULT_BORROWCK_LRU_CAP: u16 = 2024;
Expand Down
10 changes: 5 additions & 5 deletions crates/hir-def/src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Attrs {
}

pub(crate) fn filter(db: &dyn DefDatabase, krate: Crate, raw_attrs: RawAttrs) -> Attrs {
Attrs(raw_attrs.filter(db.upcast(), krate))
Attrs(raw_attrs.filter(db, krate))
}
}

Expand Down Expand Up @@ -507,7 +507,7 @@ impl AttrsWithOwner {
// FIXME: We should be never getting `None` here.
match src.value.get(it.local_id()) {
Some(val) => RawAttrs::from_attrs_owner(
db.upcast(),
db,
src.with_value(val),
db.span_map(src.file_id).as_ref(),
),
Expand All @@ -519,7 +519,7 @@ impl AttrsWithOwner {
// FIXME: We should be never getting `None` here.
match src.value.get(it.local_id()) {
Some(val) => RawAttrs::from_attrs_owner(
db.upcast(),
db,
src.with_value(val),
db.span_map(src.file_id).as_ref(),
),
Expand All @@ -531,7 +531,7 @@ impl AttrsWithOwner {
// FIXME: We should be never getting `None` here.
match src.value.get(it.local_id) {
Some(val) => RawAttrs::from_attrs_owner(
db.upcast(),
db,
src.with_value(val),
db.span_map(src.file_id).as_ref(),
),
Expand All @@ -544,7 +544,7 @@ impl AttrsWithOwner {
AttrDefId::UseId(it) => attrs_from_item_tree_loc(db, it),
};

let attrs = raw_attrs.filter(db.upcast(), def.krate(db));
let attrs = raw_attrs.filter(db, def.krate(db));
Attrs(attrs)
}

Expand Down
12 changes: 3 additions & 9 deletions crates/hir-def/src/db.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Defines database & queries for name resolution.
use base_db::{Crate, RootQueryDb, SourceDatabase, Upcast};
use base_db::{Crate, RootQueryDb, SourceDatabase};
use either::Either;
use hir_expand::{HirFileId, MacroDefId, db::ExpandDatabase};
use intern::sym;
Expand Down Expand Up @@ -100,13 +100,7 @@ pub trait InternDatabase: RootQueryDb {
}

#[query_group::query_group]
pub trait DefDatabase:
InternDatabase
+ ExpandDatabase
+ SourceDatabase
+ Upcast<dyn ExpandDatabase>
+ Upcast<dyn RootQueryDb>
{
pub trait DefDatabase: InternDatabase + ExpandDatabase + SourceDatabase {
/// Whether to expand procedural macros during name resolution.
#[salsa::input]
fn expand_proc_attr_macros(&self) -> bool;
Expand Down Expand Up @@ -381,7 +375,7 @@ fn include_macro_invoc(
.flat_map(|m| m.scope.iter_macro_invoc())
.filter_map(|invoc| {
db.lookup_intern_macro_call(*invoc.1)
.include_file_id(db.upcast(), *invoc.1)
.include_file_id(db, *invoc.1)
.map(|x| (*invoc.1, x))
})
.collect()
Expand Down
6 changes: 3 additions & 3 deletions crates/hir-def/src/expr_store/expander.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Expander {
krate: Crate,
has_attrs: &dyn HasAttrs,
) -> Attrs {
Attrs::filter(db, krate, RawAttrs::new(db.upcast(), has_attrs, self.span_map.as_ref()))
Attrs::filter(db, krate, RawAttrs::new(db, has_attrs, self.span_map.as_ref()))
}

pub(super) fn is_cfg_enabled(
Expand Down Expand Up @@ -103,7 +103,7 @@ impl Expander {
let result = self.within_limit(db, |this| {
let macro_call = this.in_file(&macro_call);
match macro_call.as_call_id_with_errors(
db.upcast(),
db,
krate,
|path| resolver(path).map(|it| db.macro_def(it)),
eager_callback,
Expand Down Expand Up @@ -178,7 +178,7 @@ impl Expander {
self.recursion_depth = u32::MAX;
cov_mark::hit!(your_stack_belongs_to_me);
return ExpandResult::only_err(ExpandError::new(
db.macro_arg_considering_derives(call_id, &call_id.lookup(db.upcast()).kind).2,
db.macro_arg_considering_derives(call_id, &call_id.lookup(db).kind).2,
ExpandErrorKind::RecursionOverflow,
));
}
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-def/src/expr_store/lower/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub(super) fn lower_path(
return None;
}
break kind = resolve_crate_root(
collector.db.upcast(),
collector.db,
collector.expander.ctx_for_range(name_ref.syntax().text_range()),
)
.map(PathKind::DollarCrate)
Expand Down Expand Up @@ -216,7 +216,7 @@ pub(super) fn lower_path(
let syn_ctxt = collector.expander.ctx_for_range(path.segment()?.syntax().text_range());
if let Some(macro_call_id) = syn_ctxt.outer_expn(collector.db) {
if collector.db.lookup_intern_macro_call(macro_call_id).def.local_inner {
kind = match resolve_crate_root(collector.db.upcast(), syn_ctxt) {
kind = match resolve_crate_root(collector.db, syn_ctxt) {
Some(crate_root) => PathKind::DollarCrate(crate_root),
None => PathKind::Crate,
}
Expand Down
Loading