Skip to content

Commit

Permalink
Merge pull request #1241 from dtolnay/edition
Browse files Browse the repository at this point in the history
Update to 2021 edition
  • Loading branch information
dtolnay committed Jul 6, 2023
2 parents fb070e9 + a57ac83 commit 1d9def0
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 25 deletions.
10 changes: 5 additions & 5 deletions BUCK
Expand Up @@ -4,7 +4,7 @@ rust_library(
doc_deps = [
":cxx-build",
],
edition = "2018",
edition = "2021",
features = [
"alloc",
"std",
Expand All @@ -28,7 +28,7 @@ rust_binary(
"gen/cmd/src/gen",
"gen/cmd/src/syntax",
],
edition = "2018",
edition = "2021",
deps = [
"//third-party:clap",
"//third-party:codespan-reporting",
Expand All @@ -53,7 +53,7 @@ rust_library(
name = "cxxbridge-macro",
srcs = glob(["macro/src/**/*.rs"]) + ["macro/src/syntax"],
doctests = False,
edition = "2018",
edition = "2021",
proc_macro = True,
deps = [
"//third-party:proc-macro2",
Expand All @@ -69,7 +69,7 @@ rust_library(
"gen/build/src/syntax",
],
doctests = False,
edition = "2018",
edition = "2021",
deps = [
"//third-party:cc",
"//third-party:codespan-reporting",
Expand All @@ -87,7 +87,7 @@ rust_library(
"gen/lib/src/gen",
"gen/lib/src/syntax",
],
edition = "2018",
edition = "2021",
visibility = ["PUBLIC"],
deps = [
"//third-party:cc",
Expand Down
10 changes: 5 additions & 5 deletions BUILD
Expand Up @@ -8,7 +8,7 @@ rust_library(
"alloc",
"std",
],
edition = "2018",
edition = "2021",
proc_macro_deps = [
":cxxbridge-macro",
],
Expand All @@ -26,7 +26,7 @@ rust_binary(
name = "cxxbridge",
srcs = glob(["gen/cmd/src/**/*.rs"]),
data = ["gen/cmd/src/gen/include/cxx.h"],
edition = "2018",
edition = "2021",
deps = [
"//third-party:clap",
"//third-party:codespan-reporting",
Expand All @@ -53,7 +53,7 @@ cc_library(
rust_proc_macro(
name = "cxxbridge-macro",
srcs = glob(["macro/src/**/*.rs"]),
edition = "2018",
edition = "2021",
deps = [
"//third-party:proc-macro2",
"//third-party:quote",
Expand All @@ -65,7 +65,7 @@ rust_library(
name = "cxx-build",
srcs = glob(["gen/build/src/**/*.rs"]),
data = ["gen/build/src/gen/include/cxx.h"],
edition = "2018",
edition = "2021",
deps = [
"//third-party:cc",
"//third-party:codespan-reporting",
Expand All @@ -81,7 +81,7 @@ rust_library(
name = "cxx-gen",
srcs = glob(["gen/lib/src/**/*.rs"]),
data = ["gen/lib/src/gen/include/cxx.h"],
edition = "2018",
edition = "2021",
visibility = ["//visibility:public"],
deps = [
"//third-party:cc",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -5,7 +5,7 @@ authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["development-tools::ffi", "api-bindings", "no-std"]
description = "Safe interop between Rust and C++"
documentation = "https://docs.rs/cxx"
edition = "2018"
edition = "2021"
exclude = ["/demo", "/gen", "/syntax", "/third-party", "/tools/buck/prelude"]
homepage = "https://cxx.rs"
keywords = ["ffi", "c++"]
Expand Down
2 changes: 1 addition & 1 deletion book/book.toml
Expand Up @@ -4,7 +4,7 @@ authors = ["David Tolnay"]
description = "CXX — safe interop between Rust and C++"

[rust]
edition = "2018"
edition = "2021"

[build]
build-dir = "build"
Expand Down
2 changes: 1 addition & 1 deletion flags/Cargo.toml
Expand Up @@ -4,7 +4,7 @@ version = "1.0.99"
authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["development-tools::ffi", "compilers"]
description = "Compiler configuration of the `cxx` crate (implementation detail)"
edition = "2018"
edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/dtolnay/cxx"
rust-version = "1.60"
Expand Down
2 changes: 1 addition & 1 deletion gen/build/Cargo.toml
Expand Up @@ -5,7 +5,7 @@ authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["development-tools::build-utils", "development-tools::ffi"]
description = "C++ code generator for integrating `cxx` crate into a Cargo build."
documentation = "https://docs.rs/cxx-build"
edition = "2018"
edition = "2021"
exclude = ["build.rs"]
homepage = "https://cxx.rs"
keywords = ["ffi", "build-dependencies"]
Expand Down
2 changes: 1 addition & 1 deletion gen/cmd/Cargo.toml
Expand Up @@ -4,7 +4,7 @@ version = "1.0.99"
authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["development-tools::build-utils", "development-tools::ffi"]
description = "C++ code generator for integrating `cxx` crate into a non-Cargo build."
edition = "2018"
edition = "2021"
exclude = ["build.rs"]
homepage = "https://cxx.rs"
keywords = ["ffi"]
Expand Down
2 changes: 1 addition & 1 deletion gen/lib/Cargo.toml
Expand Up @@ -4,7 +4,7 @@ version = "0.7.99"
authors = ["Adrian Taylor <adetaylor@chromium.org>"]
categories = ["development-tools::ffi"]
description = "C++ code generator for integrating `cxx` crate into higher level tools."
edition = "2018"
edition = "2021"
exclude = ["build.rs"]
keywords = ["ffi"]
license = "MIT OR Apache-2.0"
Expand Down
1 change: 0 additions & 1 deletion gen/src/nested.rs
Expand Up @@ -56,7 +56,6 @@ mod tests {
use crate::syntax::namespace::Namespace;
use crate::syntax::{Api, Doc, ExternType, ForeignName, Lang, Lifetimes, Pair};
use proc_macro2::{Ident, Span};
use std::iter::FromIterator;
use syn::punctuated::Punctuated;
use syn::Token;

Expand Down
2 changes: 1 addition & 1 deletion macro/Cargo.toml
Expand Up @@ -4,7 +4,7 @@ version = "1.0.99"
authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["development-tools::ffi"]
description = "Implementation detail of the `cxx` crate."
edition = "2018"
edition = "2021"
exclude = ["build.rs", "README.md"]
homepage = "https://cxx.rs"
keywords = ["ffi"]
Expand Down
1 change: 0 additions & 1 deletion syntax/discriminant.rs
Expand Up @@ -5,7 +5,6 @@ use std::cmp::Ordering;
use std::collections::BTreeSet;
use std::fmt::{self, Display};
use std::str::FromStr;
use std::u64;
use syn::{Error, Expr, Lit, Result, Token, UnOp};

pub struct DiscriminantSet {
Expand Down
1 change: 0 additions & 1 deletion syntax/namespace.rs
@@ -1,7 +1,6 @@
use crate::syntax::qualified::QualifiedName;
use quote::IdentFragment;
use std::fmt::{self, Display};
use std::iter::FromIterator;
use std::slice::Iter;
use syn::parse::{Error, Parse, ParseStream, Result};
use syn::{Expr, Ident, Lit, Meta, Token};
Expand Down
4 changes: 2 additions & 2 deletions tests/BUCK
Expand Up @@ -3,7 +3,7 @@ load("//tools/buck:rust_cxx_bridge.bzl", "rust_cxx_bridge")
rust_test(
name = "test",
srcs = ["test.rs"],
edition = "2018",
edition = "2021",
deps = [
":ffi",
"//:cxx",
Expand All @@ -18,7 +18,7 @@ rust_library(
"ffi/module.rs",
],
crate = "cxx_test_suite",
edition = "2018",
edition = "2021",
deps = [
":impl",
"//:cxx",
Expand Down
4 changes: 2 additions & 2 deletions tests/BUILD
Expand Up @@ -6,7 +6,7 @@ rust_test(
name = "test",
size = "small",
srcs = ["test.rs"],
edition = "2018",
edition = "2021",
deps = [
":cxx_test_suite",
"//:cxx",
Expand All @@ -20,7 +20,7 @@ rust_library(
"ffi/lib.rs",
"ffi/module.rs",
],
edition = "2018",
edition = "2021",
deps = [
":impl",
"//:cxx",
Expand Down
2 changes: 1 addition & 1 deletion tests/ffi/Cargo.toml
Expand Up @@ -2,7 +2,7 @@
name = "cxx-test-suite"
version = "0.0.0"
authors = ["David Tolnay <dtolnay@gmail.com>"]
edition = "2018"
edition = "2021"
publish = false

[lib]
Expand Down
1 change: 1 addition & 0 deletions third-party/Cargo.toml
Expand Up @@ -2,6 +2,7 @@
[package]
name = "third-party"
version = "0.0.0"
edition = "2021"
publish = false

[lib]
Expand Down

0 comments on commit 1d9def0

Please sign in to comment.