Commit Graph

44529 Commits

Author SHA1 Message Date
Andrew Paseltiner
b684826cab add test for #20162
closes #20162
2015-07-19 15:39:26 -04:00
bors
58fb9b5c2d Auto merge of #27100 - tshepang:better-names, r=Gankro 2015-07-19 16:33:43 +00:00
bors
cb87ea80a6 Auto merge of #27111 - AlisdairO:diagnostics253, r=Manishearth
As per topic :-).

Part of #24407.
r? @Manishearth
2015-07-19 14:06:22 +00:00
bors
3b8acb7386 Auto merge of #27101 - steveklabnik:doc_no_mutability_root, r=Gankro
And some other outdated language. @echochamber came asking about these docs
on IRC today, and they're a bit weird. I've updated them to be less ambiguous
and use contemporary terminology.
2015-07-19 12:31:35 +00:00
bors
266428845d Auto merge of #27099 - AlisdairO:diagnostics3, r=Manishearth
Per the title.  I've linked to the reference at http://doc.rust-lang.org/reference.html#type-parameters-1, but I'm not sure that's such a good link - but there doesn't seem to be a great deal of explanation elsewhere in the reference either...
2015-07-19 09:01:20 +00:00
Alisdair Owens
4ea02b72b7 replace word function with method 2015-07-19 09:59:43 +01:00
bors
6b10efcc8b Auto merge of #27121 - apasel422:issue-21332, r=Gankro
closes #21332
2015-07-19 07:26:24 +00:00
Tshepang Lekhonkhobe
ef2f4cd40a doc: use 'index' and 'value' in place of 'i' and 't' 2015-07-19 08:33:03 +02:00
bors
86fa65bcc5 Auto merge of #27122 - nham:tweak-cow-docs, r=Gankro
It seems slightly more consistent to say 'Clones' here instead of 'Copies'. The docs for the `ToOwned` trait talk about cloning and not copying.
2015-07-19 04:56:33 +00:00
Nick Hamann
f257a1501f 'Copies' => 'Clones' in Cow method docs.
It seems slightly more consistent to say 'Clones' here instead of 'Copies'.
The docs for the `ToOwned` trait talk about cloning and not copying.
2015-07-18 22:54:55 -05:00
Andrew Paseltiner
7d984ef6df split "has incompatible type for trait" errors into multiple lines
closes #21332
2015-07-18 21:14:36 -04:00
bors
9d460c5517 Auto merge of #27117 - apasel422:issue-14821, r=Gankro
closes #14821
2015-07-18 22:41:29 +00:00
Andrew Paseltiner
5f280db9fa add test for #14821
closes #14821
2015-07-18 17:40:15 -04:00
Alisdair Owens
44f29fbdbc oops, forgot to fix method name 2015-07-18 20:46:47 +01:00
Alisdair Owens
91f0301aa5 Fix to 80 char width, change to single space after period 2015-07-18 20:34:12 +01:00
Alisdair Owens
56b450b291 fix up crate/trait discrepancy, clarify language 2015-07-18 20:26:08 +01:00
Alisdair Owens
f78333e052 Add details on PhantomData 2015-07-18 18:42:00 +01:00
Alisdair Owens
6c74779a5c Add diagnostics for E0253 2015-07-18 17:25:29 +01:00
bors
a27fed7cbd Auto merge of #27096 - apasel422:issue-26217, r=nikomatsakis
closes #26217

r? @nikomatsakis
2015-07-18 11:02:58 +00:00
bors
e0e1859819 Auto merge of #27088 - tamird:fix-ios-build, r=alexcrichton
Fixes #26939.
2015-07-18 08:25:10 +00:00
bors
3f50dca386 Auto merge of #27085 - Ryman:gh17546, r=alexcrichton
This also changes how variant values are printed in errors, they are no
longer printed in their parent scope. As far as I can tell, this is
leftover from pre-namespacing of enums.

Closes #17546.
2015-07-18 06:02:50 +00:00
bors
81b6b91e83 Auto merge of #27074 - steveklabnik:gh27014, r=alexcrichton
Fixes #27014 

r? @alexcrichton 

I'm not 100% sure there's not a better way to do this, but it works.

Also, I wasn't sure how, where, or if to write a test for this.
2015-07-18 03:42:01 +00:00
bors
e58601ab08 Auto merge of #26955 - Gankro:raw-vec, r=bluss,alexcrichton
Per the top level comment:

