Commit Graph

46081 Commits

Author SHA1 Message Date
Niko Matsakis
ad700abea4 ty.rs: document/cleanup required_region_bounds a bit 2015-08-12 17:58:58 -04:00
Niko Matsakis
fda9b83960 regionck.rs: add a delayed_span_bug call to validate an asserrtion 2015-08-12 17:58:58 -04:00
Niko Matsakis
213326cddd outlives.rs: correct typo 2015-08-12 17:58:58 -04:00
Niko Matsakis
c106dd449c traits/error_reporting.rs: always note obligation cause 2015-08-12 17:58:58 -04:00
Niko Matsakis
157422a0c7 Update test error messages based on changes to wfcheck; also, break
apart the tests that tested many things at once.
2015-08-12 17:58:58 -04:00
Niko Matsakis
2b2a113638 check/wf.rs: change to use correct span and older WF algorithm;
at the time I reinstituted the old code, I hadn't given up yet and
brought back the implicator.
2015-08-12 17:58:58 -04:00
Niko Matsakis
a7c9a15e0e outlives.rs: remove use of ty.walk and replace with recursive of
ty.walk_shallow, add add'l comments.
2015-08-12 17:58:58 -04:00
Niko Matsakis
a264440ab0 outlives: convert outlives to use an exhaustive match, for better
reliability.
2015-08-12 17:58:57 -04:00
Niko Matsakis
9c5cfea43d traits: consider whether origin is RFC1214 when caching, ensuring
that the test rfc1214-warn-and-error.rs reports an error
2015-08-12 17:58:57 -04:00
Niko Matsakis
fb1b6fca36 regionck.rs: correct misuse of ty.regions() rather than regions()
and add a test that was (incorrectly) failing to compile with
existing code
2015-08-12 17:58:57 -04:00
Niko Matsakis
c9a49f93ac regionck.rs: remove dead fn type_strictly_outlives 2015-08-12 17:58:57 -04:00
Niko Matsakis
9c3a8664b6 middle/outlives.rs: s/temp/subcomponents/ 2015-08-12 17:58:57 -04:00
Niko Matsakis
0582fed63f middle/outlives.rs: fix typo 2015-08-12 17:58:57 -04:00
Niko Matsakis
b7e849bf6a infer/mod.rs: add doc comment to RFC1214 variant 2015-08-12 17:58:57 -04:00
Niko Matsakis
ff39ee9a90 wip 082a011e2bd5c8254e6c1b2fdc97a6fcb2927a7f rm binary 2015-08-12 17:58:57 -04:00
Niko Matsakis
7ed39c6d9b Fallout in tests -- explain an interesting test failure having to
do with dropck and the new outlives rules
2015-08-12 17:58:57 -04:00
Niko Matsakis
dee8b54b71 Fallout in tests --- misc error message changes, WF fixes 2015-08-12 17:58:57 -04:00
Niko Matsakis
f4aaedb51e Fallout in tests -- break test into a run-pass and compile-fail component 2015-08-12 17:58:56 -04:00
Niko Matsakis
532fcb250f Fallout in tests -- break this test into three tests, since we later saw
staging differences in terms of when errors were reported
2015-08-12 17:58:56 -04:00
Niko Matsakis
92d16d961d Fallout in tests -- break the object safety part into a separate file because error
will be in future reported by wfcheck, which runs in a later stage than
coherence
2015-08-12 17:58:56 -04:00
Niko Matsakis
09bf2fef22 Fallout in tests -- we now report an error if you even reference a type
`&Foo` where `Foo` is a trait that is not object-safe
2015-08-12 17:58:56 -04:00
Niko Matsakis
d15d743fa8 Add FIXME for apparent stage0 regression 2015-08-12 17:58:56 -04:00
Niko Matsakis
91b3e9cac0 Fallout in libs -- misc missing bounds uncovered by WF checks. 2015-08-12 17:58:56 -04:00
Niko Matsakis
788a802dad New tests --- projection outlives relation 2015-08-12 17:58:22 -04:00
Niko Matsakis
d159977502 Generalize the outlives rule for projections to handle the new cases;
also, generalize VerifyBounds to include OR conditions.
2015-08-12 17:58:22 -04:00
Niko Matsakis
75ee8f1562 Introduce a "origin/cause" for new requirements (or bugfixes...) introduced by RFC 1214,
and issue a warning (and explanatory note) when we encounter such a
thing.
2015-08-12 17:58:22 -04:00
Niko Matsakis
39d164d042 New tests --- check that wf relation is being checked in various positions 2015-08-12 17:57:58 -04:00
Niko Matsakis
6bb1e22911 New WF condition requires checking that argument types are WF
on every call. This ensures that implies bounds are reasonable
(the older code only checked that the values provided had WF types, but
we also must know that the formal types of the arguments are WF.)
2015-08-12 17:57:58 -04:00
Niko Matsakis
8d98877112 Implement a new wfcheck to replace the old wf; this new code only issues
warnings. It also checks more conditions than the old code.  Keep the
old wf code around unchanged so that we can continue to issue errors for
the cases where we used to report errors.

As part of this, remove the where-clauses-must-reference-parameter rule,
which is easily circumvented.
2015-08-12 17:57:58 -04:00
Niko Matsakis
ad47bd8a0f Extend ParameterEnvironment to remember the free_id, and to be usable
on more kind of items
2015-08-12 17:57:57 -04:00
Niko Matsakis
b1963154a1 Add two new kinds of predicates, WellFormed and ObjectSafe. 2015-08-12 17:57:57 -04:00
Niko Matsakis
928955296e Define the wf and outlives relation separately, unlike the existing
`implicator`. These definitions are also in accordance with RFC 1214 (or
more so), and hence somewhat different from the implicator. This commit
also modifies the implicator to remove the older rules for projections,
which can easily trigger infinite loops.
2015-08-12 17:57:57 -04:00
Niko Matsakis
4561607403 Don't report a hard error if there are inference failures until
after we check casts, because sometimes casts can influence inference,
unfortunately. We do re-run `select_all_trait_obligations` during
regionck anyhow.
2015-08-12 17:57:57 -04:00
Alex Crichton
8d90d3f368 Remove all unstable deprecated functionality
This commit removes all unstable and deprecated functions in the standard
library. A release was recently cut (1.3) which makes this a good time for some
spring cleaning of the deprecated functions.
2015-08-12 14:55:17 -07:00
bors
6a5c4e77a8 Auto merge of #27691 - jonas-schievink:for-macro, r=alexcrichton
Closes #27004
2015-08-12 20:58:31 +00:00
Alisdair Owens
b7e009b386 Add long diagnostics for E0366 and E0367 2015-08-12 20:50:49 +01:00
bors
d07d465cf6 Auto merge of #27690 - vadimcn:no-windres, r=alexcrichton
Fix #26803
2015-08-12 19:13:52 +00:00
mitaa
d81feb85f7 Remove duplicated path_to_string conversion 2015-08-12 20:22:52 +02:00
mitaa
f357d559ca Replace get_item_path[-1] with get_item_name 2015-08-12 20:22:25 +02:00
bors
8b5948d5bf Auto merge of #27688 - alexcrichton:rollup, r=alexcrichton 2015-08-12 17:07:11 +00:00
Ariel Ben-Yehuda
1dd0c058cf stop cross-crate associated types from being imported
Fixes #22968
Probably fixes #27602
2015-08-12 19:58:32 +03:00
Alex Ozdemir
e09f83ea44 O(1) count,nth,last for slice::Windows,Chunks(Mut)
Implemented count, nth, and last in constant time for Windows, Chunks,
and ChunksMut created from a slice.

Included checks for overflow in the implementation of nth().

Also added a test for each implemented method to libcoretest.

Addresses #24214
2015-08-12 08:34:51 -07:00
Simonas Kazlauskas
646eace6ec Fix ReentrantMutex documentation wrt DerefMut
Initial version of PR had an DerefMut implementation, which was later removed
because it may cause mutable reference aliasing.

Suggest how to implement mutability with reentrant mutex and remove the claim we
implement DerefMut.
2015-08-12 17:00:58 +03:00
bors
81c9ff24fe Auto merge of #27630 - sylvestre:master, r=dotdash 2015-08-12 12:47:22 +00:00
Robin Kruppe
15518a9c0c Mention that the fast path is broken without SSE. 2015-08-12 11:09:56 +02:00
Jonas Schievink
a016dfb1d1 Fix macro expansion in for loop pattern 2015-08-12 10:34:14 +02:00
bors
2b45a0d908 Auto merge of #27618 - dotdash:drop_fixes, r=luqmana 2015-08-12 08:13:35 +00:00
Tim Neumann
2d4e07edb5 Fix #23808: dead_code lint: visit types in paths 2015-08-12 08:22:08 +02:00
Vadim Chugunov
31be146ba0 Fix #26803 2015-08-11 23:20:19 -07:00
Björn Steinbrink
d17d2dd48e Workaround ODR violations in enum debuginfo
When using a generic enum type that was defined in an external crate,
our debuginfo currently claims that the concrete type (e.g. Option<i32>)
was defined in the current crate, where it was first used.

This means that if there are multiple crates that all use, for example,
Option<i32> values, they'll have conflicting debuginfo, each crate
claiming to have defined that type. This doesn't cause problems in
regular builds, but with LTO enabled, LLVM complains because it tries to
merge the debuginfo for those types and sees the ODR violations.

Since I couldn't find a way to get the file info for the external crate
that actually defined the enum, I'm working around the issue by using
"<unknown>" as the file for enum types. We'll want to re-visit and fix
this later, but this at least this fixes the ICE. And with the file
being unknown instead of wrong, the debuginfo isn't really worse than
before either.

Fixes #26447
2015-08-12 07:42:31 +02:00