Skip to content

Commit

Permalink
Update Rust to v1.59.0 (#1519)
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Gould <ver@buoyant.io>
(cherry picked from commit bc8fce9)
Signed-off-by: Oliver Gould <ver@buoyant.io>
  • Loading branch information
olix0r committed Mar 30, 2022
1 parent 05bb7b9 commit ae3ee55
Show file tree
Hide file tree
Showing 66 changed files with 127 additions and 123 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG RUST_VERSION=1.56.1
ARG RUST_VERSION=1.59.0

FROM docker.io/rust:${RUST_VERSION}-bullseye as kubectl
ARG KUBECTL_VERSION=v1.23.2
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "linkerd2-proxy",
"image": "ghcr.io/linkerd/dev-proxy:v6",
"image": "ghcr.io/linkerd/dev-proxy:v8",
// "dockerFile": "./Dockerfile",
"extensions": [
"matklad.rust-analyzer",
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/package/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ARG BASE_IMAGE=rust:1.56.1-buster
ARG RUST_VERSION=1.59.0
ARG BASE_IMAGE=rust:${RUST_VERSION}-buster
FROM $BASE_IMAGE
WORKDIR /linkerd
RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
timeout-minutes: 20
runs-on: ubuntu-latest
container:
image: docker://rust:1.56.1-buster
image: docker://rust:1.59.0-buster
steps:
- run: |
curl --proto =https --tlsv1.3 -vsSfLo /usr/local/bin/cargo-action-fmt "https://github.com/olix0r/cargo-action-fmt/releases/download/release%2F${CARGO_ACTION_FMT_VERSION}/cargo-action-fmt-x86_64-unknown-linux-gnu"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: docker://rust:1.56.1-buster
image: docker://rust:1.59.0-buster
options: --security-opt seccomp=unconfined # 🤷
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
# :; docker buildx build . --load

# Please make changes via update-rust-version.sh
ARG RUST_IMAGE=rust:1.56.1-buster
ARG RUST_VERSION=1.59.0
ARG RUST_IMAGE=rust:${RUST_VERSION}-buster

# Use an arbitrary ~recent edge release image to get the proxy
# identity-initializing and linkerd-await wrappers.
Expand All @@ -41,7 +42,7 @@ RUN --mount=type=cache,target=/var/lib/apt/lists \
WORKDIR /usr/src/linkerd2-proxy
COPY . .
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.56.1-buster,source=/usr/local/cargo,target=/usr/local/cargo \
--mount=type=cache,from=rust:1.59.0-buster,source=/usr/local/cargo,target=/usr/local/cargo \
mkdir -p /out && \
if [ -n "$PROXY_UNOPTIMIZED" ]; then \
(cd linkerd2-proxy && /usr/bin/time -v cargo build --locked --features="$PROXY_FEATURES") && \
Expand Down
4 changes: 2 additions & 2 deletions hyper-balance/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/addr/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]
use linkerd_dns_name::Name;
Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/admin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/gateway/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
2 changes: 1 addition & 1 deletion linkerd/app/inbound/src/http/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl tap::Inspect for Logical {
req.extensions()
.get::<tls::ConditionalServerTls>()
.cloned()
.unwrap_or_else(|| tls::ConditionalServerTls::None(tls::NoServerTls::Disabled))
.unwrap_or(tls::ConditionalServerTls::None(tls::NoServerTls::Disabled))
}

fn dst_addr<B>(&self, _: &http::Request<B>) -> Option<SocketAddr> {
Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/inbound/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
1 change: 1 addition & 0 deletions linkerd/app/inbound/src/policy/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::collections::{HashMap, HashSet};
/// The proxy usually watches dynamic policies from the control plane, though it can also use
/// 'fixed' policies configured at startup.
#[derive(Clone, Debug)]
#[allow(clippy::large_enum_variant)]
pub enum Config {
Discover {
control: control::Config,
Expand Down
1 change: 1 addition & 0 deletions linkerd/app/integration/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub struct RouteBuilder {
}

#[derive(Debug)]
#[allow(clippy::large_enum_variant)]
enum Dst {
Call(pb::GetDestination, Result<DstReceiver, grpc::Status>),
Done,
Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/integration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/outbound/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/app/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/cache/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/conditional/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/detect/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/dns/name/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
6 changes: 3 additions & 3 deletions linkerd/dns/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down Expand Up @@ -120,7 +120,7 @@ impl Resolver {
fn srv_to_socket_addr(srv: rdata::SRV) -> Result<net::SocketAddr, InvalidSrv> {
if let Some(first_label) = srv.target().iter().next() {
if let Ok(utf8) = std::str::from_utf8(first_label) {
if let Ok(ip) = utf8.replace("-", ".").parse::<std::net::IpAddr>() {
if let Ok(ip) = utf8.replace('-', ".").parse::<std::net::IpAddr>() {
return Ok(net::SocketAddr::new(ip, srv.port()));
}
}
Expand Down
10 changes: 5 additions & 5 deletions linkerd/duplex/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type,
clippy::disallowed_methods,
clippy::disallowed_types,
unsafe_code
)]

Expand Down Expand Up @@ -82,13 +82,13 @@ where
type Output = io::Result<()>;

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> io::Poll<()> {
let mut this = self.project();
let this = self.project();
// This purposefully ignores the Async part, since we don't want to
// return early if the first half isn't ready, but the other half
// could make progress.
trace!("poll");
let _ = this.half_in.copy_into(&mut this.half_out, cx)?;
let _ = this.half_out.copy_into(&mut this.half_in, cx)?;
let _ = this.half_in.copy_into(this.half_out, cx)?;
let _ = this.half_out.copy_into(this.half_in, cx)?;
if this.half_in.is_done() && this.half_out.is_done() {
Poll::Ready(Ok(()))
} else {
Expand Down
4 changes: 2 additions & 2 deletions linkerd/errno/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/error-respond/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/error/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/exp-backoff/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/http-box/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/http-classify/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/http-metrics/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/http-retry/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/identity/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
4 changes: 2 additions & 2 deletions linkerd/io/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#![deny(
warnings,
rust_2018_idioms,
clippy::disallowed_method,
clippy::disallowed_type
clippy::disallowed_methods,
clippy::disallowed_types
)]
#![forbid(unsafe_code)]

Expand Down
Loading

0 comments on commit ae3ee55

Please sign in to comment.