about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-07-06 01:58:52 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2019-07-07 13:04:07 +0300
commit941653b528deb96d5ed13935143db14c45d99d6e (patch)
tree3907e7058a7a1321603e1471174cbe4530d19ef5
parentb6d522a101982b4c6919391a378e799bd74a4da6 (diff)
downloadrust-941653b528deb96d5ed13935143db14c45d99d6e.tar.gz
rust-941653b528deb96d5ed13935143db14c45d99d6e.zip
Address review comments + Fix rebase
-rw-r--r--src/librustc_resolve/macros.rs2
-rw-r--r--src/libserialize/json.rs16
-rw-r--r--src/test/ui/feature-gates/feature-gate-custom_test_frameworks.rs3
-rw-r--r--src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr11
-rw-r--r--src/test/ui/macros/macro-deprecation.rs2
5 files changed, 22 insertions, 12 deletions
diff --git a/src/librustc_resolve/macros.rs b/src/librustc_resolve/macros.rs
index 6d669aafc81..f26c3b8ae6a 100644
--- a/src/librustc_resolve/macros.rs
+++ b/src/librustc_resolve/macros.rs
@@ -19,7 +19,7 @@ use syntax::ext::base::{MacroKind, SyntaxExtension};
 use syntax::ext::expand::{AstFragment, Invocation, InvocationKind};
 use syntax::ext::hygiene::Mark;
 use syntax::ext::tt::macro_rules;
-use syntax::feature_gate::{feature_err, is_builtin_attr_name};
+use syntax::feature_gate::{feature_err, emit_feature_err, is_builtin_attr_name};
 use syntax::feature_gate::{AttributeGate, GateIssue, Stability, BUILTIN_ATTRIBUTES};
 use syntax::symbol::{Symbol, kw, sym};
 use syntax::visit::Visitor;
diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs
index 77947a4be7f..d0007074a82 100644
--- a/src/libserialize/json.rs
+++ b/src/libserialize/json.rs
@@ -103,9 +103,8 @@
 //!
 //! ```rust
 //! # #![feature(rustc_private)]
-//! # #![allow(deprecated)]
-//! extern crate serialize;
-//! use serialize::json::{self, ToJson, Json};
+//! extern crate serialize as rustc_serialize;
+//! use rustc_serialize::json::{self, ToJson, Json};
 //!
 //! // A custom data structure
 //! struct ComplexNum {
@@ -121,7 +120,7 @@
 //! }
 //!
 //! // Only generate `RustcEncodable` trait implementation
-//! #[derive(Encodable)]
+//! #[derive(RustcEncodable)]
 //! pub struct ComplexNumRecord {
 //!     uid: u8,
 //!     dsc: String,
@@ -144,13 +143,12 @@
 //!
 //! ```rust
 //! # #![feature(rustc_private)]
-//! # #![allow(deprecated)]
-//! extern crate serialize;
+//! extern crate serialize as rustc_serialize;
 //! use std::collections::BTreeMap;
-//! use serialize::json::{self, Json, ToJson};
+//! use rustc_serialize::json::{self, Json, ToJson};
 //!
-//! // Only generate `Decodable` trait implementation
-//! #[derive(Decodable)]
+//! // Only generate `RustcDecodable` trait implementation
+//! #[derive(RustcDecodable)]
 //! pub struct TestStruct {
 //!     data_int: u8,
 //!     data_str: String,
diff --git a/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.rs b/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.rs
index 0a200497939..83bb153ba08 100644
--- a/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.rs
+++ b/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.rs
@@ -1,3 +1,6 @@
 #![test_runner(main)] //~ ERROR custom test frameworks are an unstable feature
 
+#[test_case] //~ ERROR custom test frameworks are an unstable feature
+fn f() {}
+
 fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr b/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr
index e288af54cb2..31ff7aebe3a 100644
--- a/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr
+++ b/src/test/ui/feature-gates/feature-gate-custom_test_frameworks.stderr
@@ -1,3 +1,12 @@
+error[E0658]: use of unstable library feature 'custom_test_frameworks': custom test frameworks are an unstable feature
+  --> $DIR/feature-gate-custom_test_frameworks.rs:3:1
+   |
+LL | #[test_case]
+   | ^^^^^^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/50297
+   = help: add #![feature(custom_test_frameworks)] to the crate attributes to enable
+
 error[E0658]: custom test frameworks are an unstable feature
   --> $DIR/feature-gate-custom_test_frameworks.rs:1:1
    |
@@ -7,6 +16,6 @@ LL | #![test_runner(main)]
    = note: for more information, see https://github.com/rust-lang/rust/issues/50297
    = help: add #![feature(custom_test_frameworks)] to the crate attributes to enable
 
-error: aborting due to previous error
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/macros/macro-deprecation.rs b/src/test/ui/macros/macro-deprecation.rs
index ae3827604fa..9636b48c2da 100644
--- a/src/test/ui/macros/macro-deprecation.rs
+++ b/src/test/ui/macros/macro-deprecation.rs
@@ -1,4 +1,4 @@
-// compile-pass
+// check-pass
 // aux-build:deprecated-macros.rs
 
 #[macro_use] extern crate deprecated_macros;