about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-04-20 02:18:00 +0000
committerbors <bors@rust-lang.org>2020-04-20 02:18:00 +0000
commit9b2f8dbba39dd4167f22a7026674a585c3d907d8 (patch)
tree0b0b920e6b81d0b7477aeb4aa9e54e0e5fd2f560
parentc6b55eed638db7db34e887ef255c765bc8910ec0 (diff)
parentce83b49d161b9375849345be722e86c5417dfdda (diff)
downloadrust-9b2f8dbba39dd4167f22a7026674a585c3d907d8.tar.gz
rust-9b2f8dbba39dd4167f22a7026674a585c3d907d8.zip
Auto merge of #71007 - Amanieu:deprecate_asm, r=Mark-Simulacrum
Deprecate the asm! macro in favor of llvm_asm!

Since we will be changing the syntax of `asm!` soon, deprecate it and encourage people to use `llvm_asm!` instead (which preserves the old syntax). This will avoid breakage when `asm!` is changed.

RFC: https://github.com/rust-lang/rfcs/pull/2843
-rw-r--r--Cargo.lock24
-rw-r--r--src/libcore/macros/mod.rs8
-rw-r--r--src/libcore/prelude/v1.rs1
-rw-r--r--src/librustc_query_system/Cargo.toml2
-rw-r--r--src/libstd/lib.rs1
-rw-r--r--src/libstd/prelude/v1.rs1
m---------src/stdarch0
-rw-r--r--src/test/ui/feature-gates/feature-gate-asm.rs1
-rw-r--r--src/test/ui/feature-gates/feature-gate-asm.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-asm2.rs1
-rw-r--r--src/test/ui/feature-gates/feature-gate-asm2.stderr12
11 files changed, 46 insertions, 17 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 41469fbafe9..73cb611d79f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1736,7 +1736,7 @@ checksum = "5b31c9b90731276fdd24d896f31bb10aecf2e5151733364ae81123186643d939"
 dependencies = [
  "jsonrpc-core",
  "log",
- "parking_lot 0.10.0",
+ "parking_lot 0.10.2",
  "serde",
 ]
 
@@ -1855,9 +1855,9 @@ checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83"
 
 [[package]]
 name = "lock_api"
-version = "0.3.1"
+version = "0.3.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8912e782533a93a167888781b836336a6ca5da6175c05944c86cf28c31104dc"
+checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75"
 dependencies = [
  "scopeguard",
 ]
