diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 18:36:21 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-04-01 18:36:21 -0700 |
| commit | 9edbf42a342ced7357fe5ec225975f214d872fbc (patch) | |
| tree | 3ac2106c48eb2997f0795c8bcef20f921407636b /src/libsyntax/print | |
| parent | 2e3b0c051dca9880bf66b5366dccd2e0bb424b99 (diff) | |
| parent | f86318d63c86568b312f39da20bea67e328c1fc5 (diff) | |
| download | rust-9edbf42a342ced7357fe5ec225975f214d872fbc.tar.gz rust-9edbf42a342ced7357fe5ec225975f214d872fbc.zip | |
rollup merge of #23945: pnkfelix/gate-u-negate
Feature-gate unsigned unary negate. Discussed in weekly meeting here: https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2015-03-31.md#feature-gate--expr and also in the internals thread here: http://internals.rust-lang.org/t/forbid-unsigned-integer/752
Diffstat (limited to 'src/libsyntax/print')
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index c2f323f98af..3e0c938649d 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -3053,7 +3053,7 @@ mod test { #[test] fn test_signed_int_to_string() { let pos_int = ast::LitInt(42, ast::SignedIntLit(ast::TyI32, ast::Plus)); - let neg_int = ast::LitInt((-42) as u64, ast::SignedIntLit(ast::TyI32, ast::Minus)); + let neg_int = ast::LitInt((!42 + 1) as u64, ast::SignedIntLit(ast::TyI32, ast::Minus)); assert_eq!(format!("-{}", lit_to_string(&codemap::dummy_spanned(pos_int))), lit_to_string(&codemap::dummy_spanned(neg_int))); } |
