Merge SP1A.201105.002
Change-Id: I8aaa41d26c347d0549a5dc8298c4be9a35993e43
diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json
index 4d0697a..f284d32 100644
--- a/.cargo_vcs_info.json
+++ b/.cargo_vcs_info.json
@@ -1,5 +1,5 @@
 {
   "git": {
-    "sha1": "f40ed4703128a5b77bbbbf7863b577585b7d5896"
+    "sha1": "ddd3af568ed76a2af94bcc3a9fd06af8e00fec99"
   }
 }
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 75775cd..eadb8fb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,7 +16,7 @@
       matrix:
         os: [macos-latest, ubuntu-latest, windows-latest]
         clang: [["10.0", "clang_10_0"]]
-        rust: ["1.36.0"]
+        rust: ["1.40.0"]
     steps:
       - name: Checkout Repository
         uses: actions/checkout@v2
diff --git a/Android.bp b/Android.bp
index 3824501..bf3c356 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,9 +1,22 @@
-// This file is generated by cargo2android.py --run --features=runtime,clang_10_0 --dependencies.
+// This file is generated by cargo2android.py --run --features=runtime,clang_10_0 --dependencies --copy-out.
+
+genrule {
+    name: "copy_clang-sys_build_out",
+    srcs: ["out/*"],
+    cmd: "cp $(in) $(genDir)",
+    out: [
+        "common.rs",
+        "dynamic.rs",
+    ],
+}
 
 rust_library_host {
     name: "libclang_sys",
     crate_name: "clang_sys",
-    srcs: ["src/lib.rs"],
+    srcs: [
+        "src/lib.rs",
+        ":copy_clang-sys_build_out",
+    ],
     edition: "2015",
     features: [
         "clang_10_0",
@@ -29,7 +42,7 @@
 }
 
 // dependent_library ["feature_list"]
-//   cfg-if-0.1.10
+//   cfg-if-1.0.0
 //   glob-0.3.0
-//   libc-0.2.77
-//   libloading-0.6.3
+//   libc-0.2.80
+//   libloading-0.6.5
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 23a11a9..58e4502 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,8 @@
+## [1.0.1] - 2020-10-01
+
+### Changed
+- Improved panic error message when calling an unloaded function
+
 ## [1.0.0] - 2020-07-14
 
 ### Changed
diff --git a/Cargo.toml b/Cargo.toml
index f7e1e23..7937a28 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,12 +12,12 @@
 
 [package]
 name = "clang-sys"
-version = "1.0.0"
+version = "1.0.1"
 authors = ["Kyle Mayes <kyle@mayeses.com>"]
 build = "build.rs"
 links = "clang"
 description = "Rust bindings for libclang."
-documentation = "https://kylemayes.github.io/clang-sys/runtime/clang_sys"
+documentation = "https://docs.rs/clang-sys"
 readme = "README.md"
 license = "Apache-2.0"
 repository = "https://github.com/KyleMayes/clang-sys"
diff --git a/Cargo.toml.orig b/Cargo.toml.orig
index 42a2582..18b5c1a 100644
--- a/Cargo.toml.orig
+++ b/Cargo.toml.orig
@@ -3,14 +3,14 @@
 name = "clang-sys"
 authors = ["Kyle Mayes <kyle@mayeses.com>"]
 
-version = "1.0.0"
+version = "1.0.1"
 
 readme = "README.md"
 license = "Apache-2.0"
 
 description = "Rust bindings for libclang."
 
-documentation = "https://kylemayes.github.io/clang-sys/runtime/clang_sys"
+documentation = "https://docs.rs/clang-sys"
 repository = "https://github.com/KyleMayes/clang-sys"
 
 links = "clang"
diff --git a/METADATA b/METADATA
index b656016..39ca89e 100644
--- a/METADATA
+++ b/METADATA
@@ -7,13 +7,13 @@
   }
   url {
     type: ARCHIVE
-    value: "https://static.crates.io/crates/clang-sys/clang-sys-1.0.0.crate"
+    value: "https://static.crates.io/crates/clang-sys/clang-sys-1.0.1.crate"
   }
-  version: "1.0.0"
+  version: "1.0.1"
   license_type: NOTICE
   last_upgrade_date {
     year: 2020
-    month: 7
-    day: 13
+    month: 10
+    day: 26
   }
 }
diff --git a/README.md b/README.md
index d7351f5..48eeb75 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,8 @@
 # clang-sys
 
-![Crate](https://img.shields.io/crates/v/clang-sys.svg)
-![Documentation](https://docs.rs/clang-sys/badge.svg)
-![CI](https://github.com/KyleMayes/clang-sys/workflows/CI/badge.svg?branch=master)
+[![Crate](https://img.shields.io/crates/v/clang-sys.svg)](https://crates.io/crates/clang-sys)
+[![Documentation](https://docs.rs/clang-sys/badge.svg)](https://docs.rs/clang-sys)
+[![CI](https://github.com/KyleMayes/clang-sys/workflows/CI/badge.svg?branch=master)](https://github.com/KyleMayes/clang-sys/actions?query=workflow%3ACI)
 
 Rust bindings for `libclang`.
 
@@ -10,7 +10,7 @@
 [clang-rs](https://github.com/KyleMayes/clang-rs).
 
 Supported on the stable, beta, and nightly Rust channels.<br/>
-Minimum supported Rust version: **1.36.0**
+Minimum supported Rust version: **1.40.0**
 
 Released under the Apache License 2.0.
 
diff --git a/docs.py b/docs.py
deleted file mode 100644
index 554022a..0000000
--- a/docs.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-import shutil
-import subprocess
-
-TARGET = ".docs"
-VERSION = "clang_10_0"
-
-if os.path.isdir(TARGET):
-    shutil.rmtree(TARGET)
-
-os.mkdir(TARGET)
-
-for (name, features) in [("default", VERSION), ("runtime", f"runtime,{VERSION}")]:
-    subprocess.call(["cargo", "clean"])
-    subprocess.call(["cargo", "doc", f"--features={features}", "--no-deps"])
-    print(f"Copying docs to {TARGET}/{name}...")
-    shutil.copytree(f"target/doc", f"{TARGET}/{name}")
-
-os.chdir(TARGET)
-subprocess.call(["git", "init"])
-subprocess.call(["git", "remote", "add", "origin", "git@github.com:KyleMayes/clang-sys.git"])
-subprocess.call(["git", "checkout", "--orphan", "gh-pages"])
-subprocess.call(["git", "add", "-A"])
-subprocess.call(["git", "commit", "-m", "\"Update documentation\""])
-subprocess.call(["git", "push", "origin", "gh-pages", "--force"])
-
-os.chdir("..")
-shutil.rmtree(TARGET)
diff --git a/post_update.sh b/post_update.sh
deleted file mode 100755
index bfcef00..0000000
--- a/post_update.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-
-# $1 Path to the new version.
-# $2 Path to the old version.
-
-set -x
-set -e
-
-# Change src/link.rs to include files from ../out/
-SRCFILE=src/link.rs
-OLDSTR='include!(concat!(env!("OUT_DIR"), "/common.rs"));'
-NEWSTR='include!("../out/common.rs");'
-sed -i -e "s:$OLDSTR:$NEWSTR:" $SRCFILE
-# Make sure that sed replaced $OLDSTR with $NEWSTR
-grep "$NEWSTR" $SRCFILE > /dev/null
-
-OLDSTR='include!(concat!(env!("OUT_DIR"), "/dynamic.rs"));'
-NEWSTR='include!("../out/dynamic.rs");'
-sed -i -e "s:$OLDSTR:$NEWSTR:" $SRCFILE
-# Make sure that sed replaced $OLDSTR with $NEWSTR
-grep "$NEWSTR" $SRCFILE > /dev/null
diff --git a/src/link.rs b/src/link.rs
index 082eb81..3230e4a 100644
--- a/src/link.rs
+++ b/src/link.rs
@@ -155,10 +155,12 @@
             $(#[doc=$doc] #[cfg($cfg)])*
             pub unsafe fn $name($($pname: $pty), *) $(-> $ret)* {
                 let f = with_library(|l| {
-                    match l.functions.$name {
-                        Some(f) => f,
-                        _ => panic!(concat!("function not loaded: ", stringify!($name))),
-                    }
+                    l.functions.$name.expect(concat!(
+                        "`libclang` function not loaded: `",
+                        stringify!($name),
+                        "`. This crate requires that `libclang` 3.9 or later be installed on your ",
+                        "system. For more information on how to accomplish this, see here: ",
+                        "https://rust-lang.github.io/rust-bindgen/requirements.html#installing-clang-39"))
                 }).expect("a `libclang` shared library is not loaded on this thread");
                 f($($pname), *)
             }
@@ -186,8 +188,8 @@
         /// * the `libclang` shared library could not be opened
         pub fn load_manually() -> Result<SharedLibrary, String> {
             mod build {
-                pub mod common { include!("../out/common.rs"); }
-                pub mod dynamic { include!("../out/dynamic.rs"); }
+                pub mod common { include!(concat!(env!("OUT_DIR"), "/common.rs")); }
+                pub mod dynamic { include!(concat!(env!("OUT_DIR"), "/dynamic.rs")); }
             }
 
             let (directory, filename) = build::dynamic::find(true)?;