]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoMerge pull request #235 from birkenfeld/fix
Manish Goregaokar [Tue, 25 Aug 2015 13:37:56 +0000 (19:07 +0530)]
Merge pull request #235 from birkenfeld/fix

all: remove unneeded deref and/or ref operations

8 years agoall: remove unneeded deref and/or ref operations
Georg Brandl [Tue, 25 Aug 2015 12:41:35 +0000 (14:41 +0200)]
all: remove unneeded deref and/or ref operations

8 years agoMerge pull request #233 from birkenfeld/fix
llogiq [Tue, 25 Aug 2015 11:43:37 +0000 (13:43 +0200)]
Merge pull request #233 from birkenfeld/fix

collapsible_if: remove extraneous note output

8 years agocollapsible_if: remove extraneous note output
Georg Brandl [Tue, 25 Aug 2015 11:26:20 +0000 (13:26 +0200)]
collapsible_if: remove extraneous note output

This was probably a debug addition.

8 years agoMerge pull request #231 from birkenfeld/to_string_hint
llogiq [Tue, 25 Aug 2015 10:55:09 +0000 (12:55 +0200)]
Merge pull request #231 from birkenfeld/to_string_hint

methods: people might be using to_string() to make a copy; add a hint…

8 years agomethods: people might be using to_string() to make a copy; add a hint for that
Georg Brandl [Tue, 25 Aug 2015 10:45:52 +0000 (12:45 +0200)]
methods: people might be using to_string() to make a copy; add a hint for that

8 years agoMerge pull request #227 from Manishearth/readme
llogiq [Mon, 24 Aug 2015 14:54:45 +0000 (16:54 +0200)]
Merge pull request #227 from Manishearth/readme

improved README, added lint counter

8 years agoimproved README, added lint counter
llogiq [Mon, 24 Aug 2015 14:23:05 +0000 (16:23 +0200)]
improved README, added lint counter

8 years agoMerge pull request #226 from birkenfeld/fixes
llogiq [Mon, 24 Aug 2015 14:21:17 +0000 (16:21 +0200)]
Merge pull request #226 from birkenfeld/fixes

Two small fixes/refactorings

8 years agoMerge pull request #220 from Robzz/cast_iusize_improvements
llogiq [Mon, 24 Aug 2015 08:49:01 +0000 (10:49 +0200)]
Merge pull request #220 from Robzz/cast_iusize_improvements

Casts : architecture independent handling of *size types

8 years agoranges: remove unneeded as_str()
Georg Brandl [Sun, 23 Aug 2015 14:34:23 +0000 (16:34 +0200)]
ranges: remove unneeded as_str()

8 years agoutils: extract utility method for matching trait method calls from loops
Georg Brandl [Sun, 23 Aug 2015 14:32:50 +0000 (16:32 +0200)]
utils: extract utility method for matching trait method calls from loops

8 years agoRefactored CastPass.
R.Chavignat [Sat, 22 Aug 2015 23:06:31 +0000 (01:06 +0200)]
Refactored CastPass.

8 years agoMerge branch 'master' into cast_iusize_improvements
R.Chavignat [Sat, 22 Aug 2015 22:08:16 +0000 (00:08 +0200)]
Merge branch 'master' into cast_iusize_improvements

8 years agoCompleted the implementation of *size handling.
R.Chavignat [Sat, 22 Aug 2015 21:49:03 +0000 (23:49 +0200)]
Completed the implementation of *size handling.

Added some more cases to the test, and implemented a new lint,
cast_possible_wrap, triggered when casting from an unsigned type to a
signed type of the same size.

8 years agoUpdated test case for cast lints.
R.Chavignat [Sat, 22 Aug 2015 19:36:54 +0000 (21:36 +0200)]
Updated test case for cast lints.

Also improved readability and reworded the messages.

8 years agoMerge pull request #216 from birkenfeld/match_pass
llogiq [Sat, 22 Aug 2015 17:06:48 +0000 (19:06 +0200)]
Merge pull request #216 from birkenfeld/match_pass

