Skip to content

rustup and compile-fail -> ui test move #1520

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

Merged
merged 5 commits into from
Feb 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file.

## 0.0.114 — 2017-02-08
* Rustup to rustc 1.17.0-nightly (c49d10207 2017-02-07)
* Tests are now ui tests (testing the exact output of rustc)

## 0.0.113 — 2017-02-04
* Rustup to *rustc 1.16.0-nightly (eedaa94e3 2017-02-02)*
* New lint: [`large_enum_variant`]
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ contains some questionable code itself! Also before making a pull request, pleas
`util/update_lints.py`, which will update `lib.rs` and `README.md` with the lint declarations. Our
travis build actually checks for this.

Clippy uses UI tests. UI tests check that the output of the compiler is exactly as expected.
Of course there's little sense in writing the output yourself or copying it around.
Therefore you can simply run `tests/ui/update-all-references.sh` and check whether
the output looks as you expect with `git diff`. Commit all `*.stderr` files, too.

Also please document your lint with a doc comment akin to the following:
```rust
/// **What it does:** Checks for ... (describe what the lint matches).
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.0.113"
version = "0.0.114"
authors = [
"Manish Goregaokar <[email protected]>",
"Andre Bogus <[email protected]>",
Expand Down Expand Up @@ -30,7 +30,7 @@ test = false

[dependencies]
# begin automatic update
clippy_lints = { version = "0.0.113", path = "clippy_lints" }
clippy_lints = { version = "0.0.114", path = "clippy_lints" }
# end automatic update
cargo_metadata = "0.1.1"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ transparently:

## Lints

There are 185 lints included in this crate:
There are 186 lints included in this crate:

name | default | triggers on
-----------------------------------------------------------------------------------------------------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "clippy_lints"
# begin automatic update
version = "0.0.113"
version = "0.0.114"
# end automatic update
authors = [
"Manish Goregaokar <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fn check_copy_clone<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, item: &Item, trait_ref
TypeVariants::TyFnPtr(..) => {
return;
},
TypeVariants::TyTuple(tys) if tys.len() > 12 => {
TypeVariants::TyTuple(tys, _) if tys.len() > 12 => {
return;
},
_ => (),
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ fn check_let_unit(cx: &LateContext, decl: &Decl) {
if let DeclLocal(ref local) = decl.node {
let bindtype = &cx.tables.pat_ty(&local.pat).sty;
match *bindtype {
ty::TyTuple(slice) if slice.is_empty() => {
ty::TyTuple(slice, _) if slice.is_empty() => {
if in_external_macro(cx, decl.span) || in_macro(cx, local.pat.span) {
return;
}
Expand Down Expand Up @@ -268,7 +268,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnitCmp {
if op.is_comparison() {
let sty = &cx.tables.expr_ty(left).sty;
match *sty {
ty::TyTuple(slice) if slice.is_empty() => {
ty::TyTuple(slice, _) if slice.is_empty() => {
let result = match op {
BiEq | BiLe | BiGe => "true",
_ => "false",
Expand Down
93 changes: 0 additions & 93 deletions tests/compile-fail/absurd-extreme-comparisons.rs

This file was deleted.

57 changes: 0 additions & 57 deletions tests/compile-fail/approx_const.rs

This file was deleted.

30 changes: 0 additions & 30 deletions tests/compile-fail/arithmetic.rs

This file was deleted.

45 changes: 0 additions & 45 deletions tests/compile-fail/array_indexing.rs

This file was deleted.

85 changes: 0 additions & 85 deletions tests/compile-fail/assign_ops.rs

This file was deleted.

Loading