Commit Graph

38834 Commits

Author SHA1 Message Date
Niko Matsakis
2953710d26 Fallout: port libflate to new Unique API 2015-02-18 10:25:28 -05:00
Niko Matsakis
aaf4176f0f Fallout: Port slice to use PhantomData instead of ContravariantLifetime 2015-02-18 10:25:28 -05:00
Niko Matsakis
60f507be45 Fallout: remove unused type and region parameters. 2015-02-18 10:25:28 -05:00
Niko Matsakis
872ce47955 Fallout: tests. As tests frequently elide things, lots of changes
here.  Some of this may have been poorly rebased, though I tried to be
careful and preserve the spirit of the test.
2015-02-18 10:25:28 -05:00
Niko Matsakis
ef42c2befd Fallout: docs, elided examples often elided too much. 2015-02-18 10:25:13 -05:00
Niko Matsakis
d801a4da7c Fallout: iter, add markers or other changes such that all type parameters are used. 2015-02-18 10:25:12 -05:00
Niko Matsakis
1735e41d1c Fallout: AtomicPtr needs phantom data to indicate that it contains an unsafe pointer. 2015-02-18 10:25:12 -05:00
Niko Matsakis
2bcf3a4cd1 Fallout: arena needs to use phantomdata since invariantlifetime is gone 2015-02-18 10:25:12 -05:00
Niko Matsakis
8dbdcdbfb3 Fallout: RingBuf, use Unique. 2015-02-18 10:25:12 -05:00
Niko Matsakis
c2891cc487 Fallout: EnumSet, add Marker. 2015-02-18 10:25:12 -05:00
Niko Matsakis
68ebe640b6 Fallout: port btree to use Unique, some markers. 2015-02-18 10:25:12 -05:00
Niko Matsakis
b3c00a69f2 Fallout: btree. Rephrase invariant lifetime in terms of PhantomData. 2015-02-18 10:25:12 -05:00
Niko Matsakis
c5579ca340 Fallout: Port Vec to use Unique 2015-02-18 10:25:12 -05:00
Niko Matsakis
f2529ac10d Constrain operands to outlive the operation. Fixes #21422. 2015-02-18 10:25:12 -05:00
Niko Matsakis
801bc48939 Rewrite Unique<T> so that it is covariant in T, implies NonZero and ownership,
and also follows the API of `NonZero` a bit more closely. More to do
here I think (including perhaps a new name).
2015-02-18 10:25:12 -05:00
Niko Matsakis
8c841f2a31 Extend coherence check to understand subtyping. 2015-02-18 10:24:55 -05:00
Niko Matsakis
91eedfe18b Report errors for type parameters that are not constrained, either by
variance or an associated type.
2015-02-18 10:24:55 -05:00
Niko Matsakis
2594d56e32 Introduce the new phantomdata/phantomfn markers and integrate them
into variance inference; fix various bugs in variance inference
so that it considers the correct set of constraints; modify infer to
consider the results of variance inference for type arguments.
2015-02-18 10:24:55 -05:00
Niko Matsakis
362d713026 Fix remaining bench/debuginfo tests (and a few stragglers) 2015-02-18 09:11:02 -05:00
Niko Matsakis
72eb214ee4 Update suffixes en masse in tests using perl -p -i -e 2015-02-18 09:10:10 -05:00
Niko Matsakis
8c34b26606 Update docs by dropping suffixes except where they served to instruct. 2015-02-18 09:09:14 -05:00
Niko Matsakis
1f4ee20dda Tweak pretty printing. 2015-02-18 09:09:13 -05:00
Niko Matsakis
01615b04c6 Convert required suffixes into a use of as. 2015-02-18 09:09:13 -05:00
Niko Matsakis
2b5720a15f Remove i, is, u, or us suffixes that are not necessary. 2015-02-18 09:09:12 -05:00
Niko Matsakis
700c518f2a Modify parser to require isize/usize suffixes. 2015-02-18 09:07:56 -05:00
Felix S. Klock II
fc0f6e86b6 Audit core::intrinsics for int/uint: size_of/align_of use usize.
Likewise, `fn offset` takes an `isize`.
2015-02-18 14:45:35 +01:00
Felix S. Klock II
e240cb919b Audit core::default for int/uint usage.
* Use `i32` (`u32`) in doc examples, not `int` (`u32`).

* Switch impl macros to use `isize`/`usize` rather than `int`/`uint`.
2015-02-18 14:41:13 +01:00
Felix S. Klock II
343909bca1 Audit core::cmp for int/uint.
* cast 3-valued `core::cmp::Ordering` to `i32`, not `int`.

* use `isize`/`usize` in the impl macros.
2015-02-18 14:39:06 +01:00
Felix S. Klock II
f82e2310b3 Audit core::borrow for use of int/uint: use i32 in doc example. 2015-02-18 14:37:05 +01:00
Björn Steinbrink
7412d1b2ef Eliminate excessive null-checks from slice iterators
The data pointer used in the slice is never null, using assume() to tell
LLVM about it gets rid of various unneeded null checks when iterating
over the slice.

Since the snapshot compiler is still using an older LLVM version, omit
the call in stage0, because compile times explode otherwise.

Benchmarks from #18193
````
running 5 tests
test _range    ... bench:     33329 ns/iter (+/- 417)
test assembly  ... bench:     33299 ns/iter (+/- 58)
test enumerate ... bench:     33318 ns/iter (+/- 83)
test iter      ... bench:     33311 ns/iter (+/- 130)
test position  ... bench:     33300 ns/iter (+/- 47)

test result: ok. 0 passed; 0 failed; 0 ignored; 5 measured
````

Fixes #18193
2015-02-18 14:04:46 +01:00
Björn Steinbrink
52b5150cfd Avoid ptrtoint when checking if a pointer is null
Casting the pointer to an integer requires a ptrtoint, while casting 0
to a pointer is directly folded to a `null` value.
2015-02-18 14:04:46 +01:00
Huon Wilson
dfc5c0f1e8 Manual merge of #22475 - alexcrichton:rollup, r=alexcrichton
One windows bot failed spuriously.
2015-02-18 23:50:21 +11:00
Ryan Riginding
b8527c07dc Fixed link in ffi documentation 2015-02-18 09:16:22 +01:00
Alex Crichton
47f91a9484 Register new snapshots 2015-02-17 22:04:31 -08:00
Alex Crichton
665ea963d3 Test fixes and rebase conflicts 2015-02-17 19:42:28 -08:00
Alex Crichton
ba8ce4c2c2 rollup merge of #22319: huonw/send-is-not-static
Conflicts:
	src/libstd/sync/task_pool.rs
	src/libstd/thread.rs
	src/libtest/lib.rs
	src/test/bench/shootout-reverse-complement.rs
	src/test/bench/shootout-spectralnorm.rs
2015-02-17 17:32:16 -08:00
Alex Crichton
6ac3799b75 Test fixes and rebase conflicts 2015-02-17 17:27:46 -08:00
Alex Crichton
b283881dcc rollup merge of #22394: alexcrichton/vec-from-iter-comment
Requested by Niko in #22200 (and is good to have anyway)
2015-02-17 17:27:46 -08:00
Alex Crichton
d8450d69bb rollup merge of #22435: aturon/final-stab-thread
Conflicts:
	src/test/bench/rt-messaging-ping-pong.rs
	src/test/bench/rt-parfib.rs
	src/test/bench/task-perf-spawnalot.rs
2015-02-17 17:27:44 -08:00
Alex Crichton
c14cf4dc86 rollup merge of #22460: ArtemGr/patch-1
An "immutable reference-counted pointer" is confusing, one might think that the `Rc` itself is immutable which isn't the case.
cf. http://www.reddit.com/r/rust/comments/2w75wr/how_do_i_read_immutable_vector_inside_a_spawned/coo6mm2
2015-02-17 17:27:01 -08:00
Alex Crichton
d8ba8b00a7 rollup merge of #22459: alexcrichton/feature-names
Conflicts:
	src/rustbook/main.rs
2015-02-17 17:26:59 -08:00
Alex Crichton
c166fd3041 rollup merge of #22457: steveklabnik/gh22361
FIxes #22361
2015-02-17 17:26:45 -08:00
Alex Crichton
fd5403a37a rollup merge of #22456: steveklabnik/fix_grammar
Noticed in #22429
2015-02-17 17:26:44 -08:00
Alex Crichton
6d7a5e7094 rollup merge of #22455: msiemens/add-vec-from_elem
Implement `Vec::from_elem` by making the `vec![element; len]` macro more powerful (see rust-lang/rfcs#832).

Closes #22414

r? @Gankro
2015-02-17 17:26:44 -08:00
Alex Crichton
f10f7f52b0 rollup merge of #22454: alexcrichton/stabilize-into-iterator
Now that the necessary associated types exist for the `IntoIterator` trait this
commit stabilizes the trait as-is as well as all existing implementations.
2015-02-17 17:26:44 -08:00
Alex Crichton
d25d044a01 rollup merge of #22441: msiemens/typo_fix 2015-02-17 17:26:44 -08:00
Alex Crichton
f807b6a61e rollup merge of #22440: semarie/openbsd-connect_error
The `connect_error` test check if connecting to "0.0.0.0:1" works (it
shouldn't). And in case of error, the test expects a `ConnectionRefused`
error.

Under OpenBSD, trying to connect to "0.0.0.0" isn't a `ConnectionRefused`:
it is an `InvalidInput` error.

The patch allow the error to be `ConnectionRefused` or `InvalidInput`.

Another possibility is to check connecting to "127.0.0.1:1" and expects only `ConnectionRefused` error.
2015-02-17 17:26:44 -08:00
Alex Crichton
02c276175a rollup merge of #22332: dotdash/llvmup_20150213
Fixes the crash blocking #21886.
2015-02-17 17:26:43 -08:00
Alex Crichton
25ccf3c0da rollup merge of #22331: steveklabnik/guidelines
Fixes #19315

r? @aturon
2015-02-17 17:26:43 -08:00
Kevin Butler
d2f54e6634 librustc: implement Clone for middle::ty::FreeVar 2015-02-18 00:57:35 +00:00