819 Commits

Author SHA1 Message Date
Sergio Benitez
8250a26b5b Implement RFC#1559: allow all literals in attributes. 2016-08-25 13:25:22 -07:00
Manish Goregaokar
cf597ab2ba Rollup merge of #35955 - frewsxcv:idiomatic-methods, r=eddyb
Use idiomatic names for string-related methods names.

None
2016-08-25 17:08:01 +05:30
bors
0ccd5c802b Auto merge of #35971 - jonathandturner:rollup, r=jonathandturner
Rollup of 4 pull requests

- Successful merges: #35876, #35920, #35948, #35961
- Failed merges: #35395
2016-08-24 18:42:24 -07:00
Mohit Agarwal
11e9b8de7d Update E0445 and E0454 to new error format
Fixes #35922.
Fixes #35930.
Part of #35233.

r? @GuillaumeGomez
2016-08-24 17:43:51 +05:30
Eduard Burtescu
25cf8001b1 Remove AST from metadata except for consts and const fns. 2016-08-24 13:23:38 +03:00
Corey Farwell
19aae8e069 Reuse iterator to avoid unnecessary creation. 2016-08-23 21:34:53 -04:00
Corey Farwell
2655c89549 Use idiomatic names for string-related methods names. 2016-08-23 21:28:26 -04:00
Guillaume Gomez
2c190ad0d2 Update block codes' flags 2016-08-19 16:44:29 +02:00
Scott A Carr
0ff128228f track Location in visitor, combine Location 2016-08-18 14:57:42 -04:00
Niko Matsakis
37d974f353 remove seemingly unnecessary call to encode_predicates 2016-08-17 15:21:59 -04:00
Niko Matsakis
6b33f47514 remove usize: DepGraphRead and add Untracked
The idea is that a `usize` is sort of ambiguous: in this case, it
represents indices that do not need tracking, but it could as easily be
some data read out from a tracked location, and hence represent tracked
data. Therefore, we add an `Untracked` type that lets user assert
that value is not tracked.

Also correct various typos.
2016-08-17 15:21:59 -04:00
Niko Matsakis
9daea5b639 Add a comment, remove Deref/DerefMut
The comment explains the `index-builder` pattern. We no longer need the
`Deref/DerefMut` relationship, and it seems nicer without it.
2016-08-17 15:21:59 -04:00
Niko Matsakis
1a91e67614 pacify the mercilous tidy 2016-08-17 15:21:59 -04:00
Niko Matsakis
f3990feb2e create a trait to ensure that data is tracked
Also write a comment explaining the system.
2016-08-17 15:21:58 -04:00
Niko Matsakis
00e699faf3 change callback for expr/type to a fn pointer
The idea is that, this way, we can cleanly isolate ALL state that is
being passed, since it goes as an argument to the fn pointer.
2016-08-17 15:21:45 -04:00
Niko Matsakis
c0c8ab9cd2 extract two more record calls 2016-08-17 15:21:45 -04:00
Niko Matsakis
8c4a224589 extract encode_info_for_trait_item into method 2016-08-17 15:21:45 -04:00
Niko Matsakis
8dc8151b49 pull out call to record for impl items 2016-08-17 15:21:44 -04:00
Niko Matsakis
9afcd77246 don't pass extra state fo encode_struct_ctor 2016-08-17 10:38:49 -04:00
Niko Matsakis
c716ad8af5 pull out encode_field 2016-08-17 10:38:49 -04:00
Niko Matsakis
f35196326d pull out code for encoding enum variants 2016-08-17 10:38:49 -04:00
Niko Matsakis
5166682583 pull out the record call for encode_info_for_item 2016-08-17 10:38:48 -04:00
Niko Matsakis
6277b1fef6 separate main items from addl items in metadata 2016-08-17 10:25:01 -04:00
Niko Matsakis
d49e1a9191 move rbml_w into the self struct 2016-08-17 10:25:01 -04:00
Niko Matsakis
baccdc01ae make record take a closure 2016-08-17 09:24:58 -04:00
Niko Matsakis
6b76932ba8 introduce Deref/DerefMut to model subtype rel
The idea is that ItemContentBuilder is a base-type of IndexBuilder.
2016-08-17 09:03:50 -04:00
Niko Matsakis
b2c7922d7f move free encode fns into methods of IndexBuilder 2016-08-17 09:03:50 -04:00
Niko Matsakis
92f269e665 put ecx into IndexBuilder so we don't have to pass 2016-08-17 08:03:50 -04:00
Niko Matsakis
25bb51d98f store ecx, not dep-graph 2016-08-17 07:51:12 -04:00
Niko Matsakis
85ac63e9ec rename CrateIndex to IndexBuilder 2016-08-17 07:51:12 -04:00
Niko Matsakis
b5fa8ab593 move CrateIndex into its own module 2016-08-17 07:39:11 -04:00
Eduard Burtescu
9453d9b8ad rustc: remove ParamSpace from Substs. 2016-08-17 06:32:00 +03:00
Eduard Burtescu
6f5e455c2d rustc: split GenericPredicates of a method from its parent predicates. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
3e74e5bffe rustc: split Generics of a method from its parent Generics. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
c1cfd58cbd rustc: remove SelfSpace from ParamSpace. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
4158673ad7 rustc: reduce Substs and Generics to a simple immutable API. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
4b25f08512 rustc: move trait objects from TraitRef to ExistentialTraitRef. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
c87063f07e rustc: avoid using subst::VecPerParamSpace::{empty,new} directly. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
77dc61b5c6 rustc: force all raw accesses to VecPerParamSpace through as_full_slice. 2016-08-17 05:50:57 +03:00
Eduard Burtescu
e314636b86 rustc: use Vec instead of VecPerParamSpace for ty::GenericPredicates. 2016-08-17 05:50:57 +03:00
bors
db7300d414 Auto merge of #35637 - japaric:no-builtins-lto, r=alexcrichton
exclude `#![no_builtins]` crates from LTO

