diff options
Diffstat (limited to 'tests/run-make/issue-46239')
-rw-r--r-- | tests/run-make/issue-46239/Makefile | 6 | ||||
-rw-r--r-- | tests/run-make/issue-46239/main.rs | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/run-make/issue-46239/Makefile b/tests/run-make/issue-46239/Makefile new file mode 100644 index 000000000..0006ced25 --- /dev/null +++ b/tests/run-make/issue-46239/Makefile @@ -0,0 +1,6 @@ +# ignore-cross-compile +include ../tools.mk + +all: + $(RUSTC) main.rs -C opt-level=1 + $(call RUN,main) diff --git a/tests/run-make/issue-46239/main.rs b/tests/run-make/issue-46239/main.rs new file mode 100644 index 000000000..b7df5cf4d --- /dev/null +++ b/tests/run-make/issue-46239/main.rs @@ -0,0 +1,8 @@ +fn project<T>(x: &(T,)) -> &T { &x.0 } + +fn dummy() {} + +fn main() { + let f = (dummy as fn(),); + (*project(&f))(); +} |