Commit Graph

30490 Commits

Author SHA1 Message Date
Alex Crichton
e44c2b9bbc Add #[crate_name] attributes as necessary 2014-07-05 12:45:42 -07:00
Alex Crichton
c956b70d7b rustc: Modify crate loading to ignore versions
This commit modifies crate loading to purely work off a `crate_name` and nothing
else. This commit also changes the patterns recognized from `lib<foo>-*` to
`lib<foo>*` to accomodate the future renamings of output files.

RFC: 0035-remove-crate-id
2014-07-05 12:38:42 -07:00
Alex Crichton
1007739b20 rustc: Add a new codegen flag, -C metadata=foo
This metadata is used to drive the hash of all symbols in a crate. The flag can
be specified a multiple number of times

RFC: 0035-remove-crate-id
2014-07-05 12:38:42 -07:00
Alex Crichton
50ee1ec1b4 rustc: Remove CrateId and all related support
This commit removes all support in the compiler for the #[crate_id] attribute
and all of its derivative infrastructure. A list of the functionality removed is:

* The #[crate_id] attribute no longer exists
* There is no longer the concept of a version of a crate
* Version numbers are no longer appended to symbol names
* The --crate-id command line option has been removed

To migrate forward, rename #[crate_id] to #[crate_name] and only the name of the
crate itself should be mentioned. The version/path of the old crate id should be
removed.

For a transitionary state, the #[crate_id] attribute is still accepted if
the #[crate_name] is not present, but it is warned about if it is the only
identifier present.

RFC: 0035-remove-crate-id
[breaking-change]
2014-07-05 12:38:42 -07:00
Paolo Falabella
8cec9d495d Added num::Signed implementation to Ratio (squashed) 2014-07-05 19:50:03 +01:00
bors
c8b2a3167b auto merge of #15431 : iliekturtles/rust/13279-error-msg-order, r=pcwalton
Moved note after error to reduce confusion when the pair appears in the
middle of other errors. Closes #13279.
2014-07-05 18:11:43 +00:00
bors
aaff4e05e1 auto merge of #15429 : kballard/rust/vim_tab_conventions, r=pcwalton 2014-07-05 16:26:44 +00:00
Adolfo Ochagavía
d6f8271602 Improved example in the Guide
Fixes https://github.com/rust-lang/rust/issues/15452
2014-07-05 18:19:08 +02:00
bors
98eb5f7498 auto merge of #15428 : phildawes/rust/master, r=huonw
Fix small bug introduced in e38cb972dc: PatIdent span was incorrect
because self.last_span was being used before the ident token was
parsed.
2014-07-05 14:41:44 +00:00
Jakub Wieczorek
1aa23b8e1c Fix #15453 2014-07-05 16:32:13 +02:00
bors
c8bbba9a4b auto merge of #15427 : aochagavia/rust/parse, r=pcwalton 2014-07-05 12:56:44 +00:00
bors
342321def6 auto merge of #15442 : luqmana/rust/odp, r=pnkfelix
Inadvertently changed the order in which destructors ran in certain cases with #15076.

Fixes #15438.
2014-07-05 11:11:47 +00:00
Luqman Aden
e9e5ea2f90 libcore: Fix Items iterator for zero sized types. 2014-07-05 02:49:03 -07:00
bors
e0d3cf6b2a auto merge of #15418 : pnkfelix/rust/fsk-revise-VecPerParamSpace, r=pcwalton
In my informal measurements, this brings the peak memory usage when
building librustc from 1662M down to 1502M.  Since 1662 - 1502 = 160,
this may not recover the entirety of the observed memory regression
(250M) from PR #14604.  (However, according to my local measurements,
the regression when building librustc was more like 209M, so perhaps
this will still recover the lions share of the lost memory.)
2014-07-05 08:31:48 +00:00
bors
b00f4ec8f1 auto merge of #15414 : zsiciarz/rust/patch-1, r=alexcrichton 2014-07-05 06:46:47 +00:00
bors
d611800a70 auto merge of #15284 : apoelstra/rust/bitv-methods, r=cmr
The types `Bitv` and `BitvSet` are badly out of date. This PR:
- cleans up the code (primarily, simplifies `Bitv` and implements `BitvSet` in terms of `Bitv`)
- implements several new traits for `Bitv`
- adds new functionality to `Bitv` and `BitvSet`
- replaces internal iterators with external ones
- updates documentation
- minor bug fixes

This is a significantly souped-up version of PR #15139 and is the result of the discussion there.
2014-07-05 05:01:49 +00:00
Felix S. Klock II
4459fe3e5e Revise VecPerParamSpace to use a one Vec rather than three.
In my informal measurements, this brings the peak memory usage when
building librustc from 1662M down to 1502M.  Since 1662 - 1502 = 160,
this may not recover the entirety of the observed memory regression
(250M) from PR #14604.  (However, according to my local measurements,
the regression when building librustc was more like 209M, so perhaps
this will still recover the lions share of the lost memory.)
2014-07-05 06:29:27 +02:00
Felix S. Klock II
952dded81a Refactored VecPerParamSpace to hide exposure of Vec representation.
This basically meant changing the interface so that no borrowed `&Vec`
is exposed, by hiding `fn get_vec` and `fn get_mut_vec` and revising
`fn all_vecs`.

