Skip to content

Commit 9e53e32

Browse files
committed
add type_name test
1 parent 247aa5e commit 9e53e32

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

src/compile_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,7 @@ run_test! {intrinsics,size_of_val,stable}
718718
run_test! {intrinsics,transmute,stable}
719719
run_test! {intrinsics,trigonometry,stable}
720720
run_test! {intrinsics,type_id,stable}
721+
run_test! {intrinsics,type_name,stable}
721722
run_test! {intrinsics,wrapping_ops,stable}
722723
run_test! {iter,fold,stable}
723724
run_test! {statics,thread_local,stable}

src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,9 @@ impl ArchiveBuilderBuilder for RlibArchiveBuilder {
320320
&self,
321321
_sess: &Session,
322322
_lib_name: &str,
323-
_dll_imports: &[rustc_session::cstore::DllImport],
323+
_dll_imports: std::vec::Vec<(std::string::String, std::option::Option<u16>)>,
324324
_tmpdir: &Path,
325-
_bool: bool,
326-
) -> PathBuf {
325+
) {
327326
unimplemented!("creating dll imports is not supported");
328327
}
329328
}

test/intrinsics/type_name.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#![feature(
2+
lang_items,
3+
adt_const_params,
4+
associated_type_defaults,
5+
core_intrinsics,
6+
start,
7+
unsized_const_params
8+
)]
9+
#![allow(
10+
internal_features,
11+
incomplete_features,
12+
unused_variables,
13+
dead_code,
14+
unused_imports
15+
)]
16+
#![no_std]
17+
18+
use core::intrinsics::type_name;
19+
20+
include!("../common.rs");
21+
22+
fn main() {
23+
test_eq!(
24+
type_name::<Option<u32>>(),
25+
black_box("core::option::Option<core::primitive::u32>")
26+
);
27+
}

0 commit comments

Comments
 (0)