summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2023-03-24 16:24:37 -0400
committerBen Kimock <kimockb@gmail.com>2023-04-07 15:46:45 -0400
commite88e2af959559220412e21f66e9063aeed2f7a8b (patch)
tree025d9360bf044677055ce5da1fbd62b6bcf34cce /tests/codegen
parente3126b1084fe93376458933d85c131dffd6086f2 (diff)
downloadrust-e88e2af959559220412e21f66e9063aeed2f7a8b.tar.gz
rust-e88e2af959559220412e21f66e9063aeed2f7a8b.zip
Give the cross-crate generic some work to do
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs4
-rw-r--r--tests/codegen/remap_path_prefix/xcrate-generic.rs2
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs b/tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs
index 59092dbf637..15bd0f17421 100644
--- a/tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs
+++ b/tests/codegen/remap_path_prefix/auxiliary/xcrate-generic.rs
@@ -3,4 +3,6 @@
 
 #![crate_type = "lib"]
 
-pub fn foo<T>() {}
+pub fn foo<T: Default>() -> T {
+    T::default()
+}
diff --git a/tests/codegen/remap_path_prefix/xcrate-generic.rs b/tests/codegen/remap_path_prefix/xcrate-generic.rs
index 7a9d2ca9b6b..399deec1fc9 100644
--- a/tests/codegen/remap_path_prefix/xcrate-generic.rs
+++ b/tests/codegen/remap_path_prefix/xcrate-generic.rs
@@ -7,7 +7,7 @@
 extern crate xcrate_generic;
 
 pub fn foo() {
-    xcrate_generic::foo::<u32>();
+    println!("{}", xcrate_generic::foo::<u32>());
 }
 
 // Here we check that local debuginfo is mapped correctly.