diff options
| author | bors <bors@rust-lang.org> | 2018-05-04 23:15:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-05-04 23:15:00 +0000 |
| commit | 1d168261a1bc0031ef27de735992a4842fd62553 (patch) | |
| tree | c53c956b4e906922c9de96ec644394b5c1114815 /src/test/rustfix/tuple-float-index.fixed | |
| parent | 91db9dcf3730207f63b3dfc33b2c438a769b7517 (diff) | |
| parent | 6f2d023028bbd666be2c211b923b32faf10a41da (diff) | |
Auto merge of #50084 - killercup:compiletest-rustfix, r=Manishearth
First step towards rustfix compiletest mode This is the first small step towards testing auto-fixable compiler suggestions using compiletest. Currently, it only checks if next to a UI test there also happens to a `*.rs.fixed` file, and then uses rustfix (added as external crate) on the original file, and asserts that it produces the fixed version. To show that this works, I've included one such test. I picked this test case at random (and because it was simple) -- It is not relevant to the 2018 edition. Indeed, in the near future, we want to be able to restrict rustfix to edition-lints, so this test cast might go away soon. In case you still think this is somewhat feature-complete, here's a quick list of things currently missing that I want to add before telling people they can use this: - [x] Make this an actual compiletest mode, with `test [fix] …` output and everything - [x] Assert that fixed files still compile - [x] Assert that fixed files produce no (or a known set of) diagnostics output - [x] Update `update-references.sh` to support rustfix - [x] Use a published version of rustfix (i.e.: publish a new version rustfix that exposes a useful API for this)
Diffstat (limited to 'src/test/rustfix/tuple-float-index.fixed')
| -rw-r--r-- | src/test/rustfix/tuple-float-index.fixed | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/rustfix/tuple-float-index.fixed b/src/test/rustfix/tuple-float-index.fixed new file mode 100644 index 00000000000..9cb7537b428 --- /dev/null +++ b/src/test/rustfix/tuple-float-index.fixed @@ -0,0 +1,15 @@ +// Copyright 2012 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// compile-flags: -Z parse-only + +fn main () { + ((1, (2, 3)).1).1; +} |
