From 7895ec2f14a311771c5226c8d8f690c9259e3409 Mon Sep 17 00:00:00 2001 From: Oliver Gould Date: Wed, 21 Feb 2024 18:13:56 +0000 Subject: [PATCH] dev: v43 with Rust v1.76 --- .devcontainer/devcontainer.json | 2 +- .github/workflows/beta.yml | 2 +- .github/workflows/check-all.yml | 2 +- .github/workflows/check-each.yml | 4 +-- .github/workflows/coverage.yml | 2 +- .github/workflows/deps.yml | 2 +- .github/workflows/integration.yml | 2 +- .github/workflows/lint.yml | 6 ++-- .github/workflows/nightly.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 4 +-- .github/workflows/toolchain.yml | 2 +- Dockerfile | 2 +- .../src/tests/profile_dst_overrides.rs | 30 +++++++++---------- .../outbound/src/http/require_id_header.rs | 2 +- linkerd/app/outbound/src/tcp.rs | 4 +-- linkerd/conditional/src/lib.rs | 2 +- linkerd/http-box/src/erase_request.rs | 2 +- linkerd/http-box/src/erase_response.rs | 2 +- linkerd/http-box/src/request.rs | 4 +-- linkerd/http-box/src/response.rs | 4 +-- linkerd/proxy/http/src/normalize_uri.rs | 4 +-- linkerd/proxy/http/src/orig_proto.rs | 2 +- linkerd/proxy/http/src/retain.rs | 2 +- linkerd/proxy/tcp/src/forward.rs | 2 +- linkerd/stack/src/arc_new_service.rs | 2 +- linkerd/stack/src/loadshed.rs | 2 +- rust-toolchain.toml | 2 +- 28 files changed, 50 insertions(+), 50 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index c37cd33dd4..6494daf6dc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ "build": { "dockerfile": "Dockerfile", "args": { - "DEV_VERSION": "v42", + "DEV_VERSION": "v43", "http_proxy": "${localEnv:http_proxy}", "https_proxy": "${localEnv:https_proxy}" } diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index d1efbfe861..4a165c97bb 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -22,7 +22,7 @@ permissions: jobs: build: runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust timeout-minutes: 20 continue-on-error: true steps: diff --git a/.github/workflows/check-all.yml b/.github/workflows/check-all.yml index 41d50df468..531a1b0a02 100644 --- a/.github/workflows/check-all.yml +++ b/.github/workflows/check-all.yml @@ -32,7 +32,7 @@ jobs: check-all: timeout-minutes: 20 runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 diff --git a/.github/workflows/check-each.yml b/.github/workflows/check-each.yml index b30f92d118..6e5a274038 100644 --- a/.github/workflows/check-each.yml +++ b/.github/workflows/check-each.yml @@ -37,7 +37,7 @@ jobs: list-changed-crates: timeout-minutes: 10 runs-on: ubuntu-latest - container: docker://ghcr.io/linkerd/dev:v42-rust + container: docker://ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 @@ -58,7 +58,7 @@ jobs: needs: list-changed-crates timeout-minutes: 20 runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust strategy: matrix: crate: ${{ fromJson(needs.list-changed-crates.outputs.crates) }} diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 197bd28aff..8505c37be0 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -41,7 +41,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 30 container: - image: docker://ghcr.io/linkerd/dev:v42-rust + image: docker://ghcr.io/linkerd/dev:v43-rust options: --security-opt seccomp=unconfined # 🤷 env: CXX: "/usr/bin/clang++-14" diff --git a/.github/workflows/deps.yml b/.github/workflows/deps.yml index 0adca6f80e..7565eb29c8 100644 --- a/.github/workflows/deps.yml +++ b/.github/workflows/deps.yml @@ -46,7 +46,7 @@ jobs: deprecated: timeout-minutes: 20 runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4d4bb2b6fa..0c6f38117e 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -36,7 +36,7 @@ jobs: test: timeout-minutes: 20 runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e3d641c3fa..39d49e4def 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: clippy: timeout-minutes: 10 runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 @@ -31,7 +31,7 @@ jobs: fmt: timeout-minutes: 10 runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 @@ -40,7 +40,7 @@ jobs: docs: timeout-minutes: 10 runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 18a09b08cf..300d8d39bc 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -22,7 +22,7 @@ permissions: jobs: build: runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust timeout-minutes: 20 continue-on-error: true steps: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1611a1eb0a..29be8dbfcc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -74,7 +74,7 @@ jobs: continue-on-error: ${{ !needs.meta.outputs.publish }} runs-on: ubuntu-latest timeout-minutes: 40 - container: docker://ghcr.io/linkerd/dev:v42-rust-musl + container: docker://ghcr.io/linkerd/dev:v43-rust-musl env: LINKERD2_PROXY_VENDOR: ${{ github.repository_owner }} LINKERD2_PROXY_VERSION: ${{ needs.meta.outputs.version }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0a5b62ebe7..85e5b693c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: meshtls: timeout-minutes: 10 runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 @@ -43,7 +43,7 @@ jobs: unit: timeout-minutes: 10 runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 diff --git a/.github/workflows/toolchain.yml b/.github/workflows/toolchain.yml index 983dff8092..25278dd750 100644 --- a/.github/workflows/toolchain.yml +++ b/.github/workflows/toolchain.yml @@ -14,7 +14,7 @@ permissions: jobs: devcontainer: runs-on: ubuntu-latest - container: ghcr.io/linkerd/dev:v42-rust + container: ghcr.io/linkerd/dev:v43-rust steps: - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 - run: git config --global --add safe.directory "$PWD" # actions/runner#2033 diff --git a/Dockerfile b/Dockerfile index ee515af5ca..809dda662e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ # This is intended **DEVELOPMENT ONLY**, i.e. so that proxy developers can # easily test the proxy in the context of the larger `linkerd2` project. -ARG RUST_IMAGE=ghcr.io/linkerd/dev:v42-rust +ARG RUST_IMAGE=ghcr.io/linkerd/dev:v43-rust # Use an arbitrary ~recent edge release image to get the proxy # identity-initializing and linkerd-await wrappers. diff --git a/linkerd/app/integration/src/tests/profile_dst_overrides.rs b/linkerd/app/integration/src/tests/profile_dst_overrides.rs index 169eb05698..5cb6e69311 100644 --- a/linkerd/app/integration/src/tests/profile_dst_overrides.rs +++ b/linkerd/app/integration/src/tests/profile_dst_overrides.rs @@ -73,12 +73,12 @@ async fn add_a_dst_override() { let apex = "apex"; let apex_svc = Service::new(apex).await; let profile_tx = ctrl.profile_tx(apex_svc.addr().to_string()); - ctrl.destination_tx(&apex_svc.authority()) + ctrl.destination_tx(apex_svc.authority()) .send_addr(apex_svc.svc.addr); let leaf = "leaf"; let leaf_svc = Service::new(leaf).await; - ctrl.destination_tx(&leaf_svc.authority()) + ctrl.destination_tx(leaf_svc.authority()) .send_addr(leaf_svc.svc.addr); let proxy = proxy::new() @@ -114,16 +114,16 @@ async fn add_multiple_dst_overrides() { let apex = "apex"; let apex_svc = Service::new(apex).await; - ctrl.destination_tx(&apex_svc.authority()) + ctrl.destination_tx(apex_svc.authority()) .send_addr(apex_svc.svc.addr); let leaf_a = "leaf-a"; let leaf_a_svc = Service::new(leaf_a).await; - ctrl.destination_tx(&leaf_a_svc.authority()) + ctrl.destination_tx(leaf_a_svc.authority()) .send_addr(leaf_a_svc.svc.addr); let leaf_b = "leaf-b"; let leaf_b_svc = Service::new(leaf_b).await; - ctrl.destination_tx(&leaf_b_svc.authority()) + ctrl.destination_tx(leaf_b_svc.authority()) .send_addr(leaf_b_svc.svc.addr); let profile_tx = ctrl.profile_tx(apex_svc.addr().to_string()); @@ -166,15 +166,15 @@ async fn set_a_dst_override_weight_to_zero() { let apex = "apex"; let apex_svc = Service::new(apex).await; - ctrl.destination_tx(&apex_svc.authority()) + ctrl.destination_tx(apex_svc.authority()) .send_addr(apex_svc.svc.addr); let leaf_a = "leaf-a"; let leaf_a_svc = Service::new(leaf_a).await; - ctrl.destination_tx(&leaf_a_svc.authority()) + ctrl.destination_tx(leaf_a_svc.authority()) .send_addr(leaf_a_svc.svc.addr); let leaf_b = "leaf-b"; let leaf_b_svc = Service::new(leaf_b).await; - ctrl.destination_tx(&leaf_b_svc.authority()) + ctrl.destination_tx(leaf_b_svc.authority()) .send_addr(leaf_b_svc.svc.addr); let profile_tx = ctrl.profile_tx(apex_svc.addr().to_string()); @@ -235,17 +235,17 @@ async fn set_all_dst_override_weights_to_zero() { let apex = "apex"; let apex_svc = Service::new(apex).await; - let apex_tx0 = ctrl.destination_tx(&apex_svc.authority()); + let apex_tx0 = ctrl.destination_tx(apex_svc.authority()); apex_tx0.send_addr(apex_svc.svc.addr); let leaf_a = "leaf-a"; let leaf_a_svc = Service::new(leaf_a).await; - let leaf_a_tx = ctrl.destination_tx(&leaf_a_svc.authority()); + let leaf_a_tx = ctrl.destination_tx(leaf_a_svc.authority()); leaf_a_tx.send_addr(leaf_a_svc.svc.addr); let leaf_b = "leaf-b"; let leaf_b_svc = Service::new(leaf_b).await; - let leaf_b_tx = ctrl.destination_tx(&leaf_b_svc.authority()); + let leaf_b_tx = ctrl.destination_tx(leaf_b_svc.authority()); leaf_b_tx.send_addr(leaf_b_svc.svc.addr); - let apex_tx1 = ctrl.destination_tx(&apex_svc.authority()); + let apex_tx1 = ctrl.destination_tx(apex_svc.authority()); let profile_tx = ctrl.profile_tx(apex_svc.addr().to_string()); profile_tx.send(profile( @@ -308,9 +308,9 @@ async fn remove_a_dst_override() { let leaf = "leaf"; let leaf_svc = Service::new(leaf).await; let ctrl = controller::new_unordered(); - let apex_tx0 = ctrl.destination_tx(&apex_svc.authority()); - let leaf_tx = ctrl.destination_tx(&leaf_svc.authority()); - let apex_tx1 = ctrl.destination_tx(&apex_svc.authority()); + let apex_tx0 = ctrl.destination_tx(apex_svc.authority()); + let leaf_tx = ctrl.destination_tx(leaf_svc.authority()); + let apex_tx1 = ctrl.destination_tx(apex_svc.authority()); let profile_tx = ctrl.profile_tx(apex_svc.addr().to_string()); profile_tx.send(profile( diff --git a/linkerd/app/outbound/src/http/require_id_header.rs b/linkerd/app/outbound/src/http/require_id_header.rs index c8f6f872ec..4380e42bb3 100644 --- a/linkerd/app/outbound/src/http/require_id_header.rs +++ b/linkerd/app/outbound/src/http/require_id_header.rs @@ -31,7 +31,7 @@ impl NewRequireIdentity { Self { inner } } - pub fn layer() -> impl svc::layer::Layer + Clone + Copy { + pub fn layer() -> impl svc::layer::Layer + Copy { svc::layer::mk(Self::new) } } diff --git a/linkerd/app/outbound/src/tcp.rs b/linkerd/app/outbound/src/tcp.rs index a2f6d587e7..eb433ba6d0 100644 --- a/linkerd/app/outbound/src/tcp.rs +++ b/linkerd/app/outbound/src/tcp.rs @@ -2,7 +2,7 @@ use crate::Outbound; use linkerd_app_core::{ io, svc, transport::{self, addrs::*, metrics}, - Error, + Error, Infallible, }; mod connect; @@ -55,7 +55,7 @@ impl Outbound { .push(metrics::NewServer::layer( rt.metrics.proxy.transport.clone(), )) - .push_filter(|t: T| Accept::try_from(t.param())) + .push_filter(|t: T| Ok::<_, Infallible>(Accept::from(t.param()))) .push(rt.metrics.tcp_errors.to_layer()) .instrument(mk_span) .arc_new_tcp() diff --git a/linkerd/conditional/src/lib.rs b/linkerd/conditional/src/lib.rs index 3e124904cf..15a13f9a48 100644 --- a/linkerd/conditional/src/lib.rs +++ b/linkerd/conditional/src/lib.rs @@ -11,7 +11,7 @@ pub enum Conditional { impl Conditional where - R: Copy + Clone, + R: Copy, { pub fn as_ref(&self) -> Conditional<&'_ C, R> { match self { diff --git a/linkerd/http-box/src/erase_request.rs b/linkerd/http-box/src/erase_request.rs index 5f373167a7..5d5491c3d1 100644 --- a/linkerd/http-box/src/erase_request.rs +++ b/linkerd/http-box/src/erase_request.rs @@ -32,7 +32,7 @@ impl EraseRequest { Self(inner) } - pub fn layer() -> impl layer::Layer + Clone + Copy { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(Self::new) } } diff --git a/linkerd/http-box/src/erase_response.rs b/linkerd/http-box/src/erase_response.rs index cb4daab6aa..908c26f7a5 100644 --- a/linkerd/http-box/src/erase_response.rs +++ b/linkerd/http-box/src/erase_response.rs @@ -33,7 +33,7 @@ impl EraseResponse { Self(inner) } - pub fn layer() -> impl layer::Layer + Clone + Copy { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(Self::new) } } diff --git a/linkerd/http-box/src/request.rs b/linkerd/http-box/src/request.rs index af8bacc4d3..1786f930fc 100644 --- a/linkerd/http-box/src/request.rs +++ b/linkerd/http-box/src/request.rs @@ -16,14 +16,14 @@ impl BoxRequest { BoxRequest(inner, PhantomData) } - pub fn layer() -> impl layer::Layer + Clone + Copy { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(Self::new) } } impl BoxRequest { /// Constructs a boxing layer that erases the inner request type with [`EraseRequest`]. - pub fn erased() -> impl layer::Layer> + Clone + Copy { + pub fn erased() -> impl layer::Layer> + Copy { EraseRequest::layer() } } diff --git a/linkerd/http-box/src/response.rs b/linkerd/http-box/src/response.rs index 86bb3e7635..550cbb6b4d 100644 --- a/linkerd/http-box/src/response.rs +++ b/linkerd/http-box/src/response.rs @@ -10,12 +10,12 @@ use std::task::{Context, Poll}; pub struct BoxResponse(S); impl BoxResponse { - pub fn layer() -> impl layer::Layer + Clone + Copy { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(Self) } /// Constructs a boxing layer that erases the inner response type with [`EraseResponse`]. - pub fn erased() -> impl layer::Layer> + Clone + Copy { + pub fn erased() -> impl layer::Layer> + Copy { EraseResponse::layer() } } diff --git a/linkerd/proxy/http/src/normalize_uri.rs b/linkerd/proxy/http/src/normalize_uri.rs index 138556206f..60d9b43499 100644 --- a/linkerd/proxy/http/src/normalize_uri.rs +++ b/linkerd/proxy/http/src/normalize_uri.rs @@ -53,7 +53,7 @@ pub struct MarkAbsoluteForm { // === impl NewNormalizeUri === impl NewNormalizeUri<(), N> { - pub fn layer() -> impl layer::Layer + Copy + Clone { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(|inner| Self::new((), inner)) } } @@ -137,7 +137,7 @@ impl MarkAbsoluteForm { Self { inner } } - pub fn layer() -> impl layer::Layer + Copy + Clone { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(Self::new) } } diff --git a/linkerd/proxy/http/src/orig_proto.rs b/linkerd/proxy/http/src/orig_proto.rs index 05471bda62..048797dc3a 100644 --- a/linkerd/proxy/http/src/orig_proto.rs +++ b/linkerd/proxy/http/src/orig_proto.rs @@ -231,7 +231,7 @@ impl HttpBody for UpgradeResponseBody { // === impl Downgrade === impl Downgrade { - pub fn layer() -> impl layer::Layer + Copy + Clone { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(|inner| Self { inner }) } } diff --git a/linkerd/proxy/http/src/retain.rs b/linkerd/proxy/http/src/retain.rs index ab9ed7bf6c..e5ed0f9deb 100644 --- a/linkerd/proxy/http/src/retain.rs +++ b/linkerd/proxy/http/src/retain.rs @@ -39,7 +39,7 @@ impl Retain { } } - pub fn layer() -> impl layer::Layer + Copy + Clone { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(Self::new) } } diff --git a/linkerd/proxy/tcp/src/forward.rs b/linkerd/proxy/tcp/src/forward.rs index 9b43e2ad46..462f7906bf 100644 --- a/linkerd/proxy/tcp/src/forward.rs +++ b/linkerd/proxy/tcp/src/forward.rs @@ -20,7 +20,7 @@ impl Forward { Self { connect } } - pub fn layer() -> impl layer::Layer + Clone + Copy { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(Self::new) } } diff --git a/linkerd/stack/src/arc_new_service.rs b/linkerd/stack/src/arc_new_service.rs index 8b3da45bfc..8800c780e2 100644 --- a/linkerd/stack/src/arc_new_service.rs +++ b/linkerd/stack/src/arc_new_service.rs @@ -6,7 +6,7 @@ pub struct ArcNewService { } impl ArcNewService { - pub fn layer() -> impl layer::Layer + Clone + Copy + pub fn layer() -> impl layer::Layer + Copy where N: NewService + Send + Sync + 'static, S: Send + 'static, diff --git a/linkerd/stack/src/loadshed.rs b/linkerd/stack/src/loadshed.rs index b481e83c71..e512d34863 100644 --- a/linkerd/stack/src/loadshed.rs +++ b/linkerd/stack/src/loadshed.rs @@ -27,7 +27,7 @@ impl LoadShed { /// (e.g., via [`SpawnReady`], where appropriate). /// /// [`SpawnReady`]: tower::spawn_ready::SpawnReady - pub fn layer() -> impl layer::Layer + Copy + Clone { + pub fn layer() -> impl layer::Layer + Copy { layer::mk(Self::new) } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 8142c30126..624eb0ea63 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.73.0" +channel = "1.76.0"