Jared Roesch
79d02895ff
Begin refactor type checking state
...
This first patch starts by moving around pieces of state related to
type checking. The goal is to slowly unify the type checking state
into a single typing context. This initial patch moves the
ParameterEnvironment into the InferCtxt and moves shared tables
from Inherited and ty::ctxt into their own struct Tables. This
is the foundational work to refactoring the type checker to
enable future evolution of the language and tooling.
2015-06-27 13:43:20 -07:00
Eduard Burtescu
ad66c215aa
rustc: switch most remaining middle::ty functions to methods.
2015-06-26 07:34:57 +03:00
Eli Friedman
3c69db4c3c
Cleanup: rename middle::ty::sty and its variants.
...
Use camel-case naming, and use names which actually make sense in modern Rust.
2015-06-12 11:07:16 -07:00
Joshua Landau
d7f5fa4636
Conver reborrows to .iter() calls where appropriate
2015-06-11 13:56:07 +01:00
Eduard Burtescu
76eaed44d9
syntax: move ast_map to librustc.
2015-06-10 02:40:45 +03:00
Alex Crichton
0e21beb761
libs: Move favicon URLs to HTTPS
...
Helps prevent mixed content warnings if accessing docs over HTTPS.
Closes #25459
2015-05-15 16:04:01 -07:00
Carol Nichols
7ec8172225
Update old uses of ~ in comments and debugging statements
2015-05-03 20:16:02 -04:00
Sean Patrick Santos
7129e8815e
Functional changes for associated constants. Cross-crate usage of associated constants is not yet working.
2015-04-23 21:02:26 -06:00
Sean Patrick Santos
b5499775d6
Structural changes for associated constants
...
Introduces new variants and types in syntax::ast, middle::ty, and middle::def.
2015-04-23 21:02:25 -06:00
Tamir Duberstein
10f15e72e6
Negative case of len()
-> is_empty()
...
`s/([^\(\s]+\.)len\(\) [(?:!=)>] 0/!$1is_empty()/g`
2015-04-14 20:26:03 -07:00
bors
926f38e588
Auto merge of #23998 - nrc:impl-self, r=nikomatsakis
...
Closes #23909
r? @nikomatsakis (or anyone else, really)
2015-04-08 09:58:05 +00:00
Jonathan S
3cbc345cf7
In librustc*, convert many uses of ast::Ident to ast::Name, fixing much of #6993 .
2015-04-03 17:46:08 -05:00
Nick Cameron
dc8a8e9beb
Check uses of Self
in impls in the compiler rather than during expansion
...
Closes #23909
2015-04-03 22:47:53 +13:00
Manish Goregaokar
5eb4be4c56
Rollup merge of #23803 - richo:unused-braces, r=Manishearth
...
Pretty much what it says on the tin.
2015-03-28 18:12:06 +05:30
Richo Healey
cbce6bfbdb
cleanup: Remove unused braces in use statements
2015-03-28 02:23:20 -07:00
Alex Crichton
43bfaa4a33
Mass rename uint/int to usize/isize
...
Now that support has been removed, all lingering use cases are renamed.
2015-03-26 12:10:22 -07:00
Niko Matsakis
8e58af4004
Fallout in stdlib, rustdoc, rustc, etc. For most maps, converted uses of
...
`[]` on maps to `get` in rustc, since stage0 and stage1+ disagree about
how to use `[]`.
2015-03-23 16:55:45 -04:00
Nick Cameron
46aa621452
Fix private module loophole in the 'private type in public item' check
2015-03-18 16:47:24 +13:00
Eduard Burtescu
9da918548d
syntax: move MethMac to MacImplItem and combine {Provided,Required}Method into MethodTraitItem.
2015-03-11 23:39:16 +02:00
Eduard Burtescu
ce10fa8d12
syntax: rename TypeMethod to MethodSig and use it in MethDecl.
2015-03-11 23:39:16 +02:00
Eduard Burtescu
f98b176314
syntax: gather common fields of impl & trait items into their respective types.
2015-03-11 23:39:16 +02:00
Eduard Burtescu
98491827b9
syntax: move indirection around {Trait,Impl}Item, from within.
2015-03-11 23:39:15 +02:00
Manish Goregaokar
2fcdd824ef
Rollup merge of #23056 - awlnx:master, r=nrc
2015-03-06 22:22:33 +05:30
awlnx
951ef9d1f1
fix for new attributes failing. issue #22964
2015-03-05 11:53:51 -05:00
Jorge Aparicio
ac84af24db
privacy: walk associated types in trait impls
2015-03-03 01:28:20 -05:00
Huon Wilson
eafdc7135b
Record the publicity of struct fields and enum variants.
...
The stability check checks the `PublicItems` map when giving errors if
there is a #[stable] item with a public contents that doesn't not have
its own stability. Without recording this, struct fields and enum
variants will not get errors for e.g. stable modules with unmarked
functions internally.
This is just improving the compiler's precision to give the standard
library developers more information earlier.
E.g.
#![staged_api]
#![feature(staged_api)]
#![crate_type = "lib"]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct Foo {
pub x: i32
}
#[stable(feature = "rust1", since = "1.0.0")]
pub mod bar {
pub fn baz() {}
}
Without the patch it gives:
test.rs:12:5: 12:20 error: This node does not have a stability attribute
test.rs:12 pub fn baz() {}
^~~~~~~~~~~~~~~
error: aborting due to previous error
With the patch it gives:
test.rs:7:9: 7:15 error: This node does not have a stability attribute
test.rs:7 pub x: i32
^~~~~~
test.rs:12:5: 12:20 error: This node does not have a stability attribute
test.rs:12 pub fn baz() {}
^~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
2015-02-26 16:26:34 +11:00
Eduard Burtescu
866a5ee299
Fix fallout from correct stability handling in UFCS.
2015-02-24 14:16:02 +02:00
Eduard Burtescu
d31b9ebef5
Implement <T>::method
UFCS expression syntax.
2015-02-24 14:16:02 +02:00
Eduard Burtescu
5a6a9ed792
rustc: combine partial_def_map and last_private_map into def_map.
2015-02-24 14:16:02 +02:00
Eduard Burtescu
06f362aeb3
rustc_resolve: don't handle impl items as if they were modules.
2015-02-24 14:16:01 +02:00
Eduard Burtescu
7a3054f55c
rustc_resolve: remove the distinction between DefStaticMethod and DefMethod.
2015-02-24 14:14:17 +02:00
Eduard Burtescu
ffb8092ccf
syntax: use a single Path for Trait::Item in QPath.
2015-02-24 14:14:16 +02:00
Eduard Burtescu
004df413aa
syntax: don't use TraitRef in QPath.
2015-02-24 14:14:16 +02:00
Eduard Burtescu
a817c69297
syntax: don't store a secondary NodeId for TyPath.
2015-02-24 14:14:16 +02:00
Eduard Burtescu
27747ac1a7
Revert bogus rename from DefTrait to DefaultImpl.
2015-02-24 14:14:16 +02:00
bors
2890508d97
Auto merge of #21689 - FlaPer87:oibit-send-and-friends, r=nikomatsakis
...
This is one more step towards completing #13231
This series of commits add support for default trait implementations. The changes in this PR don't break existing code and they are expected to preserve the existing behavior in the compiler as far as built-in bounds checks go.
The PR adds negative implementations of `Send`/`Sync` for some types and it removes the special cases for `Send`/`Sync` during the trait obligations checks. That is, it now fully relies on the traits check rather than lang items.
Once this patch lands and a new snapshot is created, it'll be possible to add default impls for `Send` and `Sync` and remove entirely the use of `BuiltinBound::{BoundSend,BoundSync}` for positive implementations as well.
This PR also removes the restriction on negative implementations. That is, it is now possible to add negative implementations for traits other than `Send`/`Sync`
2015-02-24 02:22:44 +00:00
Flavio Percoco
d38aab397e
Rename DefTrait to DefaultImpl
2015-02-22 02:14:25 +01:00
Flavio Percoco
4148d5361a
Fix fallout from libsyntax implementation
2015-02-22 02:14:24 +01:00
Niko Matsakis
68e5bb3f2c
Remove remaining uses of []
. This time I tried to use deref coercions where possible.
2015-02-20 14:08:14 -05:00
Niko Matsakis
9ea84aeed4
Replace all uses of &foo[]
with &foo[..]
en masse.
2015-02-18 17:36:03 -05:00
Felix S. Klock II
0a0aa11bb1
Add comment noting that this naive approach is not too naive.
2015-02-10 15:45:36 +01:00
Felix S. Klock II
0b1d5f0182
Make FRU respect privacy of all struct fields, mentioned or unmentioned.
...
This is RFC 736.
Fix #21407 .
2015-02-10 15:29:29 +01:00
Jorge Aparicio
571cc7f8e9
remove all kind annotations from closures
2015-02-04 20:06:08 -05:00
Jorge Aparicio
d5d7e6565a
for x in xs.iter()
-> for x in &xs
2015-02-02 13:40:18 -05:00
Alex Crichton
3a2530d611
Test fixes and rebase conflicts
...
Also some tidying up of a bunch of crate attributes
2015-01-30 14:53:34 -08:00
Brian Anderson
5a6fb8eb98
Merge remote-tracking branch 'rust-lang/master'
...
Conflicts:
src/librustc/lint/builtin.rs
src/librustc/lint/context.rs
2015-01-26 15:42:32 -08:00
Eduard Burtescu
11ef6f1349
Remove "unboxed" attribute in code referring to new closures.
2015-01-26 04:15:09 +02:00
Brian Anderson
63fcbcf3ce
Merge remote-tracking branch 'rust-lang/master'
...
Conflicts:
mk/tests.mk
src/liballoc/arc.rs
src/liballoc/boxed.rs
src/liballoc/rc.rs
src/libcollections/bit.rs
src/libcollections/btree/map.rs
src/libcollections/btree/set.rs
src/libcollections/dlist.rs
src/libcollections/ring_buf.rs
src/libcollections/slice.rs
src/libcollections/str.rs
src/libcollections/string.rs
src/libcollections/vec.rs
src/libcollections/vec_map.rs
src/libcore/any.rs
src/libcore/array.rs
src/libcore/borrow.rs
src/libcore/error.rs
src/libcore/fmt/mod.rs
src/libcore/iter.rs
src/libcore/marker.rs
src/libcore/ops.rs
src/libcore/result.rs
src/libcore/slice.rs
src/libcore/str/mod.rs
src/libregex/lib.rs
src/libregex/re.rs
src/librustc/lint/builtin.rs
src/libstd/collections/hash/map.rs
src/libstd/collections/hash/set.rs
src/libstd/sync/mpsc/mod.rs
src/libstd/sync/mutex.rs
src/libstd/sync/poison.rs
src/libstd/sync/rwlock.rs
src/libsyntax/feature_gate.rs
src/libsyntax/test.rs
2015-01-25 01:20:55 -08:00
Brian Anderson
cd6d9eab5d
Set unstable feature names appropriately
...
* `core` - for the core crate
* `hash` - hashing
* `io` - io
* `path` - path
* `alloc` - alloc crate
* `rand` - rand crate
* `collections` - collections crate
* `std_misc` - other parts of std
* `test` - test crate
* `rustc_private` - everything else
2015-01-23 13:28:40 -08:00
Brian Anderson
d3c0bb416e
Put #[staged_api] behind the 'staged_api' gate
2015-01-22 13:47:56 -08:00
Brian Anderson
41278c5441
Remove 'since' from unstable attributes
2015-01-21 19:25:55 -08:00
Brian Anderson
7b73ec4698
Tie stability attributes to feature gates
2015-01-21 16:16:21 -08:00
Brian Anderson
94ca8a3610
Add 'feature' and 'since' to stability attributes
2015-01-21 16:16:18 -08:00
Eduard Burtescu
cfb63d5448
rustc: fix fallout of merging ast::ViewItem into ast::Item.
2015-01-21 16:27:26 +02:00
Alex Crichton
3121c04043
Fix typedef/module name conflicts in the compiler
2015-01-18 18:26:34 -08:00
Brian Anderson
8b2335a01d
Add allow(unstable) to librustc_privacy
2015-01-17 16:38:04 -08:00
Alex Crichton
8115222607
rustc_resolve: Correctly record privacy of methods
...
Loading methods from external crates was erroneously using the type's privacy
for each method instead of each method's privacy. This commit fixes that.
Closes #21202
2015-01-16 08:39:56 -08:00
Alex Crichton
a9decbdc44
rustc: Move the privacy pass to its own crate
2015-01-16 08:38:24 -08:00