Merge pull request #453 from dtolnay/sliceconst

Rename rust::Slice<T> to rust::Slice<const T>
diff --git a/README.md b/README.md
index 49b8d09..26a8ba7 100644
--- a/README.md
+++ b/README.md
@@ -151,7 +151,7 @@
 - **Functions** &mdash; implemented in either language, callable from the other
   language.
 
-Within the `extern "C"` part of the CXX bridge we list the types and functions
+Within the `extern "C++"` part of the CXX bridge we list the types and functions
 for which C++ is the source of truth, as well as the header(s) that declare
 those APIs. In the future it's possible that this section could be generated
 bindgen-style from the headers but for now we need the signatures written out;
diff --git a/gen/lib/tests/test.rs b/gen/lib/tests/test.rs
index 73a25f3..ebb69a8 100644
--- a/gen/lib/tests/test.rs
+++ b/gen/lib/tests/test.rs
@@ -6,7 +6,7 @@
     let rs = quote! {
         #[cxx::bridge]
         mod ffi {
-            extern "C" {
+            extern "C++" {
                 fn in_C();
             }
             extern "Rust" {
diff --git a/macro/src/lib.rs b/macro/src/lib.rs
index e55a08a..852aacc 100644
--- a/macro/src/lib.rs
+++ b/macro/src/lib.rs
@@ -27,7 +27,7 @@
 /// is intended to be used.
 ///
 /// The only additional thing to note here is namespace support &mdash; if the
-/// types and functions on the `extern "C"` side of our bridge are in a
+/// types and functions on the `extern "C++"` side of our bridge are in a
 /// namespace, specify that namespace as an argument of the cxx::bridge
 /// attribute macro.
 ///
diff --git a/src/exception.rs b/src/exception.rs
index 0ffca66..f61e8fa 100644
--- a/src/exception.rs
+++ b/src/exception.rs
@@ -1,7 +1,7 @@
 use alloc::boxed::Box;
 use core::fmt::{self, Debug, Display};
 
-/// Exception thrown from an `extern "C"` function.
+/// Exception thrown from an `extern "C++"` function.
 #[derive(Debug)]
 pub struct Exception {
     pub(crate) what: Box<str>,
diff --git a/src/extern_type.rs b/src/extern_type.rs
index f92ff40..008fdc1 100644
--- a/src/extern_type.rs
+++ b/src/extern_type.rs
@@ -30,7 +30,7 @@
 /// # mod file1 {
 /// #[cxx::bridge(namespace = "example")]
 /// pub mod ffi {
-///     extern "C" {
+///     extern "C++" {
 ///         type Demo;
 ///
 ///         fn create_demo() -> UniquePtr<Demo>;
@@ -41,7 +41,7 @@
 /// // file2.rs
 /// #[cxx::bridge(namespace = "example")]
 /// pub mod ffi {
-///     extern "C" {
+///     extern "C++" {
 ///         type Demo = crate::file1::ffi::Demo;
 ///
 ///         fn take_ref_demo(demo: &Demo);
@@ -80,7 +80,7 @@
 ///
 /// #[cxx::bridge(namespace = "folly")]
 /// pub mod ffi {
-///     extern "C" {
+///     extern "C++" {
 ///         include!("rust_cxx_bindings.h");
 ///
 ///         type StringPiece = crate::folly_sys::StringPiece;
diff --git a/src/lib.rs b/src/lib.rs
index 1b71536..9a3e04e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -156,7 +156,7 @@
 //! - **Functions** &mdash; implemented in either language, callable from the
 //!   other language.
 //!
-//! Within the `extern "C"` part of the CXX bridge we list the types and
+//! Within the `extern "C++"` part of the CXX bridge we list the types and
 //! functions for which C++ is the source of truth, as well as the header(s)
 //! that declare those APIs. In the future it's possible that this section could
 //! be generated bindgen-style from the headers but for now we need the
diff --git a/syntax/parse.rs b/syntax/parse.rs
index a5f8bd1..b557584 100644
--- a/syntax/parse.rs
+++ b/syntax/parse.rs
@@ -280,7 +280,7 @@
         None => {
             return Err(Error::new_spanned(
                 abi,
-                "ABI name is required, extern \"C\" or extern \"Rust\"",
+                "ABI name is required, extern \"C++\" or extern \"Rust\"",
             ));
         }
     };
diff --git a/tests/cxx_gen.rs b/tests/cxx_gen.rs
index 06d7bc7..340e2d7 100644
--- a/tests/cxx_gen.rs
+++ b/tests/cxx_gen.rs
@@ -6,7 +6,7 @@
 const BRIDGE0: &str = r#"
     #[cxx::bridge]
     mod ffi {
-        extern "C" {
+        extern "C++" {
             pub fn do_cpp_thing(foo: &str);
         }
     }
diff --git a/tests/ffi/extra.rs b/tests/ffi/extra.rs
index cd76a7d..b5ed579 100644
--- a/tests/ffi/extra.rs
+++ b/tests/ffi/extra.rs
@@ -15,7 +15,7 @@
     impl UniquePtr<F> {}
     impl UniquePtr<G> {}
 
-    extern "C" {
+    extern "C++" {
         include!("tests/ffi/tests.h");
 
         type D = crate::other::D;
diff --git a/tests/ffi/lib.rs b/tests/ffi/lib.rs
index 4c7cbe4..6ece294 100644
--- a/tests/ffi/lib.rs
+++ b/tests/ffi/lib.rs
@@ -116,7 +116,7 @@
         i: i32,
     }
 
-    extern "C" {
+    extern "C++" {
         include!("tests/ffi/tests.h");
 
         type C;
@@ -219,7 +219,7 @@
         fn ns_c_take_ns_shared(shared: AShared);
     }
 
-    extern "C" {
+    extern "C++" {
         type COwnedEnum;
     }
 
diff --git a/tests/ffi/module.rs b/tests/ffi/module.rs
index 899d45b..cf53cde 100644
--- a/tests/ffi/module.rs
+++ b/tests/ffi/module.rs
@@ -3,7 +3,7 @@
 #[rustfmt::skip]
 #[cxx::bridge(namespace = "tests")]
 pub mod ffi {
-    extern "C" {
+    extern "C++" {
         include!("tests/ffi/tests.h");
 
         type C = crate::ffi::C;
diff --git a/tests/ui/by_value_not_supported.rs b/tests/ui/by_value_not_supported.rs
index 3ff950a..62bf8d4 100644
--- a/tests/ui/by_value_not_supported.rs
+++ b/tests/ui/by_value_not_supported.rs
@@ -6,7 +6,7 @@
         s: CxxString,
     }
 
-    extern "C" {
+    extern "C++" {
         type C;
     }
 
diff --git a/tests/ui/disallow_lifetime.rs b/tests/ui/disallow_lifetime.rs
index ee39fef..b07697a 100644
--- a/tests/ui/disallow_lifetime.rs
+++ b/tests/ui/disallow_lifetime.rs
@@ -1,6 +1,6 @@
 #[cxx::bridge]
 mod ffi {
-    extern "C" {
+    extern "C++" {
         type C;
         fn f(&'static self);
     }
diff --git a/tests/ui/include.rs b/tests/ui/include.rs
index 82fa8de..3e848b5 100644
--- a/tests/ui/include.rs
+++ b/tests/ui/include.rs
@@ -1,6 +1,6 @@
 #[cxx::bridge]
 mod ffi {
-    extern "C" {
+    extern "C++" {
         include!("path/to" what);
         include!(<path/to> what);
         include!(<path/to);
diff --git a/tests/ui/reference_to_reference.rs b/tests/ui/reference_to_reference.rs
index 526d036..2318533 100644
--- a/tests/ui/reference_to_reference.rs
+++ b/tests/ui/reference_to_reference.rs
@@ -1,6 +1,6 @@
 #[cxx::bridge]
 mod ffi {
-    extern "C" {
+    extern "C++" {
         type ThingC;
         fn repro_c(t: &&ThingC);
     }
diff --git a/tests/ui/reserved_name.rs b/tests/ui/reserved_name.rs
index 27acca5..409e67c 100644
--- a/tests/ui/reserved_name.rs
+++ b/tests/ui/reserved_name.rs
@@ -4,7 +4,7 @@
         val: usize,
     }
 
-    extern "C" {
+    extern "C++" {
         type Box;
     }
 
diff --git a/tests/ui/unique_ptr_to_opaque.rs b/tests/ui/unique_ptr_to_opaque.rs
index 720ca69..5226ca8 100644
--- a/tests/ui/unique_ptr_to_opaque.rs
+++ b/tests/ui/unique_ptr_to_opaque.rs
@@ -11,7 +11,7 @@
 
 #[cxx::bridge]
 mod ffi {
-    extern "C" {
+    extern "C++" {
         type C = crate::outside::C;
     }
 
diff --git a/tests/ui/unique_ptr_twice.rs b/tests/ui/unique_ptr_twice.rs
index b6cb4d4..14c6f62 100644
--- a/tests/ui/unique_ptr_twice.rs
+++ b/tests/ui/unique_ptr_twice.rs
@@ -1,6 +1,6 @@
 #[cxx::bridge]
 mod here {
-    extern "C" {
+    extern "C++" {
         type C;
     }
 
@@ -9,7 +9,7 @@
 
 #[cxx::bridge]
 mod there {
-    extern "C" {
+    extern "C++" {
         type C = crate::here::C;
     }
 
diff --git a/tests/ui/unnamed_receiver.rs b/tests/ui/unnamed_receiver.rs
index 917e991..13c23ae 100644
--- a/tests/ui/unnamed_receiver.rs
+++ b/tests/ui/unnamed_receiver.rs
@@ -1,6 +1,6 @@
 #[cxx::bridge]
 mod ffi {
-    extern "C" {
+    extern "C++" {
         type One;
         type Two;
         fn f(&mut self);
diff --git a/tests/ui/unrecognized_receiver.rs b/tests/ui/unrecognized_receiver.rs
index 823bfcf..5b09c56 100644
--- a/tests/ui/unrecognized_receiver.rs
+++ b/tests/ui/unrecognized_receiver.rs
@@ -1,6 +1,6 @@
 #[cxx::bridge]
 mod ffi {
-    extern "C" {
+    extern "C++" {
         fn f(self: &Unrecognized);
     }
 }
diff --git a/tests/ui/wrong_type_id.rs b/tests/ui/wrong_type_id.rs
index e3d1380..9137e51 100644
--- a/tests/ui/wrong_type_id.rs
+++ b/tests/ui/wrong_type_id.rs
@@ -1,13 +1,13 @@
 #[cxx::bridge(namespace = "folly")]
 mod here {
-    extern "C" {
+    extern "C++" {
         type StringPiece;
     }
 }
 
 #[cxx::bridge(namespace = "folly")]
 mod there {
-    extern "C" {
+    extern "C++" {
         type ByteRange = crate::here::StringPiece;
     }
 }