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 12 pull requests #85711

Merged
merged 31 commits into from
May 26, 2021
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c150772
rustdoc: avoid legacy Korean fonts in Windows
May 15, 2021
7e2e331
rustdoc: add the license of Noto Sans KR
May 15, 2021
b5e09dc
rustdoc: update static files
May 15, 2021
fe44fde
chore: format code
May 15, 2021
6b601d4
chore: update comment in rustdoc.css
May 15, 2021
8412d30
test: update unversioned-files.txt
May 18, 2021
8a2d663
test: fix the order in unversioned-files.txt
May 19, 2021
e587366
doc: clarify Mutex::try_lock, etc. errors
tlyu May 20, 2021
903e369
Fix boostrap using host exe suffix for cargo
jam1garner May 22, 2021
d7341f3
Don't reborrow self when computing the dest pointer in <[T]>::copy_wi…
SkiFire13 May 23, 2021
db8c6e0
Remove stray .stderr files
LeSeulArtichaut May 24, 2021
0e4f8cb
minor rewording after review
tlyu May 24, 2021
b63f7f9
Demote ControlFlow::{from|into}_try to pub(crate)
scottmcm May 24, 2021
ad30826
Revert "Move llvm submodule updates to rustbuild"
Mark-Simulacrum May 24, 2021
37588e9
Document shared_from_cow functions
fee1-dead May 25, 2021
79a5b12
Fix tasklist example in rustdoc book.
ehuss May 25, 2021
87cf2d4
Move stability attribute for methods under the `ip` feature from the …
CDirkx May 25, 2021
072b85c
Update books
ehuss May 25, 2021
8a7dc0d
Update cargo
ehuss May 25, 2021
0264f4f
Rollup merge of #84048 - konan8205:master, r=jsha
JohnTitor May 26, 2021
ae6a1a7
Rollup merge of #85529 - tlyu:trylock-errors, r=JohnTitor
JohnTitor May 26, 2021
d75521a
Rollup merge of #85590 - jam1garner:tool-bootstrap-su-fix, r=Mark-Sim…
JohnTitor May 26, 2021
b7b9ce3
Rollup merge of #85610 - SkiFire13:fix-copy-within-provenance, r=oli-obk
JohnTitor May 26, 2021
0bc3066
Rollup merge of #85623 - LeSeulArtichaut:stray-stderr, r=Mark-Simulacrum
JohnTitor May 26, 2021
587de8e
Rollup merge of #85645 - scottmcm:demote-from-into-try, r=yaahc
JohnTitor May 26, 2021
7508203
Rollup merge of #85647 - rust-lang:revert-81601-llvm-on-demand, r=jyn514
JohnTitor May 26, 2021
e87bc66
Rollup merge of #85666 - fee1-dead:document-shared-from-cow, r=dtolnay
JohnTitor May 26, 2021
1e51afa
Rollup merge of #85668 - ehuss:fix-rustdoc-tasklist, r=Mark-Simulacrum
JohnTitor May 26, 2021
7caf93f
Rollup merge of #85672 - CDirkx:ip, r=Mark-Simulacrum
JohnTitor May 26, 2021
bce257c
Rollup merge of #85699 - ehuss:update-books, r=ehuss
JohnTitor May 26, 2021
7c0677a
Rollup merge of #85701 - ehuss:update-cargo, r=ehuss
JohnTitor May 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Demote ControlFlow::{from|into}_try to pub(crate)
  • Loading branch information
scottmcm committed May 24, 2021
commit b63f7f9965c88314e3a83a2fcd57685c48fbade4
15 changes: 7 additions & 8 deletions library/core/src/ops/control_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,42 +186,41 @@ impl<B, C> ControlFlow<B, C> {
#[cfg(bootstrap)]
impl<R: ops::TryV1> ControlFlow<R, R::Output> {
/// Create a `ControlFlow` from any type implementing `Try`.
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
#[inline]
pub fn from_try(r: R) -> Self {
pub(crate) fn from_try(r: R) -> Self {
match R::into_result(r) {
Ok(v) => ControlFlow::Continue(v),
Err(v) => ControlFlow::Break(R::from_error(v)),
}
}

/// Convert a `ControlFlow` into any type implementing `Try`;
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
#[inline]
pub fn into_try(self) -> R {
pub(crate) fn into_try(self) -> R {
match self {
ControlFlow::Continue(v) => R::from_ok(v),
ControlFlow::Break(v) => v,
}
}
}

/// These are used only as part of implementing the iterator adapters.
/// They have mediocre names and non-obvious semantics, so aren't
/// currently on a path to potential stabilization.
#[cfg(not(bootstrap))]
impl<R: ops::TryV2> ControlFlow<R, R::Output> {
/// Create a `ControlFlow` from any type implementing `Try`.
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
#[inline]
pub fn from_try(r: R) -> Self {
pub(crate) fn from_try(r: R) -> Self {
match R::branch(r) {
ControlFlow::Continue(v) => ControlFlow::Continue(v),
ControlFlow::Break(v) => ControlFlow::Break(R::from_residual(v)),
}
}

/// Convert a `ControlFlow` into any type implementing `Try`;
#[unstable(feature = "control_flow_enum", reason = "new API", issue = "75744")]
#[inline]
pub fn into_try(self) -> R {
pub(crate) fn into_try(self) -> R {
match self {
ControlFlow::Continue(v) => R::from_output(v),
ControlFlow::Break(v) => v,
Expand Down