@@ -2395,12 +2395,12 @@ dependencies = [
 
 [[package]]
 name = "parking_lot"
-version = "0.10.0"
+version = "0.10.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "92e98c49ab0b7ce5b222f2cc9193fc4efe11c6d0bd4f648e374684a6857b1cfc"
+checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e"
 dependencies = [
  "lock_api",
- "parking_lot_core 0.7.0",
+ "parking_lot_core 0.7.1",
 ]
 
 [[package]]
@@ -2420,9 +2420,9 @@ dependencies = [
 
 [[package]]
 name = "parking_lot_core"
-version = "0.7.0"
+version = "0.7.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7582838484df45743c8434fbff785e8edf260c28748353d44bc0da32e0ceabf1"
+checksum = "0e136c1904604defe99ce5fd71a28d473fa60a12255d511aa78a9ddf11237aeb"
 dependencies = [
  "cfg-if",
  "cloudabi",
@@ -3242,7 +3242,7 @@ dependencies = [
  "libc",
  "log",
  "measureme",
- "parking_lot 0.10.0",
+ "parking_lot 0.10.2",
  "rustc-ap-graphviz",
  "rustc-ap-rustc_index",
  "rustc-ap-serialize",
@@ -3691,7 +3691,7 @@ dependencies = [
  "libc",
  "log",
  "measureme",
- "parking_lot 0.10.0",
+ "parking_lot 0.10.2",
  "rustc-hash",
  "rustc-rayon",
  "rustc-rayon-core",
@@ -3989,7 +3989,7 @@ dependencies = [
  "jobserver",
  "log",
  "measureme",
- "parking_lot 0.10.0",
+ "parking_lot 0.10.2",
  "polonius-engine",
  "rustc-rayon",
  "rustc-rayon-core",
@@ -4138,7 +4138,7 @@ name = "rustc_query_system"
 version = "0.0.0"
 dependencies = [
  "log",
- "parking_lot 0.9.0",
+ "parking_lot 0.10.2",
  "rustc-rayon-core",
  "rustc_data_structures",
  "rustc_errors",
diff --git a/src/libcore/macros/mod.rs b/src/libcore/macros/mod.rs
index 9c885ef99a9..73404a73e3d 100644
--- a/src/libcore/macros/mod.rs
+++ b/src/libcore/macros/mod.rs
@@ -1316,6 +1316,14 @@ pub(crate) mod builtin {
         issue = "70173",
         reason = "inline assembly is not stable enough for use and is subject to change"
     )]
+    #[cfg_attr(
+        not(bootstrap),
+        rustc_deprecated(
+            since = "1.44.0",
+            reason = "the syntax of asm! will change soon, use llvm_asm! to avoid breakage",
+            suggestion = "llvm_asm",
+        )
+    )]
     #[rustc_builtin_macro]
     #[macro_export]
     macro_rules! asm {
diff --git a/src/libcore/prelude/v1.rs b/src/libcore/prelude/v1.rs
index 9b4ed4e8205..6a51d39ab9d 100644
--- a/src/libcore/prelude/v1.rs
+++ b/src/libcore/prelude/v1.rs
@@ -54,6 +54,7 @@ pub use crate::fmt::macros::Debug;
 pub use crate::hash::macros::Hash;
 
 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
+#[allow(deprecated)]
 #[doc(no_inline)]
 pub use crate::{
     asm, assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
diff --git a/src/librustc_query_system/Cargo.toml b/src/librustc_query_system/Cargo.toml
index e1657a8f3c6..7520da1f32b 100644
--- a/src/librustc_query_system/Cargo.toml
+++ b/src/librustc_query_system/Cargo.toml
@@ -18,5 +18,5 @@ rustc_index = { path = "../librustc_index" }
 rustc_macros = { path = "../librustc_macros" }
 rustc_serialize = { path = "../libserialize", package = "serialize" }
 rustc_span = { path = "../librustc_span" }
-parking_lot = "0.9"
+parking_lot = "0.10"
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 59d845c619b..9d2810cacc2 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -524,6 +524,7 @@ pub use core::{
 
 // Re-export built-in macros defined through libcore.
 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
+#[allow(deprecated)]
 pub use core::{
     asm, assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
     format_args_nl, global_asm, include, include_bytes, include_str, line, llvm_asm, log_syntax,
diff --git a/src/libstd/prelude/v1.rs b/src/libstd/prelude/v1.rs
index 03686d789d7..92e3ea84850 100644
--- a/src/libstd/prelude/v1.rs
+++ b/src/libstd/prelude/v1.rs
@@ -36,6 +36,7 @@ pub use crate::result::Result::{self, Err, Ok};
 
 // Re-exported built-in macros
 #[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
+#[allow(deprecated)]
 #[doc(no_inline)]
 pub use core::prelude::v1::{
     asm, assert, cfg, column, compile_error, concat, concat_idents, env, file, format_args,
diff --git a/src/stdarch b/src/stdarch
-Subproject 1a577bd78e84e357e29c5336ff8beb432873046
+Subproject b00ecbeb268ee97cef9fa9b2375e6f6cf0864db
diff --git a/src/test/ui/feature-gates/feature-gate-asm.rs b/src/test/ui/feature-gates/feature-gate-asm.rs
index 7eeeb4bc4e2..70f5845550d 100644
--- a/src/test/ui/feature-gates/feature-gate-asm.rs
+++ b/src/test/ui/feature-gates/feature-gate-asm.rs
@@ -3,6 +3,7 @@
 fn main() {
     unsafe {
         asm!(""); //~ ERROR inline assembly is not stable enough
+        //~^ WARN use of deprecated item 'asm'
         llvm_asm!(""); //~ ERROR inline assembly is not stable enough
     }
 }
diff --git a/src/test/ui/feature-gates/feature-gate-asm.stderr b/src/test/ui/feature-gates/feature-gate-asm.stderr
index 1f9eaa5632e..9d4d7b53955 100644
--- a/src/test/ui/feature-gates/feature-gate-asm.stderr
+++ b/src/test/ui/feature-gates/feature-gate-asm.stderr
@@ -8,7 +8,7 @@ LL |         asm!("");
    = help: add `#![feature(asm)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'llvm_asm': inline assembly is not stable enough for use and is subject to change
-  --> $DIR/feature-gate-asm.rs:6:9
+  --> $DIR/feature-gate-asm.rs:7:9
    |
 LL |         llvm_asm!("");
    |         ^^^^^^^^
@@ -16,6 +16,14 @@ LL |         llvm_asm!("");
    = note: see issue #70173 <https://github.com/rust-lang/rust/issues/70173> for more information
    = help: add `#![feature(llvm_asm)]` to the crate attributes to enable
 
-error: aborting due to 2 previous errors
+warning: use of deprecated item 'asm': the syntax of asm! will change soon, use llvm_asm! to avoid breakage
+  --> $DIR/feature-gate-asm.rs:5:9
+   |
+LL |         asm!("");
+   |         ^^^ help: replace the use of the deprecated item: `llvm_asm`
+   |
+   = note: `#[warn(deprecated)]` on by default
+
+error: aborting due to 2 previous errors; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-asm2.rs b/src/test/ui/feature-gates/feature-gate-asm2.rs
index 666a4894f62..e3e86592a48 100644
--- a/src/test/ui/feature-gates/feature-gate-asm2.rs
+++ b/src/test/ui/feature-gates/feature-gate-asm2.rs
@@ -3,6 +3,7 @@
 fn main() {
     unsafe {
         println!("{:?}", asm!("")); //~ ERROR inline assembly is not stable
+        //~^ WARN use of deprecated item 'asm'
         println!("{:?}", llvm_asm!("")); //~ ERROR inline assembly is not stable
     }
 }
diff --git a/src/test/ui/feature-gates/feature-gate-asm2.stderr b/src/test/ui/feature-gates/feature-gate-asm2.stderr
index 17ba66e9842..a3c8116d6b1 100644
--- a/src/test/ui/feature-gates/feature-gate-asm2.stderr
+++ b/src/test/ui/feature-gates/feature-gate-asm2.stderr
@@ -8,7 +8,7 @@ LL |         println!("{:?}", asm!(""));
    = help: add `#![feature(asm)]` to the crate attributes to enable
 
 error[E0658]: use of unstable library feature 'llvm_asm': inline assembly is not stable enough for use and is subject to change
-  --> $DIR/feature-gate-asm2.rs:6:26
+  --> $DIR/feature-gate-asm2.rs:7:26
    |
 LL |         println!("{:?}", llvm_asm!(""));
    |                          ^^^^^^^^
@@ -16,6 +16,14 @@ LL |         println!("{:?}", llvm_asm!(""));
    = note: see issue #70173 <https://github.com/rust-lang/rust/issues/70173> for more information
    = help: add `#![feature(llvm_asm)]` to the crate attributes to enable
 
-error: aborting due to 2 previous errors
+warning: use of deprecated item 'asm': the syntax of asm! will change soon, use llvm_asm! to avoid breakage
+  --> $DIR/feature-gate-asm2.rs:5:26
+   |
+LL |         println!("{:?}", asm!(""));
+   |                          ^^^ help: replace the use of the deprecated item: `llvm_asm`
+   |
+   = note: `#[warn(deprecated)]` on by default
+
+error: aborting due to 2 previous errors; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0658`.