Migrate Rocket to Rust 2021 edition.

This commit is contained in:
Konrad Borowski 2022-03-19 19:25:24 +01:00 committed by Sergio Benitez
parent 4d83f73f86
commit 4d258739f5
31 changed files with 38 additions and 50 deletions

View File

@ -1,7 +1,7 @@
[package]
name = "rocket-benchmarks"
version = "0.0.0"
edition = "2018"
edition = "2021"
publish = false
[workspace]

View File

@ -7,7 +7,8 @@ repository = "https://github.com/SergioBenitez/Rocket/contrib/db_pools"
readme = "../README.md"
keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"
[lib]
proc-macro = true

View File

@ -7,7 +7,8 @@ repository = "https://github.com/SergioBenitez/Rocket/contrib/db_pools"
readme = "../README.md"
keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"
[package.metadata.docs.rs]
all-features = true

View File

@ -9,7 +9,8 @@ repository = "https://github.com/SergioBenitez/Rocket/tree/master/contrib/dyn_te
readme = "README.md"
keywords = ["rocket", "framework", "templates", "templating", "engine"]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"
[features]
tera = ["tera_"]

View File

@ -7,7 +7,8 @@ repository = "https://github.com/SergioBenitez/Rocket/contrib/sync_db_pools"
readme = "../README.md"
keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"
[lib]
proc-macro = true

View File

@ -7,7 +7,8 @@ repository = "https://github.com/SergioBenitez/Rocket/tree/v0.5-rc/contrib/sync_
readme = "../README.md"
keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"
[features]
diesel_sqlite_pool = ["diesel/sqlite", "diesel/r2d2"]

View File

@ -60,7 +60,7 @@ use crate::{Config, Error};
/// # impl self::r2d2::ManageConnection for ConnectionManager {
/// # type Connection = Connection;
/// # type Error = Error;
/// # fn connect(&self) -> Result<Connection> { panic!(()) }
/// # fn connect(&self) -> Result<Connection> { panic!() }
/// # fn is_valid(&self, _: &mut Connection) -> Result<()> { panic!() }
/// # fn has_broken(&self, _: &mut Connection) -> bool { panic!() }
/// # }

View File

@ -9,7 +9,8 @@ repository = "https://github.com/SergioBenitez/Rocket"
readme = "../../README.md"
keywords = ["rocket", "web", "framework", "code", "generation"]
license = "MIT OR Apache-2.0"
edition = "2018"
edition = "2021"
rust-version = "1.56"
[lib]
proc-macro = true

View File

@ -12,7 +12,8 @@ readme = "../../README.md"
keywords = ["rocket", "web", "framework", "http"]
license = "MIT OR Apache-2.0"
categories = ["web-programming"]
edition = "2018"
edition = "2021"
rust-version = "1.56"
[features]
default = []

View File

@ -13,7 +13,8 @@ keywords = ["rocket", "web", "framework", "server"]
license = "MIT OR Apache-2.0"
build = "build.rs"
categories = ["web-programming::http-server"]
edition = "2018"
edition = "2021"
rust-version = "1.56"
[package.metadata.docs.rs]
all-features = true
@ -82,7 +83,6 @@ features = ["io"]
version = "1.0"
[build-dependencies]
yansi = "0.5"
version_check = "0.9.1"
[dev-dependencies]

View File

@ -1,23 +1,4 @@
//! Ensures Rocket isn't compiled with an incompatible version of Rust.
use yansi::{Paint, Color::{Red, Yellow}};
fn main() {
const MIN_VERSION: &str = "1.46.0";
if let Some(version) = version_check::Version::read() {
if !version.at_least(MIN_VERSION) {
let msg = "Rocket requires a more recent version of rustc.";
eprintln!("{} {}", Red.paint("Error:").bold(), Paint::new(msg).bold());
eprintln!("Installed version: {}", Yellow.paint(version));
eprintln!("Minimum required: {}", Yellow.paint(MIN_VERSION));
panic!("Aborting compilation due to incompatible compiler.")
}
} else {
println!("cargo:warning=Rocket was unable to check rustc compiler compatibility.");
println!("cargo:warning=Build may fail due to incompatible rustc version.");
}
if let Some(true) = version_check::is_feature_flaggable() {
println!("cargo:rustc-cfg=nightly");
}

View File

@ -4,7 +4,7 @@ name = "rocket-fuzz"
version = "0.0.0"
authors = ["Automatically generated"]
publish = false
edition = "2018"
edition = "2021"
[package.metadata]
cargo-fuzz = true

View File

@ -2,7 +2,7 @@
name = "chat"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "config"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "cookies"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "databases"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "error-handling"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "fairings"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "forms"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "hello"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "manual_routes"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "pastebin"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "responders"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "serialization"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies.rocket]

View File

@ -2,7 +2,7 @@
name = "state"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "static-files"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "templating"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "testing"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "tls"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "todo"
version = "0.0.0"
workspace = "../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]

View File

@ -2,7 +2,7 @@
name = "rocket_guide_tests"
version = "0.5.0-rc.1"
workspace = "../../"
edition = "2018"
edition = "2021"
publish = false
[dependencies]