Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 5 pull requests #67455

Merged
merged 43 commits into from
Dec 20, 2019
Merged

Rollup of 5 pull requests #67455

merged 43 commits into from
Dec 20, 2019

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Dec 20, 2019

Successful merges:

Failed merges:

r? @ghost

VirrageS and others added 30 commits December 6, 2019 16:59
Allow defaultness on trait items syntactically.
An exception is `fn` params.
Also fix error the code description.
The WebAssembly targets of rustc have weird issues around name mangling
and import the same name from different modules. This all largely stems
from the fact that we're using literal symbol names in LLVM IR to
represent what a function is called when it's imported, and we're not
using the wasm-specific `wasm-import-name` attribute. This in turn leads
to two issues:

* If, in the same codegen unit, the same FFI symbol is referenced twice
  then rustc, when translating to LLVM IR, will only reference one
  symbol from the first wasm module referenced.

* There's also a bug in LLD [1] where even if two codegen units
  reference different modules, having the same symbol names means that
  LLD coalesces the symbols and only refers to one wasm module.

Put another way, all our imported wasm symbols from the environment are
keyed off their LLVM IR symbol name, which has lots of collisions today.
This commit fixes the issue by implementing two changes:

1. All wasm symbols with `#[link(wasm_import_module = "...")]` are
   mangled by default in LLVM IR. This means they're all given unique names.

2. Symbols then use the `wasm-import-name` attribute to ensure that the
   WebAssembly file uses the correct import name.

When put together this should ensure we don't trip over the LLD bug [1]
and we also codegen IR correctly always referencing the right symbols
with the right import module/name pairs.

Closes rust-lang#50021
Closes rust-lang#56309
Closes rust-lang#63562

[1]: https://bugs.llvm.org/show_bug.cgi?id=44316
@bors
Copy link
Contributor

bors commented Dec 20, 2019

🌲 The tree is currently closed for pull requests below priority 100, this pull request will be tested once the tree is reopened

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 20, 2019
@Centril Centril added rollup A PR which is a rollup and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 20, 2019
@bors
Copy link
Contributor

bors commented Dec 20, 2019

⌛ Testing commit 43d1532 with merge 01a4650...

bors added a commit that referenced this pull request Dec 20, 2019
Rollup of 5 pull requests

Successful merges:

 - #64588 (Add a raw "address of" operator)
 - #67031 (Update tokio crates to latest versions)
 - #67131 (Merge `TraitItem` & `ImplItem into `AssocItem`)
 - #67354 (Fix pointing at arg when cause is outside of call)
 - #67363 (Fix handling of wasm import modules and names)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Dec 20, 2019

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 01a4650 to master...

@matthiaskrgr
Copy link
Member

@rust-lang/infra looks like the toolstate is (still?) not updated properly (this pr broke clippy, but there is no note in the message, at https://github.com/rust-lang-nursery/rust-toolstate or the toolstate website)

matthiaskrgr added a commit to matthiaskrgr/rust-clippy that referenced this pull request Dec 20, 2019
@Centril Centril deleted the rollup-mf0yc81 branch December 20, 2019 20:55
bors added a commit to rust-lang/rust-clippy that referenced this pull request Dec 21, 2019
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 21, 2019
Changes:
````
rustup "Merge `ast::Mutability` and `mir::Mutability`"
rustup rust-lang#67130
rustup rust-lang#67455
There are no per-file copyright headers anymore
Update lints for `iterator_step_by_zero` changes
Fix 'redudant' spelling in redundant_clone docs
Fix documentation example for unnecessary_filter_map.
Fix `expect_fun_call` false negative on references
Fix `iterator_step_by_zero` description in declaration
Fix `iterator_step_by_zero` definition
Correct `iterator_step_by_zero` documentation
Update iterator_step_by_zero
Prevent `cmp_nan` when inside constants
Detect comparisons with NAN constants
Fix clippy build failure
````
bors added a commit that referenced this pull request Dec 22, 2019
submodules: update clippy from 69f99e7 to acbc609

Changes:
````
rustup "Merge `ast::Mutability` and `mir::Mutability`"
rustup #67130
rustup #67455
Update lints for `iterator_step_by_zero` changes
Fix 'redudant' spelling in redundant_clone docs
Fix documentation example for unnecessary_filter_map.
Fix `expect_fun_call` false negative on references
Fix `iterator_step_by_zero` description in declaration
Fix `iterator_step_by_zero` definition
Correct `iterator_step_by_zero` documentation
Update iterator_step_by_zero
Prevent `cmp_nan` when inside constants
Detect comparisons with NAN constants
Fix clippy build failure
````

r? @oli-obk  @Manishearth
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request May 5, 2020
Changes:
````
rustup "Merge `ast::Mutability` and `mir::Mutability`"
rustup rust-lang/rust#67130
rustup rust-lang/rust#67455
There are no per-file copyright headers anymore
Update lints for `iterator_step_by_zero` changes
Fix 'redudant' spelling in redundant_clone docs
Fix documentation example for unnecessary_filter_map.
Fix `expect_fun_call` false negative on references
Fix `iterator_step_by_zero` description in declaration
Fix `iterator_step_by_zero` definition
Correct `iterator_step_by_zero` documentation
Update iterator_step_by_zero
Prevent `cmp_nan` when inside constants
Detect comparisons with NAN constants
Fix clippy build failure
````
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants