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 11 pull requests #61305

Merged
merged 38 commits into from May 29, 2019

Conversation

Projects
None yet
@Centril
Copy link
Member

commented May 29, 2019

Successful merges:

  • #58975 (Implement iter::Sum and iter::Product for Option)
  • #60542 (Add Step::sub_usize)
  • #60555 (Implement nth_back for RChunks(Exact)(Mut))
  • #60766 (Weak::into_raw)
  • #61048 (Feature/nth back chunks)
  • #61191 (librustc_errors: Move annotation collection to own impl)
  • #61235 (Stabilize bufreader_buffer feature)
  • #61249 (Rename Place::local to Place::local_or_deref_local)
  • #61291 (Avoid unneeded bug!() call)
  • #61294 (Rename TraitOrImpl to Assoc and trait_or_impl to assoc.)
  • #61297 (Remove LLVM instruction stats and other (obsolete) codegen stats.)

Failed merges:

r? @ghost

jtdowney and others added some commits Mar 6, 2019

Implement `iter::Sum` and `iter::Product` for `Option`
This is similar to the existing implementation for `Result`. It will
take each item into the accumulator unless a `None` is returned.
Update stable attribute to be since 1.35.0
Co-Authored-By: jtdowney <jdowney@gmail.com>
wip nth_back on chunks
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
hopefully working nth_back on chunks
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
wip nth_back on chunks
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
hopefully working nth_back on chunks
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
wip nth_back on chunks
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
hopefully working nth_back on chunks
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
wip nth_back on chunks
Signed-off-by: wizAmit <amitforfriends_dns@yahoo.com>
sync::Weak::{as,from,into}_raw
Methods on the Weak to access it as raw pointer to the data.
rc::Weak::{as,from,into}_raw
Methods on the Weak to access it as a raw pointer to the data.
librustc_errors: Move annotation collection to own impl
Extracted from work on #59346. This moves the annotation collection to
the `FileWithAnnotatedLines` impl to allow re-use in a separate
EmitterWriter.
Rollup merge of #58975 - jtdowney:iter_arith_traits_option, r=dtolnay
Implement `iter::Sum` and `iter::Product` for `Option`

This is similar to the existing implementation for `Result`. It will take each item into the accumulator unless a `None` is returned.

I based a lot of this on #38580. From that discussion it didn't seem like this addition would be too controversial or difficult. One thing I still don't understand is picking the values for the `stable` attribute. This is my first non-documentation PR for rust so I am open to any feedback on improvements.
Rollup merge of #60542 - timvermeulen:step_sub_usize, r=scottmcm
Add Step::sub_usize

Required for #54054.

I'm aware that the `Step` trait needs a rework, but this still seems like a reasonable addition?

This currently doesn't compile because Chalk contains a type that implement this trait, and this is a breaking change. How can that be fixed?
Rollup merge of #60555 - timvermeulen:rchunks_nth_back, r=scottmcm
Implement nth_back for RChunks(Exact)(Mut)

Part of #54054.

These implementations may not be optimal because of the use of `self.len()`, but it's quite cheap and simplifies the code a lot.

There's quite some duplication going on here, I wouldn't mind cleaning this up later. A good next step would probably be to add private `split_off_up_to`/`split_off_from` helper methods for slices since their behavior is commonly useful throughout the `Chunks` types.

r? @scottmcm

Centril added some commits May 29, 2019

Rollup merge of #60766 - vorner:weak-into-raw, r=sfackler
Weak::into_raw

Hello

This is my first shot at #60728. I'd like to consult it a bit before moving further.

The biggest question I have is if this API makes sense. My motivation for it is to be able to store the `Weak` in `AtomicPtr`. For that I don't actually need for the pointer to point to the `T`, any pointer (maybe casted to `usize`) would be good enough, but this mirrors what `Arc` does and could be useful for other things too (like comparing if Arc and Weak point to the same thing without playing with the counts), while some opaque pointer wouldn't.

