diff options
| author | bors <bors@rust-lang.org> | 2020-10-17 14:44:51 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-10-17 14:44:51 +0000 |
| commit | 6af9846fcc8797bf97e9fb387385208c2219f3d0 (patch) | |
| tree | 527522b82ce55cd2bcc37b14096e6c1de63660bc /src/test/ui/inline-const/const-expr-basic.rs | |
| parent | dda2b5e3e260c14b868c494008af1c8981eaa5a8 (diff) | |
| parent | 03321b8cca91cd5d1f9c82a447add69329e52cea (diff) | |
| download | rust-6af9846fcc8797bf97e9fb387385208c2219f3d0.tar.gz rust-6af9846fcc8797bf97e9fb387385208c2219f3d0.zip | |
Auto merge of #77124 - spastorino:const-exprs-rfc-2920, r=oli-obk
Implement const expressions and patterns (RFC 2920) cc `@ecstatic-morse` `@lcnr` `@oli-obk` `@petrochenkov`
Diffstat (limited to 'src/test/ui/inline-const/const-expr-basic.rs')
| -rw-r--r-- | src/test/ui/inline-const/const-expr-basic.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/inline-const/const-expr-basic.rs b/src/test/ui/inline-const/const-expr-basic.rs new file mode 100644 index 00000000000..9254c96a1e7 --- /dev/null +++ b/src/test/ui/inline-const/const-expr-basic.rs @@ -0,0 +1,14 @@ +// run-pass + +#![allow(incomplete_features)] +#![feature(inline_const)] +fn foo() -> i32 { + const { + let x = 5 + 10; + x / 3 + } +} + +fn main() { + assert_eq!(5, foo()); +} |
