Huon Wilson
19cb8f32d8
Check stability of struct fields.
...
We were recording stability attributes applied to fields in the
compiler, and even annotating it in the libs, but the compiler didn't
actually do the checks to give errors/warnings in user crates.
2015-02-26 16:26:34 +11:00
Keegan McAllister
65ea9110bd
Always error on invalid macro fragment specifiers
...
Fixes #21370 .
unused-macro-with-follow-violation.rs was already handled correctly. That test
is just for good measure. :)
2015-02-25 17:13:16 -08:00
bors
4db0b32467
Auto merge of #22796 - Manishearth:rollup, r=Manishearth
2015-02-25 20:32:58 +00:00
Manish Goregaokar
f164254392
Rollup merge of #22787 - pnkfelix:reenable-gate-for-unsafe_no_drop_flag, r=alexcrichton
...
Turn `unsafe_no_drop_flag` back into a gated-feature.
Fix #22173
2015-02-25 10:30:12 +05:30
Manish Goregaokar
9692f3bc94
Rollup merge of #22635 - kmcallister:macros-chapter, r=steveklabnik
...
r? @steveklabnik
2015-02-25 10:27:03 +05:30
Felix S. Klock II
5d7e283ead
Turn unsafe_no_drop_flag back into a gated-feature.
...
Fix #22173
2015-02-25 01:35:41 +01:00
Manish Goregaokar
24086987f9
Rollup merge of #22736 - nikomatsakis:issue-22382, r=eddyb
...
Apply borrowck to fns that appear in const declarations.
Fixes #22382 .
r? @eddyb
2015-02-25 03:21:43 +05:30
Manish Goregaokar
4ff8b8aa8f
Rollup merge of #22752 - ipetkov:unsafe-lint-fix, r=alexcrichton
...
This allows selectively disabling the lint for individual methods or traits.
2015-02-25 03:21:05 +05:30
Niko Matsakis
cf73e36ab0
Rework trait-bound-conversion so be based on the AST and rework collect
...
to pass in the appropriate ast::generics etc
2015-02-24 16:27:23 -05:00
Niko Matsakis
0d9e473be9
Comprehence cycle detection in collect. In some cases, the cycles we
...
report are not *necessary* cycles, but we'll work on refactoring them
over time. This overlaps with the cycle detection that astconv already
does: I left that code in because it gives a more targeted error
message, though perhaps less helpful in that it doesn't give the full
details of the cycle.
2015-02-24 16:27:22 -05:00
Eduard Burtescu
9ac073604c
Fix fallout from allowing impls outside of the type's definition module.
2015-02-24 14:16:02 +02:00
Eduard Burtescu
866a5ee299
Fix fallout from correct stability handling in UFCS.
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
fe4f9b8e3a
Use partial path resolutions in expressions for UFCS desugaring.
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
0f49254b31
rustc: use partially resolved definitions to replace the T::A hack.
2015-02-24 14:14:17 +02:00
Eduard Burtescu
5809f8ae74
rustc_resolve: use the visitor model more, remove redundant repeated lookups.
2015-02-24 14:14:16 +02:00
Eduard Burtescu
326711e9bd
rustc_resolve: use DefAssociatedTy for TyQPath.
2015-02-24 14:14:16 +02:00
Eduard Burtescu
9a69378e8b
rustc: load DefAssociatedTy from cross-crate metadata. Fixes #20542 .
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
Manish Goregaokar
89d5d2448d
Rollup merge of #22213 - eddyb:ty_open-case-closed, r=nikomatsakis
...
This type wasn't necessary, as there was no place using it and unsized types not wrapped in it, at the same time.
r? @nikomatsakis
2015-02-24 12:26:01 +05:30
Eduard Burtescu
3b0cafbcd7
tests: update expected recursion limit errors for the temporary lack of spans.
2015-02-24 08:40:15 +02:00
Manish Goregaokar
d7df353377
Rollup merge of #22580 - pnkfelix:guard-pat-cfg2, r=pnkfelix
...
aatch's cfg revisions, namely to match expressions
Revise handling of match expressions so that arms branch to next arm.
Update the graphviz tests accordingly.
Fixes #22073 . (Includes regression test for the issue.)
2015-02-24 12:08:35 +05:30
Manish Goregaokar
5676f6084b
Rollup merge of #22301 - nikomatsakis:object-safe-sized-methods, r=huonw
...
RFC 817 is not yet accepted, but I wanted to put this code up so people can see how it works. And to be ready lest it should be accepted.
cc rust-lang/rfcs#817
2015-02-24 12:08:35 +05:30
Manish Goregaokar
cf2c14f81b
Rollup merge of #22730 - ipetkov:lint-docs, r=alexcrichton
...
This is a breaking change if missing docs are forbidden in any module or crate.
I had to add documentation to undocumented associated types in libstd and libcore, please let me know if the documentation is inadequate anywhere!
Fixes #20648
2015-02-24 12:08:35 +05:30
Manish Goregaokar
eaacc7aad5
Rollup merge of #22632 - nagisa:kill-show-string-with-fire!, r=alexcrichton
...
Toss the tomatoes!
r? @aturon
Fixes #22478 . The underlying bug(?) behind that issue still exists though and there’s another issue that reports it.
2015-02-24 12:08:33 +05:30
Manish Goregaokar
47377904a1
Rollup merge of #22680 - FlaPer87:type_builtin, r=nikomatsakis
...
Fixes #20302
2015-02-24 12:08:21 +05:30
Ivan Petkov
fcf70230eb
Properly reimplement unsafe-code lint to honor changing lint attributes
2015-02-23 22:32:58 -08: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
Niko Matsakis
d443f98f22
Apply borrowck to fns that appear in const declarations.
...
Fixes #22382 .
2015-02-23 17:22:51 -05:00
Niko Matsakis
fd9f7da68e
Make traits with by-value-self be considered object safe.
2015-02-23 15:28:27 -05:00
Niko Matsakis
fe512dacc8
Remove awful hack concerning Trait impl Trait in method resolution code that I've been longing to remove for quite some time.
2015-02-23 15:28:27 -05:00
Niko Matsakis
8f5d225933
Extend object safety so that methods with Sized:Self are exempt.
2015-02-23 15:28:26 -05:00
Manish Goregaokar
3b69d1b941
Rollup merge of #22490 - nagisa:inline-args, r=alexcrichton
2015-02-23 11:43:58 -08:00
Manish Goregaokar
f1a6d67e5e
Rollup merge of #22544 - bombless:fix-pattern, r=pnkfelix
2015-02-23 11:43:57 -08:00
Manish Goregaokar
8f921502bd
Rollup merge of #22667 - dotdash:retslot_cast.rs, r=huonw
...
We already do this for the function arguments, but miss it for the
retslot pointer, which can lead to LLVM assertions because the retslot
has the wrong type.
Fixes #22663
2015-02-23 11:43:56 -08:00
Ivan Petkov
2e9521c126
Update missing-doc test to explicitly check errors
...
This way we can be sure the correct error is displayed for the
respective code type.
2015-02-23 11:33:52 -08:00
Ivan Petkov
717a91d665
Update missing-docs lint to check associated type declarations
...
[breaking-change]
Fixes #20648
2015-02-23 11:07:37 -08:00
Manish Goregaokar
af81ec2f43
Rollup merge of #22559 - kmcallister:borrowck-readme, r=nikomatsakis
...
And minor fixes to other docs.
r? @nikomatsakis
2015-02-23 23:28:46 +05:30
Flavio Percoco
7ff11d7be8
Unify lifetime/type arguments error messages for (non-)builtin bounds
2015-02-22 16:31:19 +01:00
Flavio Percoco
a1945197c3
continue when builtin bounds are registered
2015-02-22 16:31:19 +01:00
Ahmed Charles
3ebdbac265
Do not permit type parameters on builtin bounds.
2015-02-22 16:31:19 +01:00
Niko Matsakis
3dcc631dee
Add additional test case for superregion
2015-02-22 13:17:50 +01:00
Björn Steinbrink
b593c60c33
Add missing cast for retslots in case of "subtyping" due to trait bounds
...
We already do this for the function arguments, but miss it for the
retslot pointer, which can lead to LLVM assertions because the retslot
has the wrong type.
Fixes #22663
2015-02-22 12:47:27 +01:00
Simonas Kazlauskas
c9d0967383
Validate inline attribute arguments
2015-02-22 13:44:28 +02:00
James Miller
4bae133070
revise handling of match expressions so that arms branch to next arm.
...
Update the graphviz tests accordingly.
Fixes #22073 . (Includes regression test for the issue.)
(Factoring of aatch CFG code, Part 4.)
2015-02-22 12:43:08 +01:00
bors
dcc6ce2c77
Auto merge of #22574 - huonw:remove-lame-statics, r=alexcirchton
...
Add a basic test that checks that the types catch the most glaring
errors that could occur.
cc #22444
2015-02-22 10:27:08 +00:00
Flavio Percoco
753db88914
allow negative impls for traits that have a default impl
2015-02-22 02:14:27 +01:00
Flavio Percoco
d021c55fb9
Restore the coherence visitor and fix fallouts
2015-02-22 02:14:27 +01:00
Niko Matsakis
3343e9c169
Add new test for impl precedence and remove unnecessary coherence rules that prevent the test from compiling.
2015-02-22 02:14:27 +01:00