8000 Rollup of 12 pull requests by jonas-schievink · Pull Request #78294 · rust-lang/rust · GitHub
[go: up one dir, main page]

Skip to content

Rollup of 12 pull requests #78294

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

Closed
wants to merge 47 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
a838a70
Add a spin loop hint for Arc::downgrade
nicbn Sep 12, 2020
f3db477
Merge branch 'master' of https://github.com/rust-lang/rust into arc-s…
nicbn Sep 12, 2020
b58db1b
Formatting
nicbn Sep 12, 2020
16e10bf
Revert "Allow dynamic linking for iOS/tvOS targets."
francesca64 Oct 7, 2020
16d65d0
revise Hermit's mutex interface to support the behaviour of StaticMutex
stlankes Oct 6, 2020
98fcc3f
using the latest version of libhermit-rs
stlankes Oct 6, 2020
d560b50
revise code to pass the format check
stlankes Oct 6, 2020
986c1fc
revise comments and descriptions of the helper functions
stlankes Oct 7, 2020
d6e955f
fix typos in new method
stlankes Oct 9, 2020
530f575
revise code to pass the format check
stlankes Oct 9, 2020
8d8a290
add hermit to the list of omit OS
stlankes Oct 9, 2020
33fd08b
remove obsolete function diverge
stlankes Oct 12, 2020
30c3dad
reuse implementation of the system provider "unsupported"
stlankes Oct 12, 2020
1741e5b
define required type 'MovableMutex'
stlankes Oct 12, 2020
bc6b2ac
move __rg_oom to the libos to avoid duplicated symbols
stlankes Oct 13, 2020
77d9831
minor changes to pass the format check
stlankes Oct 13, 2020
bf268fe
box mutex to get a movable mutex
stlankes Oct 13, 2020
b62b352
Check for exhaustion in RangeInclusive::contains
cuviper Oct 19, 2020
9fd79a3
make exhausted RangeInclusive::end_bound return Excluded(end)
cuviper Oct 19, 2020
a9470d0
Simplify assert terminator only if condition evaluates to expected value
tmiasko Oct 21, 2020
9202fbd
Check for exhaustion in SliceIndex for RangeInclusive
cuviper Oct 21, 2020
40ab18d
improve const infer error
lcnr Oct 22, 2020
9775ac6
Document inline-const in the Unstable Book
camelid Oct 22, 2020
09135e4
Add regression test for issue-77475
JohnTitor Oct 23, 2020
e1c524c
review
lcnr Oct 23, 2020
9b90e17
add `insert` and `insert_with` to `Option`
Canop Oct 1, 2020
e8df2a4
remove `option.insert_with`
Canop Oct 1, 2020
60a96ca
more tests in option.insert, code cleaning in option
Canop Oct 1, 2020
cc8b77a
fix naming unconsistency between function doc and prototype
Canop Oct 3, 2020
3955779
Update library/core/src/option.rs
Canop Oct 23, 2020
415a8e5
Update library/core/src/option.rs
Canop Oct 23, 2020
216d0fe
add tracking issue number to option_insert feature gate
Canop Oct 23, 2020
efedcb2
Update description of Empty Enum for accuracy
Enet4 Oct 23, 2020
972d9e8
move `visit_predicate` into `TypeVisitor`
lcnr Oct 23, 2020
a0ce1e0
Always store Rustdoc theme when it's changed
nasso Oct 23, 2020
3bdf2cf
Rollup merge of #76649 - nicbn:arc-spin-loop-hint, r=m-ou-se
jonas-schievink Oct 23, 2020
f4649b9
Rollup merge of #77392 - Canop:option_insert, r=m-ou-se
jonas-schievink Oct 23, 2020
bd62943
Rollup merge of #77610 - hermitcore:dtors, r=m-ou-se
jonas-schievink Oct 23, 2020
dc0a584
Rollup merge of #77716 - francesca64:revert-ios-dynamic-linking, r=jo…
jonas-schievink Oct 23, 2020
0f281de
Rollup merge of #78109 - cuviper:exhausted-rangeinc, r=dtolnay
jonas-schievink Oct 23, 2020
40afcda
Rollup merge of #78198 - tmiasko:assert, r=davidtwco
jonas-schievink Oct 23, 2020
09008bf
Rollup merge of #78249 - lcnr:ct-infer-origin, r=varkor
jonas-schievink Oct 23, 2020
7afe1e0
Rollup merge of #78250 - camelid:document-inline-const, r=spastorino
jonas-schievink Oct 23, 2020
1c5289c
Rollup merge of #78264 - JohnTitor:macro-test, r=petrochenkov
jonas-schievink Oct 23, 2020
6cdad4b
Rollup merge of #78274 - Enet4:patch-1, r=jonas-schievink
jonas-schievink Oct 23, 2020
e59100d
Rollup merge of #78278 - lcnr:predicate-visit, r=matthewjasper
jonas-schievink Oct 23, 2020
65ac669
Rollup merge of #78293 - nasso:master, r=GuillaumeGomez
jonas-schievink Oct 23, 2020
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
45 changes: 45 additions & 0 deletions src/doc/unstable-book/src/language-features/inline-const.md
8B21
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# `inline_const`

The tracking issue for this feature is: [#76001]

------

This feature allows you to use inline constant expressions. For example, you can
turn this code:

```rust
# fn add_one(x: i32) -> i32 { x + 1 }
const MY_COMPUTATION: i32 = 1 + 2 * 3 / 4;

fn main() {
let x = add_one(MY_COMPUTATION);
}
```

into this code:

```rust
#![feature(inline_const)]

# fn add_one(x: i32) -> i32 { x + 1 }
fn main() {
let x = add_one(const { 1 + 2 * 3 / 4 });
}
```

You can also use inline constant expressions in patterns:

```rust
#![feature(inline_const)]

const fn one() -> i32 { 1 }

let some_int = 3;
match some_int {
const { 1 + 2 } => println!("Matched 1 + 2"),
const { one() } => println!("Matched const fn returning 1"),
_ => println!("Didn't match anything :("),
}
```

[#76001]: https://github.com/rust-lang/rust/issues/76001
0