Instead, clients should use one of the other methods; `get_slice`,
`pop`, `truncate`, `replace`, `push_all`, or `is_empty_in`, which
should work for any case currently used in rustc.
2014-07-05 06:29:06 +02:00
Patrick Yevsukov
4ad78680de Update RELEASES.txt
Fix Typos
2014-07-05 00:22:59 -04:00
bors
29d6a8ecc6 auto merge of #15425 : jbclements/rust/hygiene-for-3-kinds-of-args, r=cmr
This pull request adds hygiene for 3 kinds of argument bindings:
- arguments to item fns,
- arguments to `ExprFnBlock`s, and
- arguments to `ExprProc`s

It also adds a bunch of unit tests, fixes a few macro uses to be non-capturing, and has a few cleanup items.

local `make check` succeeds.
2014-07-05 03:16:50 +00:00
bors
9f2a43c1b5 auto merge of #15419 : erickt/rust/json, r=pcwalton
This speeds up json serialization by removing most of the allocations.
2014-07-05 01:31:52 +00:00
Luqman Aden
1af8663579 librustc: Make sure to run destructors in the right order when matching on moved value. 2014-07-04 18:05:09 -07:00
P1start
7926aeeca4 move lifetime suggestion note to after the error
Closes #15433.
2014-07-05 12:54:26 +12:00
Patrick Walton
aaaf7e00ec librustc: Accept type aliases for structures in structure literals and
structure patterns.

Closes #4508.
2014-07-04 17:07:31 -07:00
Erick Tryzelaar
67c8a8d5dd serialize: speed up json pretty printing by batch writing spaces 2014-07-04 16:56:23 -07:00
Björn Steinbrink
f463a19cbc Remove entry_bcx from FunctionContext
We no longer need to refer to the entry block from arbitrary places, so
we can drop it from FunctionContext.
2014-07-05 01:52:12 +02:00
bors
459f155f81 auto merge of #15415 : dgoon/rust/master, r=alexcrichton 2014-07-04 23:46:44 +00:00
Erick Tryzelaar
717de500ee serialize: escaping json strings should write in batches.
This significantly speeds up encoding json strings.
2014-07-04 16:36:49 -07:00
Luqman Aden
f48cc74001 Add tests for null pointer opt. 2014-07-04 16:06:21 -07:00
Luqman Aden
31570cb22e librustc: Don't create &[T] slices with NULL as the ptr. 2014-07-04 14:36:56 -07:00
Mike Boutin
f37e202b53 rustc: Reorder error and note message to reduce confusion.
Moved note after error to reduce confusion when the pair appears in the
middle of other errors. Closes #13279.
2014-07-04 17:28:04 -04:00
Kevin Ballard
4c1fdd065b vim: set Rust tab conventions 2014-07-04 14:09:47 -07:00
Phil Dawes
9deeaefdbb Parser: fix PatIdent span bug
Fix small bug introduced in e38cb972dc: PatIdent span was incorrect
because self.last_span was being used before the ident token was
parsed.
2014-07-04 21:54:42 +01:00
bors
9897160523 auto merge of #15412 : dotdash/rust/builder, r=alexcrichton 2014-07-04 20:46:38 +00:00
Adolfo Ochagavía
45e52a13e8 Removed unnecessary method in test 2014-07-04 22:39:50 +02:00
John Clements
cc13f9bae8 implement hygiene for ExprFnBlock and ExprProc 2014-07-04 13:20:14 -07:00
John Clements
ff9995e089 added test cases for closure arg hygiene 2014-07-04 13:20:14 -07:00
John Clements
63fb7c6f40 comments only 2014-07-04 13:20:14 -07:00
John Clements
3e99309bfc make any_pat! and u64_from_be_bytes_bench_impl! macros hygienic 2014-07-04 13:20:14 -07:00
John Clements
0ba15c99f3 hygiene for item fn args
also, introduce fn_decl_arg_bindings and expand_and_rename abstractions
2014-07-04 13:20:14 -07:00
John Clements
92708322fd comments & test cases for IdentRenamers 2014-07-04 13:20:14 -07:00
John Clements
6bee3c87c9 use PatIdentRenamer for match bindings 2014-07-04 13:20:13 -07:00
John Clements
35175f015f comments only 2014-07-04 13:20:13 -07:00
John Clements
aa91ef0cf8 new_mark -> apply_mark, new_rename -> apply_rename 2014-07-04 13:20:06 -07:00
John Clements
b8cd7f7c6d add PatIdentRenamer 2014-07-04 12:08:04 -07:00
John Clements
9fdaa948c0 move RenameList to mtwt, add new_renames abstraction 2014-07-04 12:07:51 -07:00
John Clements
f126eacd11 comments, whitespace, rename NameFinderContext to PatIdentFinder 2014-07-04 12:05:43 -07:00
bors
935da0739e auto merge of #15405 : pcwalton/rust/delifetime, r=nick29581
This was parsed by the parser but completely ignored; not even stored in
the AST!

This breaks code that looks like:

    static X: &'static [u8] = &'static [1, 2, 3];

Change this code to the shorter:

    static X: &'static [u8] = &[1, 2, 3];

Closes #15312.

[breaking-change]

r? @nick29581
2014-07-04 19:01:33 +00:00
Erick Tryzelaar
83f9f07ec4 serialize: Remove allocations from escaping strs and indenting spaces 2014-07-04 11:08:38 -07:00
bors
25e8b6ed9c auto merge of #15404 : vhbit/rust/ios-ptr-fixes, r=pcwalton 2014-07-04 17:16:29 +00:00