about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-21 19:07:37 +0100
committerGitHub <noreply@github.com>2019-12-21 19:07:37 +0100
commit9fa2046ed9f6ffdef4516d6815235e59b62807ae (patch)
tree33b2327ca3a6001bcdb4525907a0625f7e90a481
parentac6dbff45e7bce90b70533d322f06de9730c2781 (diff)
parentc93198f90ea6673aaaa8984e527602f5f6873f48 (diff)
downloadrust-9fa2046ed9f6ffdef4516d6815235e59b62807ae.tar.gz
rust-9fa2046ed9f6ffdef4516d6815235e59b62807ae.zip
Rollup merge of #67420 - lzutao:_val, r=Centril
use _val to ignore parameter of any::type_name_of_val

mem::drop does the same thing too.
-rw-r--r--src/libcore/any.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs
index 882c4a53faf..a2aa6b3fea5 100644
--- a/src/libcore/any.rs
+++ b/src/libcore/any.rs
@@ -496,7 +496,6 @@ pub const fn type_name<T: ?Sized>() -> &'static str {
 /// ```
 #[unstable(feature = "type_name_of_val", issue = "66359")]
 #[rustc_const_unstable(feature = "const_type_name", issue = "63084")]
-pub const fn type_name_of_val<T: ?Sized>(val: &T) -> &'static str {
-    let _ = val;
+pub const fn type_name_of_val<T: ?Sized>(_val: &T) -> &'static str {
     type_name::<T>()
 }