Skip to content

Varargs1 #9

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

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open

Varargs1 #9

wants to merge 47 commits into from

Conversation

parched
Copy link
Owner

@parched parched commented Jan 20, 2019

No description provided.

@dlrobertson dlrobertson force-pushed the varargs1 branch 3 times, most recently from 9dca909 to 0322ede Compare January 21, 2019 14:51
@dlrobertson dlrobertson force-pushed the varargs1 branch 9 times, most recently from 071f362 to 5645330 Compare February 6, 2019 13:40
@dlrobertson dlrobertson force-pushed the varargs1 branch 10 times, most recently from 4eec6aa to 05a78a3 Compare February 13, 2019 16:43
SimonSapin and others added 8 commits February 13, 2019 18:00
The reverse conversion unfortunately causes unexpected errors like:

```
error[E0277]: the trait bound `!: std::convert::From<()>` is not satisfied
   --> src/librustc_metadata/encoder.rs:105:9
    |
105 |         self.emit_usize(seq.len)?;
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::convert::From<()>` is not implemented for `!`
    |
    = help: the following implementations were found:
              <! as std::convert::From<std::convert::Infallible>>
    = note: the trait is implemented for `()`. Possibly this error has been caused by changes to Rust's type-inference algorithm (see: rust-lang#48950 for more info). Consider whether you meant to use the type `()` here instead.
    = note: required by `std::convert::From::from`
```

I don’t understand why this error happens.
If I’m reading the code correctly the return types of `emit_usize`
and of the method that contains line 105 are both `Result<(), !>`,
so the expansion of the `?` operator should involve `!: From<!>`,
not `From<()>`.

Is this a type inference bug?
This functionality has lived for a while in the tokio ecosystem, where
it can improve performance by minimizing copies.
Returning &'a mut [u8] was unsound, and we may as well just have them
directly deref to their slices to make it easier to work with them.
@dlrobertson dlrobertson force-pushed the varargs1 branch 2 times, most recently from 7b549b3 to 5ca1743 Compare February 25, 2019 16:59
petrochenkov and others added 8 commits February 25, 2019 22:40
Stabilize TryFrom and TryInto with a convert::Infallible empty enum

This is the plan proposed in rust-lang#33417 (comment)
Stabilize `unrestricted_attribute_tokens`

In accordance with a plan described in https://internals.rust-lang.org/t/unrestricted-attribute-tokens-feature-status/8561/3.

Delimited non-macro non-builtin attributes now support the same syntax as macro attributes:
```
PATH
PATH `(` TOKEN_STREAM `)`
PATH `[` TOKEN_STREAM `]`
PATH `{` TOKEN_STREAM `}`
```
Such attributes mostly serve as inert proc macro helpers or tool attributes.
To some extent these attributes are de-facto stable due to a hole in feature gate checking (feature gating is done too late - after macro expansion.)
So if macro *removes* such helper attributes during expansion (and it must remove them, unless it's a derive macro), then the code will work on stable.

Key-value non-macro non-builtin attributes are now restricted to bare minimum required to support what we support on stable - unsuffixed literals (rust-lang#34981).
```
PATH `=` LITERAL
```
(Key-value macro attributes are not supported at all right now.)
Crater run in rust-lang#57321 found no regressions for this change.
There are multiple possible ways to extend key-value attributes (rust-lang#57321 (comment)), but I'd expect an RFC for that and it's not a pressing enough issue to block stabilization of delimited attributes.

Built-in attributes are still restricted to the "classic" meta-item syntax, nothing changes here.
rust-lang#57321 goes further and adds some additional restrictions (more consistent input checking) to built-in attributes.

Closes rust-lang#55208
Add vectored read and write support

This functionality has lived for a while in the tokio ecosystem, where
it can improve performance by minimizing copies.

r? @alexcrichton
Remove NodeId from some HIR nodes

The next iteration of rust-lang#57578.

Removes `NodeId` from:

- [x] `Lifetime`
- [x] `Ty`
- [x] `GenericParam`
- [x] `WhereClause`
- [x] `WhereEqPredicate`
- [x] `MacroDef`
- [x] `Block`
- [x] `Expr`

r? @Zoxc
Change-Id: I3fa00e999a2ee4eb72db1fdf53a8633b49176a18
bors and others added 11 commits February 26, 2019 18:26
Update stdsimd

This updates stdsimd to a Rust2015 / Rust2018 compatible version. Once this is merged it should be possible to migrate libcore and libstd to Rust2018. Once that happens, we can just require the 2018 edition in stdsimd.
[Step 1] Implement "small substs optimization" for substs of length 1

addresses part of rust-lang#58310
r?@arielb1
Update book submodule

Updates the book to the latest commit

This is to include [documentation SEO fix](rust-lang/book#1788) ASAP.
…r=alexreg

Allow lang and lib features to share names

Fixes rust-lang#58715.

I didn't add a test, because there's currently no standard lang test feature and I felt apprehensive about adding a permanently unstable feature. Instead, a shared lang/lib feature will be used in rust-lang#57760 and will essentially provide an immediately test.
Add support for defining C compatible variadic functions in unsafe rust
with extern "C".
 - Add the c_variadic language feature
 - Add the c_variadic library feature
 - Move closures defined in codegen_terminator into a separate helper
   structure and implementation.
 - Create helper functions for each of the complex match arms on the
   terminators kind in codegen_terminator.
Function signatures with the `variadic` member set are actually
C-variadic functions. Make this a little more explicit by renaming the
`variadic` boolean value, `c_variadic`.
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.