Skip to content
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

chore: update to rust 1.82 #5509

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
1 change: 1 addition & 0 deletions libflux/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[workspace]
members = ["flux-core", "flux"]
resolver = "2"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apparently workspaces w/ edition 2021 crates default to the v2 resolver, this just makes it explicit and silences a cargo warning


# https://rustwasm.github.io/docs/book/reference/code-size.html#optimizing-builds-for-code-size
[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion libflux/flux-core/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ impl PropertyKey {
// FunctionBodyExpression = Block | Expression .
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
#[serde(untagged)]
#[allow(missing_docs)]
#[allow(missing_docs, clippy::large_enum_variant)]
pub enum FunctionBody {
Block(Block),
Expr(Expression),
Expand Down
4 changes: 2 additions & 2 deletions libflux/flux-core/src/bin/fluxdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fn dump(
fn lint(flux_cmd_path: Option<&Path>, dir: &Path, limit: Option<i64>) -> Result<()> {
let flux_cmd_path = resolve_default_paths(flux_cmd_path);
let limit = match limit {
Some(limit) if limit == 0 => i64::MAX,
Some(0) => i64::MAX,
Some(limit) => limit,
None => 10,
};
Expand Down Expand Up @@ -217,7 +217,7 @@ fn consume_sequentially<T>(

impl<T> PartialOrd for Element<T> {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
other.0.partial_cmp(&self.0)
Some(self.cmp(other))
}
}

Expand Down
17 changes: 8 additions & 9 deletions libflux/flux-core/src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,7 @@ impl<'input> Parser<'input> {
// It returns Result::Ok(po) containing the postfix operator created.
// If it fails to find a postix operator, it returns Result::Err(expr) containing the original
// expression passed. This allows for further reuse of the given `expr`.
#[allow(clippy::result_large_err)]
fn parse_postfix_operator(&mut self, expr: Expression) -> Result<Expression, Expression> {
let t = self.peek();
match t.tok {
Expand Down Expand Up @@ -2010,10 +2011,10 @@ impl<'input> Parser<'input> {
}
_ => {
let t = t.clone();
let mut expr = self.parse_expression_while_more(None, &[]);
match expr {
None => {
expr = Some(Expression::Bad(Box::new(BadExpr {
let expr = self
.parse_expression_while_more(None, &[])
.unwrap_or_else(|| {
Expression::Bad(Box::new(BadExpr {
// Do not use `self.base_node_*` in order not to steal errors.
// The BadExpr is an error per se. We want to leave errors to parents.
base: BaseNode {
Expand All @@ -2025,15 +2026,13 @@ impl<'input> Parser<'input> {
},
text: t.lit,
expression: None,
})));
}
Some(_) => (),
};
}))
});
let rparen = self.close(TokenType::RParen);
Expression::Paren(Box::new(ParenExpr {
base: self.base_node_from_tokens(&lparen, &rparen),
lparen: lparen.comments,
expression: expr.expect("must be Some at this point"),
expression: expr,
rparen: rparen.comments,
}))
}
Expand Down
2 changes: 1 addition & 1 deletion libflux/flux-core/src/semantic/sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ where
self.clone_types = i;
self.next = Some(typ);
} else {
self.clone_types = usize::max_value();
self.clone_types = usize::MAX;
}
self.next()
}
Expand Down
53 changes: 22 additions & 31 deletions libflux/flux-core/src/semantic/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,38 +173,32 @@ fn infer_types(
/// # Example
///
/// ```
/// #[test]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests within doctests were never supported and Rust now complains about that

/// fn instantiation() {
/// test_infer! {
/// env: map![
/// "f" => "where A: Addable (a: A, b: A) => A",
/// ],
/// src: "x = f",
/// exp: map![
/// "x" => "where A: Addable (a: A, b: A) => A",
/// ],
/// }
/// test_infer! {
/// env: map![
/// "f" => "where A: Addable (a: A, b: A) => A",
/// ],
/// src: "x = f",
/// exp: map![
/// "x" => "where A: Addable (a: A, b: A) => A",
/// ],
/// }
/// ```
///
/// ```
/// #[test]
/// fn with_imports() {
/// test_infer! {
/// imp: map![
/// "path/to/foo" => package![
/// "f" => "(x: A) => A",
/// ],
/// ],
/// src: r#"
/// import foo "path/to/foo"
///
/// f = foo.f
/// "#,
/// exp: map![
/// test_infer! {
/// imp: map![
/// "path/to/foo" => package![
/// "f" => "(x: A) => A",
/// ],
/// }
/// ],
/// src: r#"
/// import foo "path/to/foo"
///
/// f = foo.f
/// "#,
/// exp: map![
/// "f" => "(x: A) => A",
/// ],
/// }
/// ```
///
Expand Down Expand Up @@ -243,11 +237,8 @@ macro_rules! test_infer {
/// # Example
///
/// ```
/// #[test]
/// fn undeclared_variable() {
/// test_infer_err! {
/// src: "x = f",
/// }
/// test_infer_err! {
/// src: "x = f",
/// }
/// ```
///
Expand Down
10 changes: 5 additions & 5 deletions libflux/go/libflux/buildinfo.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ package libflux
//lint:ignore U1000 generated code
var sourceHashes = map[string]string{
"libflux/Cargo.lock": "58302d93174bb2def223a5439ddbc596476216bf511a11f0ff2fc23865fc1d0a",
"libflux/Cargo.toml": "91ac4e8b467440c6e8a9438011de0e7b78c2732403bb067d4dd31539ac8a90c1",
"libflux/Cargo.toml": "5fb7dd63ac209ddff2761e189adae7d86f1f3302b15a6a114508872dc92d7f5e",
"libflux/flux-core/Cargo.toml": "971f23ba5dd621df72be85c61135abf1583b0bcc18e2cf51eb0d9107d61639db",
"libflux/flux-core/src/ast/check/mod.rs": "4a6511e9ccc9718eada01b29544bd4d5c324ae87a85906c25ad7193a890f86fc",
"libflux/flux-core/src/ast/mod.rs": "00fac7d9da0dfb0475a994b208b9e3d97ad2199a8dcc5bac941e2376c94b5f6b",
"libflux/flux-core/src/ast/mod.rs": "5e995891f9cb49d402d3031cda6a67041e12df942070607ec1e97a11ff959c6e",
"libflux/flux-core/src/ast/walk/mod.rs": "b0069cedffd1a20c77c4fe12465a8350a50a8916d0f29798ab47212fdd0b0692",
"libflux/flux-core/src/bin/README.md": "c1245a4938c923d065647b4dc4f7e19486e85c93d868ef2f7f47ddff62ec81df",
"libflux/flux-core/src/bin/analyze_query_log.rs": "39e671b867268e1d8c244325205d7b2493aba337033f1112b1fb59555778fe9d",
"libflux/flux-core/src/bin/fluxdoc.rs": "1f06347f18eace128124b3bcde236584575060b2c5c1e67ae2617db6caf1a5dc",
"libflux/flux-core/src/bin/fluxdoc.rs": "58431044721fbc9783b6ab94d58c494eca5b84be906499eb1a4ab10e8e9958e7",
"libflux/flux-core/src/db.rs": "7e9f2d2a732dd3336d24ff9a58deca9f7e91df93ca310826ea376bb3aaead2cb",
"libflux/flux-core/src/doc/example.rs": "29008d7fbf26e612107827551d6fb41f725b5973fbd617e0f04b087eff596fd2",
"libflux/flux-core/src/doc/mod.rs": "64941b878e1dda70be8b1b03e0bb850ea644755e8045b0b6f648c8af9b2f4dc6",
"libflux/flux-core/src/errors.rs": "05f6c3b6db7a4d479e8e5bfa12cecefddcc6657ce40b8979f548c8ccc4149f8b",
"libflux/flux-core/src/formatter/mod.rs": "6aaf87b945bbbfd8acc7a680aae6d3f4c84f8964a9ed6cb50b99122bb240fd45",
"libflux/flux-core/src/lib.rs": "487c5b2db051f7ed5276c566a9a6b2ee75d6a13459443cf94b51b6d90d20edd2",
"libflux/flux-core/src/map.rs": "342c1cc111d343f01b97f38be10a9f1097bdd57cdc56f55e92fd3ed5028e6973",
"libflux/flux-core/src/parser/mod.rs": "abc9f7fe02d4252c4046bf1f680916f328b5f04a73509413ef37b55a0daa1420",
"libflux/flux-core/src/parser/mod.rs": "2e72162206ecf003797f7b4dfd926bfc104e5de1a26205fd03a78535b85dea74",
"libflux/flux-core/src/parser/strconv.rs": "005ecd7a1a227d280dfd0bf065b7f9c49f68952daf7efe1c9bc3bfd91a30a909",
"libflux/flux-core/src/scanner/mod.rs": "eb7afb2eff162080046ddda7d1e9d01ffd4ec3a165bbcc95a001bf7edefa5e9c",
"libflux/flux-core/src/scanner/scanner.rl": "34e1f306994b8f69d0551110ce22efa75e0081b7c5f498ad293a739970bbcbc2",
Expand All @@ -51,7 +51,7 @@ var sourceHashes = map[string]string{
"libflux/flux-core/src/semantic/infer.rs": "b6d18c94b58da27aebb5828f6471768ccc52e679a1356c6a38d0f3cd01a06dce",
"libflux/flux-core/src/semantic/mod.rs": "c152ca3a24b73b80238316b003ec6acfb098bd4b60fecae308a38586a0bfbfe3",
"libflux/flux-core/src/semantic/nodes.rs": "848ffb45a24f9c01e0de002a3090cbd42417e3f411d3abd5bee18e22d46042b6",
"libflux/flux-core/src/semantic/sub.rs": "d78826dad39aa9128ec5d7dae23b7672b88ceb6af625b3e4865bb482d3f84903",
"libflux/flux-core/src/semantic/sub.rs": "91fab302cda581be657231084ad5b71ec0eaeb838ab26bf7e8f9b4691cf351b5",
"libflux/flux-core/src/semantic/symbols.rs": "f061d57fe4ef7f23d0adad80d43fe1c8ae92d5e25a0da4b81e21b8087e30d253",
"libflux/flux-core/src/semantic/types.rs": "d36ddbd121d669c176afe7b9eeef4b75a774fdfcf1a5e9593901b6618bc2981f",
"libflux/flux-core/src/semantic/vectorize.rs": "ec4a374bbf406b981b861d5b17d8ccfcbcd22c7f345132fe2335541dacb228e9",
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "1.72"
channel = "1.82"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bumped hoping that this fixes the build issues on windows

components = ["rustfmt", "clippy"]
targets = [
"wasm32-unknown-unknown",
Expand Down