Some secondary questions, if this is deemed desirable are:
* The weak pointer may be dangling if it is created by `Weak::new()`. It would make sense to treat this as NULL, but that is incompatible with `T: ?Sized` ‒ both `new()` and `ptr::null()` are available only for sized types. The current implementation is therefore also available only for sized `T`s. It would be possible to allow `?Sized` if the API would be `fn into_raw(self) -> Option<NonNull<T>>` and `fn from_raw(NonNull<T>)`, but that's different API than `Arc` has. What would be preferred?
* There's a FIXME in my code about what I suspect could be UB. Is it really UB & how to get the pointer correctly? Is manual offsetting of the pointer the only way?
* Am I missing some other necessary thing around the feature gates and such?
* Is the documentation understandable? I know writing docs is not my strongest skill :-|.

Thinks I'd like to do as part of the PR, but are not yet done:
* Turn the referenced issue into tracking issue for the feature flag.
* Once the `sync::Weak` is considered reasonable, I'd do the equivalent for `rc::Weak`.
* This might call for few more tests than what is currently part of the documentation.
Rollup merge of #61048 - wizAmit:feature/nth_back_chunks, r=scottmcm
Feature/nth back chunks

A succinct implementation for nth_back on chunks. Thank you @timvermeulen for the guidance.

r? @timvermeulen
Rollup merge of #61191 - phansch:annotate_snippet_refactorings1, r=es…
…tebank

librustc_errors: Move annotation collection to own impl

Extracted from work on #59346. This moves the annotation collection to
the `FileWithAnnotatedLines` impl to allow easier re-use in a separate
EmitterWriter. Even without that new EmitterWriter present, I think it makes
sense to have this as an associated function.
Rollup merge of #61235 - lzutao:stabilize-bufreader_buffer, r=Centril
Stabilize bufreader_buffer feature

FCP done in #45323 (comment)

Closes #45323

r? @SimonSapin
Rollup merge of #61249 - spastorino:local-or-deref-local, r=oli-obk,C…
…entril

Rename Place::local to Place::local_or_deref_local

r? @oli-obk
Rollup merge of #61294 - eddyb:no-trait-nor-impl, r=varkor
Rename `TraitOrImpl` to `Assoc` and `trait_or_impl` to `assoc`.
Rollup merge of #61297 - eddyb:forsaken-stats, r=nagisa
Remove LLVM instruction stats and other (obsolete) codegen stats.

Both `-Z count_llvm_insns` and `-Z codegen-stats` are removed, as (AFAIK) they have been of little use in the last few years, especially after the transition to MIR->LLVM codegen.

Other than for the LLVM instruction counts, `-Z codegen-stats` has long been obsoleted anyway.

r? @nagisa cc @rust-lang/compiler
@Centril

This comment has been minimized.

Copy link
Member Author

commented May 29, 2019

@bors r+ rollup=never p=11

@bors

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

📌 Commit 907f4fd has been approved by Centril

@bors

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

⌛️ Testing commit 907f4fd with merge 8197085...

bors added a commit that referenced this pull request May 29, 2019

Auto merge of #61305 - Centril:rollup-t39m00m, r=Centril
Rollup of 11 pull requests

Successful merges:

 - #58975 (Implement `iter::Sum` and `iter::Product` for `Option`)
 - #60542 (Add Step::sub_usize)
 - #60555 (Implement nth_back for RChunks(Exact)(Mut))
 - #60766 (Weak::into_raw)
 - #61048 (Feature/nth back chunks)
 - #61191 (librustc_errors: Move annotation collection to own impl)
 - #61235 (Stabilize bufreader_buffer feature)
 - #61249 (Rename Place::local to Place::local_or_deref_local)
 - #61291 (Avoid unneeded bug!() call)
 - #61294 (Rename `TraitOrImpl` to `Assoc` and `trait_or_impl` to `assoc`.)
 - #61297 (Remove LLVM instruction stats and other (obsolete) codegen stats.)

Failed merges:

r? @ghost
@bors

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: Centril
Pushing 8197085 to master...

@bors bors added the merged-by-bors label May 29, 2019

@bors bors merged commit 907f4fd into rust-lang:master May 29, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details

@Centril Centril deleted the Centril:rollup-t39m00m branch May 29, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.