diff --git a/.cargo/config.toml b/.cargo/config.toml index 2ac21485..4024bc0e 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -14,18 +14,10 @@ ci-check = "hack --workspace --feature-powerset --exclude-features=io-uring chec ci-check-linux = "hack --workspace --feature-powerset check --tests --examples" # tests avoiding io-uring feature -ci-test = " hack --feature-powerset --exclude=actix-rt --exclude=actix-server --exclude-features=io-uring test --workspace --lib --tests --no-fail-fast -- --nocapture" -ci-test-rt = " hack --feature-powerset --exclude-features=io-uring test --package=actix-rt --lib --tests --no-fail-fast -- --nocapture" -ci-test-server = "hack --feature-powerset --exclude-features=io-uring test --package=actix-server --lib --tests --no-fail-fast -- --nocapture" +ci-test = "hack --feature-powerset --exclude-features=io-uring test --lib --tests --no-fail-fast -- --nocapture" # tests avoiding io-uring feature on Windows -ci-test-win = " hack --feature-powerset --depth 2 --exclude=actix-rt --exclude=actix-server --exclude-features=io-uring test --workspace --lib --tests --no-fail-fast -- --nocapture" -ci-test-rt-win = " hack --feature-powerset --depth 2 --exclude-features=io-uring test --package=actix-rt --lib --tests --no-fail-fast -- --nocapture" -ci-test-server-win = "hack --feature-powerset --depth 2 --exclude-features=io-uring test --package=actix-server --lib --tests --no-fail-fast -- --nocapture" +ci-test-win = "hack --feature-powerset --depth 2 --exclude-features=io-uring test --lib --tests --no-fail-fast -- --nocapture" # test with io-uring feature -ci-test-rt-linux = " hack --feature-powerset test --package=actix-rt --lib --tests --no-fail-fast -- --nocapture" -ci-test-server-linux = "hack --feature-powerset test --package=actix-server --lib --tests --no-fail-fast -- --nocapture" - -# test lower msrv -ci-test-lower-msrv = "hack --workspace --exclude=actix-server --exclude=actix-tls --feature-powerset test --lib --tests --no-fail-fast -- --nocapture" +ci-test-linux = " hack --feature-powerset test --lib --tests --no-fail-fast -- --nocapture" diff --git a/.github/workflows/ci-master.yml b/.github/workflows/ci-master.yml index 45e5683a..29c5d8c7 100644 --- a/.github/workflows/ci-master.yml +++ b/.github/workflows/ci-master.yml @@ -101,14 +101,11 @@ jobs: if: > matrix.target.os != 'ubuntu-latest' && matrix.target.triple != 'x86_64-pc-windows-gnu' - run: | - cargo ci-test - cargo ci-test-rt - cargo ci-test-server + run: cargo ci-test - name: tests if: matrix.target.os == 'ubuntu-latest' run: | - sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && PATH=$PATH:/usr/share/rust/.cargo/bin && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-rt-linux && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-server-linux" + sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && PATH=$PATH:/usr/share/rust/.cargo/bin && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-linux" - name: Clear the cargo caches run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b2343f6..fd839fb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - { name: Windows (MinGW), os: windows-latest, triple: x86_64-pc-windows-gnu } - { name: Windows (32-bit), os: windows-latest, triple: i686-pc-windows-msvc } version: - - 1.52.0 # MSRV for -server and -tls + - 1.57.0 - stable name: ${{ matrix.target.name }} / ${{ matrix.version }} @@ -77,10 +77,6 @@ jobs: uses: actions-rs/cargo@v1 with: { command: generate-lockfile } - - name: Tweak lockfile - run: | - cargo update -p=native-tls --precise=0.2.8 - - name: check lib if: > matrix.target.os != 'ubuntu-latest' @@ -110,59 +106,16 @@ jobs: - name: tests if: matrix.target.os == 'macos-latest' - run: | - cargo ci-test - cargo ci-test-rt - cargo ci-test-server + run: cargo ci-test - name: tests if: > matrix.target.os == 'windows-latest' && matrix.target.triple != 'x86_64-pc-windows-gnu' - run: | - cargo ci-test-win - cargo ci-test-rt-win - cargo ci-test-server-win + run: cargo ci-test-win - name: tests if: matrix.target.os == 'ubuntu-latest' run: | - sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && PATH=$PATH:/usr/share/rust/.cargo/bin && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-rt-linux && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-server-linux" - - - name: Clear the cargo caches - run: | - cargo install cargo-cache --version 0.6.2 --no-default-features --features ci-autoclean - cargo-cache - - build_and_test_lower_msrv: - name: Linux / 1.49 (lower MSRV) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Install 1.49.0 # MSRV for all but -server and -tls - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.49.0-x86_64-unknown-linux-gnu - profile: minimal - override: true - - - name: Install cargo-hack - uses: actions-rs/cargo@v1 - with: - command: install - args: cargo-hack - - - name: Generate Cargo.lock - uses: actions-rs/cargo@v1 - with: { command: generate-lockfile } - - - name: Tweak lockfile - run: | - cargo update -p=rustls --precise=0.20.2 - cargo update -p=native-tls --precise=0.2.8 - - - name: tests - run: | - sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && PATH=$PATH:/usr/share/rust/.cargo/bin && RUSTUP_TOOLCHAIN=1.49 cargo ci-test-lower-msrv" + sudo bash -c "ulimit -Sl 512 && ulimit -Hl 512 && PATH=$PATH:/usr/share/rust/.cargo/bin && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test && RUSTUP_TOOLCHAIN=${{ matrix.version }} cargo ci-test-linux" - name: Clear the cargo caches run: | diff --git a/actix-codec/CHANGES.md b/actix-codec/CHANGES.md index c721762d..2de0bcf6 100644 --- a/actix-codec/CHANGES.md +++ b/actix-codec/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx +- Minimum supported Rust version (MSRV) is now 1.57. ## 0.5.1 - 2022-03-15 diff --git a/actix-macros/CHANGES.md b/actix-macros/CHANGES.md index accc52ce..9a25f7ed 100644 --- a/actix-macros/CHANGES.md +++ b/actix-macros/CHANGES.md @@ -1,7 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx -- Minimum supported Rust version (MSRV) is now 1.49. +- Minimum supported Rust version (MSRV) is now 1.57. ## 0.2.3 - 2021-10-19 diff --git a/actix-rt/CHANGES.md b/actix-rt/CHANGES.md index 4715a4b5..b19b2b7d 100644 --- a/actix-rt/CHANGES.md +++ b/actix-rt/CHANGES.md @@ -2,6 +2,7 @@ ## Unreleased - 2022-xx-xx - Add `#[track_caller]` attribute to `spawn` functions and methods. [#454] +- Minimum supported Rust version (MSRV) is now 1.57. [#454]: https://github.com/actix/actix-net/pull/454 diff --git a/actix-server/CHANGES.md b/actix-server/CHANGES.md index f8e29d33..1fdb63fd 100644 --- a/actix-server/CHANGES.md +++ b/actix-server/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx +- Minimum supported Rust version (MSRV) is now 1.57. ## 2.1.1 - 2022-03-09 diff --git a/actix-server/src/accept.rs b/actix-server/src/accept.rs index a6ae78c1..c250f909 100644 --- a/actix-server/src/accept.rs +++ b/actix-server/src/accept.rs @@ -24,7 +24,7 @@ struct ServerSocketInfo { timeout: Option, } -/// poll instance of the server. +/// Poll instance of the server. pub(crate) struct Accept { poll: Poll, waker_queue: WakerQueue, @@ -161,11 +161,13 @@ impl Accept { // a loop that would try to drain the command channel. It's yet unknown // if it's necessary/good practice to actively drain the waker queue. loop { - // take guard with every iteration so no new interest can be added - // until the current task is done. + // Take guard with every iteration so no new interests can be added until the current + // task is done. Take care not to take the guard again inside this loop. let mut guard = self.waker_queue.guard(); + + #[allow(clippy::significant_drop_in_scrutinee)] match guard.pop_front() { - // worker notify it becomes available. + // Worker notified it became available. Some(WakerInterest::WorkerAvailable(idx)) => { drop(guard); @@ -176,7 +178,7 @@ impl Accept { } } - // a new worker thread is made and it's handle would be added to Accept + // A new worker thread has been created so store its handle. Some(WakerInterest::Worker(handle)) => { drop(guard); diff --git a/actix-service/CHANGES.md b/actix-service/CHANGES.md index 36c6fba5..5f4d5086 100644 --- a/actix-service/CHANGES.md +++ b/actix-service/CHANGES.md @@ -1,7 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx -- Minimum supported Rust version (MSRV) is now 1.49. +- Minimum supported Rust version (MSRV) is now 1.57. ## 2.0.2 - 2021-12-18 diff --git a/actix-tls/CHANGES.md b/actix-tls/CHANGES.md index cf36d96c..a4b7c75a 100644 --- a/actix-tls/CHANGES.md +++ b/actix-tls/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx +- Minimum supported Rust version (MSRV) is now 1.57. ## 3.0.4 - 2022-03-15 diff --git a/actix-tls/src/connect/host.rs b/actix-tls/src/connect/host.rs index 13780751..c4ff9a01 100644 --- a/actix-tls/src/connect/host.rs +++ b/actix-tls/src/connect/host.rs @@ -27,25 +27,25 @@ pub trait Host: Unpin + 'static { impl Host for String { fn hostname(&self) -> &str { - str_split_once(self, ':') + self.split_once(':') .map(|(hostname, _)| hostname) .unwrap_or(self) } fn port(&self) -> Option { - str_split_once(self, ':').and_then(|(_, port)| port.parse().ok()) + self.split_once(':').and_then(|(_, port)| port.parse().ok()) } } impl Host for &'static str { fn hostname(&self) -> &str { - str_split_once(self, ':') + self.split_once(':') .map(|(hostname, _)| hostname) .unwrap_or(self) } fn port(&self) -> Option { - str_split_once(self, ':').and_then(|(_, port)| port.parse().ok()) + self.split_once(':').and_then(|(_, port)| port.parse().ok()) } } @@ -69,11 +69,3 @@ mod tests { assert_connection_info_eq!("example.com:false:false", "example.com", None); } } - -// `str::split_once` is stabilized in 1.52.0 -fn str_split_once(str: &str, delimiter: char) -> Option<(&str, &str)> { - let mut splitn = str.splitn(2, delimiter); - let prefix = splitn.next()?; - let suffix = splitn.next()?; - Some((prefix, suffix)) -} diff --git a/actix-tracing/CHANGES.md b/actix-tracing/CHANGES.md index aecc837c..e4396377 100644 --- a/actix-tracing/CHANGES.md +++ b/actix-tracing/CHANGES.md @@ -1,7 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx -- Minimum supported Rust version (MSRV) is now 1.49. +- Minimum supported Rust version (MSRV) is now 1.57. ## 0.1.0 - 2020-01-15 diff --git a/actix-utils/CHANGES.md b/actix-utils/CHANGES.md index 6657000b..0602b27d 100644 --- a/actix-utils/CHANGES.md +++ b/actix-utils/CHANGES.md @@ -1,7 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx -- Minimum supported Rust version (MSRV) is now 1.49. +- Minimum supported Rust version (MSRV) is now 1.57. ## 3.0.0 - 2021-04-16 diff --git a/bytestring/CHANGES.md b/bytestring/CHANGES.md index aaf6996c..2cdf6d91 100644 --- a/bytestring/CHANGES.md +++ b/bytestring/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx +- Minimum supported Rust version (MSRV) is now 1.57. ## 1.1.0 - 2022-06-11 diff --git a/bytestring/src/lib.rs b/bytestring/src/lib.rs index 39a153d2..27357602 100644 --- a/bytestring/src/lib.rs +++ b/bytestring/src/lib.rs @@ -72,7 +72,7 @@ impl AsRef<[u8]> for ByteString { impl AsRef for ByteString { fn as_ref(&self) -> &str { - &*self + self } } @@ -96,7 +96,7 @@ impl ops::Deref for ByteString { impl borrow::Borrow for ByteString { fn borrow(&self) -> &str { - &*self + self } } diff --git a/clippy.toml b/clippy.toml index f691ea3d..5cccb362 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.48" +msrv = "1.57" diff --git a/local-channel/CHANGES.md b/local-channel/CHANGES.md index a0ef93fc..1b273273 100644 --- a/local-channel/CHANGES.md +++ b/local-channel/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx +- Minimum supported Rust version (MSRV) is now 1.57. ## 0.1.3 - 2022-05-03 diff --git a/local-waker/CHANGES.md b/local-waker/CHANGES.md index f178a40b..bedfbea6 100644 --- a/local-waker/CHANGES.md +++ b/local-waker/CHANGES.md @@ -1,6 +1,7 @@ # Changes ## Unreleased - 2022-xx-xx +- Minimum supported Rust version (MSRV) is now 1.57. ## 0.1.3 - 2022-05-03