Skip to content

Commit

Permalink
update all crates msrv to 1.57 (#464)
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede authored Jul 22, 2022
1 parent 126ed4c commit 66756bc
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 91 deletions.
14 changes: 3 additions & 11 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
7 changes: 2 additions & 5 deletions .github/workflows/ci-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
55 changes: 4 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions actix-codec/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changes

## Unreleased - 2022-xx-xx
- Minimum supported Rust version (MSRV) is now 1.57.


## 0.5.1 - 2022-03-15
Expand Down
2 changes: 1 addition & 1 deletion actix-macros/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions actix-rt/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions actix-server/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changes

## Unreleased - 2022-xx-xx
- Minimum supported Rust version (MSRV) is now 1.57.


## 2.1.1 - 2022-03-09
Expand Down
12 changes: 7 additions & 5 deletions actix-server/src/accept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct ServerSocketInfo {
timeout: Option<actix_rt::time::Instant>,
}

/// poll instance of the server.
/// Poll instance of the server.
pub(crate) struct Accept {
poll: Poll,
waker_queue: WakerQueue,
Expand Down Expand Up @@ -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);

Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion actix-service/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions actix-tls/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changes

## Unreleased - 2022-xx-xx
- Minimum supported Rust version (MSRV) is now 1.57.


## 3.0.4 - 2022-03-15
Expand Down
16 changes: 4 additions & 12 deletions actix-tls/src/connect/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<u16> {
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<u16> {
str_split_once(self, ':').and_then(|(_, port)| port.parse().ok())
self.split_once(':').and_then(|(_, port)| port.parse().ok())
}
}

Expand All @@ -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))
}
2 changes: 1 addition & 1 deletion actix-tracing/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion actix-utils/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions bytestring/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changes

## Unreleased - 2022-xx-xx
- Minimum supported Rust version (MSRV) is now 1.57.


## 1.1.0 - 2022-06-11
Expand Down
4 changes: 2 additions & 2 deletions bytestring/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl AsRef<[u8]> for ByteString {

impl AsRef<str> for ByteString {
fn as_ref(&self) -> &str {
&*self
self
}
}

Expand All @@ -96,7 +96,7 @@ impl ops::Deref for ByteString {

impl borrow::Borrow<str> for ByteString {
fn borrow(&self) -> &str {
&*self
self
}
}

Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.48"
msrv = "1.57"
1 change: 1 addition & 0 deletions local-channel/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changes

## Unreleased - 2022-xx-xx
- Minimum supported Rust version (MSRV) is now 1.57.


## 0.1.3 - 2022-05-03
Expand Down
1 change: 1 addition & 0 deletions local-waker/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changes

## Unreleased - 2022-xx-xx
- Minimum supported Rust version (MSRV) is now 1.57.


## 0.1.3 - 2022-05-03
Expand Down

0 comments on commit 66756bc

Please sign in to comment.