Commit Graph

38712 Commits

Author SHA1 Message Date
Alex Crichton
386d329ac5 rollup merge of #22437: dotdash/fix_array_type
In trans_slice_vec we currently use arrayalloca, which gives us a
pointer to the element type with enough memory allocated for the
requested number of elements.  This works, but everywhere else we use
the [n x T] type for fixed size arrays and so we have to bitcast the
pointer here. Let's directly use the proper type for the allocation and
remove some code duplication along the way.
2015-02-18 14:31:59 -08:00
Alex Crichton
754db0f7ac rollup merge of #22436: nikomatsakis/issue-22246-bound-lifetimes-of-assoc-types
Take 2. This PR includes a bunch of refactoring that was part of an experimental branch implementing [implied bounds]. That particular idea isn't ready to go yet, but the refactoring proved useful for fixing #22246. The implied bounds branch also exposed #22110 so a simple fix for that is included here. I still think some more refactoring would be a good idea here -- in particular I think most of the code in wf.rs is kind of duplicating the logic in implicator and should go, but I decided to post this PR and call it a day before diving into that. I'll write a bit more details about the solutions I adopted in the various bugs. I patched the two issues I was concerned about, which was the handling of supertraits and HRTB (the latter turned out to be fine, so I added a comment explaining why.)

r? @pnkfelix (for now, anyway)
cc @aturon

[implied bounds]: http://smallcultfollowing.com/babysteps/blog/2014/07/06/implied-bounds/
2015-02-18 14:31:58 -08:00
Alex Crichton
31166ecf79 rollup merge of #22395: brson/readme-cleanup
Just a few things to make the README ever more perfect.

r? @steveklabnik
2015-02-18 14:31:57 -08:00
Alex Crichton
c07ec507e2 rollup merge of #22287: Ryman/purge_carthographers
This overlaps with #22276 (I left make check running overnight) but covers a number of additional cases and has a few rewrites where the clones are not even necessary.

This also implements `RandomAccessIterator` for `iter::Cloned`

cc @steveklabnik, you may want to glance at this before #22281 gets the bors treatment
2015-02-18 14:31:55 -08:00
Alex Crichton
c5fddd81ab rollup merge of #22118: fhahn/separate-parse-fail-2
After making `rustc` fail on errors at a stop point, like `-Z parse-only`, in #22117, the files in this PR also fail during the parse stage and should be moved as well. Sorry for spliting this move up in two PRs.
2015-02-18 14:31:23 -08:00
Alex Crichton
fa30c4f147 rollup merge of #21886: dotdash/fast_slice_iter
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:31:21 -08:00
Brian Anderson
c273571bfd Remove mention of wiki from README 2015-02-18 13:48:46 -08:00
Brian Anderson
7430e58e65 Address review feedback 2015-02-18 13:46:55 -08:00
Brian Anderson
73cc4ed4da README: Simplify markdown 2015-02-18 13:46:55 -08:00
Brian Anderson
aaabdbfe04 README: Add one sentence about what Rust is.
Most people don't know what Rust is.
2015-02-18 13:46:55 -08:00
Brian Anderson
46189559a9 README: Add a link to #rust 2015-02-18 13:46:55 -08:00
Brian Anderson
9265e13867 README: Make the wiki links more useful.
The page we want them to find is 'getting started developing'.
2015-02-18 13:46:55 -08:00
Brian Anderson
21ed20baf9 README: Give a hint about how to build Cargo from source.
Just a hint.
2015-02-18 13:46:55 -08:00
Brian Anderson
4acc483106 Simplify README by not talking about the source tarball option
I believe that few enough people build from source tarballs that
we don't have to talk about it explicitly.
2015-02-18 13:46:55 -08:00
Niko Matsakis
9bb3b3772d Add rustc_attrs feature to test. 2015-02-18 15:24:20 -05:00
Niko Matsakis
a994a99ec4 Always prefer where-clauses over impls in trait selection. Fixes #22110. 2015-02-18 15:23:34 -05:00
Niko Matsakis
2939e483fd Extend the implicator so it produces general obligations and also so
that it produces "outlives" relations for associated types. Add
several tests relating to #22246.
2015-02-18 15:23:34 -05:00
Niko Matsakis
5511add742 traits: break apart the "full normalization" code used for normalizing
parameter environments so that it can be used elsewhere.
2015-02-18 15:23:34 -05:00
Niko Matsakis
7134ad4d64 Move tcx from Typer into ClosureTyper 2015-02-18 15:23:34 -05:00
Niko Matsakis
e84a719e37 Misc. cleanup in regionck: Remove a one-variant enum for some reason. 2015-02-18 15:23:34 -05:00
Niko Matsakis
48c70d6863 Replace assert_no_late_bound_regions with
`no_late_bound_regions().unwrap()`, which allows us to write code that
doesn't necessarily *fail* when there are higher-ranked trait bounds.
2015-02-18 15:23:34 -05:00
Niko Matsakis
92d65ab2e9 Rename various things to "implications" 2015-02-18 15:23:33 -05:00
Niko Matsakis
df92fe3c96 Rename regionmanip to implicator. 2015-02-18 15:23:33 -05: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
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
Kevin Butler
061206b9c7 Remove usage of .map(|&foo| foo) 2015-02-18 00:57:35 +00:00
Kevin Butler
2f586b9687 Opt for .cloned() over .map(|x| x.clone()) etc. 2015-02-18 00:56:07 +00:00
Kevin Butler
5705d48e28 Implement RandomAccessIterator for Cloned 2015-02-18 00:56:07 +00:00
Huon Wilson
7a14f4994e Update tests for the Send - 'static change. 2015-02-18 11:27:51 +11:00
Alex Crichton
95a28c9bbd std: Add Vec::from_iter comment
Requested by Niko in #22200 (and is good to have anyway)
2015-02-17 15:23:41 -08:00
Aaron Turon
d0de2b46e9 Fallout from stabilization 2015-02-17 15:14:17 -08:00
Alex Crichton
eca2453a02 rollup merge of #22208: aturon/expose-more-path
This commit exposes the `is_sep` function and `MAIN_SEP` constant, as
well as Windows path prefixes. The path prefix enum is safely exposed on
all platforms, but it only yielded as a component for Windows.

Exposing the prefix enum as part of prefix components involved changing
the type from `OsStr` to the `Prefix` enum, which is a:

[breaking-change]
2015-02-17 15:13:53 -08:00