new lint: using &Ref patterns instead of matching on *expr (fixes #187)

8 years agoMerge pull request #222 from birkenfeld/type_complexity
Manish Goregaokar [Sat, 22 Aug 2015 12:58:45 +0000 (18:28 +0530)]
Merge pull request #222 from birkenfeld/type_complexity

types: check for macros in type complexity check

8 years agomatches: special message for this case
Georg Brandl [Fri, 21 Aug 2015 18:49:59 +0000 (20:49 +0200)]
matches: special message for this case

match &e { &Pat1 => {}, &Pat2 => {}, ... }

(inspired by dogfood fixes)

8 years ago&-matches: dogfood fixes!
Georg Brandl [Fri, 21 Aug 2015 18:44:48 +0000 (20:44 +0200)]
&-matches: dogfood fixes!

8 years agonew lint: using &Ref patterns instead of matching on *expr (fixes #187)
Georg Brandl [Fri, 21 Aug 2015 17:49:00 +0000 (19:49 +0200)]
new lint: using &Ref patterns instead of matching on *expr (fixes #187)

8 years agomatches: new module, move single_match lint there
Georg Brandl [Fri, 21 Aug 2015 17:32:21 +0000 (19:32 +0200)]
matches: new module, move single_match lint there

8 years agotypes: check for macros in type complexity check
Georg Brandl [Sat, 22 Aug 2015 12:30:53 +0000 (14:30 +0200)]
types: check for macros in type complexity check

8 years agoMerge pull request #221 from Manishearth/fix_const
Manish Goregaokar [Sat, 22 Aug 2015 07:56:26 +0000 (13:26 +0530)]
Merge pull request #221 from Manishearth/fix_const

Fix doubleborrow of refcell in consts.rs

8 years agoFix doubleborrow of refcell in consts.rs
Manish Goregaokar [Sat, 22 Aug 2015 07:31:54 +0000 (13:01 +0530)]
Fix doubleborrow of refcell in consts.rs

8 years agoMerge pull request #219 from birkenfeld/type_complexity
Manish Goregaokar [Sat, 22 Aug 2015 07:02:58 +0000 (12:32 +0530)]
Merge pull request #219 from birkenfeld/type_complexity

[RFC] new lint: type complexity (fixes #93)

8 years agonew lint: type complexity (fixes #93)
Georg Brandl [Fri, 21 Aug 2015 20:53:47 +0000 (22:53 +0200)]
new lint: type complexity (fixes #93)

Still very naive, but it's a start.

8 years agoptr_arg: fix panic when pattern type is not in tcx
Georg Brandl [Sat, 22 Aug 2015 06:57:05 +0000 (08:57 +0200)]
ptr_arg: fix panic when pattern type is not in tcx

8 years agoMerge pull request #215 from birkenfeld/type_improvements
Manish Goregaokar [Sat, 22 Aug 2015 06:43:56 +0000 (12:13 +0530)]
Merge pull request #215 from birkenfeld/type_improvements

Type improvements

8 years agoCasts : work in progress handling *size separately
R.Chavignat [Sat, 22 Aug 2015 00:44:05 +0000 (02:44 +0200)]
Casts : work in progress handling *size separately

8 years agoutils: add match_type() helper function
Georg Brandl [Fri, 21 Aug 2015 17:00:33 +0000 (19:00 +0200)]
utils: add match_type() helper function

which saves one level of matching when checking for type paths

8 years agoall: put often used DefPaths into utils as consts
Georg Brandl [Fri, 21 Aug 2015 16:48:36 +0000 (18:48 +0200)]
all: put often used DefPaths into utils as consts

Also remove the "use xxx;" blocks to ensure import paths don't change.
They don't work anyway since stuff may still be re-exported at the old
location, while we need the "canonical" location for the type checks.

Plus, the test suite catches all these cases.

8 years agotypes: use middle::ty types instead of ast types
Georg Brandl [Fri, 21 Aug 2015 16:40:36 +0000 (18:40 +0200)]
types: use middle::ty types instead of ast types

This gets rid of the match_ty_unwrap function.

8 years agoptr_arg improvements (fixes #214)
Georg Brandl [Fri, 21 Aug 2015 16:28:17 +0000 (18:28 +0200)]
ptr_arg improvements (fixes #214)

* do not trigger on mutable references
* use "real" type from ty, not AST type

8 years agoMerge pull request #212 from Manishearth/eq_op_const
llogiq [Fri, 21 Aug 2015 10:30:53 +0000 (12:30 +0200)]
Merge pull request #212 from Manishearth/eq_op_const

Eq op const

8 years agoconst folding for eq_op
llogiq [Fri, 21 Aug 2015 10:26:03 +0000 (12:26 +0200)]
const folding for eq_op

8 years agoconst folding for eq_op
llogiq [Fri, 21 Aug 2015 10:19:07 +0000 (12:19 +0200)]
const folding for eq_op

8 years agoMerge pull request #208 from Robzz/iss114
llogiq [Fri, 21 Aug 2015 05:49:19 +0000 (07:49 +0200)]
Merge pull request #208 from Robzz/iss114

Implementation of lossy cast lints (issue #114)

8 years agoAdded support for isize/usize in the CastPass lint pass.
R.Chavignat [Fri, 21 Aug 2015 01:03:37 +0000 (03:03 +0200)]
Added support for isize/usize in the CastPass lint pass.

Extracted the match that determines an integer types's size in a
utility function and implemented support for usize/isize.
Added a needed feature to the crate root.
Added some tests to cover those cases, and a test I previously forgot.
Silenced two errors signaled by dogfood.sh in unicode.rs.

8 years agoReworked the error messages for more heplfulness.
R.Chavignat [Thu, 20 Aug 2015 20:44:40 +0000 (22:44 +0200)]
Reworked the error messages for more heplfulness.

Renamed the cast_possible_overflow lint to cast_possible_truncation,
and updated the error message, readme and crate root accordingly.
Added some more information to the message for the cast_precision_loss
lint.
Updated the test case to reflect changes.

8 years agoRefactored the CastPass lints.
R.Chavignat [Thu, 20 Aug 2015 19:37:37 +0000 (21:37 +0200)]
Refactored the CastPass lints.

8 years agoFixed a little oversight.
R.Chavignat [Thu, 20 Aug 2015 12:50:26 +0000 (14:50 +0200)]
Fixed a little oversight.

8 years agoSimplified reexported ast::* type paths.
R.Chavignat [Thu, 20 Aug 2015 12:37:35 +0000 (14:37 +0200)]
Simplified reexported ast::* type paths.

Also removed trailing whitespaces.

8 years agoAlso test that the CastExpr's right arm is numeric.
R.Chavignat [Thu, 20 Aug 2015 12:36:26 +0000 (14:36 +0200)]
Also test that the CastExpr's right arm is numeric.

8 years agoMoved allow(unknown_lints) to crate level.
R.Chavignat [Thu, 20 Aug 2015 12:25:08 +0000 (14:25 +0200)]
Moved allow(unknown_lints) to crate level.

8 years agoAdded examples to lint descriptions.
R.Chavignat [Thu, 20 Aug 2015 12:24:26 +0000 (14:24 +0200)]
Added examples to lint descriptions.

8 years agoMerge pull request #209 from Manishearth/where_credit_is_due
Manish Goregaokar [Thu, 20 Aug 2015 07:01:05 +0000 (12:31 +0530)]
Merge pull request #209 from Manishearth/where_credit_is_due

give credit where credit is due

8 years agogive credit where credit is due
llogiq [Thu, 20 Aug 2015 06:59:07 +0000 (08:59 +0200)]
give credit where credit is due

8 years agoInitial implementation of lossy cast lints.
R.Chavignat [Wed, 19 Aug 2015 22:04:01 +0000 (00:04 +0200)]
Initial implementation of lossy cast lints.

Introduces 3 lints :
  cast_possible_overflow
  cast_precision_loss
  cast_sign_loss
Add a compile-test test case.
Fix errors spotted by dogfood script.

8 years agoMerge pull request #204 from Manishearth/bit-mask
llogiq [Wed, 19 Aug 2015 11:25:43 +0000 (13:25 +0200)]
Merge pull request #204 from Manishearth/bit-mask

Extend and correct the ineffective_bit_mask check

8 years agoMerge pull request #205 from Manishearth/const
llogiq [Wed, 19 Aug 2015 11:24:59 +0000 (13:24 +0200)]
Merge pull request #205 from Manishearth/const

Mul and Div for integers

8 years agoMul and Div for integers
llogiq [Wed, 19 Aug 2015 09:58:59 +0000 (11:58 +0200)]
Mul and Div for integers

8 years agofixed #203 and #197
llogiq [Wed, 19 Aug 2015 07:07:50 +0000 (09:07 +0200)]
fixed #203 and #197

8 years agoMerge pull request #202 from birkenfeld/unit_cmp
llogiq [Wed, 19 Aug 2015 06:34:19 +0000 (08:34 +0200)]
Merge pull request #202 from birkenfeld/unit_cmp

new lint: comparing unit types (fixes #201)

8 years agonew lint: comparing unit types (fixes #201)
Georg Brandl [Wed, 19 Aug 2015 04:54:20 +0000 (06:54 +0200)]
new lint: comparing unit types (fixes #201)

8 years agoMerge pull request #200 from Manishearth/consts
Manish Goregaokar [Tue, 18 Aug 2015 13:11:30 +0000 (18:41 +0530)]
Merge pull request #200 from Manishearth/consts

more small const improvements

8 years agore-applied birkenfeld's improvements
llogiq [Tue, 18 Aug 2015 12:18:36 +0000 (14:18 +0200)]
re-applied birkenfeld's improvements

8 years agomore small const improvements
llogiq [Tue, 18 Aug 2015 10:26:01 +0000 (12:26 +0200)]
more small const improvements

8 years agoMerge pull request #198 from birkenfeld/const_enh
llogiq [Tue, 18 Aug 2015 09:29:03 +0000 (11:29 +0200)]
Merge pull request #198 from birkenfeld/const_enh

consts: minor improvements

8 years agoconsts: minor improvements
Georg Brandl [Mon, 17 Aug 2015 17:55:59 +0000 (19:55 +0200)]
consts: minor improvements

8 years agoMerge pull request #196 from birkenfeld/const_struct
llogiq [Tue, 18 Aug 2015 09:02:04 +0000 (11:02 +0200)]
Merge pull request #196 from birkenfeld/const_struct

[rfc] consts: convert to using a struct with state

8 years agoconsts: convert to using a struct with state
Georg Brandl [Mon, 17 Aug 2015 15:51:30 +0000 (17:51 +0200)]
consts: convert to using a struct with state

Struct has the context reference (as an Option) and the
needed_resolution flag.

8 years agoMerge pull request #195 from birkenfeld/impl_const_not
llogiq [Mon, 17 Aug 2015 15:02:26 +0000 (17:02 +0200)]
Merge pull request #195 from birkenfeld/impl_const_not

const eval: implement ! for integers

8 years agoconst eval: implement ! for integers
Georg Brandl [Mon, 17 Aug 2015 14:45:50 +0000 (16:45 +0200)]
const eval: implement ! for integers

8 years agoMerge pull request #194 from Manishearth/consts_neg_zero
llogiq [Mon, 17 Aug 2015 14:29:02 +0000 (16:29 +0200)]
Merge pull request #194 from Manishearth/consts_neg_zero

added test and fixed negativity check in Partial{Eq, Ord} impl

8 years agoadded test and fixed negativity check in Partial{Eq, Ord} impl
llogiq [Mon, 17 Aug 2015 14:24:57 +0000 (16:24 +0200)]
added test and fixed negativity check in Partial{Eq, Ord} impl

8 years agoMerge pull request #193 from Manishearth/const_bitop
llogiq [Mon, 17 Aug 2015 13:15:21 +0000 (15:15 +0200)]
Merge pull request #193 from Manishearth/const_bitop

Added bit operations to const folding

8 years agoAdded bit operations to const folding
llogiq [Mon, 17 Aug 2015 13:11:36 +0000 (15:11 +0200)]
Added bit operations to const folding

8 years agoMerge pull request #192 from Manishearth/const_cmp
llogiq [Mon, 17 Aug 2015 11:25:40 +0000 (13:25 +0200)]
Merge pull request #192 from Manishearth/const_cmp

Const cmp

8 years agodogfooding
llogiq [Mon, 17 Aug 2015 11:23:17 +0000 (13:23 +0200)]
dogfooding

8 years agoadded PartialEq/PartialOrd to ConstantVariant, used to implement comparing binops
llogiq [Mon, 17 Aug 2015 11:18:14 +0000 (13:18 +0200)]
added PartialEq/PartialOrd to ConstantVariant, used to implement comparing binops

8 years agoMerge pull request #191 from Manishearth/fix-165
llogiq [Mon, 17 Aug 2015 10:11:32 +0000 (12:11 +0200)]
Merge pull request #191 from Manishearth/fix-165

Closes #165

8 years agomake float_cmp check for zero
llogiq [Mon, 17 Aug 2015 10:06:56 +0000 (12:06 +0200)]
make float_cmp check for zero

8 years agoadded regression test for #189
llogiq [Mon, 17 Aug 2015 09:46:45 +0000 (11:46 +0200)]
added regression test for #189

8 years agofix 189, fixed a few warnings, ==/!= for consts, refactored consts test
llogiq [Mon, 17 Aug 2015 09:43:36 +0000 (11:43 +0200)]
fix 189, fixed a few warnings, ==/!= for consts, refactored consts test

8 years agoMerge pull request #190 from Manishearth/fix-189
llogiq [Mon, 17 Aug 2015 09:49:05 +0000 (11:49 +0200)]
Merge pull request #190 from Manishearth/fix-189

Fix 189

8 years agoadded regression test for #189
llogiq [Mon, 17 Aug 2015 09:46:45 +0000 (11:46 +0200)]
added regression test for #189

8 years agofix 189, fixed a few warnings, ==/!= for consts, refactored consts test
llogiq [Mon, 17 Aug 2015 09:43:36 +0000 (11:43 +0200)]
fix 189, fixed a few warnings, ==/!= for consts, refactored consts test

8 years agoMerge pull request #184 from Manishearth/identity_op
Manish Goregaokar [Mon, 17 Aug 2015 09:05:45 +0000 (14:35 +0530)]
Merge pull request #184 from Manishearth/identity_op

Identity op now uses const folding, no longer follows const bindings

8 years agoMerge pull request #186 from birkenfeld/fix
Manish Goregaokar [Mon, 17 Aug 2015 05:35:02 +0000 (11:05 +0530)]
Merge pull request #186 from birkenfeld/fix

loops: fix two trailing periods in lint msgs

8 years agoMerge pull request #185 from birkenfeld/iter_next_loop
Manish Goregaokar [Mon, 17 Aug 2015 05:34:58 +0000 (11:04 +0530)]
Merge pull request #185 from birkenfeld/iter_next_loop

new lint: iterating over any Iterator::next() result (fixes #182)

8 years agoloops: fix two trailing periods in lint msgs
Georg Brandl [Mon, 17 Aug 2015 05:30:33 +0000 (07:30 +0200)]
loops: fix two trailing periods in lint msgs

8 years agonew lint: lint when iterating over any Iterator::next() result (fixes #182)
Georg Brandl [Mon, 17 Aug 2015 05:23:57 +0000 (07:23 +0200)]
new lint: lint when iterating over any Iterator::next() result (fixes #182)

8 years agomade is_negative(..) public (+doctest), fixed identity_op and precedence
llogiq [Sun, 16 Aug 2015 21:09:56 +0000 (23:09 +0200)]
made is_negative(..) public (+doctest), fixed identity_op and precedence

8 years agoMerge pull request #179 from nweston/step-by-zero
llogiq [Sun, 16 Aug 2015 18:12:52 +0000 (20:12 +0200)]
Merge pull request #179 from nweston/step-by-zero

New lint: Range::step_by(0) (fixes #95)

8 years agoNew lint: Range::step_by(0) (fixes #95)
Nathan Weston [Sat, 15 Aug 2015 16:55:25 +0000 (12:55 -0400)]
New lint: Range::step_by(0) (fixes #95)

Uses type information so it can detect non-literal ranges as well
(Range or RangeFrom -- the other range types don't have step_by).

8 years agocopied over cmp_owned fix from master
llogiq [Sun, 16 Aug 2015 14:13:44 +0000 (16:13 +0200)]
copied over cmp_owned fix from master

8 years agodogfooding, part 2
llogiq [Sun, 16 Aug 2015 14:09:00 +0000 (16:09 +0200)]
dogfooding, part 2

8 years agodogfooded
llogiq [Sun, 16 Aug 2015 14:05:51 +0000 (16:05 +0200)]
dogfooded

8 years agoWith working test now
llogiq [Sun, 16 Aug 2015 13:56:09 +0000 (15:56 +0200)]
With working test now

8 years agorestrict toplevel_ref_arg to only functions (fixes #170)
Manish Goregaokar [Sun, 16 Aug 2015 11:54:03 +0000 (17:24 +0530)]
restrict toplevel_ref_arg to only functions (fixes #170)

8 years agoMerge pull request #180 from birkenfeld/small_changes
Manish Goregaokar [Sun, 16 Aug 2015 07:42:56 +0000 (13:12 +0530)]
Merge pull request #180 from birkenfeld/small_changes

Small changes

8 years agoadd some imports to guard against crate moves
Georg Brandl [Sun, 16 Aug 2015 07:03:06 +0000 (09:03 +0200)]
add some imports to guard against crate moves

8 years agoall: organize imports
Georg Brandl [Sun, 16 Aug 2015 06:54:43 +0000 (08:54 +0200)]
all: organize imports

* remove unused imports
* separate external and internal imports
* consistent import of rustc::lint
* move #[allow(unused_imports)] to local impl

8 years agoall: remove unneeded as_str() calls for ast::Name
Georg Brandl [Sun, 16 Aug 2015 06:33:10 +0000 (08:33 +0200)]
all: remove unneeded as_str() calls for ast::Name

Name has PartialEq and Display impls that do what we want.

8 years agoMerge pull request #177 from birkenfeld/if_let_mini_fix
Manish Goregaokar [Sat, 15 Aug 2015 08:42:34 +0000 (14:12 +0530)]
Merge pull request #177 from birkenfeld/if_let_mini_fix

misc: fix check for unit body in "match -> if let" lint (fixes #172)

8 years agoMerge pull request #178 from birkenfeld/dogfood_shebang
llogiq [Sat, 15 Aug 2015 08:25:01 +0000 (10:25 +0200)]
Merge pull request #178 from birkenfeld/dogfood_shebang

util: make dogfood executable and give it a shebang

8 years agoutil: make dogfood executable and give it a shebang
Georg Brandl [Sat, 15 Aug 2015 07:58:26 +0000 (09:58 +0200)]
util: make dogfood executable and give it a shebang

8 years agomisc: fix check for unit body in "match -> if let" lint (fixes #172)
Georg Brandl [Sat, 15 Aug 2015 07:22:50 +0000 (09:22 +0200)]
misc: fix check for unit body in "match -> if let" lint (fixes #172)

8 years agoMerge pull request #176 from birkenfeld/static_lt_fix
Manish Goregaokar [Sat, 15 Aug 2015 07:38:20 +0000 (13:08 +0530)]
Merge pull request #176 from birkenfeld/static_lt_fix

lifetimes: fix case with one unnamed and one static ref (fixes #171)