Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Jun 11, 2021

Implements #1776 (comment).

The error looks like this:

error: found `malloc` symbol definition that clashes with a built-in shim
  --> tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:12:9
   |
12 |         malloc(0);
   |         ^^^^^^^^^ found `malloc` symbol definition that clashes with a built-in shim
   |
help: the `malloc` symbol is defined here

  --> tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:2:1
   |
2  | / extern "C" fn malloc(_: usize) -> *mut std::ffi::c_void {
3  | |     //~^ HELP the `malloc` symbol is defined here
4  | |     unreachable!()
5  | | }
   | |_^
   = note: inside `main` at tests/compile-fail/function_calls/exported_symbol_shim_clashing.rs:12:9

This does not implement "better error messages than we do currently for arg/ABI mismatches" in #1776 (comment) -- I failed to remove all check_arg_count() and check_abi() (they are still used in src/shims/intrinsics.rs and call_dlsym()) and they don't receive the name of the shim.

…ng `let link_name = link_name_sym.as_str()`
@RalfJung
Copy link
Member

Looks great, thanks. :)
@bors r+

@bors
Copy link
Contributor

bors commented Jun 15, 2021

📌 Commit aaaa142 has been approved by RalfJung

@bors
Copy link
Contributor

bors commented Jun 15, 2021

⌛ Testing commit aaaa142 with merge 486b5df...

@bors
Copy link
Contributor

bors commented Jun 15, 2021

☀️ Test successful - checks-actions
Approved by: RalfJung
Pushing 486b5df to master...

@bors bors merged commit 486b5df into rust-lang:master Jun 15, 2021
@ghost ghost deleted the 1776-follow-up branch June 15, 2021 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants