Skip to content

Rollup of 17 pull requests - #57733

Closed
GuillaumeGomez wants to merge 45 commits into
rust-lang:masterfrom
GuillaumeGomez:rollup
Closed

Rollup of 17 pull requests#57733
GuillaumeGomez wants to merge 45 commits into
rust-lang:masterfrom
GuillaumeGomez:rollup

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost

sdroegeand others added 30 commits December 13, 2018 11:07
Using `!` for `c_void` would have the problem that pointers and
potentially references to an uninhabited type would be created, and at
least for references this is UB.
Also document in addition that newtype wrappers around `c_void` are not
recommended for representing opaque types (as a workaround for `extern
type` not being stable) but instead refer to the Nomicon.
…rent implementation
We need at least two variants of the enum as otherwise the compiler
complains about the #[repr(u8)] attribute and we also need at least one
variant as otherwise the enum would be uninhabitated and dereferencing
pointers to it would be UB.
As such, mark the variants not unstable because they should not actually
exist but because they are temporary implementation details until
`extern type` is stable and can be used instead.
- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
- Fixesrust-lang#53844.
- Removes the last example since it appears to be redundant with the
previous two examples.
This may be needed with some host compilers.
A few items were referenced, but did not have links.
It's simpler and makes some benchmark run up to 1% faster. It also makes
`hir::ExprKind` more like `ast::ExprKind` (which underwent the
equivalent change in rust-lang#55777).
It's identical to `ast::Label`.
When given multiple lifetimes prior to type parameters in generic
parameters, do not ICE and print the correct suggestion.
Remove confusing comment about ideally using `!` for `c_void`
Using `!` for `c_void` would have the problem that pointers and
potentially references to an uninhabited type would be created, and at
least for references this is UB.
In addition document that newtype wrappers around `c_void` can be used
safely in place of `extern type` until the latter is stabilized.
----
I'm not 100% sure about the usage for opaque types as the [nomicon](https://doc.rust-lang.org/nomicon/ffi.html#representing-opaque-structs) still recommends using `#[repr(C)] pub struct Foo { _private: [u8; 0] }` but it seems like these two should be equivalent in the end? Also the `#[repr(C)]` (in both cases) should be unneeded because such types never being passed by value, never being dereferenced but only passed around as pointer or reference, so the representation of (*values* of) the type itself should not matter at all?
Also in context of `c_void` and `!` the second unresolved question in the [`extern type`](rust-lang#43467) stabilization ticket seems relevant
> In [std's](https://github.com/rust-lang/rust/blob/164619a8cfe6d376d25bd3a6a9a5f2856c8de64d/src/libstd/os/raw.rs#L59-L64) source, it is mentioned that LLVM expects i8* for C's void*.
> We'd need to continue to hack this for the two c_voids in std and libc.
> But perhaps this should be done across-the-board for all extern types?
> Somebody should check what Clang does.
Please correct me if my understanding is wrong and everything's actually fine as is.
…tsakis
Add a regression test for mutating a non-mut #[thread_local]
This should closerust-lang#54901 since the regression has since been fixed.
…etMisdreavus
Cleanup PartialEq docs.
- Cleanup the `impl PartialEq<BookFormat> for Book` implementation
- Implement `impl PartialEq<Book> for BookFormat` so it’s symmetric
- Fixesrust-lang#53844.
- Removes the last example since it appears to be redundant with the
previous two examples.
Support passing cflags/cxxflags/ldflags to LLVM build
This may be needed with some host compilers.
resolve: Add a test for issue rust-lang#57539
Add a test for the bugfix regression reported in rust-lang#57539Closesrust-lang#57539
…erister
use structured macro and path resolve suggestions
… r=QuietMisdreavus
Fix sources sidebar not showing up
Fixesrust-lang#57601.
The order of imports made it so that the sidebar creation was called before the sidebar sources were created. Like this, when the sources are loaded, they create the sidebar as expected.
r? @QuietMisdreavus
…reavus
Fixes text becoming invisible when element targetted
Fixesrust-lang#57628.
r? @QuietMisdreavus
librustc_metadata: Pass a default value when unwrapping a span
Fixesrust-lang#57323.
When compiling with `static-nobundle` a-la
`rustc -l static-nobundle=nonexistent main.rs`
we now get a neat output in the form of:
```
error[E0658]: kind="static-nobundle" is feature gated (see issue rust-lang#37403)
|
= help: add #![feature(static_nobundle)] to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.
```
The build and tests completed successfully on my machine. Should I be adding a new test?
Add some links in std::fs.
A few items were referenced, but did not have links.
…woerister
Two HIR tweaks
Two HIR tweaks that make things slightly simpler and faster.
Document Unpin in std::prelude documentation
…-applicability, r=withoutboats
Enhance `Pin` impl applicability for `PartialEq` and `PartialOrd`.
This allows for comparing for equality or ordering a `Pin<P>` and a `Pin<Q>` as long as `P` and `Q` are correspondingly comparable themselves *even when `P` and `Q` are different types*.
An example might be comparing a `Pin<&mut OsString>` to a `Pin<&mut PathBuf>`, which might arise from pin projections from a pair of larger contexts that aren't `Unpin`.
…etMisdreavus
Fix non-clickable urls
Fixesrust-lang#57695
I didn't find anywhere where this rule was useful. Why did you add it @JohnHeitmann?
r? @QuietMisdreavus
Fix suggestions given mulitple bad lifetimes
When given multiple lifetimes prior to type parameters in generic
parameters, do not ICE and print the correct suggestion.
r? @estebank
CC @pnkfelixFixes: rust-lang#57521
Use structured suggestion to surround struct literal with parenthesis
@rust-highfive

Copy link
Copy Markdown
Contributor

Your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@CentrilCentril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollupA PR which is a rollup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

16 participants

@GuillaumeGomez@rust-highfive@Centril@sdroege@frewsxcv@eqrion@petrochenkov@petrhosek@mjbshaw@euclio@ehuss@nnethercote@sugar700@pthariensflame@dlrobertson@estebank