A low-level utility for more ergonomically allocating, reallocating, and deallocating a
a buffer of memory on the heap without having to worry about all the corner cases
involved. This type is excellent for building your own data structures like Vec and VecDeque.
In particular:

* Produces heap::EMPTY on zero-sized types
* Produces heap::EMPTY on zero-length allocations
* Catches all overflows in capacity computations (promotes them to "capacity overflow" panics)
* Guards against 32-bit systems allocating more than isize::MAX bytes
* Guards against overflowing your length
* Aborts on OOM
* Avoids freeing heap::EMPTY
* Contains a ptr::Unique and thus endows the user with all related benefits

This type does not in anyway inspect the memory that it manages. When dropped it *will*
free its memory, but it *won't* try to Drop its contents. It is up to the user of RawVec
to handle the actual things *stored* inside of a RawVec.

Note that a RawVec always forces its capacity to be usize::MAX for zero-sized types.
This enables you to use capacity growing logic catch the overflows in your length
that might occur with zero-sized types.

However this means that you need to be careful when roundtripping this type
with a `Box<[T]>`: `cap()` won't yield the len. However `with_capacity`,
`shrink_to_fit`, and `from_box` will actually set RawVec's private capacity
field. This allows zero-sized types to not be special-cased by consumers of
this type.

Edit: 
fixes #18726 and fixes #23842
2015-07-17 23:58:52 +00:00
Steve Klabnik
72dbbeef50 Remove confusing 'mutability root' term
And some other outdated language. @echochamber came asking about these docs
on IRC today, and they're a bit weird. I've updated them to be less ambiguous
and use contemporary terminology.
2015-07-17 18:50:42 -04:00
bors
5df259b9da Auto merge of #27098 - Manishearth:rollup, r=Manishearth
- Successful merges: #26777, #27067, #27071, #27081, #27091, #27094, #27095
- Failed merges:
2015-07-17 22:27:37 +00:00
Manish Goregaokar
8638dc7f9a nit 2015-07-18 03:06:35 +05:30
Manish Goregaokar
1f0564b337 Rollup merge of #27095 - tshepang:space, r=alexcrichton 2015-07-18 08:13:16 +05:30
Manish Goregaokar
fdc39cd50d Rollup merge of #27094 - tamird:DRY-search-focus, r=brson
Following up on comment from #26977.

r? @brson
2015-07-18 08:13:16 +05:30
Manish Goregaokar
99987a82b6 Rollup merge of #27091 - steveklabnik:doc_tests_glob, r=Gankro
Globs used to be a feature you'd turn on, but now they're not, so this sounds
a bit odd.
2015-07-18 08:13:16 +05:30
Manish Goregaokar
2ea87785be Rollup merge of #27081 - rick68:patch-15, r=alexcrichton
improve the 'Unsafety' section of `collections::vec::Vec::<T>::from_raw_parts`.
2015-07-18 08:13:16 +05:30
Manish Goregaokar
00653da41a Rollup merge of #27071 - AlisdairO:diagnostics, r=Manishearth
Added some detailed diagnostics for E0364 and E0365.
2015-07-18 08:13:15 +05:30
Manish Goregaokar
1cf11cc04e Rollup merge of #27067 - GuillaumeGomez:patch-1, r=cmr
Now the macro argument list can be finished by a comma (not sure this is correct english...).

cc @tamird
r? @bluss
2015-07-18 08:13:15 +05:30
Manish Goregaokar
22aa16334c Rollup merge of #26777 - barosl:macro-doc-escapes, r=pnkfelix
Escape sequences in documentation comments must not be parsed as a normal string when expanding a macro, otherwise some innocent but invalid-escape-sequence-looking comments will trigger an ICE.

Although this commit replaces normal string literals with raw string literals in macro expansion, this shouldn't be much a problem considering documentation comments are converted into attributes before being passed to a macro anyways.

