Skip to content

Commit 76ef9d5

Browse files
authored
fix: rust 1.89 compatibility (#5560)
1 parent 3510e8c commit 76ef9d5

File tree

8 files changed

+21
-20
lines changed

8 files changed

+21
-20
lines changed

libflux/flux-core/src/ast/walk/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl<'a> Node<'a> {
211211
}
212212
}
213213
#[allow(missing_docs)]
214-
pub fn from_stmt(stmt: &Statement) -> Node {
214+
pub fn from_stmt(stmt: &Statement) -> Node<'_> {
215215
match stmt {
216216
Statement::Expr(s) => Node::ExprStmt(s),
217217
Statement::Variable(s) => Node::VariableAssgn(s),
@@ -222,25 +222,25 @@ impl<'a> Node<'a> {
222222
Statement::Builtin(s) => Node::BuiltinStmt(s),
223223
}
224224
}
225-
fn from_function_body(fb: &FunctionBody) -> Node {
225+
fn from_function_body(fb: &FunctionBody) -> Node<'_> {
226226
match fb {
227227
FunctionBody::Block(b) => Node::Block(b),
228228
FunctionBody::Expr(e) => Node::from_expr(e),
229229
}
230230
}
231-
fn from_property_key(pk: &PropertyKey) -> Node {
231+
fn from_property_key(pk: &PropertyKey) -> Node<'_> {
232232
match pk {
233233
PropertyKey::Identifier(i) => Node::Identifier(i),
234234
PropertyKey::StringLit(s) => Node::StringLit(s),
235235
}
236236
}
237-
fn from_string_expr_part(sp: &StringExprPart) -> Node {
237+
fn from_string_expr_part(sp: &StringExprPart) -> Node<'_> {
238238
match sp {
239239
StringExprPart::Text(t) => Node::TextPart(t),
240240
StringExprPart::Interpolated(e) => Node::InterpolatedPart(e),
241241
}
242242
}
243-
fn from_assignment(a: &Assignment) -> Node {
243+
fn from_assignment(a: &Assignment) -> Node<'_> {
244244
match a {
245245
Assignment::Variable(v) => Node::VariableAssgn(v),
246246
Assignment::Member(m) => Node::MemberAssgn(m),

libflux/flux-core/src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ impl<T> Errors<T> {
5959
self.errors.pop()
6060
}
6161

62-
pub fn iter(&self) -> slice::Iter<T> {
62+
pub fn iter(&self) -> slice::Iter<'_, T> {
6363
self.errors.iter()
6464
}
6565

66-
pub fn iter_mut(&mut self) -> slice::IterMut<T> {
66+
pub fn iter_mut(&mut self) -> slice::IterMut<'_, T> {
6767
self.errors.iter_mut()
6868
}
6969

libflux/flux-core/src/formatter/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,15 +1949,15 @@ struct Operator<'a> {
19491949
}
19501950

19511951
impl<'a> Operator<'a> {
1952-
fn new(op: &ast::Operator) -> Operator {
1952+
fn new(op: &ast::Operator) -> Operator<'_> {
19531953
Operator {
19541954
op: Some(op),
19551955
l_op: None,
19561956
is_logical: false,
19571957
}
19581958
}
19591959

1960-
fn new_logical(op: &ast::LogicalOperator) -> Operator {
1960+
fn new_logical(op: &ast::LogicalOperator) -> Operator<'_> {
19611961
Operator {
19621962
op: None,
19631963
l_op: Some(op),

libflux/flux-core/src/map.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ where
8282
self.0.remove(key)
8383
}
8484

85-
pub fn entry(&mut self, key: K) -> std::collections::hash_map::Entry<K, V> {
85+
pub fn entry(&mut self, key: K) -> std::collections::hash_map::Entry<'_, K, V> {
8686
self.0.entry(key)
8787
}
8888

libflux/flux-core/src/semantic/bootstrap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pub fn parse_dir(dir: &Path) -> io::Result<Vec<String>> {
108108
Ok(package_names)
109109
}
110110

111-
fn stdlib_importer(path: &Path) -> FileSystemImporter<StdFS> {
111+
fn stdlib_importer(path: &Path) -> FileSystemImporter<StdFS<'_>> {
112112
let fs = StdFS::new(path);
113113
FileSystemImporter::new(fs)
114114
}
@@ -194,7 +194,7 @@ fn add_record_to_map(
194194

195195
/// Stdlib returns the prelude and importer for the Flux standard library given a path to a
196196
/// compiled directory structure.
197-
pub fn stdlib(dir: &Path) -> Result<(PackageExports, FileSystemImporter<StdFS>)> {
197+
pub fn stdlib(dir: &Path) -> Result<(PackageExports, FileSystemImporter<StdFS<'_>>)> {
198198
let mut stdlib_importer = stdlib_importer(dir);
199199
let prelude = prelude_from_importer(&mut stdlib_importer)?;
200200
Ok((prelude, stdlib_importer))

libflux/flux-core/src/semantic/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ fn check_labels(pkg: &nodes::Package, config: &AnalyzerConfig) -> Result<()> {
124124
/// Note that options can only appear at file scope since the structure of the semantic
125125
/// graph only allows expression statements, assignments and return statements inside function bodies.
126126
/// As a convenience to later checks, it returns a map of all the option statements in the package.
127-
fn check_option_stmts(pkg: &nodes::Package) -> Result<OptionMap> {
127+
fn check_option_stmts(pkg: &nodes::Package) -> Result<OptionMap<'_>> {
128128
let mut opt_stmts = vec![];
129129
for f in &pkg.files {
130130
for st in &f.body {

libflux/flux-core/src/semantic/infer.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ impl From<Constraint> for Constraints {
100100
}
101101
}
102102

103+
#[cfg_attr(feature = "strict", allow(dead_code, missing_docs))]
103104
#[derive(Debug, Display, Eq, PartialEq)]
104105
#[display(fmt = "type error {}: {}", loc, err)]
105106
pub struct Error {

libflux/go/libflux/buildinfo.gen.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ var sourceHashes = map[string]string{
1818
"libflux/flux-core/Cargo.toml": "6900c5330cd237b71f112893f989a392ab484baf6f0aa88dfe1e38a8878c17c5",
1919
"libflux/flux-core/src/ast/check/mod.rs": "4a6511e9ccc9718eada01b29544bd4d5c324ae87a85906c25ad7193a890f86fc",
2020
"libflux/flux-core/src/ast/mod.rs": "00fac7d9da0dfb0475a994b208b9e3d97ad2199a8dcc5bac941e2376c94b5f6b",
21-
"libflux/flux-core/src/ast/walk/mod.rs": "05f4e42e347a5c7cc7ee6ec8dc360cea637b58037e5a198c6051ee22da9ae9e2",
21+
"libflux/flux-core/src/ast/walk/mod.rs": "4b134ff5e48cb1187c4a463985c333f486aa0416a45ccb2a624ba9d6ff1751b6",
2222
"libflux/flux-core/src/bin/README.md": "c1245a4938c923d065647b4dc4f7e19486e85c93d868ef2f7f47ddff62ec81df",
2323
"libflux/flux-core/src/bin/analyze_query_log.rs": "39e671b867268e1d8c244325205d7b2493aba337033f1112b1fb59555778fe9d",
2424
"libflux/flux-core/src/bin/fluxdoc.rs": "1f06347f18eace128124b3bcde236584575060b2c5c1e67ae2617db6caf1a5dc",
2525
"libflux/flux-core/src/db.rs": "7e9f2d2a732dd3336d24ff9a58deca9f7e91df93ca310826ea376bb3aaead2cb",
2626
"libflux/flux-core/src/doc/example.rs": "29008d7fbf26e612107827551d6fb41f725b5973fbd617e0f04b087eff596fd2",
2727
"libflux/flux-core/src/doc/mod.rs": "64941b878e1dda70be8b1b03e0bb850ea644755e8045b0b6f648c8af9b2f4dc6",
28-
"libflux/flux-core/src/errors.rs": "05f6c3b6db7a4d479e8e5bfa12cecefddcc6657ce40b8979f548c8ccc4149f8b",
29-
"libflux/flux-core/src/formatter/mod.rs": "6aaf87b945bbbfd8acc7a680aae6d3f4c84f8964a9ed6cb50b99122bb240fd45",
28+
"libflux/flux-core/src/errors.rs": "241dc196cb17b7a49f40545d6767bbb2a9486b08dc9579542d028bec81502069",
29+
"libflux/flux-core/src/formatter/mod.rs": "9a179a005b300e17436c2e3b1a5928a9ced149a65dcab05eb727ebd558caa6ac",
3030
"libflux/flux-core/src/lib.rs": "487c5b2db051f7ed5276c566a9a6b2ee75d6a13459443cf94b51b6d90d20edd2",
31-
"libflux/flux-core/src/map.rs": "342c1cc111d343f01b97f38be10a9f1097bdd57cdc56f55e92fd3ed5028e6973",
31+
"libflux/flux-core/src/map.rs": "7e5d73b41054eb94a676370a066f918b3abc6b42409b766bb7281688d24c4419",
3232
"libflux/flux-core/src/parser/mod.rs": "78f0decd163926b323d0b657c5f1d59a328842573aa0e4e291d594ea1e2e7fb4",
3333
"libflux/flux-core/src/parser/strconv.rs": "005ecd7a1a227d280dfd0bf065b7f9c49f68952daf7efe1c9bc3bfd91a30a909",
3434
"libflux/flux-core/src/scanner/mod.rs": "eb7afb2eff162080046ddda7d1e9d01ffd4ec3a165bbcc95a001bf7edefa5e9c",
@@ -37,8 +37,8 @@ var sourceHashes = map[string]string{
3737
"libflux/flux-core/src/scanner/token.rs": "4269721a053e8456e9a7983a72190ed86cd671d016e1d187d6772e1720f932e1",
3838
"libflux/flux-core/src/scanner/unicode.rl": "f923f3b385ddfa65c74427b11971785fc25ea806ca03d547045de808e16ef9a1",
3939
"libflux/flux-core/src/scanner/unicode.rl.COPYING": "6cf2d5d26d52772ded8a5f0813f49f83dfa76006c5f398713be3854fe7bc4c7e",
40-
"libflux/flux-core/src/semantic/bootstrap.rs": "593505d952f49a15afc19763f68d0bb619428de014bd4e0c0e81f394a4dcd0cc",
41-
"libflux/flux-core/src/semantic/check.rs": "4fb5164785b6e7e6a26bb91a46f8045e90da0251e8f60842146aee8971eb3491",
40+
"libflux/flux-core/src/semantic/bootstrap.rs": "24733ab31bf1677507bdbe371ef9c194d80e2bad7ccecf5c9c064bafe413a6b3",
41+
"libflux/flux-core/src/semantic/check.rs": "bbe290ca4bdd9bf2a79c905e30ed8e7cacc1e86e42bf2ca9f2d84bbbdcbde302",
4242
"libflux/flux-core/src/semantic/convert.rs": "6801a6f21107d8fa1f7125966451b4dde008732a5f29a319c943d9bd026ba47f",
4343
"libflux/flux-core/src/semantic/env.rs": "0d6295a88dae8eaaed12ee20a8d218616683e8d45a776966e0cab02be2760fd0",
4444
"libflux/flux-core/src/semantic/flatbuffers/mod.rs": "49ff0c257a8382a09d9716ab32b1ce9a2374bc2bbd2067f0886f114a87357d20",
@@ -48,7 +48,7 @@ var sourceHashes = map[string]string{
4848
"libflux/flux-core/src/semantic/fresh.rs": "18cb879ece9052682c9dda8117c23acd1f63c0325feaa1aef9a53db4f17d2d69",
4949
"libflux/flux-core/src/semantic/fs.rs": "ae886648b20fc1e50d3c75418a9d62bb5102e93958e1bbdbf008066be4eb3909",
5050
"libflux/flux-core/src/semantic/import.rs": "4bfa02fc96b4de3d913dbec622f0907307b4a15fe9dd4283d9cb86c6f0d18655",
51-
"libflux/flux-core/src/semantic/infer.rs": "b6d18c94b58da27aebb5828f6471768ccc52e679a1356c6a38d0f3cd01a06dce",
51+
"libflux/flux-core/src/semantic/infer.rs": "e222a2bd9b3d3bf66f5c91b0e97ab05396af4e5b5c0512141e97925d00452ffe",
5252
"libflux/flux-core/src/semantic/mod.rs": "c152ca3a24b73b80238316b003ec6acfb098bd4b60fecae308a38586a0bfbfe3",
5353
"libflux/flux-core/src/semantic/nodes.rs": "848ffb45a24f9c01e0de002a3090cbd42417e3f411d3abd5bee18e22d46042b6",
5454
"libflux/flux-core/src/semantic/sub.rs": "d78826dad39aa9128ec5d7dae23b7672b88ceb6af625b3e4865bb482d3f84903",

0 commit comments

Comments
 (0)