mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Use statics + clone instead of const until const can access statics
This commit is contained in:
parent
dd626e78c7
commit
f2d51073d2
49 changed files with 389 additions and 362 deletions
|
@ -1827,7 +1827,7 @@ impl DefWithBody {
|
|||
continue;
|
||||
}
|
||||
let mut need_mut = &mol[local];
|
||||
if body[binding_id].name == sym::self_
|
||||
if body[binding_id].name == sym::self_.clone()
|
||||
&& need_mut == &mir::MutabilityReason::Unused
|
||||
{
|
||||
need_mut = &mir::MutabilityReason::Not;
|
||||
|
@ -2589,7 +2589,7 @@ pub struct StaticLifetime;
|
|||
|
||||
impl StaticLifetime {
|
||||
pub fn name(self) -> Name {
|
||||
Name::new_symbol_root(sym::tick_static)
|
||||
Name::new_symbol_root(sym::tick_static.clone())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3249,7 +3249,7 @@ impl Local {
|
|||
}
|
||||
|
||||
pub fn is_self(self, db: &dyn HirDatabase) -> bool {
|
||||
self.name(db) == sym::self_
|
||||
self.name(db) == sym::self_.clone()
|
||||
}
|
||||
|
||||
pub fn is_mut(self, db: &dyn HirDatabase) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue