From 3e0ffe0448ddd03d3ba5434daa63e6183bb058ee Mon Sep 17 00:00:00 2001
From: Per Lindgren <per.lindgren@ltu.se>
Date: Thu, 13 Dec 2018 22:57:55 +0100
Subject: [PATCH] stable vs nightly features

---
 .vscode/tasks.json   |  8 ++++----
 Cargo.toml           | 10 ++++++++--
 README.md            | 10 ++++++++++
 examples/example.rs  |  2 +-
 examples/example2.rs |  2 +-
 5 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 82a5462..d035175 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -5,8 +5,8 @@
     "tasks": [
         {
             "type": "shell",
-            "label": "cargo run --example example --features debug-fmt",
-            "command": "cargo run --example example --features debug-fmt",
+            "label": "cargo +stable run --example example --features debug-fmt",
+            "command": "cargo +stable run --example example --features debug-fmt",
             "problemMatcher": [
                 "$rustc"
             ],
@@ -17,8 +17,8 @@
         },
         {
             "type": "shell",
-            "label": "cargo run --example example2 --features debug-fmt",
-            "command": "cargo run --example example2 --features debug-fmt",
+            "label": "cargo +nightly run --example example2 --features 'debug-fmt nightly'",
+            "command": "cargo +nightly run --example example2 --features 'debug-fmt nightly'",
             "problemMatcher": [
                 "$rustc"
             ],
diff --git a/Cargo.toml b/Cargo.toml
index 4aca0f9..769e7d7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,9 +15,15 @@ version = "0.3.0"
 
 [dependencies]
 vcell = "0.1.0"
+array-debug = { git = "https://gitlab.henriktjader.com/pln/array-debug", optional = true  }
 
 [features]
 debug-fmt = []
+nightly = ["array-debug"]
 
-[dev-dependencies]
-array-debug = { git = "https://gitlab.henriktjader.com/pln/array-debug" }
\ No newline at end of file
+[[example]]
+name = "example"
+
+[[example]]
+name = "example2"
+required-features = ["nightly"]
diff --git a/README.md b/README.md
index 74673ce..2169679 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,11 @@ Notice, the current implementation of `array-debug` (see `examples/example2.rs`)
 
 
 ``` rust
+//! Example to show the use of `Debug` formatting for small register arrays
+//!
+//! > cargo +stable run --example example --features debug-fmt
+//!
+
 extern crate volatile_register;
 use std::mem;
 use volatile_register::{RW};
@@ -46,6 +51,11 @@ Registers will be formatted under `UpperHex`, notice in the example that arrays
 For register arrays with more then 32 elements, `array-debug` provides a newtype over array, replicating the array behavior while providing `Debug`.
 
 ``` rust
+//! Example to show the use of ¡Debug` formatting for big register arrays
+//!
+//! > cargo +nightly run --example example2 --features 'debug-fmt nightly'
+//!
+
 extern crate array_debug;
 extern crate volatile_register;
 
diff --git a/examples/example.rs b/examples/example.rs
index dd87d7f..49acf93 100644
--- a/examples/example.rs
+++ b/examples/example.rs
@@ -1,6 +1,6 @@
 //! Example to show the use of `Debug` formatting for small register arrays
 //!
-//! > cargo run --example example2 --features debug-fmt
+//! > cargo +stable run --example example --features debug-fmt
 //!
 
 extern crate volatile_register;
diff --git a/examples/example2.rs b/examples/example2.rs
index 805e28f..7334539 100644
--- a/examples/example2.rs
+++ b/examples/example2.rs
@@ -1,6 +1,6 @@
 //! Example to show the use of ¡Debug` formatting for big register arrays
 //!
-//! > cargo run --example example2 --features debug-fmt
+//! > cargo +nightly run --example example2 --features 'debug-fmt nightly'
 //!
 
 extern crate array_debug;
-- 
GitLab