From 883351e1d707a4e1021d9ce4bfe878dc0d038c2a Mon Sep 17 00:00:00 2001 From: xFrednet Date: Fri, 14 Jul 2023 00:31:40 +0200 Subject: [PATCH] Bump nightly -> 2023-07-13 --- .github/workflows/rust.yml | 2 +- .github/workflows/rust_bors.yml | 2 +- cargo-marker/README.md | 2 +- cargo-marker/src/backend/driver.rs | 2 +- marker_api/src/context.rs | 14 +++++++------- marker_rustc_driver/src/main.rs | 8 ++++++-- rust-toolchain | 2 +- util/update-toolchain.sh | 2 +- 8 files changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3da87b40..7f5d2980 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,7 +38,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2023-06-01 + toolchain: nightly-2023-07-13 components: cargo, clippy, rustfmt - run: rustc -vV - run: cargo build diff --git a/.github/workflows/rust_bors.yml b/.github/workflows/rust_bors.yml index 00312b4a..5616fdf1 100644 --- a/.github/workflows/rust_bors.yml +++ b/.github/workflows/rust_bors.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2023-06-01 + toolchain: nightly-2023-07-13 components: cargo, clippy, rustfmt - run: rustc -vV - run: cargo build diff --git a/cargo-marker/README.md b/cargo-marker/README.md index 9fc4f745..4e7c0eec 100644 --- a/cargo-marker/README.md +++ b/cargo-marker/README.md @@ -22,7 +22,7 @@ FIXME(xFrednet): Add license shield, once crates.io also says: * **Simple CLI**: *cargo_marker* does all the heavy lifting for you, making custom code analysis, as simple as a single console command. * **Seamless Integration**: *cargo_marker* reuses Rust's existing infrastructure for linting, running Marker as part of your workflow is close to the effort needed for its sibling *[Clippy]*. * **Automatic Lint-Crate Compilation**: *cargo_marker* automatically fetches and builds specified lint crates, streamlining the process of incorporating additional linting rules into your project. -* **User-Friendly Setup**: *cargo_marker* can automatically set up the driver and toolchain, allowing you to focus on writing quality code. (This version will setup rustc's driver for `nightly-2023-06-01`) +* **User-Friendly Setup**: *cargo_marker* can automatically set up the driver and toolchain, allowing you to focus on writing quality code. (This version will setup rustc's driver for `nightly-2023-07-13`) ## Prerequisites diff --git a/cargo-marker/src/backend/driver.rs b/cargo-marker/src/backend/driver.rs index 8c235fac..0c56d2c0 100644 --- a/cargo-marker/src/backend/driver.rs +++ b/cargo-marker/src/backend/driver.rs @@ -14,7 +14,7 @@ pub const MARKER_DRIVER_BIN_NAME: &str = "marker_rustc_driver.exe"; /// This is the driver version and toolchain, that is used by the setup command /// to install the driver. pub static DEFAULT_DRIVER_INFO: Lazy = Lazy::new(|| DriverVersionInfo { - toolchain: "nightly-2023-06-01".to_string(), + toolchain: "nightly-2023-07-13".to_string(), version: "0.1.0".to_string(), api_version: "0.1.0".to_string(), }); diff --git a/marker_api/src/context.rs b/marker_api/src/context.rs index b6c6b94c..67e74d29 100644 --- a/marker_api/src/context.rs +++ b/marker_api/src/context.rs @@ -202,13 +202,13 @@ impl<'ast> AstContext<'ast> { /// This struct holds function pointers to driver implementations of required /// functions. These can roughly be split into two categories: /// -/// 1. **Public utility**: These functions will be exposed to lint-crates via -/// an [`AstContext`] instance. Therefore, the function signature of these -/// has to be stable, or at least be stable for [`AstContext`]. -/// 2. **Internal utility**: These functions are intended for internal usage -/// inside the API or the `marker_adapter` crate. Some nodes might also have -/// a reference to these callbacks to request additional information if -/// required. These are not part of the stable API and can therefore be changed. +/// 1. **Public utility**: These functions will be exposed to lint-crates via an [`AstContext`] +/// instance. Therefore, the function signature of these has to be stable, or at least be stable +/// for [`AstContext`]. +/// 2. **Internal utility**: These functions are intended for internal usage inside the API or the +/// `marker_adapter` crate. Some nodes might also have a reference to these callbacks to request +/// additional information if required. These are not part of the stable API and can therefore be +/// changed. /// /// Any changes to this struct will most likely require changes to the /// `DriverContextWrapper` implementation in the `marker_adapter` crate. That diff --git a/marker_rustc_driver/src/main.rs b/marker_rustc_driver/src/main.rs index 1e354234..749c73bb 100644 --- a/marker_rustc_driver/src/main.rs +++ b/marker_rustc_driver/src/main.rs @@ -37,7 +37,10 @@ use std::ops::Deref; use std::path::{Path, PathBuf}; use std::process::{exit, Command}; -const RUSTC_TOOLCHAIN_VERSION: &str = "nightly-2023-06-01"; +use rustc_session::config::ErrorOutputType; +use rustc_session::EarlyErrorHandler; + +const RUSTC_TOOLCHAIN_VERSION: &str = "nightly-2023-07-13"; struct DefaultCallbacks; impl rustc_driver::Callbacks for DefaultCallbacks {} @@ -135,7 +138,8 @@ interfacing with the driver directly and use `cargo marker` instead. } fn main() { - rustc_driver::init_rustc_env_logger(); + let handler = EarlyErrorHandler::new(ErrorOutputType::default()); + rustc_driver::init_rustc_env_logger(&handler); // FIXME: Add ICE hook. Ideally this would distinguish where the error happens. // ICEs have to be reported like in Clippy. For lint impl ICEs we should have diff --git a/rust-toolchain b/rust-toolchain index 9612e9ee..8e40e465 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2023-06-01" +channel = "nightly-2023-07-13" components = ["cargo", "llvm-tools-preview", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"] # This has to be synced with the toolchain in `github/workflows` diff --git a/util/update-toolchain.sh b/util/update-toolchain.sh index 05e3216f..9001de48 100755 --- a/util/update-toolchain.sh +++ b/util/update-toolchain.sh @@ -2,7 +2,7 @@ if [[ $1 == nightly-????-??-?? ]] then - sed -i "s/nightly-2023-06-01/$1/g" ./marker_rustc_driver/src/main.rs ./rust-toolchain ./.github/workflows/* ./util/update-toolchain.sh .cargo-marker/src/backend/driver.rs ./cargo-marker/README.md + sed -i "s/nightly-2023-07-13/$1/g" ./marker_rustc_driver/src/main.rs ./rust-toolchain ./.github/workflows/* ./util/update-toolchain.sh ./cargo-marker/src/backend/driver.rs ./cargo-marker/README.md else echo "Please enter a valid toolchain like \`nightly-2022-01-01\`" fi;