Amanieu d'Antras
3ef1f6f2c0
Add #[cfg(target_has_atomic)] to get atomic support for the current target
2017-03-02 14:57:31 -08:00
Brian Anderson
e6157ed9fe
doc: Update reference with better description of target_env
...
The definition of this value recently changed slightly. It no
longer corresponds directly to the target triple.
Also shuffled things around to make the order of cfg descriptions more
logical and added text related them to the target triple.
cc #33403
2017-03-02 14:57:31 -08:00
Aidan Hobson Sayers
72512746a6
Document heap allocation location guarantee
2017-03-02 14:57:30 -08:00
Ticki
d36fc2c127
Add support for naked functions
2017-03-02 14:57:30 -08:00
Steve Klabnik
fcafdb178a
Add other primitive types to the reference
...
Fixes #31628
2017-03-02 14:57:30 -08:00
NODA, Kai
c745c9090a
reference.md: clarify the limitation of type alias on an enum
...
Cf. rust-lang/rust#26264
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2017-03-02 14:57:30 -08:00
Kai Noda
60d1ec57b2
Clarify the semantics of enum discriminants
...
cf. https://doc.rust-lang.org/error-index.html#E0082
2017-03-02 14:57:30 -08:00
NODA, Kai
17f5fa364b
reference.md: clarify negation.
...
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2017-03-02 14:57:30 -08:00
Alex Burka
d4fcca9708
document inclusive range syntax
2017-03-02 14:57:30 -08:00
Alex Crichton
942ca02c33
std: Stabilize APIs for the 1.8 release
...
This commit is the result of the FCPs ending for the 1.8 release cycle for both
the libs and the lang suteams. The full list of changes are:
Stabilized
* `braced_empty_structs`
* `augmented_assignments`
* `str::encode_utf16` - renamed from `utf16_units`
* `str::EncodeUtf16` - renamed from `Utf16Units`
* `Ref::map`
* `RefMut::map`
* `ptr::drop_in_place`
* `time::Instant`
* `time::SystemTime`
* `{Instant,SystemTime}::now`
* `{Instant,SystemTime}::duration_since` - renamed from `duration_from_earlier`
* `{Instant,SystemTime}::elapsed`
* Various `Add`/`Sub` impls for `Time` and `SystemTime`
* `SystemTimeError`
* `SystemTimeError::duration`
* Various impls for `SystemTimeError`
* `UNIX_EPOCH`
* `ops::{Add,Sub,Mul,Div,Rem,BitAnd,BitOr,BitXor,Shl,Shr}Assign`
Deprecated
* Scoped TLS (the `scoped_thread_local!` macro)
* `Ref::filter_map`
* `RefMut::filter_map`
* `RwLockReadGuard::map`
* `RwLockWriteGuard::map`
* `Condvar::wait_timeout_with`
Closes #27714
Closes #27715
Closes #27746
Closes #27748
Closes #27908
Closes #29866
2017-03-02 14:57:30 -08:00
Aidan Hobson Sayers
c6d0c90e76
Add the 'T' present in the rust book
2017-03-02 14:57:30 -08:00
Katze
3847e76cd5
documentation fix
...
`continue` expression's description mentioned `break` instead of `continue`
Signed-off-by: benaryorg <binary@benary.org>
2017-03-02 14:57:29 -08:00
Georg Brandl
ced9df6e08
Document the null-char/null-byte escape in the reference
...
It appears in the examples, but is not covered by any of the cases
in the prose description.
2017-03-02 14:57:29 -08:00
Florian Hahn
c537ee0921
Capitalize some occurences of Rust in documentation
2017-03-02 14:57:29 -08:00
Aleksey Kladov
0cb66b02b5
reference: clarify use declaration location
2017-03-02 14:57:29 -08:00
Ivan Kozik
e9feea531b
reference: vtable entries: copy @nikomatsakis's wording
2017-03-02 14:57:29 -08:00
Ivan Kozik
cba3c5b998
reference: vtable entries are resolved at runtime
2017-03-02 14:57:29 -08:00
Tshepang Lekhonkhobe
e0b4b6502c
reference: make the line a little more readable
2017-03-02 14:57:29 -08:00
Tshepang Lekhonkhobe
a0bb93b8b9
reference: add trailing commas
2017-03-02 14:57:29 -08:00
Tshepang Lekhonkhobe
a37f734d90
reference: explicit return at function end is not idiomatic
2017-03-02 14:57:29 -08:00
Alex Crichton
ece4e96bf5
Remove "powerpc64le" and "mipsel" target_arch
...
Currently the `mipsel-unknown-linux-gnu` target doesn't actually set the
`target_arch` value to `mipsel` but it rather uses `mips`. Alternatively the
`powerpc64le` target does indeed set the `target_arch` as `powerpc64le`,
causing a bit of inconsistency between theset two.
As these are just the same instance of one instruction set, let's use
`target_endian` to switch between them and only set the `target_arch` as one
value. This should cut down on the number of `#[cfg]` annotations necessary and
all around be a little more ergonomic.
2017-03-02 14:57:28 -08:00
est31
52c119400d
Fix reference info about parent doc block comments
...
Block comments don't have to be in the format `/*! ... !*/`
in order to be read as doc comments about the parent block.
The format `/*! ... */` is enough.
2017-03-02 14:57:28 -08:00
Matt Brubeck
59b3d5e276
Fix examples that use missing_docs lint
...
The missing_docs lint only applies to public items in public modules, so this
example code did not actually generate any warnings or errors.
2017-03-02 14:57:28 -08:00
Steffen
56cdafb7a7
add feature gate "abi_vectorcall" for the vectorcall calling convention
2017-03-02 14:57:28 -08:00
Anton Blanchard
285207fcd2
Add powerpc64 and powerpc64le support
...
This adds support for big endian and little endian PowerPC64.
make check runs clean apart from one big endian backtrace issue.
2017-03-02 14:57:28 -08:00
Oliver 'ker' Schneider
de78a831fc
the reference was inferring values that didn't fit into their target type
2017-03-02 14:57:28 -08:00
Tobias Bucher
6ab905d932
Clarify how Rust treats backslashes at end of line in string literals
...
Rust differs in that behavior from C: In C, the newline escapes are resolved
before anything else, and in Rust this depends on whether the backslash is
escaped itself.
A difference can be observed in the following two programs:
```c
#include <stdio.h>
int main()
{
printf("\\
n\n");
return 0;
}
```
```rust
fn main() {
println!("\\
n");
}
```
The first program prints two newlines, the second one prints a backslash, a
newline, the latin character n and a final newline.
2017-03-02 14:57:28 -08:00
Vadim Petrochenkov
560935deff
Require exact type equality + add tests
...
+ Rebase fixes
2017-03-02 14:57:28 -08:00
Vadim Petrochenkov
63807192e3
Rewrite VisiblePrivateTypesVisitor
2017-03-02 14:57:27 -08:00
Vadim Petrochenkov
9996ef3878
Implement `#[deprecated]` attribute (RFC 1270)
2017-03-02 14:57:27 -08:00
Aleksey Kladov
79609695e5
DOCS: update reference about paths
2017-03-02 14:57:27 -08:00
Marvin Löbel
9b58070c50
Added stmt_expr_attribute feature gate
2017-03-02 14:57:27 -08:00
Vadim Petrochenkov
b547b2fa74
Remove `#[staged_api]`
2017-03-02 14:57:27 -08:00
Manish Goregaokar
283ceb5cc9
Update reference.md
2017-03-02 14:57:27 -08:00
Vadim Petrochenkov
856570d8b2
Rename #[deprecated] to #[rustc_deprecated]
2017-03-02 14:57:27 -08:00
Steve Klabnik
1b5ebd736f
Fix up escapes in the reference
...
Fixes #29470
2017-03-02 14:57:26 -08:00
Steve Klabnik
dd8d2f10e9
Clear up the reference around let
...
First, re-word the section on if let/while let to be more clear.
Second, actually call them let statements in the statement section
Fixes #29801
2017-03-02 14:57:26 -08:00
mdinger
ab88658f1b
Document block doc comments better
2017-03-02 14:57:26 -08:00
Daniel Trebbien
d2809fd217
reference: Remove struct_variant from Compiler Features
...
The struct_variant feature was accepted and is no longer feature gated.
See #19122 , #19124
§6.1.6 Enumerations shows an example of a struct-like enum variant.
2017-03-02 14:57:26 -08:00
Steve Klabnik
b1f34cdbb5
Beef up macro designator docs
...
Fixes #28824
2017-03-02 14:57:26 -08:00
Aleksey Kladov
bfbae649da
reference: clarify impl
...
Another kind of nominal types in Rust are trait objects, so the following is valid
```rust
trait A {
}
impl A {
}
```
2017-03-02 14:57:26 -08:00
Tshepang Lekhonkhobe
93dc100784
reference: 'struct' is more common that 'structure'
...
Shoud have been part of commit 0b13ee0ced39
2017-03-02 14:57:26 -08:00
Andrew Paseltiner
09ea36e36f
Correct spelling in docs
2017-03-02 14:57:25 -08:00
Tshepang Lekhonkhobe
b7deb2ed3b
reference: add link to the symbols
2017-03-02 14:57:25 -08:00
Seeker14491
d4e74a9719
Unhide some code from the Traits section
...
Having this code section hidden is misleading because it makes it look like implementing Circle for Foo automatically makes Foo implement Shape.
2017-03-02 14:57:25 -08:00
Vadim Petrochenkov
d42dbf2792
Test and gate empty structures and variants better
2017-03-02 14:57:25 -08:00
Kyle Robinson Young
31e0700af6
doc: fixing typos
2017-03-02 14:57:25 -08:00
Felix S. Klock II
2849dcd7f5
Non-parametric dropck; instead trust an unsafe attribute (RFC 1238).
...
Implement cannot-assume-parametricity (CAP) from RFC 1238, and add the
UGEH attribute.
----
Note that we check for the attribute attached to the dtor method, not
the Drop impl.
(This is just to match the specification of RFC and the tests; I am
not wedded to this approach.)
2017-03-02 14:57:25 -08:00
Tshepang Lekhonkhobe
9e5df6097f
reference: fix typos
2017-03-02 14:57:25 -08:00
Tshepang Lekhonkhobe
db2cda03c1
reference: Unsafe section does not fit under Functions
2017-03-02 14:57:24 -08:00
Simon Mazur
e2a100a310
docs: anchors fixes
2017-03-02 14:57:24 -08:00
Aleksey Kladov
4600ed89e5
reference: fix markdown formatting
2017-03-02 14:57:24 -08:00
Tshepang Lekhonkhobe
d913749858
reference: "ffi" is normally in upper case
2017-03-02 14:57:24 -08:00
Tshepang Lekhonkhobe
0e88336027
reference: make that less awkward to read
2017-03-02 14:57:24 -08:00
Steve Klabnik
7b7bd5fc32
Improve identifier defintion in the reference
...
Fixes #28706
2017-03-02 14:57:24 -08:00
Tshepang Lekhonkhobe
d16c687fd2
reference: it is sometimes called "the compiler" in this document
2017-03-02 14:57:24 -08:00
DenisKolodin
f9c49f1ceb
Typo fix in use declaration section of reference
2017-03-02 14:57:24 -08:00
Sebastian Wicki
9e17afda22
rustc: Add target_vendor for target triples
...
This adds a new target property, `target_vendor` which can be used as a
matcher for conditional compilation. The vendor is part of the autoconf
target triple: <arch><sub>-<vendor>-<os>-<env>
The default value for `target_vendor` is "unknown".
Matching against the `target_vendor` with `#[cfg]` is currently feature
gated as `cfg_target_vendor`.
2017-03-02 14:57:23 -08:00
Tshepang Lekhonkhobe
e08aa8af38
reference: rename "structure" to the more familiar "struct"
2017-03-02 14:57:23 -08:00
Tshepang Lekhonkhobe
7d65a7c75d
reference: not sure this is the right place to discuss design
2017-03-02 14:57:23 -08:00
Tshepang Lekhonkhobe
7e925a9db9
reference: fix anchor link
2017-03-02 14:57:23 -08:00
Tshepang Lekhonkhobe
796eae2601
reference: 3 of the 4 things mentioned here are optional
2017-03-02 14:57:23 -08:00
Tshepang Lekhonkhobe
a25a53755b
reference: follow idiom in code snippet
2017-03-02 14:57:23 -08:00
Vadim Petrochenkov
e34d9ff9cb
Add feature gate
2017-03-02 14:57:23 -08:00
Vadim Petrochenkov
deac1ba9d6
Add some more tests
2017-03-02 14:57:23 -08:00
Tshepang Lekhonkhobe
f20c725e14
reference: actual keywords feel more appropriate
2017-03-02 14:57:22 -08:00
Tshepang Lekhonkhobe
39e1da58b5
reference: mark that up to make it more clear it is a keyword
2017-03-02 14:57:22 -08:00
Tshepang Lekhonkhobe
5ce86d741f
doc: follow idiom in code snippet
2017-03-02 14:57:22 -08:00
Vadim Petrochenkov
82f3a7e173
Remove some remains of virtual structs from the parser
2017-03-02 14:57:22 -08:00
Tshepang Lekhonkhobe
98c9905df0
reference: using periods here is unusual
2017-03-02 14:57:22 -08:00
Tshepang Lekhonkhobe
e619fef7b4
reference: not comfortable seeing a paragraph starting with a lowercase letter
2017-03-02 14:57:22 -08:00
Tshepang Lekhonkhobe
867426f2a5
reference: format code snippets in an idiomatic manner
2017-03-02 14:57:22 -08:00
christopherdumas
9a083e1b18
Removed incorrect reference from #28196
2017-03-02 14:57:22 -08:00
Matt Brubeck
b255463e8a
Document the recursion_limit crate attribute
2017-03-02 14:57:22 -08:00
Corey Farwell
0baecb3a82
Use correct indefinite article in reference.md
2017-03-02 14:57:21 -08:00
Matt Brubeck
1080315a04
Include cfg(test) in the reference
2017-03-02 14:57:21 -08:00
Steve Klabnik
26cb7ad80f
add cfg(target_env) to the reference
...
Fixes #27587
2017-03-02 14:57:21 -08:00
Alex Crichton
1ca1a3f614
syntax: Add a new unstable #[linked_from] attribute
...
To correctly reexport statically included libraries from a DLL on Windows, the
compiler will soon need to have knowledge about what symbols are statically
included and which are not. To solve this problem a new unstable
`#[linked_from]` attribute is being added and recognized on `extern` blocks to
indicate which native library the symbols are coming from.
The compiler then keeps track of what the set of FFI symbols are that are
included statically. This information will be used in a future commit to
configure how we invoke the linker on Windows.
2017-03-02 14:57:21 -08:00
Steve Klabnik
eb19d9f70f
Add an example to Trait section of reference
...
Fixes #26115
2017-03-02 14:57:21 -08:00
Matt Friedman
cdc866eaac
add `meta` designator to macro reference
2017-03-02 14:57:21 -08:00
Tshepang Lekhonkhobe
9487a87f36
reference: follow idiom in this tiny snippet
2017-03-02 14:57:21 -08:00
Tshepang Lekhonkhobe
4c1241560b
reference: "those" feels misplaced there
...
Also, join the 2 sentences to improve flow
2017-03-02 14:57:21 -08:00
Jared Roesch
ff481fcf41
Add feature gate
2017-03-02 14:57:21 -08:00
Aidan Hobson Sayers
9dc78acf17
Note possiblities of empty extern blocks (based on #12575 )
2017-03-02 14:57:20 -08:00
Tshepang Lekhonkhobe
900b145e80
reference: miscellaneous fixes
2017-03-02 14:57:20 -08:00
Tshepang Lekhonkhobe
0eacc7a99f
reference: improve coercions section
2017-03-02 14:57:20 -08:00
Steven Allen
cfa8081166
Don't mention packed attribute in reference.md
2017-03-02 14:57:20 -08:00
Tshepang Lekhonkhobe
acc3424f06
reference: make 'Move and copied types' section more simple
2017-03-02 14:57:20 -08:00
Tshepang Lekhonkhobe
1b4665cbf8
reference: do not display the extra space
2017-03-02 14:57:20 -08:00
Tshepang Lekhonkhobe
9f4fc45349
reference: 'inherits' is more clear than 'implies'
2017-03-02 14:57:20 -08:00
Tshepang Lekhonkhobe
0ccce726cf
reference: remove stray comma
2017-03-02 14:57:20 -08:00
Tshepang Lekhonkhobe
5078953726
reference: improve examples of the different array types
2017-03-02 14:57:20 -08:00
Tshepang Lekhonkhobe
c28524e31d
reference: fix typo
2017-03-02 14:57:20 -08:00
Tshepang Lekhonkhobe
16a38e86c8
reference: improve lambda example
2017-03-02 14:57:19 -08:00
Tshepang Lekhonkhobe
dd82fcb88a
reference: tiny fixes
...
One is for grammar, and the other is for clarity
2017-03-02 14:57:19 -08:00
Tshepang Lekhonkhobe
d218edd315
reference: that looks like exclamations marks for some fonts
...
The sentences are also so short that they don't need periods at the end
2017-03-02 14:57:19 -08:00
Tshepang Lekhonkhobe
05ed1afb85
reference: make tuple usage examples more meaningful
2017-03-02 14:57:19 -08:00
Tshepang Lekhonkhobe
c9a97701a1
reference: improve readability of type inference explanations for float and integer types
2017-03-02 14:57:19 -08:00
Alex Newman
e9a61a5645
Add netbsd amd64 support
2017-03-02 14:57:19 -08:00
Alexis Beingessner
42b941a7a3
accessing private fields is not safe, and io isn't scary
2017-03-02 14:57:19 -08:00