Fixes #25929.
Fixes #25943.
2015-07-18 08:13:15 +05:30
Alisdair Owens
ea79264ee4 Add diagnostics for E0392 2015-07-17 22:20:53 +01:00
Alisdair Owens
94b1ca8448 Write diagnostics for E0364 and E0365 2015-07-17 21:05:51 +01:00
Andrew Paseltiner
d088db99a7 clarify that T does not contain 'a 2015-07-17 16:02:43 -04:00
Andrew Paseltiner
27188bbefe treat for<'a> T: 'a as T: 'static
closes #26217
2015-07-17 15:41:34 -04:00
Tshepang Lekhonkhobe
02ae661cfd doc: add missing space 2015-07-17 20:55:11 +02:00
bors
e05ac3938b Auto merge of #27045 - nikomatsakis:better-object-defaults-error, r=pnkfelix
Transition to the new object lifetime defaults, replacing the old defaults completely.

r? @pnkfelix 

This is a [breaking-change] as specified by [RFC 1156][1156] (though all cases that would break should have been receiving warnings starting in Rust 1.2). Types like `&'a Box<Trait>` (or `&'a Rc<Trait>`, etc) will change from being interpreted as `&'a Box<Trait+'a>` to `&'a Box<Trait+'static>`. To restore the old behavior, write the `+'a` explicitly. For example, the function:


```rust
trait Trait { }
fn foo(x: &Box<Trait>) { ... }
```

would be rewritten as:

```rust
trait Trait { }
fn foo(x: &'a Box<Trait+'a>) { ... }
```

if one wanted to preserve the current typing.

[1156]: https://github.com/rust-lang/rfcs/blob/master/text/1156-adjust-default-object-bounds.md
2015-07-17 18:35:50 +00:00
Tamir Duberstein
b3a9cd3a69 DRY 2015-07-17 14:35:09 -04:00
Alexis Beingessner
b0ee1ebef4 fix pretty printers to handle new Vec 2015-07-17 10:43:58 -07:00
Steve Klabnik
d0e1b06fc0 Clean up some wording around globs.
Globs used to be a feature you'd turn on, but now they're not, so this sounds
a bit odd.
2015-07-17 13:15:06 -04:00
bors
d4432b3737 Auto merge of #27076 - alexcrichton:update-llvm, r=brson
LLVM has recently created their 3.7 release branch, and this PR updates us to that point. This should hopefully mean that we're basically compatible with the upcoming 3.7 release. Additionally, there are a number of goodies on this branch.

* This contains a fix for https://llvm.org/bugs/show_bug.cgi?id=23957
  which should help us bootstrap farther on 32-bit MSVC targets.
* There is better support for writing multiple flavors of archives, allowing us
  to use the built-in LLVM support instead of the system `ar` on all current
  platforms of the compiler.
* This LLVM has SafeStack support
* An [optimization patch](7cf5e26e18) by @pcwalton is included.
* A number of other minor test fixes here and there.

Due to problems dealing with the data layout we pass to LLVM, this PR also takes the time to clean up how we specific this. We no longer specify a data layout to LLVM by default and instead take the default for the target from LLVM to pass to the module that we're building. This should be more robust going into the future, and I'm also not sure we know what any of these arcane strings are any more...
2015-07-17 16:18:52 +00:00
Tamir Duberstein
5f9a1dfa7e [ios] std: avoid result::fold 2015-07-17 11:54:02 -04:00
Alexis Beingessner
bfa0e1f58a Add RawVec to unify raw Vecish code 2015-07-17 08:29:15 -07:00
Alex Crichton
6d96edfe16 test: Ignore a failing test on LLDB
Re-enabling it is tracked in #27089
2015-07-17 08:28:08 -07:00
Alex Crichton
81d128b968 Merge branch 'generic-enum-disr-fix' of https://github.com/michaelwoerister/rust into update-llvm 2015-07-17 08:24:11 -07:00
Kevin Butler
b416762a5f Improve error message for variant values used as types
This also changes how variant values are printed in errors, they are no
longer printed in their parent scope. As far as I can tell, this is
leftover from pre-namespacing of enums.

Closes #17546.
2015-07-17 15:24:02 +01:00
bors
b5dad7dcb2 Auto merge of #27082 - Manishearth:rollup, r=Manishearth
- Successful merges: #25993, #27038, #27069, #27070, #27080
- Failed merges: #27034, #27064
2015-07-17 10:26:31 +00:00
Manish Goregaokar
ed8b7ea83e Rollup merge of #27080 - soderstroff:kristof-patch, r=Gankro
I fixed a single character typo.
r? @steveklabnik
2015-07-17 15:56:12 +05:30