Alex Crichton
af995ce1e7
Make missing documentation linting more robust
...
Add some more cases for warning about missing documentation, and also add a test
to make sure it doesn't die in the future.
2013-05-30 01:02:55 -05:00
Patrick Walton
206ab89629
librustc: Stop reexporting the standard modules from prelude.
2013-05-29 19:04:53 -07:00
Alex Crichton
ae7df57c5a
Prevent refcount cycles during linting
...
Shaves off ~600MB of memory while compiling rustc
2013-05-27 22:22:09 -05:00
bors
5d04ee805b
auto merge of #6715 : Xazax-hun/rust/incoming, r=graydon
...
Preliminary implementation for: https://github.com/mozilla/rust/issues/6275
This is my first (non hello world) rust code, so it may not be idiomatic.
2013-05-27 13:44:08 -07:00
Seo Sanghyeon
363e672736
Use adjustments table for allocation lint
2013-05-28 03:12:13 +09:00
Gábor Horváth
3d61931fca
Only trigger missing documentation warnings to public functions and fields.
2013-05-24 14:13:41 +02:00
Gábor Horváth
c6581325ac
Warnings for missing documentations.
2013-05-24 10:27:31 +02:00
Erick Tryzelaar
9635b30837
cleanup warnings from librustc
2013-05-23 17:57:07 -07:00
Patrick Walton
c532e033c9
librustc: Change std
to extra
throughout libsyntax and librustc
2013-05-22 21:57:08 -07:00
Patrick Walton
f3723cf7c4
libextra: Rename the actual metadata names of libcore to libstd and libstd to libextra
2013-05-22 21:57:07 -07:00
Alex Crichton
82fa0018c8
Remove all unnecessary allocations (as flagged by lint)
2013-05-20 16:10:40 -05:00
Alex Crichton
074799b4c5
Implement a lint mode to detect unnecessary allocations
2013-05-20 16:08:50 -05:00
Brian Anderson
66319b0278
Register snapshots
2013-05-19 23:34:32 -07:00
Huon Wilson
aa179cb0f1
rustc: relax limits on (u)int type limit lint. Fixes #6130 .
2013-05-18 01:49:36 +10:00
Alex Crichton
4d44abd52a
Change lints to indicate exactly where the level was set
2013-05-17 00:54:03 -04:00
Alex Crichton
1daaf785ab
Optimize lint passes to perform far fewer allocations
...
Achieves ~3x speedup on lint passes for libcore
2013-05-17 00:49:17 -04:00
Alex Crichton
030c666cc1
Re-implement lint with less emphasis on item ids
...
This way it's much easier to add lints throughout compilation correctly, and
functions on impls can alter the way lints are emitted.
2013-05-17 00:49:16 -04:00
Alex Crichton
5614e83e81
Remove vecs_implicitly_copyable from the compiler
2013-05-14 12:25:18 -04:00
bors
7a4c6e587d
auto merge of #6325 : sammykim/rust/lint-name, r=graydon
...
Fix #3525 .
2013-05-09 08:54:38 -07:00
Patrick Walton
3affc6ed40
librustc: Fix merge fallout.
2013-05-08 17:04:02 -07:00
Patrick Walton
db4573a776
librustc: Remove mutable fields from the language.
...
They're still parsed though, to get through bootstrapping.
2013-05-08 17:04:00 -07:00
Sangeun Kim
dc48a558b6
Show lint names
2013-05-08 17:23:48 +09:00
bors
86500fbb13
auto merge of #6297 : sammykim/rust/static-lint-table, r=luqmana
2013-05-07 23:18:39 -07:00
Sangeun Kim
356ebe8792
extranous thing is removed
2013-05-08 10:42:47 +09:00
Sangeun Kim
7455f986a8
Make lint_table static
2013-05-07 16:28:58 +09:00
Niko Matsakis
4300d4d2fa
Merge remote-tracking branch 'mozilla/incoming' into issue-5910-dyna-freeze
...
Conflicts:
src/libcore/core.rc
src/libcore/hashmap.rs
src/libcore/num/f32.rs
src/libcore/num/f64.rs
src/libcore/num/float.rs
src/libcore/num/int-template.rs
src/libcore/num/num.rs
src/libcore/num/strconv.rs
src/libcore/num/uint-template.rs
src/libcore/ops.rs
src/libcore/os.rs
src/libcore/prelude.rs
src/libcore/rt/mod.rs
src/libcore/unstable/lang.rs
src/librustc/driver/session.rs
src/librustc/middle/astencode.rs
src/librustc/middle/borrowck/check_loans.rs
src/librustc/middle/borrowck/gather_loans.rs
src/librustc/middle/borrowck/loan.rs
src/librustc/middle/borrowck/preserve.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/region.rs
src/librustc/middle/trans/base.rs
src/librustc/middle/trans/inline.rs
src/librustc/middle/trans/reachable.rs
src/librustc/middle/typeck/check/_match.rs
src/librustc/middle/typeck/check/regionck.rs
src/librustc/util/ppaux.rs
src/libstd/arena.rs
src/libstd/ebml.rs
src/libstd/json.rs
src/libstd/serialize.rs
src/libstd/std.rc
src/libsyntax/ast_map.rs
src/libsyntax/parse/parser.rs
src/test/compile-fail/borrowck-uniq-via-box.rs
src/test/compile-fail/regions-infer-borrow-scope-within-loop.rs
src/test/run-pass/borrowck-nested-calls.rs
2013-05-05 15:11:04 -04:00
Niko Matsakis
0b0b8018a6
add warning for #6248 and remove instances of it
2013-05-05 12:17:59 -04:00
bors
b42ea7f9ef
auto merge of #6174 : sanxiyn/rust/static-string, r=brson
2013-05-01 22:06:37 -07:00
Brendan Zabarauskas
e596128bd8
Remove 'Local Variable' comments
2013-05-02 13:22:04 +10:00
Seo Sanghyeon
4294aed01b
Use static strings
2013-05-02 10:36:30 +09:00
Erick Tryzelaar
c2e1f47955
rustc: remove the rest of drop
...
Removes:
ast::struct_def::dtor
syntax::ast::ii_dtor
syntax::visit::fk_dtor
syntax::ast_map::node_dtor
syntax:struct_dtor
2013-05-01 07:49:41 -07:00
Patrick Walton
f30f54e9d0
librustc: Remove the concept of modes from the compiler.
...
This commit does not remove `ty::arg`, although that should be
possible to do now.
2013-04-29 14:30:55 -07:00
Daniel Micay
f792baba42
only use #[no_core] in libcore
2013-04-27 21:34:24 -04:00
Alex Crichton
8884c6abdb
Use backticks for the unsafe keyword in error messages
2013-04-23 02:06:47 -04:00
Alex Crichton
d1985c9dd0
Implement a lint mode to deal with unused 'mut' variables
2013-04-20 21:02:38 -04:00
Alex Crichton
3c2a44b60f
Don't warn about unsafe functions which don't need to be unsafe
2013-04-20 15:52:05 -04:00
Alex Crichton
1e4a439f7f
rustc: de-mode + fallout from libsyntax changes
2013-04-19 23:23:23 -04:00
Alex Crichton
4bfa3c6663
Add a lint mode for unused unsafe blocks/functions
2013-04-14 01:15:46 -04:00
Niko Matsakis
5606fc0c90
Revert map.each to something which takes two parameters
...
rather than a tuple. The current setup iterates over
`BaseIter<(&'self K, &'self V)>` where 'self is a lifetime declared
*in the each method*. You can't place such a type in
the impl declaration. The compiler currently allows it,
but this will not be legal under #5656 and I'm pretty sure
it's not sound now.
2013-04-10 07:51:48 -07:00
Alex Crichton
3e67085d7a
Allow lint modes to be used on unused variables and dead assignments
2013-04-09 13:48:44 -04:00
Niko Matsakis
d28f734412
Refactor so that references to traits are not represented using a type with a
...
bare function store (which is not in fact a kind of value) but rather
ty::TraitRef. Removes many uses of fail!() and other telltale signs of
type-semantic mismatch.
cc #4183 (not a fix, but related)
2013-04-05 05:36:02 -04:00
Daniel Micay
cc148b58ff
rename Linear{Map,Set} => Hash{Map,Set}
2013-04-03 10:30:36 -04:00
Daniel Micay
44029a5bbc
hashmap: rm linear namespace
2013-04-03 10:30:18 -04:00
Brian Anderson
e3327d3833
Fix warnings
2013-03-31 20:22:47 -07:00
Niko Matsakis
6965fe4bce
Add AbiSet and integrate it into the AST.
...
I believe this patch incorporates all expected syntax changes from extern
function reform (#3678 ). You can now write things like:
extern "<abi>" fn foo(s: S) -> T { ... }
extern "<abi>" mod { ... }
extern "<abi>" fn(S) -> T
The ABI for foreign functions is taken from this syntax (rather than from an
annotation). We support the full ABI specification I described on the mailing
list. The correct ABI is chosen based on the target architecture.
Calls by pointer to C functions are not yet supported, and the Rust type of
crust fns is still *u8.
2013-03-29 18:36:20 -07:00
Patrick Walton
1e91595520
librustc: Remove fail_unless!
2013-03-29 16:39:08 -07:00
Alex Crichton
be57d745d2
Removing unused imports
2013-03-28 23:56:46 -04:00
Patrick Walton
8b56a8380b
librustc: Modify all code to use new lifetime binder syntax
2013-03-26 21:30:17 -07:00
Alex Crichton
6f812fef1b
rustc: Remove uses of oldmap::HashMap
2013-03-26 19:21:04 -04:00
Patrick Walton
e7c60c141b
librustc: Remove pure
from libsyntax and librustc.
2013-03-22 12:57:27 -07:00
Andrew Paseltiner
9966eaaba4
rustc: replace uses of old deriving attribute with new one
2013-03-22 06:24:19 -04:00
Marvin Löbel
9d9a209e9a
back-renamed slice_DBG_BRWD, slice_V_DBG_BRWD -> slice, slice_DBG_UNIQ -> slice_unique
2013-03-21 14:05:57 +01:00
Marvin Löbel
a7d296f24c
renamed str::view -> slice_DBG_BRWD
...
renamed str::slice -> slice_DBG_UNIQ
changed vec slice method -> to_owned()
renamed vec view method -> slice_V_DBG_BRWD
2013-03-21 01:50:32 +01:00
Alex Crichton
3fac7cce8f
rustc: Remove some bad copies throughout
2013-03-20 01:28:32 -04:00
Luqman Aden
787f5bb0db
Now actually allow using constants in those constant expressions for [T * n].
2013-03-18 17:31:41 -07:00
Patrick Walton
352c070365
librustc: Convert all uses of old lifetime notation to new lifetime notation. rs=delifetiming
2013-03-18 17:21:14 -07:00
Patrick Walton
8fa66e8e07
librustc: Remove implicit self from the language, except for old-style drop blocks.
2013-03-13 20:07:10 -07:00
Niko Matsakis
852619d5d7
Remove ++
mode from the compiler (it is parsed as +
mode)
...
and obsolete `-` mode altogether (it *was* parsed as `+` mode).
2013-03-13 17:00:09 -04:00
Niko Matsakis
efc7f82bc4
Revamp foreign code not to consider the Rust modes. This requires
...
adjusting a few foreign functions that were declared with by-ref
mode. This also allows us to remove by-val mode in the near future.
With copy mode, though, we have to be careful because Rust will implicitly pass
somethings by pointer but this may not be the C ABI rules. For example, rust
will pass a struct Foo as a Foo*. So I added some code into the adapters to
fix this (though the C ABI rules may put the pointer back, oh well).
This patch also includes a lint mode for the use of by-ref mode
in foreign functions as the semantics of this have changed.
2013-03-13 16:59:37 -04:00
Patrick Walton
08c840205e
librustc: Lint the old drop
destructor notation off
2013-03-11 09:36:00 -07:00
Patrick Walton
d18f785457
librustc: Replace all uses of fn()
with &fn()
. rs=defun
2013-03-11 09:35:58 -07:00
Patrick Walton
d7e74b5e91
librustc: Convert all uses of assert
over to fail_unless!
2013-03-07 22:37:57 -08:00
Patrick Walton
954ae9c975
libsyntax: Remove struct literal expressions from the compiler
2013-03-07 22:32:55 -08:00
Alex Crichton
dfb5c10dea
Remove unused imports throughout src/
2013-03-04 12:27:01 -05:00
Alex Crichton
55461d888f
Change the default level of unused_imports to warn
2013-03-04 12:27:01 -05:00
Erick Tryzelaar
85fecd0ba7
Merge remote-tracking branch 'remotes/origin/incoming' into incoming
2013-03-01 07:01:48 -08:00
Patrick Walton
107bf96ff0
librustc: Mark all type implementations public. rs=impl-publicity
2013-02-28 11:32:24 -08:00
Erick Tryzelaar
3953bdd812
Merge remote-tracking branch 'remotes/origin/incoming' into incoming
2013-02-28 07:25:31 -08:00
Niko Matsakis
c623d21e38
Introduce lifetime declarations into the lists of type parameters.
...
Major changes are:
- replace ~[ty_param] with Generics structure, which includes
both OptVec<TyParam> and OptVec<Lifetime>;
- the use of syntax::opt_vec to avoid allocation for empty lists;
cc #4846
2013-02-27 19:42:09 -05:00
Erick Tryzelaar
7d0ec86c4a
Merge remote-tracking branch 'remotes/origin/incoming' into incoming
2013-02-27 11:03:21 -08:00
Patrick Walton
c483aab4ae
librustc: Implement a lint mode for mutable structures; deny by default. r=tjc
2013-02-26 04:18:11 -08:00
Erick Tryzelaar
f14409c528
libsyntax: progress on making syntax::visit vecs_implicitly_copyable-free
2013-02-25 07:49:34 -08:00
Erick Tryzelaar
9ac5262bdf
libsyntax: convert visit to pass ty_params by reference
2013-02-25 07:27:01 -08:00
Daniel Micay
1afddff97f
remove oldsmallintmap
...
Closes #4738
2013-02-23 01:40:17 -05:00
Luqman Aden
9ea6a49696
Remove the last bits of structural records from tests/rustc/rusti/rustpkg.
2013-02-21 15:19:40 -08:00
Patrick Walton
bf2a225c0b
librustc: Separate most trait bounds with '+'. rs=plussing
2013-02-20 21:14:20 -08:00
Tim Chevalier
0c3290a217
Merge
2013-02-20 18:45:50 -08:00
Luqman Aden
6282e5da67
librustc: tidy
2013-02-20 18:45:50 -08:00
Luqman Aden
cd82c4566b
librustc: Get rid of structural records save for front/test.rs.
2013-02-20 18:45:50 -08:00
Erick Tryzelaar
b90ccc9a38
librustc: minor cleanup
2013-02-19 10:02:52 -08:00
Erick Tryzelaar
ae86c03af2
librustc: change check_item_non_camel_case_types to not copy
2013-02-19 10:02:52 -08:00
Erick Tryzelaar
53951afe48
librustc: convert lint_dict to take @~strs as keys
2013-02-19 10:02:52 -08:00
Erick Tryzelaar
de5fdaf934
convert ast::meta_items to take @~strs
2013-02-19 10:02:52 -08:00
Patrick Walton
9143688197
librustc: Replace impl Type : Trait
with impl Trait for Type
. rs=implflipping
2013-02-14 14:44:12 -08:00
Nick Desaulniers
4445b38df2
Remove die!, raplace invocations with fail! Issue #4524 pt 3
2013-02-13 17:01:32 -08:00
bors
d6442e97a5
auto merge of #4854 : thestinger/rust/oldmap, r=catamorphism
2013-02-09 15:02:51 -08:00
Daniel Micay
a32c5c73ee
oldmap: get rid of legacy _ref suffixes
2013-02-08 19:12:51 -05:00
Niko Matsakis
a380df809c
Fix subtle error in caching during kind computation that could cause linear
...
values to be copied. Rewrite kind computation so that instead of directly
computing the kind it computes what kinds of values are present in the type,
and then derive kinds based on that. I find this easier to think about.
Fixes #4821 .
2013-02-08 07:20:39 -08:00
Niko Matsakis
a32498d846
Make ~fn non-copyable, make &fn copyable, split barefn/closure types,
...
correct handling of moves for struct-record update.
Part of #3678 . Fixes #2828 , #3904 , #4719 .
2013-02-07 05:53:30 -08:00
Patrick Walton
801f3225b2
oldmap: use &K instead of K in find and get
...
This reverts commit a4250a96fd
.
This is not the cause of the nonexhaustive-match failure.
2013-02-05 19:41:45 -08:00
Graydon Hoare
a4250a96fd
Revert "oldmap: use &K instead of K in find and get"
...
This reverts commit 8e643525d4
.
2013-02-05 14:30:53 -08:00
Daniel Micay
8e643525d4
oldmap: use &K instead of K in find and get
2013-02-03 23:30:56 -05:00
Daniel Micay
81b4f36d49
oldmap: remove legacy each method
2013-02-03 15:55:11 -05:00
Daniel Micay
319eeb1c79
rename map -> oldmap and mark it as deprecated
...
LinearMap is quite a bit faster, and is fully owned/sendable without
requiring copies. The older std::map also doesn't use explicit self and
relies on mutable fields.
2013-02-03 15:55:10 -05:00
John Clements
53688addaa
test cases, cleanup
2013-01-31 23:05:12 -08:00
Daniel Micay
70855f5a07
move smallintmap to oldsmallintmap
2013-01-31 23:13:56 -05:00
Nick Desaulniers
aee7929469
Replace most invocations of fail keyword with die! macro
2013-01-31 20:12:49 -08:00
Niko Matsakis
0682ad0eb9
Finalize moves-based-on-type implementation.
...
Changes:
- Refactor move mode computation
- Removes move mode arguments, unary move, capture clauses
(though they still parse for backwards compatibility)
- Simplify how moves are handled in trans
- Fix a number of illegal copies that cropped up
- Workaround for bug involving def-ids in params
(see details below)
Future work (I'll open bugs for these...):
- Improve error messages for moves that are due
to bindings
- Add support for moving owned content like a.b.c
to borrow check, test in trans (but I think it'll
"just work")
- Proper fix for def-ids in params
Def ids in params:
Move captures into a map instead of recomputing.
This is a workaround for a larger bug having to do with the def-ids associated
with ty_params, which are not always properly preserved when inlining. I am
not sure of my preferred fix for the larger bug yet. This current fix removes
the only code in trans that I know of which relies on ty_param def-ids, but
feels fragile.
2013-01-31 12:09:00 -08:00
Patrick Walton
ae50912875
librustc: De-export rustc. rs=deexporting
2013-01-30 13:44:24 -08:00
Patrick Walton
226cd68f13
librustc: De-implicit-self the visitor. r=graydon
2013-01-29 10:43:12 -08:00