Lance Roy
94301c405c
Additional traits for std::mem::ManuallyDrop
...
Add pass-through implementations for all of the derivable traits. These
cannot be derived since ManuallyDrop is a union.
2017-09-04 02:29:16 -07:00
Lance Roy
6276dbd953
Derive std::mem::ManuallyDrop from Clone and Copy.
...
Although types that don't implement Drop can't be Copyable, this can
still be useful when ManuallyDrop is used inside a generic type. This
doesn't derive from Copy as that would require T: Copy + Clone, instead
it provides an impl of Clone for T: Clone.
2017-09-04 01:00:15 -07:00
bors
0006d3e01c
Auto merge of #44263 - durka:stabilize-discriminant, r=dtolnay
...
stabilize mem::discriminant (closes #24263 )
2017-09-03 21:32:29 +00:00
Eh2406
f65bb2a051
Manuall rebase of @Migi pull/41336
2017-09-03 09:12:22 -04:00
Ariel Ben-Yehuda
291b4eddce
add error message for the other case too
2017-09-03 13:10:54 +03:00
Ariel Ben-Yehuda
efa09ea554
on_unimplemented: add method-name checks and use them in Try
2017-09-03 13:10:54 +03:00
Ariel Ben-Yehuda
6dec953c5a
address review comments
2017-09-03 13:10:54 +03:00
Ariel Ben-Yehuda
02b3ae63e2
enable desugaring-sensitive error messages and use them in Try
...
Maybe I should allow error messages to check the *specific* desugaring?
Thanks @huntiep for the idea!
2017-09-03 13:10:54 +03:00
MarkMcCaskey
570ae39973
Merge branch 'master' of git://github.com/rust-lang/rust
2017-09-02 17:01:34 -04:00
Alex Burka
d516434981
stabilize mem::discriminant ( closes #24263 )
2017-09-02 01:59:54 -04:00
Jimmy Cuadra
93a56cdacd
impl From<Infallible> for TryFromIntError.
2017-09-01 01:57:05 -07:00
Jimmy Cuadra
36c0ff8690
Reword docs for Infallible to make them easier to understand.
2017-09-01 00:26:37 -07:00
Jacob Kiesel
2e34ff7671
Fix documentation and formatting.
2017-09-01 00:07:26 -06:00
Mark
e572d85e00
Merge branch 'master' into master
2017-08-31 12:49:48 -04:00
Alex Crichton
2972687d10
Update bootstrap compiler
...
This commit updates the bootstrap compiler and clears out a number
of #[cfg(stage0)] annotations and related business
2017-08-31 06:58:58 -07:00
MarkMcCaskey
1d69c985be
update unimplemented! docs
2017-08-30 22:26:54 -04:00
Alex Crichton
c0812c8458
Rollup merge of #44160 - AndyGauge:api-docs-macros, r=steveklabnik
...
API docs: macros. Standard Documentation Checklist
Fixes #29381
r? @steveklabnik
2017-08-30 13:17:05 -07:00
Chris Stankus
e15a07ad64
Remove Borrow bound from SliceExt::binary_search
2017-08-30 12:02:25 -05:00
Jimmy Cuadra
414ee9a254
Remove test case that assumes FromStr provides TryFrom<&'a str>.
...
See https://travis-ci.org/rust-lang/rust/jobs/269861252
2017-08-30 04:43:09 -07:00
Jimmy Cuadra
b0edfce950
Implement TryFrom explicitly for infallible numeric conversions.
...
See https://github.com/rust-lang/rust/pull/44174#discussion_r135982787
2017-08-30 04:42:25 -07:00
bors
c66e7fa8de
Auto merge of #43903 - oli-obk:alignto, r=aturon
...
Add align_offset intrinsic
see https://github.com/rust-lang/rfcs/pull/2043 for details and the plan towards stabilization (reexport in `core::mem` via various convenience functions)
as per @scottmcm 's [comment](https://github.com/rust-lang/rfcs/pull/2043#issuecomment-316818169 ), this is just the intrinsic (which is obviously unstable).
2017-08-30 08:06:42 +00:00
Jimmy Cuadra
80e3f8941d
Add blanket TryFrom impl when From is implemented.
...
Adds `impl<T, U> TryFrom<T> for U where U: From<T>`.
Removes `impl<'a, T> TryFrom<&'a str> for T where T: FromStr` due to
overlapping impls caused by the new blanket impl. This removal is to
be discussed further on the tracking issue for TryFrom.
Refs #33417 .
2017-08-29 22:13:21 -07:00
Ariel Ben-Yehuda
be0ac0124c
Rollup merge of #44158 - dtolnay:zero48, r=sfackler
...
Use a byte literal ASCII 0 instead of its decimal value
@SimonSapin noticed this in https://github.com/dtolnay/itoa/pull/8 .
2017-08-29 21:41:04 +00:00
Ariel Ben-Yehuda
11e75fd115
Rollup merge of #43705 - panicbit:option_ref_mut_cloned, r=aturon
...
libcore: Implement cloned() for Option<&mut T>
None
2017-08-29 21:40:53 +00:00
Andy Gauge
b9b654924e
API docs: macros. Part of #29329 Standard Library Documentation Checklist.
2017-08-29 10:30:19 -07:00
David Tolnay
4312ed765a
Use a byte literal ASCII 0 instead of its decimal value
2017-08-29 10:01:12 -07:00
John Kåre Alsaker
d29af37999
Merge branch 'master' of https://github.com/rust-lang/rust into gen
2017-08-28 02:41:16 +02:00
Tatsuyuki Ishi
611b111139
Move unused-extern-crate to late pass
2017-08-27 19:02:24 +09:00
Jacob Kiesel
c589f867f8
Add clamp functions
2017-08-26 10:21:17 -06:00
Corey Farwell
7e8753d1c1
Rollup merge of #44072 - lukaramu:fix-doc-headings, r=steveklabnik
...
Fix inconsistent doc headings
This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574.
r? @steveklabnik
2017-08-26 06:46:34 -07:00
Tamir Duberstein
b3f50caee0
*: remove crate_{name,type} attributes
...
Fixes #41701 .
2017-08-25 16:18:21 -04:00
Alex Crichton
c872f47276
Merge remote-tracking branch 'origin/master' into gen
2017-08-25 07:15:12 -07:00
bors
ba65645c78
Auto merge of #44031 - scottmcm:swap_with_slice, r=alexcrichton
...
Add [T]::swap_with_slice
The safe version of a method from `ptr`, like `[T]::copy_from_slice` is.
Tracking issue: https://github.com/rust-lang/rust/issues/44030
2017-08-25 10:20:15 +00:00
lukaramu
49ee9f3f08
Fix inconsistent doc headings
...
This fixes headings reading "Unsafety" and "Example", they should be
"Safety" and "Examples" according to RFC 1574.
2017-08-24 18:42:53 +02:00
Oliver Schneider
be96ad2c85
Update intrinsics.rs
2017-08-22 12:48:20 +02:00
Scott McMurray
c4cb2d1f2e
Add [T]::swap_with_slice
...
The safe version of a method from ptr, like [T]::copy_from_slice
2017-08-21 22:20:00 -07:00
Alex Crichton
04c66c30a7
Merge remote-tracking branch 'origin/master' into gen
2017-08-21 21:47:07 -07:00
bors
942711e115
Auto merge of #43690 - scalexm:issue-28229, r=nikomatsakis
...
Generate builtin impls for `Clone`
This fixes a long-standing ICE and limitation where some builtin types implement `Copy` but not `Clone` (whereas `Clone` is a super trait of `Copy`).
However, this PR has a few side-effects:
* `Clone` is now marked as a lang item.
* `[T; N]` is now `Clone` if `T: Clone` (currently, only if `T: Copy` and for `N <= 32`).
* `fn foo<'a>() where &'a mut (): Clone { }` won't compile anymore because of how bounds for builtin traits are handled (e.g. same thing currently if you replace `Clone` by `Copy` in this example). Of course this function is unusable anyway, an error would pop as soon as it is called.
Hence, I'm wondering wether this PR would need an RFC...
Also, cc-ing @nikomatsakis, @arielb1.
Related issues: #28229 , #24000 .
2017-08-22 01:34:54 +00:00
Alex Crichton
b31998ec93
Merge remote-tracking branch 'origin/master' into gen
2017-08-21 10:41:56 -07:00
Oliver Schneider
1dc3a2b5fa
Add align_offset intrinsic
...
see https://github.com/rust-lang/rfcs/pull/2043 for details
2017-08-21 15:57:21 +02:00
bors
c1111dfcac
Auto merge of #43996 - shanavas786:fix-typo, r=frewsxcv
...
Fix typo in doc
2017-08-20 15:58:05 +00:00
bors
3d9f57a292
Auto merge of #43978 - GuillaumeGomez:missing-links, r=frewsxcv
...
Missing links
r? @rust-lang/docs
2017-08-20 13:28:18 +00:00
Shanavas M
ee3463eb7f
Fix typo in doc
2017-08-20 11:07:42 +03:00
Corey Farwell
aac3008d12
Minor Iterator::filter_map description rewording.
...
Fixes https://github.com/rust-lang/rust/issues/39294 .
2017-08-18 21:19:30 -04:00
Guillaume Gomez
a5a1739945
Add missing urls for Result struct
2017-08-18 16:48:07 +02:00
Alex Crichton
4b5f330c70
Merge remote-tracking branch 'origin/master' into gen
2017-08-17 13:23:20 -07:00
Corey Farwell
58f3041eca
Rollup merge of #43928 - anthonyclays:anthonyclays-refcell-docfix, r=QuietMisdreavus
...
Fixed typo in RefCell::get_mut
"[...] is usually not you want." => "[...] is usually not what you want."
2017-08-17 10:44:14 -04:00
Corey Farwell
1512e44c17
Rollup merge of #43905 - partim:master, r=steveklabnik
...
Document that `std:#️⃣ :Hasher::finish()` does not reset the hasher.
Clarifies the fact that `finish()` doesn’t in fact end or reset the hasher. This was surprising to me …
Follows up on and fixes #43763
2017-08-17 10:44:08 -04:00
Corey Farwell
a4387d54dc
Rollup merge of #43891 - Fourchaux:master, r=steveklabnik
...
Fix typos & us spellings
Fixing some typos and non en-US spellings.
(Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-17 10:44:07 -04:00
Anthony Clays
fa346fc5d6
Fixed typo in RefCell::get_mut
2017-08-17 10:57:17 +02:00