Upgrade to rust toolchain 1.82.0 (#4245)
* Upgrade to rust toolchain 1.82.0 * Fix lint about variant being too large * Fix lint about Err variant being too large
This commit is contained in:
@ -12,7 +12,7 @@ fn basic() {
|
|||||||
let expected = Program {
|
let expected = Program {
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 11,
|
end: 11,
|
||||||
body: vec![BodyItem::VariableDeclaration(VariableDeclaration {
|
body: vec![BodyItem::VariableDeclaration(Box::new(VariableDeclaration {
|
||||||
start: 0,
|
start: 0,
|
||||||
end: 11,
|
end: 11,
|
||||||
declarations: vec![VariableDeclarator {
|
declarations: vec![VariableDeclarator {
|
||||||
@ -36,7 +36,7 @@ fn basic() {
|
|||||||
visibility: ItemVisibility::Default,
|
visibility: ItemVisibility::Default,
|
||||||
kind: VariableKind::Const,
|
kind: VariableKind::Const,
|
||||||
digest: None,
|
digest: None,
|
||||||
})],
|
}))],
|
||||||
non_code_meta: NonCodeMeta::default(),
|
non_code_meta: NonCodeMeta::default(),
|
||||||
digest: None,
|
digest: None,
|
||||||
};
|
};
|
||||||
|
@ -454,7 +454,7 @@ pub(crate) use impl_value_meta;
|
|||||||
pub enum BodyItem {
|
pub enum BodyItem {
|
||||||
ImportStatement(Box<ImportStatement>),
|
ImportStatement(Box<ImportStatement>),
|
||||||
ExpressionStatement(ExpressionStatement),
|
ExpressionStatement(ExpressionStatement),
|
||||||
VariableDeclaration(VariableDeclaration),
|
VariableDeclaration(Box<VariableDeclaration>),
|
||||||
ReturnStatement(ReturnStatement),
|
ReturnStatement(ReturnStatement),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2719,7 +2719,7 @@ pub struct FunctionExpression {
|
|||||||
impl_value_meta!(FunctionExpression);
|
impl_value_meta!(FunctionExpression);
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone)]
|
#[derive(Debug, PartialEq, Clone)]
|
||||||
pub struct RequiredParamAfterOptionalParam(pub Parameter);
|
pub struct RequiredParamAfterOptionalParam(pub Box<Parameter>);
|
||||||
|
|
||||||
impl std::fmt::Display for RequiredParamAfterOptionalParam {
|
impl std::fmt::Display for RequiredParamAfterOptionalParam {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
@ -2751,7 +2751,7 @@ impl FunctionExpression {
|
|||||||
if param.optional {
|
if param.optional {
|
||||||
found_optional = true;
|
found_optional = true;
|
||||||
} else if found_optional {
|
} else if found_optional {
|
||||||
return Err(RequiredParamAfterOptionalParam(param.clone()));
|
return Err(RequiredParamAfterOptionalParam(Box::new(param.clone())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let boundary = self.params.partition_point(|param| !param.optional);
|
let boundary = self.params.partition_point(|param| !param.optional);
|
||||||
|
@ -1342,7 +1342,7 @@ fn declaration_keyword(i: TokenSlice) -> PResult<(VariableKind, Token)> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Parse a variable/constant declaration.
|
/// Parse a variable/constant declaration.
|
||||||
fn declaration(i: TokenSlice) -> PResult<VariableDeclaration> {
|
fn declaration(i: TokenSlice) -> PResult<Box<VariableDeclaration>> {
|
||||||
let (visibility, visibility_token) = opt(terminated(item_visibility, whitespace))
|
let (visibility, visibility_token) = opt(terminated(item_visibility, whitespace))
|
||||||
.parse_next(i)?
|
.parse_next(i)?
|
||||||
.map_or((ItemVisibility::Default, None), |pair| (pair.0, Some(pair.1)));
|
.map_or((ItemVisibility::Default, None), |pair| (pair.0, Some(pair.1)));
|
||||||
@ -1404,7 +1404,7 @@ fn declaration(i: TokenSlice) -> PResult<VariableDeclaration> {
|
|||||||
.map_err(|e| e.cut())?;
|
.map_err(|e| e.cut())?;
|
||||||
|
|
||||||
let end = val.end();
|
let end = val.end();
|
||||||
Ok(VariableDeclaration {
|
Ok(Box::new(VariableDeclaration {
|
||||||
start,
|
start,
|
||||||
end,
|
end,
|
||||||
declarations: vec![VariableDeclarator {
|
declarations: vec![VariableDeclarator {
|
||||||
@ -1417,7 +1417,7 @@ fn declaration(i: TokenSlice) -> PResult<VariableDeclaration> {
|
|||||||
visibility,
|
visibility,
|
||||||
kind,
|
kind,
|
||||||
digest: None,
|
digest: None,
|
||||||
})
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TryFrom<Token> for Identifier {
|
impl TryFrom<Token> for Identifier {
|
||||||
|
@ -290,7 +290,7 @@ where
|
|||||||
walk_value(&xs.expression, f)
|
walk_value(&xs.expression, f)
|
||||||
}
|
}
|
||||||
BodyItem::VariableDeclaration(vd) => {
|
BodyItem::VariableDeclaration(vd) => {
|
||||||
if !f.walk(vd.into())? {
|
if !f.walk(vd.as_ref().into())? {
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
for dec in &vd.declarations {
|
for dec in &vd.declarations {
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.81.0"
|
channel = "1.82.0"
|
||||||
components = ["clippy", "rustfmt"]
|
components = ["clippy", "rustfmt"]
|
||||||
|
Reference in New Issue
Block a user