diff --git a/.github/workflows/nightly.yaml b/.github/workflows/nightly.yaml index 2ff8d9a0a039..d8b27de7b134 100644 --- a/.github/workflows/nightly.yaml +++ b/.github/workflows/nightly.yaml @@ -83,7 +83,7 @@ jobs: steps: - name: 📂 Checkout code uses: actions/checkout@v4 - - run: rustup override set nightly-2024-06-30 + - run: rustup override set nightly-2025-01-12 - uses: baptiste0928/cargo-install@v3 with: crate: cargo-udeps diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4340d073e86b..8fb46bb51cbb 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -537,7 +537,7 @@ jobs: steps: - name: 📂 Checkout code uses: actions/checkout@v4 - - run: rustup override set nightly-2024-06-30 + - run: rustup override set nightly-2025-01-12 - uses: baptiste0928/cargo-install@v3 with: crate: cargo-hack diff --git a/prqlc/prqlc-parser/src/parser/mod.rs b/prqlc/prqlc-parser/src/parser/mod.rs index ef572c640958..f28ebff71fed 100644 --- a/prqlc/prqlc-parser/src/parser/mod.rs +++ b/prqlc/prqlc-parser/src/parser/mod.rs @@ -198,13 +198,15 @@ mod tests { "#); } + #[cfg(test)] + impl SupportsDocComment for String { + fn with_doc_comment(self, _doc_comment: Option) -> Self { + self + } + } + #[test] fn test_no_doc_comment_in_with_doc_comment() { - impl SupportsDocComment for String { - fn with_doc_comment(self, _doc_comment: Option) -> Self { - self - } - } assert_debug_snapshot!(parse_with_parser(r#"hello"#, with_doc_comment(new_line().ignore_then(ident_part()))).unwrap(), @r#""hello""#); } } diff --git a/prqlc/prqlc-parser/src/span.rs b/prqlc/prqlc-parser/src/span.rs index 6d75819303e3..7dcce0c92180 100644 --- a/prqlc/prqlc-parser/src/span.rs +++ b/prqlc/prqlc-parser/src/span.rs @@ -57,7 +57,7 @@ impl<'de> Deserialize<'de> for Span { { struct SpanVisitor {} - impl<'de> Visitor<'de> for SpanVisitor { + impl Visitor<'_> for SpanVisitor { type Value = Span; fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/prqlc/prqlc/src/codegen/mod.rs b/prqlc/prqlc/src/codegen/mod.rs index 3ca401ed70f6..b69d349498a5 100644 --- a/prqlc/prqlc/src/codegen/mod.rs +++ b/prqlc/prqlc/src/codegen/mod.rs @@ -149,7 +149,7 @@ struct SeparatedExprs<'a, T: WriteSource> { line_end: &'static str, } -impl<'a, T: WriteSource> WriteSource for SeparatedExprs<'a, T> { +impl WriteSource for SeparatedExprs<'_, T> { fn write(&self, mut opt: WriteOpt) -> Option { // try inline if let Some(inline) = self.write_inline(opt.clone()) { @@ -180,7 +180,7 @@ impl<'a, T: WriteSource> WriteSource for SeparatedExprs<'a, T> { } } -impl<'a, T: WriteSource> SeparatedExprs<'a, T> { +impl SeparatedExprs<'_, T> { fn write_inline(&self, mut opt: WriteOpt) -> Option { let mut exprs = Vec::new(); for expr in self.exprs { diff --git a/prqlc/prqlc/src/error_message.rs b/prqlc/prqlc/src/error_message.rs index 8671304bcd7b..7f519b2068b6 100644 --- a/prqlc/prqlc/src/error_message.rs +++ b/prqlc/prqlc/src/error_message.rs @@ -220,7 +220,7 @@ impl<'a> FileTreeCache<'a> { } } -impl<'a> Cache for FileTreeCache<'a> { +impl Cache for FileTreeCache<'_> { type Storage = String; fn fetch(&mut self, id: &PathBuf) -> Result<&Source, Box> { let file_contents = match self.file_tree.sources.get(id) { diff --git a/prqlc/prqlc/src/ir/decl.rs b/prqlc/prqlc/src/ir/decl.rs index fc6c940862fe..a859af7881f8 100644 --- a/prqlc/prqlc/src/ir/decl.rs +++ b/prqlc/prqlc/src/ir/decl.rs @@ -148,7 +148,7 @@ impl std::fmt::Debug for Module { struct DebugNames<'a>(&'a HashMap); -impl<'a> std::fmt::Debug for DebugNames<'a> { +impl std::fmt::Debug for DebugNames<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { let mut dm = f.debug_map(); for (n, decl) in self.0.iter().sorted_by_key(|x| x.0) { diff --git a/prqlc/prqlc/src/semantic/reporting.rs b/prqlc/prqlc/src/semantic/reporting.rs index 472bb883c179..039e2145afe1 100644 --- a/prqlc/prqlc/src/semantic/reporting.rs +++ b/prqlc/prqlc/src/semantic/reporting.rs @@ -41,7 +41,7 @@ struct Labeler<'a> { report: &'a mut ReportBuilder<'static, (String, Range)>, } -impl<'a> Labeler<'a> { +impl Labeler<'_> { fn label_module(&mut self, module: &Module) { for (_, decl) in module.names.iter() { if let DeclKind::TableDecl(TableDecl { @@ -67,7 +67,7 @@ impl<'a> Labeler<'a> { } } -impl<'a> pl::PlFold for Labeler<'a> { +impl pl::PlFold for Labeler<'_> { fn fold_expr(&mut self, node: pl::Expr) -> Result { if let Some(ident) = node.kind.as_ident() { if let Some(span) = node.span { diff --git a/prqlc/prqlc/src/sql/pq/anchor.rs b/prqlc/prqlc/src/sql/pq/anchor.rs index 29537046d085..cb6bc559f51a 100644 --- a/prqlc/prqlc/src/sql/pq/anchor.rs +++ b/prqlc/prqlc/src/sql/pq/anchor.rs @@ -649,7 +649,7 @@ impl<'a> CidRedirector<'a> { } } -impl<'a> RqFold for CidRedirector<'a> { +impl RqFold for CidRedirector<'_> { fn fold_cid(&mut self, cid: CId) -> Result { Ok(self.cid_redirects.get(&cid).cloned().unwrap_or(cid)) } @@ -666,7 +666,7 @@ impl<'a> RqFold for CidRedirector<'a> { } } -impl<'a> PqMapper for CidRedirector<'a> { +impl PqMapper for CidRedirector<'_> { fn fold_rel(&mut self, rel: RIId) -> Result { Ok(rel) } diff --git a/prqlc/prqlc/src/sql/pq/context.rs b/prqlc/prqlc/src/sql/pq/context.rs index 9089bb668553..0c1c28418e7c 100644 --- a/prqlc/prqlc/src/sql/pq/context.rs +++ b/prqlc/prqlc/src/sql/pq/context.rs @@ -135,8 +135,8 @@ impl AnchorContext { QueryLoader::load(context, query) } - /// Generates a new ID and name for a wildcard column and registers it in the - /// AnchorContext's column_decls HashMap. + // /// Generates a new ID and name for a wildcard column and registers it in the + // /// AnchorContext's column_decls HashMap. // pub fn register_wildcard(&mut self, riid: RIId) -> CId { // let id = self.cid.gen(); // let kind = ColumnDecl::RelationColumn(riid, id, RelationColumn::Wildcard); @@ -240,7 +240,7 @@ impl AnchorContext { } } - /// Returns a set of all columns of all tables in a pipeline + // /// Returns a set of all columns of all tables in a pipeline // pub(super) fn collect_pipeline_inputs( // &self, // pipeline: &[SqlTransform], diff --git a/prqlc/prqlc/src/sql/pq/gen_query.rs b/prqlc/prqlc/src/sql/pq/gen_query.rs index c79fb621cade..bf7a94c503f7 100644 --- a/prqlc/prqlc/src/sql/pq/gen_query.rs +++ b/prqlc/prqlc/src/sql/pq/gen_query.rs @@ -125,9 +125,9 @@ struct TransformCompiler<'a> { ctx: &'a mut Context, } -impl<'a> RqFold for TransformCompiler<'a> {} +impl RqFold for TransformCompiler<'_> {} -impl<'a> PqMapper for TransformCompiler<'a> { +impl PqMapper for TransformCompiler<'_> { fn fold_rel(&mut self, rel: RIId) -> Result { compile_relation_instance(rel, self.ctx) } diff --git a/prqlc/prqlc/src/sql/pq/postprocess.rs b/prqlc/prqlc/src/sql/pq/postprocess.rs index 42a033f42818..fd617e2c073c 100644 --- a/prqlc/prqlc/src/sql/pq/postprocess.rs +++ b/prqlc/prqlc/src/sql/pq/postprocess.rs @@ -44,9 +44,9 @@ struct CteSorting { has_been_used: bool, } -impl<'a> RqFold for SortingInference<'a> {} +impl RqFold for SortingInference<'_> {} -impl<'a> PqFold for SortingInference<'a> { +impl PqFold for SortingInference<'_> { fn fold_sql_query(&mut self, query: SqlQuery) -> Result { let mut ctes = Vec::with_capacity(query.ctes.len()); for cte in query.ctes { @@ -102,7 +102,7 @@ impl<'a> PqFold for SortingInference<'a> { } } -impl<'a> PqMapper for SortingInference<'a> { +impl PqMapper for SortingInference<'_> { fn fold_rel(&mut self, rel: RelationExpr) -> Result { Ok(rel) } @@ -200,9 +200,9 @@ struct RelVarNameAssigner<'a> { ctx: &'a mut Context, } -impl<'a> RqFold for RelVarNameAssigner<'a> {} +impl RqFold for RelVarNameAssigner<'_> {} -impl<'a> PqFold for RelVarNameAssigner<'a> { +impl PqFold for RelVarNameAssigner<'_> { fn fold_sql_relation(&mut self, relation: SqlRelation) -> Result { // only fold AtomicPipelines Ok(match relation { @@ -221,7 +221,7 @@ impl<'a> PqFold for RelVarNameAssigner<'a> { } } -impl<'a> PqMapper for RelVarNameAssigner<'a> { +impl PqMapper for RelVarNameAssigner<'_> { fn fold_rel(&mut self, mut rel: RelationExpr) -> Result { // normal fold rel.kind = match rel.kind { diff --git a/rust-toolchain.toml b/rust-toolchain.toml index e9730c1a452c..5d865004fbe6 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,6 +1,6 @@ [toolchain] # Generally run 1 behind latest -channel = "1.82.0" +channel = "1.83.0" components = ["rustfmt", "clippy"] # We want two targets: wasm32, and the default target for the platform, which we # don't list here. (i.e. we use each platform to test each platform)