Merge tag 'upstream/v1.0.44' into jsonrc-update-to-1.0.44

Release 1.0.44 of serde_json merged into serde_jsonrc.
diff --git a/Cargo.toml b/Cargo.toml
index 1fe9a2c..20a6b76 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,20 +1,20 @@
 [package]
-name = "serde_json"
-version = "1.0.44" # remember to update html_root_url
-authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
-license = "MIT OR Apache-2.0"
-description = "A JSON serialization file format"
+name = "serde_jsonrc"
+version = "0.1.1" # remember to update html_root_url
+authors = [
+    "Michael Bolin <bolinfest@gmail.com>",
+    "Erick Tryzelaar <erick.tryzelaar@gmail.com>",
+    "David Tolnay <dtolnay@gmail.com>",
+]
+license = "MIT/Apache-2.0"
+description = "A lenient JSON serialization file format"
 repository = "https://github.com/serde-rs/json"
-documentation = "http://docs.serde.rs/serde_json/"
+documentation = "http://docs.serde.rs/serde_jsonrc/"
 keywords = ["json", "serde", "serialization"]
 categories = ["encoding"]
 readme = "README.md"
 include = ["Cargo.toml", "src/**/*.rs", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
 
-[badges]
-travis-ci = { repository = "serde-rs/json" }
-appveyor = { repository = "serde-rs/json" }
-
 [dependencies]
 serde = "1.0.60"
 indexmap = { version = "1.2", optional = true }
@@ -44,12 +44,12 @@
 [features]
 default = []
 
-# Use a different representation for the map type of serde_json::Value.
+# Use a different representation for the map type of serde_jsonrc::Value.
 # This allows data to be read into a Value and written back to a JSON string
 # while preserving the order of map keys in the input.
 preserve_order = ["indexmap"]
 
-# Use an arbitrary precision number representation for serde_json::Number. This
+# Use an arbitrary precision number representation for serde_jsonrc::Number. This
 # allows JSON numbers of arbitrary size/precision to be read into a Number and
 # written back to a JSON string without loss of precision.
 arbitrary_precision = []
diff --git a/README.md b/README.md
index d67cf22..535bba5 100644
--- a/README.md
+++ b/README.md
@@ -1,353 +1,95 @@
-# Serde JSON &emsp; [![Build Status]][travis] [![Latest Version]][crates.io] [![Rustc Version 1.15+]][rustc]
+# serde_jsonrc
 
-[Build Status]: https://api.travis-ci.org/serde-rs/json.svg?branch=master
-[travis]: https://travis-ci.org/serde-rs/json
-[Latest Version]: https://img.shields.io/crates/v/serde_json.svg
-[crates.io]: https://crates.io/crates/serde\_json
-[Rustc Version 1.15+]: https://img.shields.io/badge/rustc-1.15+-lightgray.svg
-[rustc]: https://blog.rust-lang.org/2017/02/02/Rust-1.15.html
+This is a lenient JSON parser forked from the
+[serde_json](https://crates.io/crates/serde_json) crate
+that is that is designed to parse JSON written by humans
+(e.g., JSON config files). This means that it supports:
 
-**Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.**
+- `/*` and `//` style comments.
+- Trailing commas for object and array literals.
+- [planned] Unquoted object keys (precise spec TBD).
 
----
+I am still playing with the idea of making it more lenient,
+which could include taking more features from the
+[JSON5](https://json5.org/) spec.
 
-```toml
-[dependencies]
-serde_json = "1.0"
-```
+## Motivation
 
-You may be looking for:
+When I created this crate, my immediate goal was to create a fast parser
+for a config file for a work project. I wanted a file format that would
+be familiar to developers, but restrictive in what it accepted.
+I had encountered this problem several times in my career, which always
+faced the same set of tradeoffs:
 
-- [JSON API documentation](https://docs.serde.rs/serde_json/)
-- [Serde API documentation](https://docs.serde.rs/serde/)
-- [Detailed documentation about Serde](https://serde.rs/)
-- [Setting up `#[derive(Serialize, Deserialize)]`](https://serde.rs/codegen.html)
-- [Release notes](https://github.com/serde-rs/json/releases)
+- JSON: Not easy enough to use because of lack of support for comments
+  and trailing commas.
+- YAML: Input language has too many features.
+- TOML: Use is not yet widespread enough that I would consider it
+  "familiar to developers." Also, nested objects either end up
+  being verbose or about the same as JSON.
 
-JSON is a ubiquitous open-standard format that uses human-readable text to
-transmit data objects consisting of key-value pairs.
+When considering the relative downsides of each of these options, it
+was clear that what I really wanted was a more lenient JSON.
+The next question was how to get a lenient JSON parser (in Rust, in
+my case). I considered the following options:
 
-```json
-{
-    "name": "John Doe",
-    "age": 43,
-    "address": {
-        "street": "10 Downing Street",
-        "city": "London"
-    },
-    "phones": [
-        "+44 1234567",
-        "+44 2345678"
-    ]
-}
-```
+### Make serde_json lenient
 
-There are three common ways that you might find yourself needing to work
-with JSON data in Rust.
+This was my first choice, but [the maintainer wanted to keep the
+scope of `serde_json` limited to strict JSON](https://github.com/dtolnay/request-for-implementation/issues/24),
+so we respectfully agreed that forking was the way to go.
 
- - **As text data.** An unprocessed string of JSON data that you receive on
-   an HTTP endpoint, read from a file, or prepare to send to a remote
-   server.
- - **As an untyped or loosely typed representation.** Maybe you want to
-   check that some JSON data is valid before passing it on, but without
-   knowing the structure of what it contains. Or you want to do very basic
-   manipulations like insert a key in a particular spot.
- - **As a strongly typed Rust data structure.** When you expect all or most
-   of your data to conform to a particular structure and want to get real
-   work done without JSON's loosey-goosey nature tripping you up.
+### json5 crate
 
-Serde JSON provides efficient, flexible, safe ways of converting data
-between each of these representations.
+The [json5 crate](https://crates.io/crates/json5) supports the superset
+of JSON specified at https://json5.org/. In principle, the feature set
+met my needs, but in practice, I discovered the implementation was not
+nearly as performant as `serde_json`, even for small files.
+(Also, it cannot parse streams: only strings.)
 
-## Operating on untyped JSON values
+### serde-hjson crate
 
-Any valid JSON data can be manipulated in the following recursive enum
-representation. This data structure is [`serde_json::Value`][value].
+The [serde-hjson crate](https://crates.io/crates/serde-hjson) provies
+a parser for a different superset of JSON named [Hjson](http://hjson.org/)
+("JSON for humans"). I am not a fan of Hjson because the language
+it accepts is not valid JavaScript, so it's not nearly intuitive as
+JSON.
 
-```rust
-enum Value {
-    Null,
-    Bool(bool),
-    Number(Number),
-    String(String),
-    Array(Vec<Value>),
-    Object(Map<String, Value>),
-}
-```
+## Long-Term Goals
 
-A string of JSON data can be parsed into a `serde_json::Value` by the
-[`serde_json::from_str`][from_str] function. There is also
-[`from_slice`][from_slice] for parsing from a byte slice &[u8] and
-[`from_reader`][from_reader] for parsing from any `io::Read` like a File or
-a TCP stream.
+Ultimately, I would like to see a more lenient form of JSON
+standardized that experiences the same level of ubiquity as JSON
+today. I would like this crate to be a reference implementation
+of that new, more lenient specification.
 
-<a href="https://play.rust-lang.org/?edition=2018&gist=d69d8e3156d4bb81c4461b60b772ab72" target="_blank">
-<img align="right" width="50" src="https://raw.githubusercontent.com/serde-rs/serde-rs.github.io/master/img/run.png">
-</a>
+I suspect that being more conservative in adding new
+features to the spec has the best chance of getting widespread
+buy-in, which is why I am not immediately gravitating towards
+implementing all of [JSON5](https://json5.org/). Instead,
+I am starting with my [suggested improvements to JSON](http://bolinfest.com/essays/json.html)
+from way back in 2011.
 
-```rust
-use serde_json::{Result, Value};
+Finally, my gut feeling is that a new version of JSON should still
+be valid JavaScript. For example, one other shortcoming of JSON today
+is a lack of support for multiline strings. JSON5 addresses this by
+allowing `\` for continued lines, but at this point, I think backtick
+(`` ` ``) would be a more intuitive solution because that would be
+consistent with ES6 (though string interpolation would not be supported).
 
-fn untyped_example() -> Result<()> {
-    // Some JSON input data as a &str. Maybe this comes from the user.
-    let data = r#"
-        {
-            "name": "John Doe",
-            "age": 43,
-            "phones": [
-                "+44 1234567",
-                "+44 2345678"
-            ]
-        }"#;
+## License
 
-    // Parse the string of data into serde_json::Value.
-    let v: Value = serde_json::from_str(data)?;
+Because serde_jsonrc is a fork of serde_json, it maintains the original licence,
+which means it is licensed under either of
 
-    // Access parts of the data by indexing with square brackets.
-    println!("Please call {} at the number {}", v["name"], v["phones"][0]);
+- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
+  http://www.apache.org/licenses/LICENSE-2.0)
+- MIT license ([LICENSE-MIT](LICENSE-MIT) or
+  http://opensource.org/licenses/MIT)
 
-    Ok(())
-}
-```
+at your option.
 
-The result of square bracket indexing like `v["name"]` is a borrow of the data
-at that index, so the type is `&Value`. A JSON map can be indexed with string
-keys, while a JSON array can be indexed with integer keys. If the type of the
-data is not right for the type with which it is being indexed, or if a map does
-not contain the key being indexed, or if the index into a vector is out of
-bounds, the returned element is `Value::Null`.
-
-When a `Value` is printed, it is printed as a JSON string. So in the code above,
-the output looks like `Please call "John Doe" at the number "+44 1234567"`. The
-quotation marks appear because `v["name"]` is a `&Value` containing a JSON
-string and its JSON representation is `"John Doe"`. Printing as a plain string
-without quotation marks involves converting from a JSON string to a Rust string
-with [`as_str()`] or avoiding the use of `Value` as described in the following
-section.
-
-[`as_str()`]: https://docs.serde.rs/serde_json/enum.Value.html#method.as_str
-
-The `Value` representation is sufficient for very basic tasks but can be tedious
-to work with for anything more significant. Error handling is verbose to
-implement correctly, for example imagine trying to detect the presence of
-unrecognized fields in the input data. The compiler is powerless to help you
-when you make a mistake, for example imagine typoing `v["name"]` as `v["nmae"]`
-in one of the dozens of places it is used in your code.
-
-## Parsing JSON as strongly typed data structures
-
-Serde provides a powerful way of mapping JSON data into Rust data structures
-largely automatically.
-
-<a href="https://play.rust-lang.org/?edition=2018&gist=15cfab66d38ff8a15a9cf1d8d897ac68" target="_blank">
-<img align="right" width="50" src="https://raw.githubusercontent.com/serde-rs/serde-rs.github.io/master/img/run.png">
-</a>
-
-```rust
-use serde::{Deserialize, Serialize};
-use serde_json::Result;
-
-#[derive(Serialize, Deserialize)]
-struct Person {
-    name: String,
-    age: u8,
-    phones: Vec<String>,
-}
-
-fn typed_example() -> Result<()> {
-    // Some JSON input data as a &str. Maybe this comes from the user.
-    let data = r#"
-        {
-            "name": "John Doe",
-            "age": 43,
-            "phones": [
-                "+44 1234567",
-                "+44 2345678"
-            ]
-        }"#;
-
-    // Parse the string of data into a Person object. This is exactly the
-    // same function as the one that produced serde_json::Value above, but
-    // now we are asking it for a Person as output.
-    let p: Person = serde_json::from_str(data)?;
-
-    // Do things just like with any other Rust data structure.
-    println!("Please call {} at the number {}", p.name, p.phones[0]);
-
-    Ok(())
-}
-```
-
-This is the same `serde_json::from_str` function as before, but this time we
-assign the return value to a variable of type `Person` so Serde will
-automatically interpret the input data as a `Person` and produce informative
-error messages if the layout does not conform to what a `Person` is expected
-to look like.
-
-Any type that implements Serde's `Deserialize` trait can be deserialized
-this way. This includes built-in Rust standard library types like `Vec<T>`
-and `HashMap<K, V>`, as well as any structs or enums annotated with
-`#[derive(Deserialize)]`.
-
-Once we have `p` of type `Person`, our IDE and the Rust compiler can help us
-use it correctly like they do for any other Rust code. The IDE can
-autocomplete field names to prevent typos, which was impossible in the
-`serde_json::Value` representation. And the Rust compiler can check that
-when we write `p.phones[0]`, then `p.phones` is guaranteed to be a
-`Vec<String>` so indexing into it makes sense and produces a `String`.
-
-## Constructing JSON values
-
-Serde JSON provides a [`json!` macro][macro] to build `serde_json::Value`
-objects with very natural JSON syntax.
-
-<a href="https://play.rust-lang.org/?edition=2018&gist=6ccafad431d72b62e77cc34c8e879b24" target="_blank">
-<img align="right" width="50" src="https://raw.githubusercontent.com/serde-rs/serde-rs.github.io/master/img/run.png">
-</a>
-
-```rust
-use serde_json::json;
-
-fn main() {
-    // The type of `john` is `serde_json::Value`
-    let john = json!({
-        "name": "John Doe",
-        "age": 43,
-        "phones": [
-            "+44 1234567",
-            "+44 2345678"
-        ]
-    });
-
-    println!("first phone number: {}", john["phones"][0]);
-
-    // Convert to a string of JSON and print it out
-    println!("{}", john.to_string());
-}
-```
-
-The `Value::to_string()` function converts a `serde_json::Value` into a
-`String` of JSON text.
-
-One neat thing about the `json!` macro is that variables and expressions can
-be interpolated directly into the JSON value as you are building it. Serde
-will check at compile time that the value you are interpolating is able to
-be represented as JSON.
-
-<a href="https://play.rust-lang.org/?edition=2018&gist=f9101a6e61dfc9e02c6a67f315ed24f2" target="_blank">
-<img align="right" width="50" src="https://raw.githubusercontent.com/serde-rs/serde-rs.github.io/master/img/run.png">
-</a>
-
-```rust
-let full_name = "John Doe";
-let age_last_year = 42;
-
-// The type of `john` is `serde_json::Value`
-let john = json!({
-    "name": full_name,
-    "age": age_last_year + 1,
-    "phones": [
-        format!("+44 {}", random_phone())
-    ]
-});
-```
-
-This is amazingly convenient but we have the problem we had before with
-`Value` which is that the IDE and Rust compiler cannot help us if we get it
-wrong. Serde JSON provides a better way of serializing strongly-typed data
-structures into JSON text.
-
-## Creating JSON by serializing data structures
-
-A data structure can be converted to a JSON string by
-[`serde_json::to_string`][to_string]. There is also
-[`serde_json::to_vec`][to_vec] which serializes to a `Vec<u8>` and
-[`serde_json::to_writer`][to_writer] which serializes to any `io::Write`
-such as a File or a TCP stream.
-
-<a href="https://play.rust-lang.org/?edition=2018&gist=3472242a08ed2ff88a944f2a2283b0ee" target="_blank">
-<img align="right" width="50" src="https://raw.githubusercontent.com/serde-rs/serde-rs.github.io/master/img/run.png">
-</a>
-
-```rust
-use serde::{Deserialize, Serialize};
-use serde_json::Result;
-
-#[derive(Serialize, Deserialize)]
-struct Address {
-    street: String,
-    city: String,
-}
-
-fn print_an_address() -> Result<()> {
-    // Some data structure.
-    let address = Address {
-        street: "10 Downing Street".to_owned(),
-        city: "London".to_owned(),
-    };
-
-    // Serialize it to a JSON string.
-    let j = serde_json::to_string(&address)?;
-
-    // Print, write to a file, or send to an HTTP server.
-    println!("{}", j);
-
-    Ok(())
-}
-```
-
-Any type that implements Serde's `Serialize` trait can be serialized this
-way. This includes built-in Rust standard library types like `Vec<T>` and
-`HashMap<K, V>`, as well as any structs or enums annotated with
-`#[derive(Serialize)]`.
-
-## Performance
-
-It is fast. You should expect in the ballpark of 500 to 1000 megabytes per
-second deserialization and 600 to 900 megabytes per second serialization,
-depending on the characteristics of your data. This is competitive with the
-fastest C and C++ JSON libraries or even 30% faster for many use cases.
-Benchmarks live in the [serde-rs/json-benchmark] repo.
-
-[serde-rs/json-benchmark]: https://github.com/serde-rs/json-benchmark
-
-## Getting help
-
-Serde developers live in the #serde channel on
-[`irc.mozilla.org`](https://wiki.mozilla.org/IRC). The #rust channel is also a
-good resource with generally faster response time but less specific knowledge
-about Serde. If IRC is not your thing, we are happy to respond to [GitHub
-issues](https://github.com/serde-rs/json/issues/new) as well.
-
-## No-std support
-
-This crate currently requires the Rust standard library. For JSON support in
-Serde without a standard library, please see the [`serde-json-core`] crate.
-
-[`serde-json-core`]: https://japaric.github.io/serde-json-core/serde_json_core/
-
-[value]: https://docs.serde.rs/serde_json/value/enum.Value.html
-[from_str]: https://docs.serde.rs/serde_json/de/fn.from_str.html
-[from_slice]: https://docs.serde.rs/serde_json/de/fn.from_slice.html
-[from_reader]: https://docs.serde.rs/serde_json/de/fn.from_reader.html
-[to_string]: https://docs.serde.rs/serde_json/ser/fn.to_string.html
-[to_vec]: https://docs.serde.rs/serde_json/ser/fn.to_vec.html
-[to_writer]: https://docs.serde.rs/serde_json/ser/fn.to_writer.html
-[macro]: https://docs.serde.rs/serde_json/macro.json.html
-
-<br>
-
-#### License
-
-<sup>
-Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
-2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
-</sup>
-
-<br>
+### Contribution
 
-<sub>
 Unless you explicitly state otherwise, any contribution intentionally submitted
-for inclusion in this crate by you, as defined in the Apache-2.0 license, shall
+for inclusion in serde_jsonrc by you, as defined in the Apache-2.0 license, shall
 be dual licensed as above, without any additional terms or conditions.
-</sub>
diff --git a/src/de.rs b/src/de.rs
index 5c9c20b..d1def35 100644
--- a/src/de.rs
+++ b/src/de.rs
@@ -33,7 +33,7 @@
 where
     R: read::Read<'de>,
 {
-    /// Create a JSON deserializer from one of the possible serde_json input
+    /// Create a JSON deserializer from one of the possible serde_jsonrc input
     /// sources.
     ///
     /// Typically it is more convenient to use one of these methods instead:
@@ -177,7 +177,7 @@
     ///
     /// ```edition2018
     /// use serde::Deserialize;
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// fn main() {
     ///     let mut json = String::new();
@@ -185,7 +185,7 @@
     ///         json = format!("[{}]", json);
     ///     }
     ///
-    ///     let mut deserializer = serde_json::Deserializer::from_str(&json);
+    ///     let mut deserializer = serde_jsonrc::Deserializer::from_str(&json);
     ///     deserializer.disable_recursion_limit();
     ///     let deserializer = serde_stacker::Deserializer::new(&mut deserializer);
     ///     let value = Value::deserialize(deserializer).unwrap();
@@ -244,11 +244,64 @@
     /// Returns the first non-whitespace byte without consuming it, or `None` if
     /// EOF is encountered.
     fn parse_whitespace(&mut self) -> Result<Option<u8>> {
+        // Consume comments as if they were whitespace.
         loop {
             match try!(self.peek()) {
                 Some(b' ') | Some(b'\n') | Some(b'\t') | Some(b'\r') => {
                     self.eat_char();
                 }
+                Some(b'/') => {
+                    self.eat_char();
+                    match try!(self.peek()) {
+                        Some(b'/') => {
+                            // TODO: Read until newline.
+                            loop {
+                                match try!(self.peek()) {
+                                    Some(b'\n') => {
+                                        self.eat_char();
+                                        break;
+                                    }
+                                    Some(_) => {
+                                        self.eat_char();
+                                    }
+                                    None => {
+                                        return Ok(None);
+                                    }
+                                }
+                            }
+                        }
+                        Some(b'*') => loop {
+                            match try!(self.peek()) {
+                                Some(b'*') => {
+                                    self.eat_char();
+                                    match try!(self.peek()) {
+                                        Some(b'/') => {
+                                            self.eat_char();
+                                            break;
+                                        }
+                                        Some(_) => self.eat_char(),
+                                        None => {
+                                            return Err(self.peek_error(
+                                                ErrorCode::EofWhileParsingBlockComment,
+                                            ));
+                                        }
+                                    }
+                                }
+                                Some(_) => {
+                                    self.eat_char();
+                                }
+                                None => {
+                                    return Err(
+                                        self.peek_error(ErrorCode::EofWhileParsingBlockComment)
+                                    );
+                                }
+                            }
+                        },
+                        _ => {
+                            return Err(self.peek_error(ErrorCode::ExpectedCommentSlashOrStar));
+                        }
+                    };
+                }
                 other => {
                     return Ok(other);
                 }
@@ -412,11 +465,13 @@
                             // number as a `u64` until we grow too large. At that point, switch to
                             // parsing the value as a `f64`.
                             if overflow!(res * 10 + digit, u64::max_value()) {
-                                return Ok(ParserNumber::F64(try!(self.parse_long_integer(
+                                return Ok(ParserNumber::F64(try!(
+                                    self.parse_long_integer(
                                     positive,
                                     res,
                                     1, // res * 10^1
-                                ))));
+                                )
+                                )));
                             }
 
                             res = res * 10 + digit;
@@ -1356,7 +1411,7 @@
     ///
     /// [RFC 7159]: https://tools.ietf.org/html/rfc7159
     ///
-    /// The behavior of serde_json is specified to fail on non-UTF-8 strings
+    /// The behavior of serde_jsonrc is specified to fail on non-UTF-8 strings
     /// when deserializing into Rust UTF-8 string types such as String, and
     /// succeed with non-UTF-8 bytes when deserializing using this method.
     ///
@@ -1370,9 +1425,9 @@
     /// ```edition2018
     /// use serde_bytes::ByteBuf;
     ///
-    /// fn look_at_bytes() -> Result<(), serde_json::Error> {
+    /// fn look_at_bytes() -> Result<(), serde_jsonrc::Error> {
     ///     let json_data = b"\"some bytes: \xe5\x00\xe5\"";
-    ///     let bytes: ByteBuf = serde_json::from_slice(json_data)?;
+    ///     let bytes: ByteBuf = serde_jsonrc::from_slice(json_data)?;
     ///
     ///     assert_eq!(b'\xe5', bytes[12]);
     ///     assert_eq!(b'\0', bytes[13]);
@@ -1393,7 +1448,7 @@
     ///
     /// fn look_at_bytes() {
     ///     let json_data = b"\"invalid unicode surrogate: \\uD801\"";
-    ///     let parsed: Result<ByteBuf, _> = serde_json::from_slice(json_data);
+    ///     let parsed: Result<ByteBuf, _> = serde_jsonrc::from_slice(json_data);
     ///
     ///     assert!(parsed.is_err());
     ///
@@ -1690,15 +1745,11 @@
 
 struct SeqAccess<'a, R: 'a> {
     de: &'a mut Deserializer<R>,
-    first: bool,
 }
 
 impl<'a, R: 'a> SeqAccess<'a, R> {
     fn new(de: &'a mut Deserializer<R>) -> Self {
-        SeqAccess {
-            de: de,
-            first: true,
-        }
+        SeqAccess { de }
     }
 }
 
@@ -1709,46 +1760,44 @@
     where
         T: de::DeserializeSeed<'de>,
     {
-        let peek = match try!(self.de.parse_whitespace()) {
-            Some(b']') => {
-                return Ok(None);
-            }
-            Some(b',') if !self.first => {
-                self.de.eat_char();
-                try!(self.de.parse_whitespace())
-            }
+        match try!(self.de.parse_whitespace()) {
             Some(b) => {
-                if self.first {
-                    self.first = false;
-                    Some(b)
+                // List most common branch first.
+                if b != b']' {
+                    let result = Ok(Some(try!(seed.deserialize(&mut *self.de))));
+                    if !result.is_ok() {
+                        return result;
+                    }
+
+                    match try!(self.de.parse_whitespace()) {
+                        Some(b',') => self.de.eat_char(),
+                        Some(b']') => {
+                            // Ignore.
+                        }
+                        Some(_) => {
+                            return Err(self.de.peek_error(ErrorCode::ExpectedListCommaOrEnd));
+                        }
+                        None => {
+                            return Err(self.de.peek_error(ErrorCode::EofWhileParsingList));
+                        }
+                    }
+                    result
                 } else {
-                    return Err(self.de.peek_error(ErrorCode::ExpectedListCommaOrEnd));
+                    Ok(None)
                 }
             }
-            None => {
-                return Err(self.de.peek_error(ErrorCode::EofWhileParsingList));
-            }
-        };
-
-        match peek {
-            Some(b']') => Err(self.de.peek_error(ErrorCode::TrailingComma)),
-            Some(_) => Ok(Some(try!(seed.deserialize(&mut *self.de)))),
-            None => Err(self.de.peek_error(ErrorCode::EofWhileParsingValue)),
+            None => Err(self.de.peek_error(ErrorCode::EofWhileParsingList)),
         }
     }
 }
 
 struct MapAccess<'a, R: 'a> {
     de: &'a mut Deserializer<R>,
-    first: bool,
 }
 
 impl<'a, R: 'a> MapAccess<'a, R> {
     fn new(de: &'a mut Deserializer<R>) -> Self {
-        MapAccess {
-            de: de,
-            first: true,
-        }
+        MapAccess { de }
     }
 }
 
@@ -1759,32 +1808,13 @@
     where
         K: de::DeserializeSeed<'de>,
     {
-        let peek = match try!(self.de.parse_whitespace()) {
+        match try!(self.de.parse_whitespace()) {
+            Some(b'"') => seed.deserialize(MapKey { de: &mut *self.de }).map(Some),
             Some(b'}') => {
                 return Ok(None);
             }
-            Some(b',') if !self.first => {
-                self.de.eat_char();
-                try!(self.de.parse_whitespace())
-            }
-            Some(b) => {
-                if self.first {
-                    self.first = false;
-                    Some(b)
-                } else {
-                    return Err(self.de.peek_error(ErrorCode::ExpectedObjectCommaOrEnd));
-                }
-            }
-            None => {
-                return Err(self.de.peek_error(ErrorCode::EofWhileParsingObject));
-            }
-        };
-
-        match peek {
-            Some(b'"') => seed.deserialize(MapKey { de: &mut *self.de }).map(Some),
-            Some(b'}') => Err(self.de.peek_error(ErrorCode::TrailingComma)),
             Some(_) => Err(self.de.peek_error(ErrorCode::KeyMustBeAString)),
-            None => Err(self.de.peek_error(ErrorCode::EofWhileParsingValue)),
+            None => Err(self.de.peek_error(ErrorCode::EofWhileParsingObject)),
         }
     }
 
@@ -1793,8 +1823,22 @@
         V: de::DeserializeSeed<'de>,
     {
         try!(self.de.parse_object_colon());
-
-        seed.deserialize(&mut *self.de)
+        let result = seed.deserialize(&mut *self.de);
+        if result.is_ok() {
+            match try!(self.de.parse_whitespace()) {
+                Some(b',') => self.de.eat_char(),
+                Some(b'}') => {
+                    // Ignore.
+                }
+                Some(_) => {
+                    return Err(self.de.peek_error(ErrorCode::ExpectedObjectCommaOrEnd));
+                }
+                None => {
+                    return Err(self.de.peek_error(ErrorCode::EofWhileParsingObject));
+                }
+            };
+        };
+        result
     }
 }
 
@@ -2032,7 +2076,7 @@
 /// arrays, objects, or strings, or be followed by whitespace or a self-delineating value.
 ///
 /// ```edition2018
-/// use serde_json::{Deserializer, Value};
+/// use serde_jsonrc::{Deserializer, Value};
 ///
 /// fn main() {
 ///     let data = "{\"k\": 3}1\"cool\"\"stuff\" 3{}  [0, 1, 2]";
@@ -2056,7 +2100,7 @@
     R: read::Read<'de>,
     T: de::Deserialize<'de>,
 {
-    /// Create a JSON stream deserializer from one of the possible serde_json
+    /// Create a JSON stream deserializer from one of the possible serde_jsonrc
     /// input sources.
     ///
     /// Typically it is more convenient to use one of these methods instead:
@@ -2082,7 +2126,7 @@
     /// ```edition2018
     /// let data = b"[0] [1] [";
     ///
-    /// let de = serde_json::Deserializer::from_slice(data);
+    /// let de = serde_jsonrc::Deserializer::from_slice(data);
     /// let mut stream = de.into_iter::<Vec<i32>>();
     /// assert_eq!(0, stream.byte_offset());
     ///
@@ -2187,10 +2231,10 @@
 /// Deserialize an instance of type `T` from an IO stream of JSON.
 ///
 /// The content of the IO stream is deserialized directly from the stream
-/// without being buffered in memory by serde_json.
+/// without being buffered in memory by serde_jsonrc.
 ///
 /// When reading from a source against which short reads are not efficient, such
-/// as a [`File`], you will want to apply your own buffering because serde_json
+/// as a [`File`], you will want to apply your own buffering because serde_jsonrc
 /// will not buffer the input. See [`std::io::BufReader`].
 ///
 /// It is expected that the input stream ends after the deserialized object.
@@ -2232,7 +2276,7 @@
 ///     let reader = BufReader::new(file);
 ///
 ///     // Read the JSON contents of the file as an instance of `User`.
-///     let u = serde_json::from_reader(reader)?;
+///     let u = serde_jsonrc::from_reader(reader)?;
 ///
 ///     // Return the `User`.
 ///     Ok(u)
@@ -2261,7 +2305,7 @@
 /// }
 ///
 /// fn read_user_from_stream(tcp_stream: TcpStream) -> Result<User, Box<dyn Error>> {
-///     let mut de = serde_json::Deserializer::from_reader(tcp_stream);
+///     let mut de = serde_jsonrc::Deserializer::from_reader(tcp_stream);
 ///     let u = User::deserialize(&mut de)?;
 ///
 ///     Ok(u)
@@ -2316,7 +2360,7 @@
 ///             \"location\": \"Menlo Park, CA\"
 ///         }";
 ///
-///     let u: User = serde_json::from_slice(j).unwrap();
+///     let u: User = serde_jsonrc::from_slice(j).unwrap();
 ///     println!("{:#?}", u);
 /// }
 /// ```
@@ -2358,7 +2402,7 @@
 ///             \"location\": \"Menlo Park, CA\"
 ///         }";
 ///
-///     let u: User = serde_json::from_str(j).unwrap();
+///     let u: User = serde_jsonrc::from_str(j).unwrap();
 ///     println!("{:#?}", u);
 /// }
 /// ```
diff --git a/src/error.rs b/src/error.rs
index 42f0937..4cebca5 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -18,7 +18,7 @@
     err: Box<ErrorImpl>,
 }
 
-/// Alias for a `Result` with the error type `serde_json::Error`.
+/// Alias for a `Result` with the error type `serde_jsonrc::Error`.
 pub type Result<T> = result::Result<T, Error>;
 
 impl Error {
@@ -51,11 +51,13 @@
         match self.err.code {
             ErrorCode::Message(_) => Category::Data,
             ErrorCode::Io(_) => Category::Io,
-            ErrorCode::EofWhileParsingList
+            ErrorCode::EofWhileParsingBlockComment
+            | ErrorCode::EofWhileParsingList
             | ErrorCode::EofWhileParsingObject
             | ErrorCode::EofWhileParsingString
             | ErrorCode::EofWhileParsingValue => Category::Eof,
             ErrorCode::ExpectedColon
+            | ErrorCode::ExpectedCommentSlashOrStar
             | ErrorCode::ExpectedListCommaOrEnd
             | ErrorCode::ExpectedObjectCommaOrEnd
             | ErrorCode::ExpectedObjectOrArray
@@ -107,7 +109,7 @@
     }
 }
 
-/// Categorizes the cause of a `serde_json::Error`.
+/// Categorizes the cause of a `serde_jsonrc::Error`.
 #[derive(Copy, Clone, PartialEq, Eq, Debug)]
 pub enum Category {
     /// The error was caused by a failure to read or write bytes on an IO
@@ -132,7 +134,7 @@
 
 #[cfg_attr(feature = "cargo-clippy", allow(fallible_impl_from))]
 impl From<Error> for io::Error {
-    /// Convert a `serde_json::Error` into an `io::Error`.
+    /// Convert a `serde_jsonrc::Error` into an `io::Error`.
     ///
     /// JSON syntax and data errors are turned into `InvalidData` IO errors.
     /// EOF errors are turned into `UnexpectedEof` IO errors.
@@ -142,12 +144,12 @@
     ///
     /// enum MyError {
     ///     Io(io::Error),
-    ///     Json(serde_json::Error),
+    ///     Json(serde_jsonrc::Error),
     /// }
     ///
-    /// impl From<serde_json::Error> for MyError {
-    ///     fn from(err: serde_json::Error) -> MyError {
-    ///         use serde_json::error::Category;
+    /// impl From<serde_jsonrc::Error> for MyError {
+    ///     fn from(err: serde_jsonrc::Error) -> MyError {
+    ///         use serde_jsonrc::error::Category;
     ///         match err.classify() {
     ///             Category::Io => {
     ///                 MyError::Io(err.into())
@@ -187,6 +189,9 @@
     /// Some IO error occurred while serializing or deserializing.
     Io(io::Error),
 
+    /// Saw an opening `'/*'` without a closing `'*/'`.
+    EofWhileParsingBlockComment,
+
     /// EOF while parsing a list.
     EofWhileParsingList,
 
@@ -202,6 +207,10 @@
     /// Expected this character to be a `':'`.
     ExpectedColon,
 
+    /// Saw a `'/'` while parsing whitespace, so expected it to be
+    /// followed by either `'/'` or `'*'`.
+    ExpectedCommentSlashOrStar,
+
     /// Expected this character to be either a `','` or a `']'`.
     ExpectedListCommaOrEnd,
 
@@ -303,11 +312,15 @@
         match *self {
             ErrorCode::Message(ref msg) => f.write_str(msg),
             ErrorCode::Io(ref err) => Display::fmt(err, f),
+            ErrorCode::EofWhileParsingBlockComment => {
+                f.write_str("EOF while parsing a block comment")
+            }
             ErrorCode::EofWhileParsingList => f.write_str("EOF while parsing a list"),
             ErrorCode::EofWhileParsingObject => f.write_str("EOF while parsing an object"),
             ErrorCode::EofWhileParsingString => f.write_str("EOF while parsing a string"),
             ErrorCode::EofWhileParsingValue => f.write_str("EOF while parsing a value"),
             ErrorCode::ExpectedColon => f.write_str("expected `:`"),
+            ErrorCode::ExpectedCommentSlashOrStar => f.write_str("expected `/` or `*` after `/`"),
             ErrorCode::ExpectedListCommaOrEnd => f.write_str("expected `,` or `]`"),
             ErrorCode::ExpectedObjectCommaOrEnd => f.write_str("expected `,` or `}`"),
             ErrorCode::ExpectedObjectOrArray => f.write_str("expected `{` or `[`"),
diff --git a/src/lib.rs b/src/lib.rs
index fe442ca..069441a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,13 @@
-//! # Serde JSON
+//! # Serde jsonrc
+//!
+//! **This crate is a fork of [Serde JSON](https://github.com/serde-rs/json)**
+//! that accepts a more lenient form of JSON. Specifically, it allows:
+//!
+//! - `/*` and `//` style comments.
+//! - Trailing commas for object and array literals.
+//!
+//! This is designed to make it easier to use JSON files that are maintained
+//! by hand, such as configuration files.
 //!
 //! JSON is a ubiquitous open-standard format that uses human-readable text to
 //! transmit data objects consisting of key-value pairs.
@@ -32,16 +41,16 @@
 //!    of your data to conform to a particular structure and want to get real
 //!    work done without JSON's loosey-goosey nature tripping you up.
 //!
-//! Serde JSON provides efficient, flexible, safe ways of converting data
+//! Serde jsonrc provides efficient, flexible, safe ways of converting data
 //! between each of these representations.
 //!
 //! # Operating on untyped JSON values
 //!
 //! Any valid JSON data can be manipulated in the following recursive enum
-//! representation. This data structure is [`serde_json::Value`][value].
+//! representation. This data structure is [`serde_jsonrc::Value`][value].
 //!
 //! ```edition2018
-//! # use serde_json::{Number, Map};
+//! # use serde_jsonrc::{Number, Map};
 //! #
 //! # #[allow(dead_code)]
 //! enum Value {
@@ -54,14 +63,14 @@
 //! }
 //! ```
 //!
-//! A string of JSON data can be parsed into a `serde_json::Value` by the
-//! [`serde_json::from_str`][from_str] function. There is also
+//! A string of JSON data can be parsed into a `serde_jsonrc::Value` by the
+//! [`serde_jsonrc::from_str`][from_str] function. There is also
 //! [`from_slice`][from_slice] for parsing from a byte slice &[u8] and
 //! [`from_reader`][from_reader] for parsing from any `io::Read` like a File or
 //! a TCP stream.
 //!
 //! ```edition2018
-//! use serde_json::{Result, Value};
+//! use serde_jsonrc::{Result, Value};
 //!
 //! fn untyped_example() -> Result<()> {
 //!     // Some JSON input data as a &str. Maybe this comes from the user.
@@ -75,8 +84,8 @@
 //!             ]
 //!         }"#;
 //!
-//!     // Parse the string of data into serde_json::Value.
-//!     let v: Value = serde_json::from_str(data)?;
+//!     // Parse the string of data into serde_jsonrc::Value.
+//!     let v: Value = serde_jsonrc::from_str(data)?;
 //!
 //!     // Access parts of the data by indexing with square brackets.
 //!     println!("Please call {} at the number {}", v["name"], v["phones"][0]);
@@ -104,7 +113,7 @@
 //! a JSON string to a Rust string with [`as_str()`] or avoiding the use of
 //! `Value` as described in the following section.
 //!
-//! [`as_str()`]: https://docs.serde.rs/serde_json/enum.Value.html#method.as_str
+//! [`as_str()`]: https://docs.serde.rs/serde_jsonrc/enum.Value.html#method.as_str
 //!
 //! The `Value` representation is sufficient for very basic tasks but can be
 //! tedious to work with for anything more significant. Error handling is
@@ -120,7 +129,7 @@
 //!
 //! ```edition2018
 //! use serde::{Deserialize, Serialize};
-//! use serde_json::Result;
+//! use serde_jsonrc::Result;
 //!
 //! #[derive(Serialize, Deserialize)]
 //! struct Person {
@@ -142,9 +151,9 @@
 //!         }"#;
 //!
 //!     // Parse the string of data into a Person object. This is exactly the
-//!     // same function as the one that produced serde_json::Value above, but
+//!     // same function as the one that produced serde_jsonrc::Value above, but
 //!     // now we are asking it for a Person as output.
-//!     let p: Person = serde_json::from_str(data)?;
+//!     let p: Person = serde_jsonrc::from_str(data)?;
 //!
 //!     // Do things just like with any other Rust data structure.
 //!     println!("Please call {} at the number {}", p.name, p.phones[0]);
@@ -157,7 +166,7 @@
 //! # }
 //! ```
 //!
-//! This is the same `serde_json::from_str` function as before, but this time we
+//! This is the same `serde_jsonrc::from_str` function as before, but this time we
 //! assign the return value to a variable of type `Person` so Serde will
 //! automatically interpret the input data as a `Person` and produce informative
 //! error messages if the layout does not conform to what a `Person` is expected
@@ -171,20 +180,20 @@
 //! Once we have `p` of type `Person`, our IDE and the Rust compiler can help us
 //! use it correctly like they do for any other Rust code. The IDE can
 //! autocomplete field names to prevent typos, which was impossible in the
-//! `serde_json::Value` representation. And the Rust compiler can check that
+//! `serde_jsonrc::Value` representation. And the Rust compiler can check that
 //! when we write `p.phones[0]`, then `p.phones` is guaranteed to be a
 //! `Vec<String>` so indexing into it makes sense and produces a `String`.
 //!
 //! # Constructing JSON values
 //!
-//! Serde JSON provides a [`json!` macro][macro] to build `serde_json::Value`
+//! Serde jsonrc provides a [`json!` macro][macro] to build `serde_jsonrc::Value`
 //! objects with very natural JSON syntax.
 //!
 //! ```edition2018
-//! use serde_json::json;
+//! use serde_jsonrc::json;
 //!
 //! fn main() {
-//!     // The type of `john` is `serde_json::Value`
+//!     // The type of `john` is `serde_jsonrc::Value`
 //!     let john = json!({
 //!         "name": "John Doe",
 //!         "age": 43,
@@ -201,7 +210,7 @@
 //! }
 //! ```
 //!
-//! The `Value::to_string()` function converts a `serde_json::Value` into a
+//! The `Value::to_string()` function converts a `serde_jsonrc::Value` into a
 //! `String` of JSON text.
 //!
 //! One neat thing about the `json!` macro is that variables and expressions can
@@ -210,14 +219,14 @@
 //! be represented as JSON.
 //!
 //! ```edition2018
-//! # use serde_json::json;
+//! # use serde_jsonrc::json;
 //! #
 //! # fn random_phone() -> u16 { 0 }
 //! #
 //! let full_name = "John Doe";
 //! let age_last_year = 42;
 //!
-//! // The type of `john` is `serde_json::Value`
+//! // The type of `john` is `serde_jsonrc::Value`
 //! let john = json!({
 //!     "name": full_name,
 //!     "age": age_last_year + 1,
@@ -229,20 +238,20 @@
 //!
 //! This is amazingly convenient but we have the problem we had before with
 //! `Value` which is that the IDE and Rust compiler cannot help us if we get it
-//! wrong. Serde JSON provides a better way of serializing strongly-typed data
+//! wrong. Serde jsonrc provides a better way of serializing strongly-typed data
 //! structures into JSON text.
 //!
 //! # Creating JSON by serializing data structures
 //!
 //! A data structure can be converted to a JSON string by
-//! [`serde_json::to_string`][to_string]. There is also
-//! [`serde_json::to_vec`][to_vec] which serializes to a `Vec<u8>` and
-//! [`serde_json::to_writer`][to_writer] which serializes to any `io::Write`
+//! [`serde_jsonrc::to_string`][to_string]. There is also
+//! [`serde_jsonrc::to_vec`][to_vec] which serializes to a `Vec<u8>` and
+//! [`serde_jsonrc::to_writer`][to_writer] which serializes to any `io::Write`
 //! such as a File or a TCP stream.
 //!
 //! ```edition2018
 //! use serde::{Deserialize, Serialize};
-//! use serde_json::Result;
+//! use serde_jsonrc::Result;
 //!
 //! #[derive(Serialize, Deserialize)]
 //! struct Address {
@@ -258,7 +267,7 @@
 //!     };
 //!
 //!     // Serialize it to a JSON string.
-//!     let j = serde_json::to_string(&address)?;
+//!     let j = serde_jsonrc::to_string(&address)?;
 //!
 //!     // Print, write to a file, or send to an HTTP server.
 //!     println!("{}", j);
@@ -281,17 +290,17 @@
 //! This crate currently requires the Rust standard library. For JSON support in
 //! Serde without a standard library, please see the [`serde-json-core`] crate.
 //!
-//! [value]: https://docs.serde.rs/serde_json/value/enum.Value.html
-//! [from_str]: https://docs.serde.rs/serde_json/de/fn.from_str.html
-//! [from_slice]: https://docs.serde.rs/serde_json/de/fn.from_slice.html
-//! [from_reader]: https://docs.serde.rs/serde_json/de/fn.from_reader.html
-//! [to_string]: https://docs.serde.rs/serde_json/ser/fn.to_string.html
-//! [to_vec]: https://docs.serde.rs/serde_json/ser/fn.to_vec.html
-//! [to_writer]: https://docs.serde.rs/serde_json/ser/fn.to_writer.html
-//! [macro]: https://docs.serde.rs/serde_json/macro.json.html
-//! [`serde-json-core`]: https://japaric.github.io/serde-json-core/serde_json_core/
+//! [value]: https://docs.serde.rs/serde_jsonrc/value/enum.Value.html
+//! [from_str]: https://docs.serde.rs/serde_jsonrc/de/fn.from_str.html
+//! [from_slice]: https://docs.serde.rs/serde_jsonrc/de/fn.from_slice.html
+//! [from_reader]: https://docs.serde.rs/serde_jsonrc/de/fn.from_reader.html
+//! [to_string]: https://docs.serde.rs/serde_jsonrc/ser/fn.to_string.html
+//! [to_vec]: https://docs.serde.rs/serde_jsonrc/ser/fn.to_vec.html
+//! [to_writer]: https://docs.serde.rs/serde_jsonrc/ser/fn.to_writer.html
+//! [macro]: https://docs.serde.rs/serde_jsonrc/macro.json.html
+//! [`serde-json-core`]: https://japaric.github.io/serde-json-core/serde_jsonrc_core/
 
-#![doc(html_root_url = "https://docs.rs/serde_json/1.0.44")]
+#![doc(html_root_url = "https://docs.rs/serde_jsonrc/0.1.1")]
 #![allow(unknown_lints, bare_trait_objects, ellipsis_inclusive_range_patterns)]
 #![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
 #![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
diff --git a/src/macros.rs b/src/macros.rs
index 16116a0..f6d8ccb 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -1,7 +1,7 @@
-/// Construct a `serde_json::Value` from a JSON literal.
+/// Construct a `serde_jsonrc::Value` from a JSON literal.
 ///
 /// ```edition2018
-/// # use serde_json::json;
+/// # use serde_jsonrc::json;
 /// #
 /// let value = json!({
 ///     "code": 200,
@@ -23,7 +23,7 @@
 /// map with non-string keys, the `json!` macro will panic.
 ///
 /// ```edition2018
-/// # use serde_json::json;
+/// # use serde_jsonrc::json;
 /// #
 /// let code = 200;
 /// let features = vec!["serde", "json"];
@@ -40,7 +40,7 @@
 /// Trailing commas are allowed inside both arrays and objects.
 ///
 /// ```edition2018
-/// # use serde_json::json;
+/// # use serde_jsonrc::json;
 /// #
 /// let value = json!([
 ///     "notice",
diff --git a/src/map.rs b/src/map.rs
index 3ef3811..5e13df9 100644
--- a/src/map.rs
+++ b/src/map.rs
@@ -1,7 +1,7 @@
-//! A map of String to serde_json::Value.
+//! A map of String to serde_jsonrc::Value.
 //!
 //! By default the map is backed by a [`BTreeMap`]. Enable the `preserve_order`
-//! feature of serde_json to use [`IndexMap`] instead.
+//! feature of serde_jsonrc to use [`IndexMap`] instead.
 //!
 //! [`BTreeMap`]: https://doc.rust-lang.org/std/collections/struct.BTreeMap.html
 //! [`IndexMap`]: https://docs.rs/indexmap/*/indexmap/map/struct.IndexMap.html
@@ -240,7 +240,7 @@
 /// map.
 ///
 /// ```edition2018
-/// # use serde_json::Value;
+/// # use serde_jsonrc::Value;
 /// #
 /// # let val = &Value::String("".to_owned());
 /// # let _ =
@@ -268,10 +268,10 @@
 /// present in the map.
 ///
 /// ```edition2018
-/// # use serde_json::json;
+/// # use serde_jsonrc::json;
 /// #
-/// # let mut map = serde_json::Map::new();
-/// # map.insert("key".to_owned(), serde_json::Value::Null);
+/// # let mut map = serde_jsonrc::Map::new();
+/// # map.insert("key".to_owned(), serde_jsonrc::Value::Null);
 /// #
 /// map["key"] = json!("value");
 /// ```
@@ -444,7 +444,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     /// assert_eq!(map.entry("serde").key(), &"serde");
     /// ```
     pub fn key(&self) -> &String {
@@ -460,9 +460,9 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     /// map.entry("serde").or_insert(json!(12));
     ///
     /// assert_eq!(map["serde"], 12);
@@ -481,9 +481,9 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     /// map.entry("serde").or_insert_with(|| json!("hoho"));
     ///
     /// assert_eq!(map["serde"], "hoho".to_owned());
@@ -506,9 +506,9 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::map::Entry;
+    /// use serde_jsonrc::map::Entry;
     ///
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     ///
     /// match map.entry("serde") {
     ///     Entry::Vacant(vacant) => {
@@ -528,11 +528,11 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
-    /// use serde_json::map::Entry;
+    /// use serde_jsonrc::map::Entry;
     ///
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     ///
     /// match map.entry("serde") {
     ///     Entry::Vacant(vacant) => {
@@ -553,11 +553,11 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
-    /// use serde_json::map::Entry;
+    /// use serde_jsonrc::map::Entry;
     ///
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     /// map.insert("serde".to_owned(), json!(12));
     ///
     /// match map.entry("serde") {
@@ -577,11 +577,11 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
-    /// use serde_json::map::Entry;
+    /// use serde_jsonrc::map::Entry;
     ///
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     /// map.insert("serde".to_owned(), json!(12));
     ///
     /// match map.entry("serde") {
@@ -601,11 +601,11 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
-    /// use serde_json::map::Entry;
+    /// use serde_jsonrc::map::Entry;
     ///
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     /// map.insert("serde".to_owned(), json!([1, 2, 3]));
     ///
     /// match map.entry("serde") {
@@ -627,11 +627,11 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
-    /// use serde_json::map::Entry;
+    /// use serde_jsonrc::map::Entry;
     ///
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     /// map.insert("serde".to_owned(), json!([1, 2, 3]));
     ///
     /// match map.entry("serde") {
@@ -654,11 +654,11 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
-    /// use serde_json::map::Entry;
+    /// use serde_jsonrc::map::Entry;
     ///
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     /// map.insert("serde".to_owned(), json!(12));
     ///
     /// match map.entry("serde") {
@@ -679,11 +679,11 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
-    /// use serde_json::map::Entry;
+    /// use serde_jsonrc::map::Entry;
     ///
-    /// let mut map = serde_json::Map::new();
+    /// let mut map = serde_jsonrc::Map::new();
     /// map.insert("serde".to_owned(), json!(12));
     ///
     /// match map.entry("serde") {
@@ -715,7 +715,7 @@
     }
 }
 
-/// An iterator over a serde_json::Map's entries.
+/// An iterator over a serde_jsonrc::Map's entries.
 pub struct Iter<'a> {
     iter: IterImpl<'a>,
 }
@@ -740,7 +740,7 @@
     }
 }
 
-/// A mutable iterator over a serde_json::Map's entries.
+/// A mutable iterator over a serde_jsonrc::Map's entries.
 pub struct IterMut<'a> {
     iter: IterMutImpl<'a>,
 }
@@ -765,7 +765,7 @@
     }
 }
 
-/// An owning iterator over a serde_json::Map's entries.
+/// An owning iterator over a serde_jsonrc::Map's entries.
 pub struct IntoIter {
     iter: IntoIterImpl,
 }
@@ -779,7 +779,7 @@
 
 //////////////////////////////////////////////////////////////////////////////
 
-/// An iterator over a serde_json::Map's keys.
+/// An iterator over a serde_jsonrc::Map's keys.
 pub struct Keys<'a> {
     iter: KeysImpl<'a>,
 }
@@ -793,7 +793,7 @@
 
 //////////////////////////////////////////////////////////////////////////////
 
-/// An iterator over a serde_json::Map's values.
+/// An iterator over a serde_jsonrc::Map's values.
 pub struct Values<'a> {
     iter: ValuesImpl<'a>,
 }
@@ -807,7 +807,7 @@
 
 //////////////////////////////////////////////////////////////////////////////
 
-/// A mutable iterator over a serde_json::Map's values.
+/// A mutable iterator over a serde_jsonrc::Map's values.
 pub struct ValuesMut<'a> {
     iter: ValuesMutImpl<'a>,
 }
diff --git a/src/number.rs b/src/number.rs
index fd2707a..7ed3066 100644
--- a/src/number.rs
+++ b/src/number.rs
@@ -18,7 +18,7 @@
 #[cfg(feature = "arbitrary_precision")]
 /// Not public API. Should be pub(crate).
 #[doc(hidden)]
-pub const TOKEN: &'static str = "$serde_json::private::Number";
+pub const TOKEN: &'static str = "$serde_jsonrc::private::Number";
 
 /// Represents a JSON number, whether integer or floating point.
 #[derive(Clone, PartialEq)]
@@ -47,7 +47,7 @@
     /// return the integer value.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let big = i64::max_value() as u64 + 10;
     /// let v = json!({ "a": 64, "b": big, "c": 256.0 });
@@ -78,7 +78,7 @@
     /// return the integer value.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": 64, "b": -64, "c": 256.0 });
     ///
@@ -110,7 +110,7 @@
     /// `is_u64` return false but this is not a guarantee in the future.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": 256.0, "b": 64, "c": -64 });
     ///
@@ -142,7 +142,7 @@
     /// None otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let big = i64::max_value() as u64 + 10;
     /// let v = json!({ "a": 64, "b": big, "c": 256.0 });
@@ -173,7 +173,7 @@
     /// None otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": 64, "b": -64, "c": 256.0 });
     ///
@@ -195,7 +195,7 @@
     /// Represents the number as f64 if possible. Returns None otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": 256.0, "b": 64, "c": -64 });
     ///
@@ -221,7 +221,7 @@
     /// ```edition2018
     /// # use std::f64;
     /// #
-    /// # use serde_json::Number;
+    /// # use serde_jsonrc::Number;
     /// #
     /// assert!(Number::from_f64(256.0).is_some());
     ///
diff --git a/src/raw.rs b/src/raw.rs
index 5c4f8cf..0aea3f6 100644
--- a/src/raw.rs
+++ b/src/raw.rs
@@ -34,7 +34,7 @@
 ///
 /// ```edition2018
 /// use serde::{Deserialize, Serialize};
-/// use serde_json::{Result, value::RawValue};
+/// use serde_jsonrc::{Result, value::RawValue};
 ///
 /// #[derive(Deserialize)]
 /// struct Input<'a> {
@@ -51,18 +51,18 @@
 /// // Efficiently rearrange JSON input containing separate "code" and "payload"
 /// // keys into a single "info" key holding an array of code and payload.
 /// //
-/// // This could be done equivalently using serde_json::Value as the type for
+/// // This could be done equivalently using serde_jsonrc::Value as the type for
 /// // payload, but &RawValue will perform better because it does not require
 /// // memory allocation. The correct range of bytes is borrowed from the input
 /// // data and pasted verbatim into the output.
 /// fn rearrange(input: &str) -> Result<String> {
-///     let input: Input = serde_json::from_str(input)?;
+///     let input: Input = serde_jsonrc::from_str(input)?;
 ///
 ///     let output = Output {
 ///         info: (input.code, input.payload),
 ///     };
 ///
-///     serde_json::to_string(&output)
+///     serde_jsonrc::to_string(&output)
 /// }
 ///
 /// fn main() -> Result<()> {
@@ -80,7 +80,7 @@
 ///
 /// ```edition2018
 /// # use serde::Deserialize;
-/// # use serde_json::value::RawValue;
+/// # use serde_jsonrc::value::RawValue;
 /// #
 /// #[derive(Deserialize)]
 /// struct SomeStruct<'a> {
@@ -90,20 +90,20 @@
 /// ```
 ///
 /// The borrowed form is suitable when deserializing through
-/// [`serde_json::from_str`] and [`serde_json::from_slice`] which support
+/// [`serde_jsonrc::from_str`] and [`serde_jsonrc::from_slice`] which support
 /// borrowing from the input data without memory allocation.
 ///
-/// When deserializing through [`serde_json::from_reader`] you will need to use
+/// When deserializing through [`serde_jsonrc::from_reader`] you will need to use
 /// the boxed form of `RawValue` instead. This is almost as efficient but
 /// involves buffering the raw value from the I/O stream into memory.
 ///
-/// [`serde_json::from_str`]: ../fn.from_str.html
-/// [`serde_json::from_slice`]: ../fn.from_slice.html
-/// [`serde_json::from_reader`]: ../fn.from_reader.html
+/// [`serde_jsonrc::from_str`]: ../fn.from_str.html
+/// [`serde_jsonrc::from_slice`]: ../fn.from_slice.html
+/// [`serde_jsonrc::from_reader`]: ../fn.from_reader.html
 ///
 /// ```edition2018
 /// # use serde::Deserialize;
-/// # use serde_json::value::RawValue;
+/// # use serde_jsonrc::value::RawValue;
 /// #
 /// #[derive(Deserialize)]
 /// struct SomeStruct {
@@ -163,7 +163,7 @@
 impl RawValue {
     /// Convert an owned `String` of JSON data to an owned `RawValue`.
     ///
-    /// This function is equivalent to `serde_json::from_str::<Box<RawValue>>`
+    /// This function is equivalent to `serde_jsonrc::from_str::<Box<RawValue>>`
     /// except that we avoid an allocation and memcpy if both of the following
     /// are true:
     ///
@@ -185,7 +185,7 @@
     ///
     /// ```edition2018
     /// use serde::Deserialize;
-    /// use serde_json::{Result, value::RawValue};
+    /// use serde_jsonrc::{Result, value::RawValue};
     ///
     /// #[derive(Deserialize)]
     /// struct Response<'a> {
@@ -195,7 +195,7 @@
     /// }
     ///
     /// fn process(input: &str) -> Result<()> {
-    ///     let response: Response = serde_json::from_str(input)?;
+    ///     let response: Response = serde_jsonrc::from_str(input)?;
     ///
     ///     let payload = response.payload.get();
     ///     if payload.starts_with('{') {
@@ -217,7 +217,7 @@
     }
 }
 
-pub const TOKEN: &'static str = "$serde_json::private::RawValue";
+pub const TOKEN: &'static str = "$serde_jsonrc::private::RawValue";
 
 impl Serialize for RawValue {
     fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
diff --git a/src/read.rs b/src/read.rs
index 71b0504..00538d9 100644
--- a/src/read.rs
+++ b/src/read.rs
@@ -16,7 +16,7 @@
 /// stable we can use actual specialization.
 ///
 /// This trait is sealed and cannot be implemented for types outside of
-/// `serde_json`.
+/// `serde_jsonrc`.
 pub trait Read<'de>: private::Sealed {
     #[doc(hidden)]
     fn next(&mut self) -> Result<Option<u8>>;
diff --git a/src/value/from.rs b/src/value/from.rs
index 2b743d2..4b93f09 100644
--- a/src/value/from.rs
+++ b/src/value/from.rs
@@ -34,7 +34,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let f: f32 = 13.37;
     /// let x: Value = f.into();
@@ -50,7 +50,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let f: f64 = 13.37;
     /// let x: Value = f.into();
@@ -66,7 +66,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let b = false;
     /// let x: Value = b.into();
@@ -82,7 +82,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let s: String = "lorem".to_string();
     /// let x: Value = s.into();
@@ -98,7 +98,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let s: &str = "lorem";
     /// let x: Value = s.into();
@@ -114,7 +114,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     /// use std::borrow::Cow;
     ///
     /// let s: Cow<str> = Cow::Borrowed("lorem");
@@ -122,7 +122,7 @@
     /// ```
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     /// use std::borrow::Cow;
     ///
     /// let s: Cow<str> = Cow::Owned("lorem".to_string());
@@ -139,7 +139,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::{Map, Value};
+    /// use serde_jsonrc::{Map, Value};
     ///
     /// let mut m = Map::new();
     /// m.insert("Lorem".to_string(), "ipsum".into());
@@ -156,7 +156,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let v = vec!["lorem", "ipsum", "dolor"];
     /// let x: Value = v.into();
@@ -172,7 +172,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let v: &[&str] = &["lorem", "ipsum", "dolor"];
     /// let x: Value = v.into();
@@ -188,14 +188,14 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let v = std::iter::repeat(42).take(5);
     /// let x: Value = v.collect();
     /// ```
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let v: Vec<_> = vec!["lorem", "ipsum", "dolor"];
     /// let x: Value = v.into_iter().collect();
@@ -203,7 +203,7 @@
     ///
     /// ```edition2018
     /// use std::iter::FromIterator;
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let x: Value = Value::from_iter(vec!["lorem", "ipsum", "dolor"]);
     /// ```
@@ -218,7 +218,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// let u = ();
     /// let x: Value = u.into();
diff --git a/src/value/index.rs b/src/value/index.rs
index 47990a5..dba13bd 100644
--- a/src/value/index.rs
+++ b/src/value/index.rs
@@ -4,7 +4,7 @@
 use super::Value;
 use map::Map;
 
-/// A type that can be used to index into a `serde_json::Value`.
+/// A type that can be used to index into a `serde_jsonrc::Value`.
 ///
 /// The [`get`] and [`get_mut`] methods of `Value` accept any type that
 /// implements `Index`, as does the [square-bracket indexing operator]. This
@@ -16,12 +16,12 @@
 /// [square-bracket indexing operator]: ../enum.Value.html#impl-Index%3CI%3E
 ///
 /// This trait is sealed and cannot be implemented for types outside of
-/// `serde_json`.
+/// `serde_jsonrc`.
 ///
 /// # Examples
 ///
 /// ```edition2018
-/// # use serde_json::json;
+/// # use serde_jsonrc::json;
 /// #
 /// let data = json!({ "inner": [1, 2, 3] });
 ///
@@ -180,7 +180,7 @@
 {
     type Output = Value;
 
-    /// Index into a `serde_json::Value` using the syntax `value[0]` or
+    /// Index into a `serde_jsonrc::Value` using the syntax `value[0]` or
     /// `value["k"]`.
     ///
     /// Returns `Value::Null` if the type of `self` does not match the type of
@@ -194,7 +194,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let data = json!({
     ///     "x": {
@@ -218,7 +218,7 @@
 where
     I: Index,
 {
-    /// Write into a `serde_json::Value` using the syntax `value[0] = ...` or
+    /// Write into a `serde_jsonrc::Value` using the syntax `value[0] = ...` or
     /// `value["k"] = ...`.
     ///
     /// If the index is a number, the value must be an array of length bigger
@@ -233,7 +233,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let mut data = json!({ "x": 0 });
     ///
diff --git a/src/value/mod.rs b/src/value/mod.rs
index eb4b900..b61d358 100644
--- a/src/value/mod.rs
+++ b/src/value/mod.rs
@@ -2,14 +2,14 @@
 //!
 //! # Constructing JSON
 //!
-//! Serde JSON provides a [`json!` macro][macro] to build `serde_json::Value`
+//! Serde jsonrc provides a [`json!` macro][macro] to build `serde_jsonrc::Value`
 //! objects with very natural JSON syntax.
 //!
 //! ```edition2018
-//! use serde_json::json;
+//! use serde_jsonrc::json;
 //!
 //! fn main() {
-//!     // The type of `john` is `serde_json::Value`
+//!     // The type of `john` is `serde_jsonrc::Value`
 //!     let john = json!({
 //!         "name": "John Doe",
 //!         "age": 43,
@@ -26,7 +26,7 @@
 //! }
 //! ```
 //!
-//! The `Value::to_string()` function converts a `serde_json::Value` into a
+//! The `Value::to_string()` function converts a `serde_jsonrc::Value` into a
 //! `String` of JSON text.
 //!
 //! One neat thing about the `json!` macro is that variables and expressions can
@@ -35,14 +35,14 @@
 //! be represented as JSON.
 //!
 //! ```edition2018
-//! # use serde_json::json;
+//! # use serde_jsonrc::json;
 //! #
 //! # fn random_phone() -> u16 { 0 }
 //! #
 //! let full_name = "John Doe";
 //! let age_last_year = 42;
 //!
-//! // The type of `john` is `serde_json::Value`
+//! // The type of `john` is `serde_jsonrc::Value`
 //! let john = json!({
 //!     "name": full_name,
 //!     "age": age_last_year + 1,
@@ -52,14 +52,14 @@
 //! });
 //! ```
 //!
-//! A string of JSON data can be parsed into a `serde_json::Value` by the
-//! [`serde_json::from_str`][from_str] function. There is also
+//! A string of JSON data can be parsed into a `serde_jsonrc::Value` by the
+//! [`serde_jsonrc::from_str`][from_str] function. There is also
 //! [`from_slice`][from_slice] for parsing from a byte slice `&[u8]` and
 //! [`from_reader`][from_reader] for parsing from any `io::Read` like a File or
 //! a TCP stream.
 //!
 //! ```edition2018
-//! use serde_json::{json, Value, Error};
+//! use serde_jsonrc::{json, Value, Error};
 //!
 //! fn untyped_example() -> Result<(), Error> {
 //!     // Some JSON input data as a &str. Maybe this comes from the user.
@@ -73,8 +73,8 @@
 //!             ]
 //!         }"#;
 //!
-//!     // Parse the string of data into serde_json::Value.
-//!     let v: Value = serde_json::from_str(data)?;
+//!     // Parse the string of data into serde_jsonrc::Value.
+//!     let v: Value = serde_jsonrc::from_str(data)?;
 //!
 //!     // Access parts of the data by indexing with square brackets.
 //!     println!("Please call {} at the number {}", v["name"], v["phones"][0]);
@@ -85,10 +85,10 @@
 //! # untyped_example().unwrap();
 //! ```
 //!
-//! [macro]: https://docs.serde.rs/serde_json/macro.json.html
-//! [from_str]: https://docs.serde.rs/serde_json/de/fn.from_str.html
-//! [from_slice]: https://docs.serde.rs/serde_json/de/fn.from_slice.html
-//! [from_reader]: https://docs.serde.rs/serde_json/de/fn.from_reader.html
+//! [macro]: https://docs.serde.rs/serde_jsonrc/macro.json.html
+//! [from_str]: https://docs.serde.rs/serde_jsonrc/de/fn.from_str.html
+//! [from_slice]: https://docs.serde.rs/serde_jsonrc/de/fn.from_slice.html
+//! [from_reader]: https://docs.serde.rs/serde_jsonrc/de/fn.from_reader.html
 
 use std::fmt::{self, Debug};
 use std::io;
@@ -111,13 +111,13 @@
 
 /// Represents any valid JSON value.
 ///
-/// See the `serde_json::value` module documentation for usage examples.
+/// See the `serde_jsonrc::value` module documentation for usage examples.
 #[derive(Clone, PartialEq)]
 pub enum Value {
     /// Represents a JSON null value.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!(null);
     /// ```
@@ -126,7 +126,7 @@
     /// Represents a JSON boolean.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!(true);
     /// ```
@@ -135,7 +135,7 @@
     /// Represents a JSON number, whether integer or floating point.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!(12.5);
     /// ```
@@ -144,7 +144,7 @@
     /// Represents a JSON string.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!("a string");
     /// ```
@@ -153,7 +153,7 @@
     /// Represents a JSON array.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!(["an", "array"]);
     /// ```
@@ -162,13 +162,13 @@
     /// Represents a JSON object.
     ///
     /// By default the map is backed by a BTreeMap. Enable the `preserve_order`
-    /// feature of serde_json to use IndexMap instead, which preserves
+    /// feature of serde_jsonrc to use IndexMap instead, which preserves
     /// entries in the order they are inserted into the map. In particular, this
     /// allows JSON data to be deserialized into a Value and serialized to a
     /// string while retaining the order of map keys in the input.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "an": "object" });
     /// ```
@@ -213,7 +213,7 @@
     /// Display a JSON value as a string.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let json = json!({ "city": "London", "street": "10 Downing Street" });
     ///
@@ -265,7 +265,7 @@
     /// or the given index is not within the bounds of the array.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let object = json!({ "A": 65, "B": 66, "C": 67 });
     /// assert_eq!(*object.get("A").unwrap(), json!(65));
@@ -281,7 +281,7 @@
     /// `None`.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let object = json!({
     ///     "A": ["a", "á", "à"],
@@ -307,7 +307,7 @@
     /// or the given index is not within the bounds of the array.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let mut object = json!({ "A": 65, "B": 66, "C": 67 });
     /// *object.get_mut("A").unwrap() = json!(69);
@@ -326,7 +326,7 @@
     /// object.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let obj = json!({ "a": { "nested": true }, "b": ["an", "array"] });
     ///
@@ -344,7 +344,7 @@
     /// otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": { "nested": true }, "b": ["an", "array"] });
     ///
@@ -365,7 +365,7 @@
     /// Returns None otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let mut v = json!({ "a": { "nested": true } });
     ///
@@ -386,7 +386,7 @@
     /// array.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let obj = json!({ "a": ["an", "array"], "b": { "an": "object" } });
     ///
@@ -403,7 +403,7 @@
     /// otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": ["an", "array"], "b": { "an": "object" } });
     ///
@@ -424,7 +424,7 @@
     /// Returns None otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let mut v = json!({ "a": ["an", "array"] });
     ///
@@ -444,7 +444,7 @@
     /// to return the string slice.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": "some string", "b": false });
     ///
@@ -461,7 +461,7 @@
     /// otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": "some string", "b": false });
     ///
@@ -490,7 +490,7 @@
     /// Returns true if the `Value` is a Number. Returns false otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": 1, "b": "2" });
     ///
@@ -513,7 +513,7 @@
     /// return the integer value.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let big = i64::max_value() as u64 + 10;
     /// let v = json!({ "a": 64, "b": big, "c": 256.0 });
@@ -539,7 +539,7 @@
     /// return the integer value.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": 64, "b": -64, "c": 256.0 });
     ///
@@ -567,7 +567,7 @@
     /// `is_u64` return false but this is not a guarantee in the future.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": 256.0, "b": 64, "c": -64 });
     ///
@@ -588,7 +588,7 @@
     /// None otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let big = i64::max_value() as u64 + 10;
     /// let v = json!({ "a": 64, "b": big, "c": 256.0 });
@@ -608,7 +608,7 @@
     /// None otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": 64, "b": -64, "c": 256.0 });
     ///
@@ -627,7 +627,7 @@
     /// None otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": 256.0, "b": 64, "c": -64 });
     ///
@@ -648,7 +648,7 @@
     /// guaranteed to return the boolean value.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": false, "b": "false" });
     ///
@@ -665,7 +665,7 @@
     /// otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": false, "b": "false" });
     ///
@@ -687,7 +687,7 @@
     /// to return `Some(())`.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": null, "b": false });
     ///
@@ -703,7 +703,7 @@
     /// If the `Value` is a Null, returns (). Returns None otherwise.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let v = json!({ "a": null, "b": false });
     ///
@@ -734,7 +734,7 @@
     /// # Examples
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let data = json!({
     ///     "x": {
@@ -789,11 +789,11 @@
     /// # Example of Use
     ///
     /// ```edition2018
-    /// use serde_json::Value;
+    /// use serde_jsonrc::Value;
     ///
     /// fn main() {
     ///     let s = r#"{"x": 1.0, "y": 2.0}"#;
-    ///     let mut value: Value = serde_json::from_str(s).unwrap();
+    ///     let mut value: Value = serde_jsonrc::from_str(s).unwrap();
     ///
     ///     // Check value using read-only pointer
     ///     assert_eq!(value.pointer("/x"), Some(&1.0.into()));
@@ -844,7 +844,7 @@
     /// Takes the value out of the `Value`, leaving a `Null` in its place.
     ///
     /// ```edition2018
-    /// # use serde_json::json;
+    /// # use serde_jsonrc::json;
     /// #
     /// let mut v = json!({ "x": "y" });
     /// assert_eq!(v["x"].take(), json!("y"));
@@ -863,7 +863,7 @@
 ///
 /// ```edition2018
 /// # use serde::Deserialize;
-/// use serde_json::Value;
+/// use serde_jsonrc::Value;
 ///
 /// #[derive(Deserialize)]
 /// struct Settings {
@@ -872,9 +872,9 @@
 ///     extras: Value,
 /// }
 ///
-/// # fn try_main() -> Result<(), serde_json::Error> {
+/// # fn try_main() -> Result<(), serde_jsonrc::Error> {
 /// let data = r#" { "level": 42 } "#;
-/// let s: Settings = serde_json::from_str(data)?;
+/// let s: Settings = serde_jsonrc::from_str(data)?;
 ///
 /// assert_eq!(s.level, 42);
 /// assert_eq!(s.extras, Value::Null);
@@ -896,14 +896,14 @@
 mod partial_eq;
 mod ser;
 
-/// Convert a `T` into `serde_json::Value` which is an enum that can represent
+/// Convert a `T` into `serde_jsonrc::Value` which is an enum that can represent
 /// any valid JSON data.
 ///
 /// # Example
 ///
 /// ```edition2018
 /// use serde::Serialize;
-/// use serde_json::json;
+/// use serde_jsonrc::json;
 ///
 /// use std::error::Error;
 ///
@@ -919,13 +919,13 @@
 ///         location: "Menlo Park, CA".to_owned(),
 ///     };
 ///
-///     // The type of `expected` is `serde_json::Value`
+///     // The type of `expected` is `serde_jsonrc::Value`
 ///     let expected = json!({
 ///         "fingerprint": "0xF9BA143B95FF6D82",
 ///         "location": "Menlo Park, CA",
 ///     });
 ///
-///     let v = serde_json::to_value(u).unwrap();
+///     let v = serde_jsonrc::to_value(u).unwrap();
 ///     assert_eq!(v, expected);
 ///
 ///     Ok(())
@@ -947,7 +947,7 @@
 ///     let mut map = BTreeMap::new();
 ///     map.insert(vec![32, 64], "x86");
 ///
-///     println!("{}", serde_json::to_value(map).unwrap_err());
+///     println!("{}", serde_jsonrc::to_value(map).unwrap_err());
 /// }
 /// ```
 // Taking by value is more friendly to iterator adapters, option and result
@@ -959,13 +959,13 @@
     value.serialize(Serializer)
 }
 
-/// Interpret a `serde_json::Value` as an instance of type `T`.
+/// Interpret a `serde_jsonrc::Value` as an instance of type `T`.
 ///
 /// # Example
 ///
 /// ```edition2018
 /// use serde::Deserialize;
-/// use serde_json::json;
+/// use serde_jsonrc::json;
 ///
 /// #[derive(Deserialize, Debug)]
 /// struct User {
@@ -974,13 +974,13 @@
 /// }
 ///
 /// fn main() {
-///     // The type of `j` is `serde_json::Value`
+///     // The type of `j` is `serde_jsonrc::Value`
 ///     let j = json!({
 ///         "fingerprint": "0xF9BA143B95FF6D82",
 ///         "location": "Menlo Park, CA"
 ///     });
 ///
-///     let u: User = serde_json::from_value(j).unwrap();
+///     let u: User = serde_jsonrc::from_value(j).unwrap();
 ///     println!("{:#?}", u);
 /// }
 /// ```
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
index 0000000..934a473
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,4 @@
+In order to facilitate incorporating changes from upstream serde_json,
+all tests for new functionality introduced by serde_jsonc should go
+in separate files so that changes to tests from upstream can be merged
+seamlessly.
diff --git a/tests/comments.rs b/tests/comments.rs
new file mode 100644
index 0000000..4484fda
--- /dev/null
+++ b/tests/comments.rs
@@ -0,0 +1,29 @@
+#[macro_use]
+extern crate serde_jsonrc;
+
+use serde_jsonrc::{from_str, Value};
+
+#[test]
+fn test_parse_line_comments() {
+    let s = r#"
+    {
+        // Here is a comment.
+        "key": "value"
+    }// Here is a another comment at the end."#;
+    let value: Value = from_str(s).unwrap();
+    assert_eq!(value, json!({"key": "value"}));
+}
+
+#[test]
+fn test_parse_block_comments() {
+    let s = r#"
+    /*
+     Here is a comment up here.
+     */
+    {
+        /* And one in here. */
+        "key": "value"
+    }/* Some at the end... *//* ...back to back! */"#;
+    let value: Value = from_str(s).unwrap();
+    assert_eq!(value, json!({"key": "value"}));
+}
diff --git a/tests/crate/Cargo.toml b/tests/crate/Cargo.toml
index fd594ce..d09de09 100644
--- a/tests/crate/Cargo.toml
+++ b/tests/crate/Cargo.toml
@@ -7,10 +7,10 @@
 path = "test.rs"
 
 [dependencies]
-serde_json = { path = "../.." }
+serde_jsonrc = { path = "../.." }
 
 [features]
-arbitrary_precision = ["serde_json/arbitrary_precision"]
-preserve_order = ["serde_json/preserve_order"]
-raw_value = ["serde_json/raw_value"]
-unbounded_depth = ["serde_json/unbounded_depth"]
+arbitrary_precision = ["serde_jsonrc/arbitrary_precision"]
+preserve_order = ["serde_jsonrc/preserve_order"]
+raw_value = ["serde_jsonrc/raw_value"]
+unbounded_depth = ["serde_jsonrc/unbounded_depth"]
diff --git a/tests/crate/test.rs b/tests/crate/test.rs
index 91876e1..d1ee3b8 100644
--- a/tests/crate/test.rs
+++ b/tests/crate/test.rs
@@ -1,2 +1,2 @@
-extern crate serde_json;
-pub use serde_json::*;
+extern crate serde_jsonrc;
+pub use serde_jsonrc::*;
diff --git a/tests/debug.rs b/tests/debug.rs
index f88828c..692c0fa 100644
--- a/tests/debug.rs
+++ b/tests/debug.rs
@@ -1,7 +1,7 @@
 #[macro_use]
-extern crate serde_json;
+extern crate serde_jsonrc;
 
-use serde_json::{Number, Value};
+use serde_jsonrc::{Number, Value};
 
 #[test]
 fn number() {
@@ -48,7 +48,7 @@
 
 #[test]
 fn error() {
-    let err = serde_json::from_str::<Value>("{0}").unwrap_err();
+    let err = serde_jsonrc::from_str::<Value>("{0}").unwrap_err();
     let expected = "Error(\"key must be a string\", line: 1, column: 2)";
     assert_eq!(format!("{:?}", err), expected);
 }
diff --git a/tests/preserve_order.rs b/tests/preserve_order.rs
index beea1f4..c4d39c8 100644
--- a/tests/preserve_order.rs
+++ b/tests/preserve_order.rs
@@ -1,6 +1,6 @@
-extern crate serde_json;
+extern crate serde_jsonrc;
 
-use serde_json::{from_str, Value};
+use serde_jsonrc::{from_str, Value};
 
 #[test]
 fn test_map_order() {
diff --git a/tests/regression/issue520.rs b/tests/regression/issue520.rs
index 6befd49..c2067b8 100644
--- a/tests/regression/issue520.rs
+++ b/tests/regression/issue520.rs
@@ -9,8 +9,8 @@
 #[test]
 fn test() {
     let e = E::Float(159.1);
-    let v = serde_json::to_value(e).unwrap();
-    let e = serde_json::from_value::<E>(v).unwrap();
+    let v = serde_jsonrc::to_value(e).unwrap();
+    let e = serde_jsonrc::from_value::<E>(v).unwrap();
 
     match e {
         E::Float(f) => assert_eq!(f, 159.1),
diff --git a/tests/stream.rs b/tests/stream.rs
index 88a3952..9638e48 100644
--- a/tests/stream.rs
+++ b/tests/stream.rs
@@ -3,9 +3,9 @@
 extern crate serde;
 
 #[macro_use]
-extern crate serde_json;
+extern crate serde_jsonrc;
 
-use serde_json::{Deserializer, Value};
+use serde_jsonrc::{Deserializer, Value};
 
 // Rustfmt issue https://github.com/rust-lang-nursery/rustfmt/issues/2740
 #[cfg_attr(rustfmt, rustfmt_skip)]
diff --git a/tests/test.rs b/tests/test.rs
index 789b862..c9f9070 100644
--- a/tests/test.rs
+++ b/tests/test.rs
@@ -10,7 +10,7 @@
 extern crate serde;
 extern crate serde_bytes;
 #[macro_use]
-extern crate serde_json;
+extern crate serde_jsonrc;
 
 #[macro_use]
 mod macros;
@@ -31,7 +31,7 @@
 
 use serde_bytes::{ByteBuf, Bytes};
 
-use serde_json::{
+use serde_jsonrc::{
     from_reader, from_slice, from_str, from_value, to_string, to_string_pretty, to_value, to_vec,
     to_writer, Deserializer, Number, Value,
 };
@@ -928,13 +928,13 @@
 #[test]
 fn test_malicious_number() {
     #[derive(Serialize)]
-    #[serde(rename = "$serde_json::private::Number")]
+    #[serde(rename = "$serde_jsonrc::private::Number")]
     struct S {
-        #[serde(rename = "$serde_json::private::Number")]
+        #[serde(rename = "$serde_jsonrc::private::Number")]
         f: &'static str,
     }
 
-    let actual = serde_json::to_value(&S { f: "not a number" })
+    let actual = serde_jsonrc::to_value(&S { f: "not a number" })
         .unwrap_err()
         .to_string();
     assert_eq!(actual, "invalid number at line 1 column 1");
@@ -1053,8 +1053,8 @@
         ("[", "EOF while parsing a list at line 1 column 1"),
         ("[ ", "EOF while parsing a list at line 1 column 2"),
         ("[1", "EOF while parsing a list at line 1 column 2"),
-        ("[1,", "EOF while parsing a value at line 1 column 3"),
-        ("[1,]", "trailing comma at line 1 column 4"),
+        ("[1,", "EOF while parsing a list at line 1 column 3"),
+        // ("[1,]", "trailing comma at line 1 column 4"),
         ("[1 2]", "expected `,` or `]` at line 1 column 4"),
         ("[]a", "trailing characters at line 1 column 3"),
     ]);
@@ -1094,7 +1094,7 @@
         ("{\"a\":", "EOF while parsing a value at line 1 column 5"),
         ("{\"a\":1", "EOF while parsing an object at line 1 column 6"),
         ("{\"a\":1 1", "expected `,` or `}` at line 1 column 8"),
-        ("{\"a\":1,", "EOF while parsing a value at line 1 column 7"),
+        ("{\"a\":1,", "EOF while parsing an object at line 1 column 7"),
         ("{}a", "trailing characters at line 1 column 3"),
     ]);
 
@@ -1245,9 +1245,9 @@
              "unknown field `foo`, expected `age` or `name` at line 1 column 39"),
 
             // JSON does not allow trailing commas in data structures
-            ("{\"Cat\":[0, \"Kate\",]}", "trailing comma at line 1 column 19"),
-            ("{\"Cat\":{\"age\": 2, \"name\": \"Kate\",}}",
-             "trailing comma at line 1 column 34"),
+            // ("{\"Cat\":[0, \"Kate\",]}", "trailing comma at line 1 column 19"),
+            // ("{\"Cat\":{\"age\": 2, \"name\": \"Kate\",}}",
+            //  "trailing comma at line 1 column 34"),
         ],
     );
 }
@@ -1820,7 +1820,7 @@
 
     // map with float key
     let map = treemap!(Float => "x");
-    assert!(serde_json::to_value(&map).is_err());
+    assert!(serde_jsonrc::to_value(&map).is_err());
 }
 
 #[test]
@@ -2029,7 +2029,7 @@
 
 #[test]
 fn null_invalid_type() {
-    let err = serde_json::from_str::<String>("null").unwrap_err();
+    let err = serde_jsonrc::from_str::<String>("null").unwrap_err();
     assert_eq!(
         format!("{}", err),
         String::from("invalid type: null, expected a string at line 1 column 4")
@@ -2076,7 +2076,7 @@
 #[cfg(feature = "raw_value")]
 #[test]
 fn test_borrowed_raw_value() {
-    use serde_json::value::RawValue;
+    use serde_jsonrc::value::RawValue;
 
     #[derive(Serialize, Deserialize)]
     struct Wrapper<'a> {
@@ -2087,30 +2087,30 @@
     };
 
     let wrapper_from_str: Wrapper =
-        serde_json::from_str(r#"{"a": 1, "b": {"foo": 2}, "c": 3}"#).unwrap();
+        serde_jsonrc::from_str(r#"{"a": 1, "b": {"foo": 2}, "c": 3}"#).unwrap();
     assert_eq!(r#"{"foo": 2}"#, wrapper_from_str.b.get());
 
-    let wrapper_to_string = serde_json::to_string(&wrapper_from_str).unwrap();
+    let wrapper_to_string = serde_jsonrc::to_string(&wrapper_from_str).unwrap();
     assert_eq!(r#"{"a":1,"b":{"foo": 2},"c":3}"#, wrapper_to_string);
 
-    let wrapper_to_value = serde_json::to_value(&wrapper_from_str).unwrap();
+    let wrapper_to_value = serde_jsonrc::to_value(&wrapper_from_str).unwrap();
     assert_eq!(json!({"a": 1, "b": {"foo": 2}, "c": 3}), wrapper_to_value);
 
     let array_from_str: Vec<&RawValue> =
-        serde_json::from_str(r#"["a", 42, {"foo": "bar"}, null]"#).unwrap();
+        serde_jsonrc::from_str(r#"["a", 42, {"foo": "bar"}, null]"#).unwrap();
     assert_eq!(r#""a""#, array_from_str[0].get());
     assert_eq!(r#"42"#, array_from_str[1].get());
     assert_eq!(r#"{"foo": "bar"}"#, array_from_str[2].get());
     assert_eq!(r#"null"#, array_from_str[3].get());
 
-    let array_to_string = serde_json::to_string(&array_from_str).unwrap();
+    let array_to_string = serde_jsonrc::to_string(&array_from_str).unwrap();
     assert_eq!(r#"["a",42,{"foo": "bar"},null]"#, array_to_string);
 }
 
 #[cfg(feature = "raw_value")]
 #[test]
 fn test_boxed_raw_value() {
-    use serde_json::value::RawValue;
+    use serde_jsonrc::value::RawValue;
 
     #[derive(Serialize, Deserialize)]
     struct Wrapper {
@@ -2120,38 +2120,38 @@
     };
 
     let wrapper_from_str: Wrapper =
-        serde_json::from_str(r#"{"a": 1, "b": {"foo": 2}, "c": 3}"#).unwrap();
+        serde_jsonrc::from_str(r#"{"a": 1, "b": {"foo": 2}, "c": 3}"#).unwrap();
     assert_eq!(r#"{"foo": 2}"#, wrapper_from_str.b.get());
 
     let wrapper_from_reader: Wrapper =
-        serde_json::from_reader(br#"{"a": 1, "b": {"foo": 2}, "c": 3}"#.as_ref()).unwrap();
+        serde_jsonrc::from_reader(br#"{"a": 1, "b": {"foo": 2}, "c": 3}"#.as_ref()).unwrap();
     assert_eq!(r#"{"foo": 2}"#, wrapper_from_reader.b.get());
 
     let wrapper_from_value: Wrapper =
-        serde_json::from_value(json!({"a": 1, "b": {"foo": 2}, "c": 3})).unwrap();
+        serde_jsonrc::from_value(json!({"a": 1, "b": {"foo": 2}, "c": 3})).unwrap();
     assert_eq!(r#"{"foo":2}"#, wrapper_from_value.b.get());
 
-    let wrapper_to_string = serde_json::to_string(&wrapper_from_str).unwrap();
+    let wrapper_to_string = serde_jsonrc::to_string(&wrapper_from_str).unwrap();
     assert_eq!(r#"{"a":1,"b":{"foo": 2},"c":3}"#, wrapper_to_string);
 
-    let wrapper_to_value = serde_json::to_value(&wrapper_from_str).unwrap();
+    let wrapper_to_value = serde_jsonrc::to_value(&wrapper_from_str).unwrap();
     assert_eq!(json!({"a": 1, "b": {"foo": 2}, "c": 3}), wrapper_to_value);
 
     let array_from_str: Vec<Box<RawValue>> =
-        serde_json::from_str(r#"["a", 42, {"foo": "bar"}, null]"#).unwrap();
+        serde_jsonrc::from_str(r#"["a", 42, {"foo": "bar"}, null]"#).unwrap();
     assert_eq!(r#""a""#, array_from_str[0].get());
     assert_eq!(r#"42"#, array_from_str[1].get());
     assert_eq!(r#"{"foo": "bar"}"#, array_from_str[2].get());
     assert_eq!(r#"null"#, array_from_str[3].get());
 
     let array_from_reader: Vec<Box<RawValue>> =
-        serde_json::from_reader(br#"["a", 42, {"foo": "bar"}, null]"#.as_ref()).unwrap();
+        serde_jsonrc::from_reader(br#"["a", 42, {"foo": "bar"}, null]"#.as_ref()).unwrap();
     assert_eq!(r#""a""#, array_from_reader[0].get());
     assert_eq!(r#"42"#, array_from_reader[1].get());
     assert_eq!(r#"{"foo": "bar"}"#, array_from_reader[2].get());
     assert_eq!(r#"null"#, array_from_reader[3].get());
 
-    let array_to_string = serde_json::to_string(&array_from_str).unwrap();
+    let array_to_string = serde_jsonrc::to_string(&array_from_str).unwrap();
     assert_eq!(r#"["a",42,{"foo": "bar"},null]"#, array_to_string);
 }
 
diff --git a/tests/trailing_comma.rs b/tests/trailing_comma.rs
new file mode 100644
index 0000000..63c2128
--- /dev/null
+++ b/tests/trailing_comma.rs
@@ -0,0 +1,114 @@
+#[macro_use]
+extern crate serde_derive;
+
+extern crate serde;
+
+#[macro_use]
+extern crate serde_jsonrc;
+
+use serde_jsonrc::{from_str, Value};
+
+#[test]
+fn test_trailing_comma_object() {
+    let s = r#"
+    {
+        "key": "value",
+    }"#;
+    let value: Value = from_str(s).unwrap();
+    assert_eq!(value, json!({"key": "value"}));
+}
+
+#[test]
+fn test_double_comma_object() {
+    let s = r#"
+    {
+        "key1": "value1",,
+        "key2": "value2"
+    }"#;
+    let actual = from_str::<Value>(s).unwrap_err().to_string();
+    assert_eq!(actual, "key must be a string at line 3 column 26");
+}
+
+#[test]
+fn test_double_trailing_comma_object() {
+    let s = r#"
+    {
+        "key1": "value1",
+        "key2": "value2",,
+    }"#;
+    let actual = from_str::<Value>(s).unwrap_err().to_string();
+    assert_eq!(actual, "key must be a string at line 4 column 26");
+}
+
+#[test]
+fn test_trailing_comma_array() {
+    let s = r#"
+    {
+        "key": [
+            "one",
+            "two",
+            "three",
+        ]
+    }"#;
+    let value: Value = from_str(s).unwrap();
+    assert_eq!(value, json!({"key": ["one", "two", "three"]}));
+}
+
+#[test]
+fn test_double_comma_array() {
+    let s = r#"
+    {
+        "key": [
+            "one",,
+            "two",
+        ]
+    }"#;
+    let actual = from_str::<Value>(s).unwrap_err().to_string();
+    assert_eq!(actual, "expected value at line 4 column 19");
+}
+
+#[test]
+fn test_double_trailing_comma_array() {
+    let s = r#"
+    {
+        "key": [
+            "one",
+            "two",,
+        ]
+    }"#;
+    let actual = from_str::<Value>(s).unwrap_err().to_string();
+    assert_eq!(actual, "expected value at line 5 column 19");
+}
+
+#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
+#[serde(deny_unknown_fields)]
+enum Animal {
+    Dog,
+    Frog(String, Vec<isize>),
+    Cat { age: usize, name: String },
+    AntHive(Vec<String>),
+}
+
+#[test]
+fn test_parse_enum_as_array_with_deny_unknown_fields() {
+    let animal: Animal = from_str("{\"Cat\":[0, \"Kate\",]}").unwrap();
+    assert_eq!(
+        animal,
+        Animal::Cat {
+            age: 0,
+            name: "Kate".to_string()
+        }
+    );
+}
+
+#[test]
+fn test_parse_enum_as_object_with_deny_unknown_fields() {
+    let animal: Animal = from_str("{\"Cat\":{\"age\": 2, \"name\": \"Kate\",}}").unwrap();
+    assert_eq!(
+        animal,
+        Animal::Cat {
+            age: 2,
+            name: "Kate".to_string()
+        }
+    );
+}
diff --git a/tests/ui/missing_colon.rs b/tests/ui/missing_colon.rs
index d93b7b9..3691827 100644
--- a/tests/ui/missing_colon.rs
+++ b/tests/ui/missing_colon.rs
@@ -1,4 +1,4 @@
-use serde_json::json;
+use serde_jsonrc::json;
 
 fn main() {
     json!({ "a" });
diff --git a/tests/ui/missing_value.rs b/tests/ui/missing_value.rs
index 0ba14e2..aaba179 100644
--- a/tests/ui/missing_value.rs
+++ b/tests/ui/missing_value.rs
@@ -1,4 +1,4 @@
-use serde_json::json;
+use serde_jsonrc::json;
 
 fn main() {
     json!({ "a" : });
diff --git a/tests/ui/not_found.rs b/tests/ui/not_found.rs
index 2df6870..f8c9462 100644
--- a/tests/ui/not_found.rs
+++ b/tests/ui/not_found.rs
@@ -1,4 +1,4 @@
-use serde_json::json;
+use serde_jsonrc::json;
 
 fn main() {
     json!({ "a" : x });
diff --git a/tests/ui/parse_expr.rs b/tests/ui/parse_expr.rs
index e7f1805..96a42df 100644
--- a/tests/ui/parse_expr.rs
+++ b/tests/ui/parse_expr.rs
@@ -1,4 +1,4 @@
-use serde_json::json;
+use serde_jsonrc::json;
 
 fn main() {
     json!({ "a" : ~ });
diff --git a/tests/ui/parse_key.rs b/tests/ui/parse_key.rs
index 858bd71..c11de44 100644
--- a/tests/ui/parse_key.rs
+++ b/tests/ui/parse_key.rs
@@ -1,4 +1,4 @@
-use serde_json::json;
+use serde_jsonrc::json;
 
 fn main() {
     json!({ "".s : true });
diff --git a/tests/ui/unexpected_after_array_element.rs b/tests/ui/unexpected_after_array_element.rs
index 226c58c..4ea2fd6 100644
--- a/tests/ui/unexpected_after_array_element.rs
+++ b/tests/ui/unexpected_after_array_element.rs
@@ -1,4 +1,4 @@
-use serde_json::json;
+use serde_jsonrc::json;
 
 fn main() {
     json!([ true => ]);
diff --git a/tests/ui/unexpected_after_map_entry.rs b/tests/ui/unexpected_after_map_entry.rs
index 0dfb731..ce4348f 100644
--- a/tests/ui/unexpected_after_map_entry.rs
+++ b/tests/ui/unexpected_after_map_entry.rs
@@ -1,4 +1,4 @@
-use serde_json::json;
+use serde_jsonrc::json;
 
 fn main() {
     json!({ "k": true => });
diff --git a/tests/ui/unexpected_colon.rs b/tests/ui/unexpected_colon.rs
index e767ea6..7484bcc 100644
--- a/tests/ui/unexpected_colon.rs
+++ b/tests/ui/unexpected_colon.rs
@@ -1,4 +1,4 @@
-use serde_json::json;
+use serde_jsonrc::json;
 
 fn main() {
     json!({ : true });
diff --git a/tests/ui/unexpected_comma.rs b/tests/ui/unexpected_comma.rs
index 338874e..e845d1b 100644
--- a/tests/ui/unexpected_comma.rs
+++ b/tests/ui/unexpected_comma.rs
@@ -1,4 +1,4 @@
-use serde_json::json;
+use serde_jsonrc::json;
 
 fn main() {
     json!({ "a" , "b": true });