Skip to content

Rollup of 9 pull requests - #80867

Merged
bors merged 23 commits into
rust-lang:masterfrom
JohnTitor:rollup-tvqw555
Jan 10, 2021
Merged

Rollup of 9 pull requests#80867
bors merged 23 commits into
rust-lang:masterfrom
JohnTitor:rollup-tvqw555

Conversation

@JohnTitor

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Julian Wollersbergerand others added 23 commits November 28, 2020 13:35
The size assertion in the comment was inverted compared to the code. After fixing that the implication that `(new_size >= old_size) => new_size != 0` still doesn't hold so explain why `old_size != 0` at this point.
On structured suggestion for `let` -> `const` and `const` -> `let`, use
a proper `Span` and update tests to check the correct application.
Follow up to rust-lang#80012.
It was only used once, in a function that was otherwise trivial.
In particular, the CI built `libLLVM-*.so` needs to have `libz.so`
RPATHed so that binaries like `llvm-config` work at all.
This makes it possible to have both std::panic and core::panic as a
builtin macro, by using different builtin macro names for each.
Also removes SyntaxExtension::is_derive_copy, as the macro name (e.g.
sym::Copy) is now tracked and provides that information directly.
This used to be necessary for `is_builtin` in the past, but is no longer required.
Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com>
Hopefully this will prevent people from continuing to ask about this
over and over again :)
See [this Zulip discussion][1] for more.
[1]: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Vec.3A.3Atruncate.20implementation
…u64, r=withoutboats
Implement From<char> for u64 and u128.
With this PR you can write
```
let u = u64::from('👤');
let u = u128::from('👤');
```
Previously, you could already write `as` conversions ([Playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=cee18febe28e69024357d099f07ca081)):
```
// Lossless conversions
dbg!('👤' as u32); // Prints 128100
dbg!('👤' as u64); // Prints 128100
dbg!('👤' as u128); // Prints 128100
// truncates, thus no `From` impls.
dbg!('👤' as u8); // Prints 100
dbg!('👤' as u16); // Prints 62564
// These `From` impls already exist.
dbg!(u32::from('👤')); // Prints 128100
dbg!(u64::from(u32::from('👤'))); // Prints 128100
```
The idea is from ``@gendx`` who opened [this Internals thread](https://internals.rust-lang.org/t/implement-from-char-for-u64/13454), and ``@withoutboats`` responded that someone should open a PR for it.
Some people mentioned `From<char>` impls for `f32` and `f64`, but that doesn't seem correct to me, so I didn't include them here.
I don't know what the feature should be named. Must it be registered somewhere, like unstable features?
r? ``@withoutboats``
…r=matthewjasper
Improve core::ptr::drop_in_place debuginfo
* Use span of the dropped type as function span when possible.
* Rename symbol from `core::ptr::drop_in_place::$hash` to `{{drop}}::<$TYPE>::$hash`.
Fixesrust-lang#77465
(I haven't yet updated the tests)
Fix safety comment
The size assertion in the comment was inverted compared to the code. After fixing that the implication that `(new_size >= old_size) => new_size != 0` still doesn't hold so explain why `old_size != 0` at this point.
… r=petrochenkov
Use correct span for structured suggestion
On structured suggestion for `let` -> `const` and `const` -> `let`, use
a proper `Span` and update tests to check the correct application.
Follow up to rust-lang#80012.
…Gomez
Remove useless `fill_in` function
It was only used once, in a function that was otherwise trivial.
…ulacrum
Support `download-ci-llvm` on NixOS
In particular, the CI built `libLLVM-*.so` needs to have `libz.so`
RPATHed so that binaries like `llvm-config` work at all.
…repetita, r=jyn514
Remove under-used ImplPolarity enum
It doesn't make much sense to have an enum with only two possible values and to store it inside an `Option` in my opinion when you can do all the same with a simple boolean. I don't expect any chances, performance or RSS usage wise.
r? ``@jyn514``
…=petrochenkov
Allow #[rustc_builtin_macro = "name"]
This adds the option of specifying the name of a builtin macro in the `#[rustc_builtin_macro]` attribute: `#[rustc_builtin_macro = "name"]`.
This makes it possible to have both `std::panic!` and `core::panic!` as a builtin macro, by using different builtin macro names for each. This is needed to implement the edition-specific behaviour of the panic macros of RFC 3007.
Also removes `SyntaxExtension::is_derive_copy`, as the macro name (e.g. `sym::Copy`) is now tracked and provides that information directly.
r? ``@petrochenkov``
…ttmcm
Add comment to `Vec::truncate` explaining `>` vs `>=`
Hopefully this will prevent people from continuing to ask about this
over and over again :)
See [this Zulip discussion][1] for more.
[1]: https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Vec.3A.3Atruncate.20implementation
r? ``@scottmcm``
@rustbotrustbot added the rollup A PR which is a rollup label Jan 10, 2021
@JohnTitor

Copy link
Copy Markdown
MemberAuthor

@bors r+ p=9 rollup=never

@bors

bors commented Jan 10, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 19b8c65 has been approved by JohnTitor

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 10, 2021
@bors

bors commented Jan 10, 2021

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 19b8c65 with merge 34628e5...

@bors

bors commented Jan 10, 2021

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: JohnTitor
Pushing 34628e5 to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Jan 10, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.rollupA PR which is a rollupS-waiting-on-borsStatus: 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.

11 participants

@JohnTitor@bors@rustbot@bjorn3@LingMan@estebank@jyn514@GuillaumeGomez@nagisa@m-ou-se@camelid