this prevents intrinsics like `memcpy` from being mis-optimized to
infinite recursive calls when LTO is used.

fixes #31544
closes #35540

---

r? @alexcrichton
cc @Amanieu
2016-08-16 10:13:18 -07:00
bors
e25542cb02 Auto merge of #35162 - canndrew:bang_type_coerced, r=nikomatsakis
Implement the `!` type

This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.
2016-08-16 00:12:12 -07:00
bors
f65d96fe3f Auto merge of #35340 - michaelwoerister:incr-comp-cli-args, r=nikomatsakis
Take commandline arguments into account for incr. comp.

Implements the conservative strategy described in https://github.com/rust-lang/rust/issues/33727.

From now one, every time a new commandline option is added, one has to specify if it influences the incremental compilation cache. I've tried to implement this as automatic as possible: One just has to added either the `[TRACKED]` or the `[UNTRACKED]` marker next to the field. The `Options`, `CodegenOptions`, and `DebuggingOptions` definitions in `session::config` show plenty of examples.

The PR removes some cruft from `session::config::Options`, mostly unnecessary copies of flags also present in `DebuggingOptions` or `CodeGenOptions` in the same struct.

One notable removal is the `cfg` field that contained the values passed via `--cfg` commandline arguments. I chose to remove it because (1) its content is only a subset of what later is stored in `hir::Crate::config` and it's pretty likely that reading the cfgs from `Options` would not be what you wanted, and (2) we could not incorporate it into the dep-tracking hash of the `Options` struct because of how the test framework works, leaving us with a piece of untracked but vital data.

It is now recommended (just as before) to access the crate config via the `krate()` method in the HIR map.

Because the `cfg` field is not present in the `Options` struct any more, some methods in the `CompilerCalls` trait now take the crate config as an explicit parameter -- which might constitute a breaking change for plugin authors.
2016-08-15 08:35:18 -07:00
Jorge Aparicio
35eba85c3d refactor: use CStore::is_no_builtins 2016-08-14 21:56:26 -05:00
Eduard Burtescu
1bb1444516 Get rid of the .note interpretation of rustc dylib metadata. 2016-08-14 11:16:28 +03:00
Andrew Cann
fadabe08f5 Rename empty/bang to never
Split Ty::is_empty method into is_never and is_uninhabited
2016-08-13 21:37:09 +08:00
Andrew Cann
ed02344fbc Remove obsolete divergence related stuff
Replace FnOutput with Ty
Replace FnConverging(ty) with ty
Purge FnDiverging, FunctionRetTy::NoReturn and FunctionRetTy::None
2016-08-13 21:37:09 +08:00
Andrew Cann
0d863616e0 Add EmptyToAny adjustment 2016-08-13 21:37:09 +08:00
Andrew Cann
ba7330c1cc Start implementation of RFC 1216 (make ! a type)
Add `TyKind::Empty` and fix resulting build errors.
2016-08-13 21:37:09 +08:00
Eduard Burtescu
d92e594c38 typeck: record impl Trait concrete resolutions. 2016-08-12 06:43:34 +03:00