mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Align naming
This commit is contained in:
parent
55356332bf
commit
deb40d52aa
4 changed files with 5 additions and 6 deletions
|
@ -202,7 +202,7 @@ fn lower_struct(
|
||||||
ast::StructKind::Tuple(fl) => {
|
ast::StructKind::Tuple(fl) => {
|
||||||
for (i, fd) in fl.fields().enumerate() {
|
for (i, fd) in fl.fields().enumerate() {
|
||||||
let attrs = expander.parse_attrs(&fd);
|
let attrs = expander.parse_attrs(&fd);
|
||||||
if !expander.check_cfg(&attrs) {
|
if !expander.is_cfg_enabled(&attrs) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -220,7 +220,7 @@ fn lower_struct(
|
||||||
ast::StructKind::Record(fl) => {
|
ast::StructKind::Record(fl) => {
|
||||||
for fd in fl.fields() {
|
for fd in fl.fields() {
|
||||||
let attrs = expander.parse_attrs(&fd);
|
let attrs = expander.parse_attrs(&fd);
|
||||||
if !expander.check_cfg(&attrs) {
|
if !expander.is_cfg_enabled(&attrs) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,7 +118,7 @@ impl Expander {
|
||||||
Attrs::new(owner, &self.hygiene)
|
Attrs::new(owner, &self.hygiene)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn check_cfg(&self, attrs: &Attrs) -> bool {
|
pub(crate) fn is_cfg_enabled(&self, attrs: &Attrs) -> bool {
|
||||||
attrs.is_cfg_enabled(&self.cfg_options)
|
attrs.is_cfg_enabled(&self.cfg_options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -306,8 +306,7 @@ impl ExprCollector<'_> {
|
||||||
.inspect(|field| field_ptrs.push(AstPtr::new(field)))
|
.inspect(|field| field_ptrs.push(AstPtr::new(field)))
|
||||||
.filter_map(|field| {
|
.filter_map(|field| {
|
||||||
let attrs = self.expander.parse_attrs(&field);
|
let attrs = self.expander.parse_attrs(&field);
|
||||||
|
if !self.expander.is_cfg_enabled(&attrs) {
|
||||||
if !self.expander.check_cfg(&attrs) {
|
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -337,7 +337,7 @@ fn collect_impl_items(
|
||||||
.filter_map(|item_node| match item_node {
|
.filter_map(|item_node| match item_node {
|
||||||
ast::ImplItem::FnDef(it) => {
|
ast::ImplItem::FnDef(it) => {
|
||||||
let attrs = expander.parse_attrs(&it);
|
let attrs = expander.parse_attrs(&it);
|
||||||
if !expander.check_cfg(&attrs) {
|
if !expander.is_cfg_enabled(&attrs) {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
let def = FunctionLoc {
|
let def = FunctionLoc {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue