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 6 pull requests #85594

Merged
merged 13 commits into from
May 23, 2021
Merged

Rollup of 6 pull requests #85594

merged 13 commits into from
May 23, 2021

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

ChrisDenton and others added 13 commits May 6, 2021 02:41
This avoids using jmp stubs when calling functions exported from a dll.
the example focuses on Linux, but that should be enough to explain how
the behaviour can change
Originally committed to Rust in 2013, it is identical to append
with a reversed order of arguments.
This sets their toggles to be closed in the HTML (matching the default
setting), and opens them if the setting indicates to do so.

This distinguishes between implementations and implementors based on
being descendants of certain named elements.
MSVC: Avoid using jmp stubs for dll function imports

Windows import libraries contain two symbols for every function: `__imp_FunctionName` and `FunctionName` (where `FunctionName` is the name of the function to be imported).

`__imp_FunctionName` contains the address of the imported function. This will be filled in by the Windows executable loader at runtime. `FunctionName` contains a jmp stub that simply jumps to the address given by `__imp_FunctionName`. E.g. it's a function that solely contains a single jmp instruction:

```asm
jmp __imp_FunctionName
```

When using an external DLL function in Rust, by default the linker will link to FunctionName, causing a bit of indirection at runtime. In Microsoft's C++ it's possible to instead tell it to insert calls to the address in `__imp_FunctionName` by using the  `__declspec(dllimport)` attribute. In Rust it's possible to get effectively the same behaviour using the `#[link]` attribute on `extern` blocks.

----

The second commit also merges multiple `extern` blocks into one block. This is because otherwise Rust will currently create duplicate linker arguments for each block. In this case having duplicates shouldn't matter much other than the noise when displaying the linker command.
add an example to explain std::io::Read::read returning 0 in some cases

I have always found the explanation about `Read::read` returning 0 to indicate EOF but not indefinitely, so here's more info using Linux as example. I can also add example code if necessary
Add doc aliases to `unit`

I think it makes sense for `unit` to have the same doc aliases as `tuple` does.
…manieu

Remove surplus prepend LinkedList fn

This nightly library feature provides a function on `LinkedList<T>` that is identical to `fn append` with a reversed order of arguments. Observe this diff against the `fn append` doctest:
```diff
+#![feature(linked_list_prepend)]
 fn main() {
    use std::collections::LinkedList;
    let mut list1 = LinkedList::new();
    list1.push_back('a');
    let mut list2 = LinkedList::new();
    list2.push_back('b');
    list2.push_back('c');

-    list1.append(&mut list2);
+    list2.prepend(&mut list1);

-    let mut iter = list1.iter();
+    let mut iter = list2.iter();
     assert_eq!(iter.next(), Some(&'a'));
     assert_eq!(iter.next(), Some(&'b'));
     assert_eq!(iter.next(), Some(&'c'));
     assert!(iter.next().is_none());

-    assert!(list2.is_empty());
+    assert!(list1.is_empty());
 }
```

As this has received no obvious request to stabilize it, nor does it have a tracking issue, and was left on nightly and the consensus seems to have been to deprecate it in this pre-1.0 PR in 2014, rust-lang#20356, I propose simply removing it.
…meGomez

Fix auto-hide for implementations and implementors.

This sets their toggles to be closed in the HTML (matching the default
setting), and opens them if the setting indicates to do so.

This distinguishes between implementations and implementors based on
being descendants of certain named elements.

Demo https://hoffman-andrews.com/rust/fix-toggle-settings/std/io/trait.Read.html#implementors
and https://hoffman-andrews.com/rust/fix-toggle-settings/std/string/struct.String.html#trait-implementations

Fixes rust-lang#85411

r? `@GuillaumeGomez`
@rustbot rustbot added the rollup A PR which is a rollup label May 23, 2021
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented May 23, 2021

📌 Commit 85b45b5 has been approved by Dylan-DPC

@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 May 23, 2021
@bors
Copy link
Contributor

bors commented May 23, 2021

⌛ Testing commit 85b45b5 with merge 92418ce...

@bors
Copy link
Contributor

bors commented May 23, 2021

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing 92418ce to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 23, 2021
@bors bors merged commit 92418ce into rust-lang:master May 23, 2021
@rustbot rustbot added this to the 1.54.0 milestone May 23, 2021
@Dylan-DPC-zz Dylan-DPC-zz deleted the rollup-40sgqgg branch May 23, 2021 14:53
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 S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants