1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-12-24 00:50:36 +00:00

update MSRV to 1.65 (#3059)

This commit is contained in:
Rob Ede 2023-07-02 01:09:15 +01:00 committed by GitHub
parent 1072d0dacf
commit 241da6e081
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
74 changed files with 202 additions and 166 deletions

View file

@ -23,7 +23,7 @@ jobs:
- { name: macOS, os: macos-latest, triple: x86_64-apple-darwin }
- { name: Windows, os: windows-latest, triple: x86_64-pc-windows-msvc }
version:
- 1.59.0 # MSRV
- 1.65.0 # MSRV
- stable
name: ${{ matrix.target.name }} / ${{ matrix.version }}
@ -49,17 +49,9 @@ jobs:
- name: Install cargo-hack
uses: taiki-e/install-action@cargo-hack
- name: workaround MSRV issues
if: matrix.version != 'stable'
run: |
cargo install cargo-edit --version=0.8.0
cargo add const-str@0.3 --dev -p=actix-web
cargo add const-str@0.3 --dev -p=awc
- name: workaround MSRV issues
if: matrix.version != 'stable'
run: |
cargo update -p=zstd-sys --precise=2.0.1+zstd.1.5.2
# - name: workaround MSRV issues
# if: matrix.version != 'stable'
# run: |
- name: check minimal
run: cargo ci-check-min

View file

@ -63,7 +63,8 @@ jobs:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with: { toolchain: nightly }
# temp: unpin once https://github.com/rust-lang/rust/issues/113152 is fixed
with: { toolchain: nightly-2023-06-28 }
- uses: taiki-e/cache-cargo-install-action@v1
with: { tool: cargo-public-api }

View file

@ -2,6 +2,8 @@
## Unreleased - 2023-xx-xx
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 0.6.3 - 2023-01-21
- XHTML files now use `Content-Disposition: inline` instead of `attachment`. [#2903]

View file

@ -11,7 +11,7 @@ homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web"
categories = ["asynchronous", "web-programming::http-server"]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[lib]
name = "actix_files"

View file

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-files?label=latest)](https://crates.io/crates/actix-files)
[![Documentation](https://docs.rs/actix-files/badge.svg?version=0.6.3)](https://docs.rs/actix-files/0.6.3)
![Version](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![Version](https://img.shields.io/badge/rustc-1.65+-ab6000.svg)
![License](https://img.shields.io/crates/l/actix-files.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-files/0.6.3/status.svg)](https://deps.rs/crate/actix-files/0.6.3)
@ -15,4 +15,4 @@
- [API Documentation](https://docs.rs/actix-files)
- [Example Project](https://github.com/actix/examples/tree/master/basics/static-files)
- Minimum Supported Rust Version (MSRV): 1.59
- Minimum Supported Rust Version (MSRV): 1.65

View file

@ -97,8 +97,6 @@ impl FromRequest for PathBufWrap {
#[cfg(test)]
mod tests {
use std::iter::FromIterator;
use super::*;
#[test]

View file

@ -2,6 +2,8 @@
## Unreleased - 2023-xx-xx
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 3.1.0 - 2023-01-21
- Minimum supported Rust version (MSRV) is now 1.59.

View file

@ -13,7 +13,7 @@ categories = [
"web-programming::websocket",
]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[package.metadata.docs.rs]
features = []
@ -41,12 +41,12 @@ bytes = "1"
futures-core = { version = "0.3.17", default-features = false }
http = "0.2.7"
log = "0.4"
socket2 = "0.4"
socket2 = "0.5"
serde = "1"
serde_json = "1"
slab = "0.4"
serde_urlencoded = "0.7"
tls-openssl = { version = "0.10.9", package = "openssl", optional = true }
tls-openssl = { version = "0.10.55", package = "openssl", optional = true }
tokio = { version = "1.24.2", features = ["sync"] }
[dev-dependencies]

View file

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-http-test?label=latest)](https://crates.io/crates/actix-http-test)
[![Documentation](https://docs.rs/actix-http-test/badge.svg?version=3.1.0)](https://docs.rs/actix-http-test/3.1.0)
![Version](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![Version](https://img.shields.io/badge/rustc-1.65+-ab6000.svg)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-http-test)
<br>
[![Dependency Status](https://deps.rs/crate/actix-http-test/3.1.0/status.svg)](https://deps.rs/crate/actix-http-test/3.1.0)
@ -14,4 +14,4 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-http-test)
- Minimum Supported Rust Version (MSRV): 1.59
- Minimum Supported Rust Version (MSRV): 1.65

View file

@ -7,6 +7,10 @@
- Add `body::to_body_limit()` function.
- Add `body::BodyLimitExceeded` error type.
### Changed
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 3.3.1 - 2023-03-02
### Fixed

View file

@ -16,7 +16,7 @@ categories = [
"web-programming::websocket",
]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[package.metadata.docs.rs]
# features that docs.rs will build with
@ -105,20 +105,20 @@ actix-tls = { version = "3", features = ["openssl"] }
actix-web = "4"
async-stream = "0.3"
criterion = { version = "0.4", features = ["html_reports"] }
env_logger = "0.9"
criterion = { version = "0.5", features = ["html_reports"] }
env_logger = "0.10"
futures-util = { version = "0.3.17", default-features = false, features = ["alloc"] }
memchr = "2.4"
once_cell = "1.9"
rcgen = "0.9"
rcgen = "0.11"
regex = "1.3"
rustversion = "1"
rustls-pemfile = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
static_assertions = "1"
tls-openssl = { package = "openssl", version = "0.10.9" }
tls-rustls = { package = "rustls", version = "0.20.0" }
tls-openssl = { package = "openssl", version = "0.10.55" }
tls-rustls = { package = "rustls", version = "0.20" }
tokio = { version = "1.24.2", features = ["net", "rt", "macros"] }
[[example]]

View file

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-http?label=latest)](https://crates.io/crates/actix-http)
[![Documentation](https://docs.rs/actix-http/badge.svg?version=3.3.1)](https://docs.rs/actix-http/3.3.1)
![Version](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![Version](https://img.shields.io/badge/rustc-1.65+-ab6000.svg)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-http.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-http/3.3.1/status.svg)](https://deps.rs/crate/actix-http/3.3.1)
@ -14,7 +14,7 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-http)
- Minimum Supported Rust Version (MSRV): 1.59
- Minimum Supported Rust Version (MSRV): 1.65
## Example

View file

@ -104,7 +104,6 @@ impl MessageBody for BoxBody {
#[cfg(test)]
mod tests {
use static_assertions::{assert_impl_all, assert_not_impl_any};
use super::*;

View file

@ -1,4 +1,4 @@
use std::{convert::TryFrom, io, marker::PhantomData, mem::MaybeUninit, task::Poll};
use std::{io, marker::PhantomData, mem::MaybeUninit, task::Poll};
use actix_codec::Decoder;
use bytes::{Bytes, BytesMut};

View file

@ -160,7 +160,6 @@ mod openssl {
#[cfg(feature = "rustls")]
mod rustls {
use std::io;
use actix_service::ServiceFactoryExt as _;

View file

@ -1,7 +1,5 @@
//! [`TryIntoHeaderPair`] trait and implementations.
use std::convert::TryFrom as _;
use super::{
Header, HeaderName, HeaderValue, InvalidHeaderName, InvalidHeaderValue, TryIntoHeaderValue,
};

View file

@ -1,7 +1,5 @@
//! [`TryIntoHeaderValue`] trait and implementations.
use std::convert::TryFrom as _;
use bytes::Bytes;
use http::{header::InvalidHeaderValue, Error as HttpError, HeaderValue};
use mime::Mime;

View file

@ -1,4 +1,4 @@
use std::{convert::TryFrom, str::FromStr};
use std::str::FromStr;
use derive_more::{Display, Error};
use http::header::InvalidHeaderValue;

View file

@ -1,7 +1,4 @@
use std::{
convert::{TryFrom, TryInto},
fmt,
};
use std::fmt;
use derive_more::{Display, Error};

View file

@ -1,4 +1,4 @@
use std::{cmp, convert::TryFrom as _, fmt, str};
use std::{cmp, fmt, str};
use crate::error::ParseError;

View file

@ -234,7 +234,6 @@ impl<P> fmt::Debug for Request<P> {
#[cfg(test)]
mod tests {
use super::*;
use std::convert::TryFrom;
#[test]
fn test_basics() {

View file

@ -30,9 +30,9 @@ use crate::{
///
/// # Automatic HTTP Version Selection
/// There are two ways to select the HTTP version of an incoming connection:
/// - One is to rely on the ALPN information that is provided when using a TLS (HTTPS); both
/// versions are supported automatically when using either of the `.rustls()` or `.openssl()`
/// finalizing methods.
/// - One is to rely on the ALPN information that is provided when using TLS (HTTPS); both versions
/// are supported automatically when using either of the `.rustls()` or `.openssl()` finalizing
/// methods.
/// - The other is to read the first few bytes of the TCP stream. This is the only viable approach
/// for supporting H2C, which allows the HTTP/2 protocol to work over plaintext connections. Use
/// the `.tcp_auto_h2c()` finalizing method to enable this behavior.

View file

@ -1,5 +1,4 @@
use std::cmp::min;
use std::convert::TryFrom;
use bytes::{Buf, BufMut, BytesMut};
use tracing::debug;

View file

@ -4,7 +4,7 @@
extern crate tls_rustls as rustls;
use std::{
convert::{Infallible, TryFrom},
convert::Infallible,
io::{self, BufReader, Write},
net::{SocketAddr, TcpStream as StdTcpStream},
sync::Arc,

View file

@ -1,5 +1,9 @@
# Changes
## Unreleased
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 0.6.0 - 2023-02-26
- Add `MultipartForm` derive macro.

View file

@ -7,7 +7,7 @@ keywords = ["http", "web", "framework", "async", "futures"]
homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web.git"
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]

View file

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-multipart-derive?label=latest)](https://crates.io/crates/actix-multipart-derive)
[![Documentation](https://docs.rs/actix-multipart-derive/badge.svg?version=0.5.0)](https://docs.rs/actix-multipart-derive/0.5.0)
![Version](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![Version](https://img.shields.io/badge/rustc-1.65+-ab6000.svg)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-multipart-derive.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-multipart-derive/0.5.0/status.svg)](https://deps.rs/crate/actix-multipart-derive/0.5.0)
@ -14,4 +14,4 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-multipart-derive)
- Minimum Supported Rust Version (MSRV): 1.59
- Minimum Supported Rust Version (MSRV): 1.65

View file

@ -8,7 +8,7 @@
#![doc(html_favicon_url = "https://actix.rs/favicon.ico")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
use std::{collections::HashSet, convert::TryFrom as _};
use std::collections::HashSet;
use darling::{FromDeriveInput, FromField, FromMeta};
use parse_size::parse_size;

View file

@ -1,4 +1,4 @@
#[rustversion::stable(1.59)] // MSRV
#[rustversion::stable(1.65)] // MSRV
#[test]
fn compile_macros() {
let t = trybuild::TestCases::new();

View file

@ -2,6 +2,8 @@
## Unreleased - 2023-xx-xx
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 0.6.0 - 2023-02-26
- Added `MultipartForm` typed data extractor. [#2883]

View file

@ -10,7 +10,7 @@ keywords = ["http", "web", "framework", "async", "futures"]
homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web.git"
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]

View file

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-multipart?label=latest)](https://crates.io/crates/actix-multipart)
[![Documentation](https://docs.rs/actix-multipart/badge.svg?version=0.6.0)](https://docs.rs/actix-multipart/0.6.0)
![Version](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![Version](https://img.shields.io/badge/rustc-1.65+-ab6000.svg)
![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-multipart.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-multipart/0.6.0/status.svg)](https://deps.rs/crate/actix-multipart/0.6.0)
@ -14,4 +14,4 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-multipart)
- Minimum Supported Rust Version (MSRV): 1.59
- Minimum Supported Rust Version (MSRV): 1.65

View file

@ -2,9 +2,7 @@
use std::{
cell::{Cell, RefCell, RefMut},
cmp,
convert::TryFrom,
fmt,
cmp, fmt,
marker::PhantomData,
pin::Pin,
rc::Rc,

View file

@ -2,6 +2,8 @@
## Unreleased - 2023-xx-xx
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 0.5.1 - 2022-09-19
- Correct typo in error string for `i32` deserialization. [#2876]

View file

@ -10,7 +10,7 @@ description = "Resource path matching and router"
keywords = ["actix", "router", "routing"]
repository = "https://github.com/actix/actix-web.git"
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[lib]
name = "actix_router"
@ -27,7 +27,7 @@ serde = "1"
tracing = { version = "0.1.30", default-features = false, features = ["log"] }
[dev-dependencies]
criterion = { version = "0.4", features = ["html_reports"] }
criterion = { version = "0.5", features = ["html_reports"] }
http = "0.2.7"
serde = { version = "1", features = ["derive"] }
percent-encoding = "2.1"

View file

@ -1389,8 +1389,6 @@ mod tests {
#[cfg(feature = "http")]
#[test]
fn parse_urlencoded_param() {
use std::convert::TryFrom;
let re = ResourceDef::new("/user/{id}/test");
let mut path = Path::new("/user/2345/test");

View file

@ -65,7 +65,6 @@ impl ResourcePath for Url {
#[cfg(test)]
mod tests {
use http::Uri;
use std::convert::TryFrom;
use super::*;
use crate::{Path, ResourceDef};

View file

@ -2,6 +2,8 @@
## Unreleased - 2023-xx-xx
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 0.1.1 - 2023-02-26
- Add `TestServerConfig::port()` setter method.

View file

@ -16,7 +16,7 @@ categories = [
"web-programming::websocket",
]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[features]
default = []
@ -43,6 +43,6 @@ log = "0.4"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_urlencoded = "0.7"
tls-openssl = { package = "openssl", version = "0.10.9", optional = true }
tls-rustls = { package = "rustls", version = "0.20.0", optional = true }
tls-openssl = { package = "openssl", version = "0.10.55", optional = true }
tls-rustls = { package = "rustls", version = "0.20", optional = true }
tokio = { version = "1.24.2", features = ["sync"] }

View file

@ -2,6 +2,8 @@
## Unreleased - 2023-xx-xx
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 4.2.0 - 2023-01-21
- Minimum supported Rust version (MSRV) is now 1.57 due to transitive `time` dependency.

View file

@ -7,7 +7,7 @@ keywords = ["actix", "http", "web", "framework", "async"]
homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web"
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[lib]
name = "actix_web_actors"
@ -32,7 +32,6 @@ actix-test = "0.1"
awc = { version = "3", default-features = false }
actix-web = { version = "4", features = ["macros"] }
env_logger = "0.10"
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
mime = "0.3"
env_logger = "0.9"
futures-util = { version = "0.3.17", default-features = false }

View file

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-web-actors?label=latest)](https://crates.io/crates/actix-web-actors)
[![Documentation](https://docs.rs/actix-web-actors/badge.svg?version=4.2.0)](https://docs.rs/actix-web-actors/4.2.0)
![Version](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![Version](https://img.shields.io/badge/rustc-1.65+-ab6000.svg)
![License](https://img.shields.io/crates/l/actix-web-actors.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-web-actors/4.2.0/status.svg)](https://deps.rs/crate/actix-web-actors/4.2.0)
@ -14,4 +14,4 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-web-actors)
- Minimum Supported Rust Version (MSRV): 1.59
- Minimum Supported Rust Version (MSRV): 1.65

View file

@ -58,7 +58,6 @@
use std::{
collections::VecDeque,
convert::TryFrom,
future::Future,
io, mem,
pin::Pin,

View file

@ -2,6 +2,8 @@
## Unreleased - 2023-xx-xx
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 4.2.0 - 2023-02-26
- Add support for custom methods with the `#[route]` macro. [#2969]

View file

@ -9,7 +9,7 @@ authors = [
"Rob Ede <robjtede@icloud.com>",
]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[lib]
proc-macro = true

View file

@ -4,7 +4,7 @@
[![crates.io](https://img.shields.io/crates/v/actix-web-codegen?label=latest)](https://crates.io/crates/actix-web-codegen)
[![Documentation](https://docs.rs/actix-web-codegen/badge.svg?version=4.2.0)](https://docs.rs/actix-web-codegen/4.2.0)
![Version](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![Version](https://img.shields.io/badge/rustc-1.65+-ab6000.svg)
![License](https://img.shields.io/crates/l/actix-web-codegen.svg)
<br />
[![dependency status](https://deps.rs/crate/actix-web-codegen/4.2.0/status.svg)](https://deps.rs/crate/actix-web-codegen/4.2.0)
@ -14,7 +14,7 @@
## Documentation & Resources
- [API Documentation](https://docs.rs/actix-web-codegen)
- Minimum Supported Rust Version (MSRV): 1.59
- Minimum Supported Rust Version (MSRV): 1.65
## Compile Testing

View file

@ -1,4 +1,4 @@
use std::{collections::HashSet, convert::TryFrom};
use std::collections::HashSet;
use actix_router::ResourceDef;
use proc_macro::TokenStream;

View file

@ -1,4 +1,4 @@
#[rustversion::stable(1.59)] // MSRV
#[rustversion::stable(1.65)] // MSRV
#[test]
fn compile_macros() {
let t = trybuild::TestCases::new();

View file

@ -8,10 +8,20 @@ error[E0277]: the trait bound `fn() -> impl std::future::Future<Output = String>
--> tests/trybuild/route-custom-lowercase.rs:14:55
|
14 | let srv = actix_test::start(|| App::new().service(index));
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl std::future::Future<Output = String> {index}`
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for fn item `fn() -> impl std::future::Future<Output = String> {index}`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `HttpServiceFactory`:
(A, B)
(A, B, C)
(A, B, C, D)
(A, B, C, D, E)
(A, B, C, D, E, F)
(A, B, C, D, E, F, G)
(A, B, C, D, E, F, G, H)
(A, B, C, D, E, F, G, H, I)
and $N others
note: required by a bound in `App::<T>::service`
--> $WORKSPACE/actix-web/src/app.rs
|

View file

@ -5,15 +5,25 @@ error: HTTP method defined more than once: `GET`
| ^^^^^
error[E0277]: the trait bound `fn() -> impl std::future::Future<Output = String> {index}: HttpServiceFactory` is not satisfied
--> tests/trybuild/route-duplicate-method-fail.rs:12:55
|
12 | let srv = actix_test::start(|| App::new().service(index));
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl std::future::Future<Output = String> {index}`
| |
| required by a bound introduced by this call
|
--> tests/trybuild/route-duplicate-method-fail.rs:12:55
|
12 | let srv = actix_test::start(|| App::new().service(index));
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for fn item `fn() -> impl std::future::Future<Output = String> {index}`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `HttpServiceFactory`:
(A, B)
(A, B, C)
(A, B, C, D)
(A, B, C, D, E)
(A, B, C, D, E, F)
(A, B, C, D, E, F, G)
(A, B, C, D, E, F, G, H)
(A, B, C, D, E, F, G, H, I)
and $N others
note: required by a bound in `App::<T>::service`
--> $WORKSPACE/actix-web/src/app.rs
|
| F: HttpServiceFactory + 'static,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `App::<T>::service`
--> $WORKSPACE/actix-web/src/app.rs
|
| F: HttpServiceFactory + 'static,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `App::<T>::service`

View file

@ -7,15 +7,25 @@ error: The #[route(..)] macro requires at least one `method` attribute
= note: this error originates in the attribute macro `route` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `fn() -> impl std::future::Future<Output = String> {index}: HttpServiceFactory` is not satisfied
--> tests/trybuild/route-missing-method-fail.rs:12:55
|
12 | let srv = actix_test::start(|| App::new().service(index));
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl std::future::Future<Output = String> {index}`
| |
| required by a bound introduced by this call
|
--> tests/trybuild/route-missing-method-fail.rs:12:55
|
12 | let srv = actix_test::start(|| App::new().service(index));
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for fn item `fn() -> impl std::future::Future<Output = String> {index}`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `HttpServiceFactory`:
(A, B)
(A, B, C)
(A, B, C, D)
(A, B, C, D, E)
(A, B, C, D, E, F)
(A, B, C, D, E, F, G)
(A, B, C, D, E, F, G, H)
(A, B, C, D, E, F, G, H, I)
and $N others
note: required by a bound in `App::<T>::service`
--> $WORKSPACE/actix-web/src/app.rs
|
| F: HttpServiceFactory + 'static,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `App::<T>::service`
--> $WORKSPACE/actix-web/src/app.rs
|
| F: HttpServiceFactory + 'static,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `App::<T>::service`

View file

@ -13,15 +13,25 @@ error: Invalid input for macro
| ^^^^^^
error[E0277]: the trait bound `fn() -> impl std::future::Future<Output = String> {index}: HttpServiceFactory` is not satisfied
--> tests/trybuild/routes-missing-args-fail.rs:13:55
|
13 | let srv = actix_test::start(|| App::new().service(index));
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl std::future::Future<Output = String> {index}`
| |
| required by a bound introduced by this call
|
--> tests/trybuild/routes-missing-args-fail.rs:13:55
|
13 | let srv = actix_test::start(|| App::new().service(index));
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for fn item `fn() -> impl std::future::Future<Output = String> {index}`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `HttpServiceFactory`:
(A, B)
(A, B, C)
(A, B, C, D)
(A, B, C, D, E)
(A, B, C, D, E, F)
(A, B, C, D, E, F, G)
(A, B, C, D, E, F, G, H)
(A, B, C, D, E, F, G, H, I)
and $N others
note: required by a bound in `App::<T>::service`
--> $WORKSPACE/actix-web/src/app.rs
|
| F: HttpServiceFactory + 'static,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `App::<T>::service`
--> $WORKSPACE/actix-web/src/app.rs
|
| F: HttpServiceFactory + 'static,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `App::<T>::service`

View file

@ -7,15 +7,25 @@ error: The #[routes] macro requires at least one `#[<method>(..)]` attribute.
= note: this error originates in the attribute macro `routes` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `fn() -> impl std::future::Future<Output = String> {index}: HttpServiceFactory` is not satisfied
--> tests/trybuild/routes-missing-method-fail.rs:12:55
|
12 | let srv = actix_test::start(|| App::new().service(index));
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for `fn() -> impl std::future::Future<Output = String> {index}`
| |
| required by a bound introduced by this call
|
--> tests/trybuild/routes-missing-method-fail.rs:12:55
|
12 | let srv = actix_test::start(|| App::new().service(index));
| ------- ^^^^^ the trait `HttpServiceFactory` is not implemented for fn item `fn() -> impl std::future::Future<Output = String> {index}`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `HttpServiceFactory`:
(A, B)
(A, B, C)
(A, B, C, D)
(A, B, C, D, E)
(A, B, C, D, E, F)
(A, B, C, D, E, F, G)
(A, B, C, D, E, F, G, H)
(A, B, C, D, E, F, G, H, I)
and $N others
note: required by a bound in `App::<T>::service`
--> $WORKSPACE/actix-web/src/app.rs
|
| F: HttpServiceFactory + 'static,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `App::<T>::service`
--> $WORKSPACE/actix-web/src/app.rs
|
| F: HttpServiceFactory + 'static,
| ^^^^^^^^^^^^^^^^^^ required by this bound in `App::<T>::service`

View file

@ -10,6 +10,7 @@
### Changed
- Handler functions can now receive up to 16 extractor parameters.
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 4.3.1 - 2023-02-26

View file

@ -16,7 +16,7 @@ categories = [
homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web.git"
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[package.metadata.docs.rs]
# features that docs.rs will build with
@ -92,7 +92,7 @@ serde = "1.0"
serde_json = "1.0"
serde_urlencoded = "0.7"
smallvec = "1.6.1"
socket2 = "0.4"
socket2 = "0.5"
time = { version = "0.3", default-features = false, features = ["formatting"] }
url = "2.1"
@ -102,18 +102,18 @@ actix-test = { version = "0.1", features = ["openssl", "rustls"] }
awc = { version = "3", features = ["openssl"] }
brotli = "3.3.3"
const-str = "0.3"
criterion = { version = "0.4", features = ["html_reports"] }
env_logger = "0.9"
const-str = "0.5"
criterion = { version = "0.5", features = ["html_reports"] }
env_logger = "0.10"
flate2 = "1.0.13"
futures-util = { version = "0.3.17", default-features = false, features = ["std"] }
rand = "0.8"
rcgen = "0.9"
rcgen = "0.11"
rustls-pemfile = "1"
serde = { version = "1.0", features = ["derive"] }
static_assertions = "1"
tls-openssl = { package = "openssl", version = "0.10.9" }
tls-rustls = { package = "rustls", version = "0.20.0" }
tls-openssl = { package = "openssl", version = "0.10.55" }
tls-rustls = { package = "rustls", version = "0.20" }
tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
zstd = "0.12"

View file

@ -5,7 +5,7 @@
</p>
<p>
[![crates.io](https://img.shields.io/crates/v/actix-web?label=latest)](https://crates.io/crates/actix-web) [![Documentation](https://docs.rs/actix-web/badge.svg?version=4.3.1)](https://docs.rs/actix-web/4.3.1) ![MSRV](https://img.shields.io/badge/rustc-1.59+-ab6000.svg) ![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-web.svg) [![Dependency Status](https://deps.rs/crate/actix-web/4.3.1/status.svg)](https://deps.rs/crate/actix-web/4.3.1) <br /> [![CI](https://github.com/actix/actix-web/actions/workflows/ci.yml/badge.svg)](https://github.com/actix/actix-web/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/actix/actix-web/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web) ![downloads](https://img.shields.io/crates/d/actix-web.svg) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
[![crates.io](https://img.shields.io/crates/v/actix-web?label=latest)](https://crates.io/crates/actix-web) [![Documentation](https://docs.rs/actix-web/badge.svg?version=4.3.1)](https://docs.rs/actix-web/4.3.1) ![MSRV](https://img.shields.io/badge/rustc-1.65+-ab6000.svg) ![MIT or Apache 2.0 licensed](https://img.shields.io/crates/l/actix-web.svg) [![Dependency Status](https://deps.rs/crate/actix-web/4.3.1/status.svg)](https://deps.rs/crate/actix-web/4.3.1) <br /> [![CI](https://github.com/actix/actix-web/actions/workflows/ci.yml/badge.svg)](https://github.com/actix/actix-web/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/actix/actix-web/branch/master/graph/badge.svg)](https://codecov.io/gh/actix/actix-web) ![downloads](https://img.shields.io/crates/d/actix-web.svg) [![Chat on Discord](https://img.shields.io/discord/771444961383153695?label=chat&logo=discord)](https://discord.gg/NWpN5mmg3x)
</p>
</div>
@ -24,7 +24,7 @@
- SSL support using OpenSSL or Rustls
- Middlewares ([Logger, Session, CORS, etc](https://actix.rs/docs/middleware/))
- Integrates with the [`awc` HTTP client](https://docs.rs/awc/)
- Runs on stable Rust 1.59+
- Runs on stable Rust 1.65+
## Documentation

View file

@ -51,7 +51,6 @@
use std::{
cell::{Ref, RefMut},
convert::TryFrom,
rc::Rc,
};

View file

@ -1,7 +1,6 @@
//! For middleware documentation, see [`DefaultHeaders`].
use std::{
convert::TryFrom,
future::Future,
marker::PhantomData,
pin::Pin,

View file

@ -270,8 +270,8 @@ impl<B> ErrorHandlers<B> {
handlers
.get(status)
.map(|h| h.as_ref())
.or_else(|| status.is_client_error().then(|| default_client).flatten())
.or_else(|| status.is_server_error().then(|| default_server).flatten())
.or_else(|| status.is_client_error().then_some(default_client).flatten())
.or_else(|| status.is_server_error().then_some(default_server).flatten())
}
}

View file

@ -3,7 +3,6 @@
use std::{
borrow::Cow,
collections::HashSet,
convert::TryFrom,
env,
fmt::{self, Display as _},
future::Future,

View file

@ -15,11 +15,12 @@ use crate::{
///
/// The default is `TrailingSlash::Trim`.
#[non_exhaustive]
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Default)]
pub enum TrailingSlash {
/// Trim trailing slashes from the end of the path.
///
/// Using this will require all routes to omit trailing slashes for them to be accessible.
#[default]
Trim,
/// Only merge any present multiple trailing slashes.
@ -33,12 +34,6 @@ pub enum TrailingSlash {
Always,
}
impl Default for TrailingSlash {
fn default() -> Self {
TrailingSlash::Trim
}
}
/// Middleware for normalizing a request's path so that routes can be matched more flexibly.
///
/// # Normalization Steps

View file

@ -27,7 +27,6 @@ use crate::{
/// # Examples
/// ```no_run
/// # use actix_web::{web, HttpResponse, HttpRequest, Responder, HttpMessage as _};
///
/// #[derive(Debug, Clone, PartialEq)]
/// struct FlagFromMiddleware(String);
///

View file

@ -1,6 +1,5 @@
use std::{
cell::{Ref, RefMut},
convert::TryInto,
future::Future,
pin::Pin,
task::{Context, Poll},

View file

@ -136,7 +136,7 @@ impl ResourceMap {
.root_rmap_fn(String::with_capacity(AVG_PATH_LEN), |mut acc, node| {
node.pattern
.resource_path_from_iter(&mut acc, &mut elements)
.then(|| acc)
.then_some(acc)
})
.ok_or(UrlGenerationError::NotEnoughElements)?;
@ -149,7 +149,7 @@ impl ResourceMap {
// external resource; third slash would be the root slash in the path
let third_slash_index = path
.char_indices()
.filter_map(|(i, c)| (c == '/').then(|| i))
.filter_map(|(i, c)| (c == '/').then_some(i))
.nth(2)
.unwrap_or(path.len());

View file

@ -359,7 +359,6 @@ where
#[cfg(test)]
mod tests {
use serde::{Deserialize, Serialize};
use super::*;

View file

@ -2,6 +2,8 @@
## Unreleased - 2023-xx-xx
- Minimum supported Rust version (MSRV) is now 1.65 due to transitive `time` dependency.
## 3.1.1 - 2023-02-26
### Changed

View file

@ -13,7 +13,7 @@ categories = [
homepage = "https://actix.rs"
repository = "https://github.com/actix/actix-web.git"
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
[lib]
name = "awc"
@ -83,8 +83,8 @@ tokio = { version = "1.24.2", features = ["sync"] }
cookie = { version = "0.16", features = ["percent-encode"], optional = true }
tls-openssl = { package = "openssl", version = "0.10.9", optional = true }
tls-rustls = { package = "rustls", version = "0.20.0", optional = true, features = ["dangerous_configuration"] }
tls-openssl = { package = "openssl", version = "0.10.55", optional = true }
tls-rustls = { package = "rustls", version = "0.20", optional = true, features = ["dangerous_configuration"] }
trust-dns-resolver = { version = "0.22", optional = true }
@ -98,12 +98,12 @@ actix-utils = "3"
actix-web = { version = "4", features = ["openssl"] }
brotli = "3.3.3"
const-str = "0.3"
env_logger = "0.9"
const-str = "0.5"
env_logger = "0.10"
flate2 = "1.0.13"
futures-util = { version = "0.3.17", default-features = false }
static_assertions = "1.1"
rcgen = "0.9"
rcgen = "0.11"
rustls-pemfile = "1"
tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
zstd = "0.12"

View file

@ -12,7 +12,7 @@
- [API Documentation](https://docs.rs/awc)
- [Example Project](https://github.com/actix/examples/tree/master/https-tls/awc-https)
- Minimum Supported Rust Version (MSRV): 1.59
- Minimum Supported Rust Version (MSRV): 1.65
## Example

View file

@ -1,4 +1,4 @@
use std::{convert::TryFrom, fmt, net::IpAddr, rc::Rc, time::Duration};
use std::{fmt, net::IpAddr, rc::Rc, time::Duration};
use base64::prelude::*;

View file

@ -1,6 +1,6 @@
//! HTTP client.
use std::{convert::TryFrom, rc::Rc, time::Duration};
use std::{rc::Rc, time::Duration};
use actix_http::{error::HttpError, header::HeaderMap, Method, RequestHead, Uri};
use actix_rt::net::TcpStream;

View file

@ -1,5 +1,4 @@
use std::{
convert::TryFrom,
future::Future,
net::SocketAddr,
pin::Pin,

View file

@ -1,4 +1,4 @@
use std::{convert::TryFrom, fmt, net, rc::Rc, time::Duration};
use std::{fmt, net, rc::Rc, time::Duration};
use base64::prelude::*;
use bytes::Bytes;

View file

@ -26,7 +26,7 @@
//! }
//! ```
use std::{convert::TryFrom, fmt, net::SocketAddr, str};
use std::{fmt, net::SocketAddr, str};
use base64::prelude::*;

View file

@ -1 +1 @@
msrv = "1.59"
msrv = "1.65"