Skip to content

Commit 4dfa3b9

Browse files
committed
---
yaml --- r: 210166 b: refs/heads/try c: 899d418 h: refs/heads/master v: v3
1 parent 7300141 commit 4dfa3b9

File tree

188 files changed

+5237
-7937
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+5237
-7937
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: aecf3d8b659c1f5bc457a5a146357ba484e27346
5+
refs/heads/try: 899d4180ef052c3bd7598d18ad1e5af0bc57fc88
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/configure

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,14 +544,13 @@ fi
544544
BOOL_OPTIONS=""
545545
VAL_OPTIONS=""
546546

547-
opt debug 0 "debug mode; disables optimization unless \`--enable-optimize\` given"
547+
opt debug 0 "debug mode"
548548
opt valgrind 0 "run tests with valgrind (memcheck by default)"
549549
opt helgrind 0 "run tests with helgrind instead of memcheck"
550550
opt valgrind-rpass 1 "run rpass-valgrind tests with valgrind"
551551
opt docs 1 "build standard library documentation"
552552
opt compiler-docs 0 "build compiler documentation"
553553
opt optimize-tests 1 "build tests with optimizations"
554-
opt debuginfo-tests 0 "build tests with debugger metadata"
555554
opt libcpp 1 "build with llvm with libc++ instead of libstdc++ when using clang"
556555
opt llvm-assertions 0 "build LLVM with assertions"
557556
opt debug-assertions 0 "build with debugging assertions"

branches/try/mk/tests.mk

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -632,13 +632,6 @@ ifndef CFG_DISABLE_OPTIMIZE_TESTS
632632
CTEST_RUSTC_FLAGS += -O
633633
endif
634634

635-
# Analogously to the above, whether to pass `-g` when compiling tests
636-
# is a separate choice from whether to pass `-g` when building the
637-
# compiler and standard library themselves.
638-
CTEST_RUSTC_FLAGS := $$(subst -g,,$$(CTEST_RUSTC_FLAGS))
639-
ifdef CFG_ENABLE_DEBUGINFO_TESTS
640-
CTEST_RUSTC_FLAGS += -g
641-
endif
642635

643636
CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
644637
--compile-lib-path $$(HLIB$(1)_H_$(3)) \

branches/try/src/doc/grammar.md

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -176,15 +176,9 @@ excluded from the `ident` rule.
176176

177177
```antlr
178178
lit_suffix : ident;
179-
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit | bool_lit ] lit_suffix ?;
179+
literal : [ string_lit | char_lit | byte_string_lit | byte_lit | num_lit ] lit_suffix ?;
180180
```
181181

182-
The optional `lit_suffix` production is only used for certain numeric literals,
183-
but is reserved for future extension. That is, the above gives the lexical
184-
grammar, but a Rust parser will reject everything but the 12 special cases
185-
mentioned in [Number literals](reference.html#number-literals) in the
186-
reference.
187-
188182
#### Character and string literals
189183

190184
```antlr
@@ -244,9 +238,7 @@ dec_lit : [ dec_digit | '_' ] + ;
244238

245239
#### Boolean literals
246240

247-
```antlr
248-
bool_lit : [ "true" | "false" ] ;
249-
```
241+
**FIXME:** write grammar
250242

251243
The two values of the boolean type are written `true` and `false`.
252244

@@ -305,7 +297,7 @@ transcriber : '(' transcriber * ')' | '[' transcriber * ']'
305297

306298
```antlr
307299
item : mod_item | fn_item | type_item | struct_item | enum_item
308-
| const_item | static_item | trait_item | impl_item | extern_block ;
300+
| static_item | trait_item | impl_item | extern_block ;
309301
```
310302

311303
### Type Parameters
@@ -377,10 +369,6 @@ path_item : ident | "mod" ;
377369

378370
**FIXME:** grammar?
379371

380-
### Enumerations
381-
382-
**FIXME:** grammar?
383-
384372
### Constant items
385373

386374
```antlr

branches/try/src/doc/not_found.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,8 @@ function populate_rust_search() {
5757

5858
// #18540, use a single token
5959

60-
var a = document.createElement("a");
61-
a.href = "http://doc.rust-lang.org/core/?search=" + encodeURIComponent(lt);
62-
a.textContent = lt;
6360
var search = document.getElementById('core-search');
64-
search.innerHTML = "";
65-
search.appendChild(a);
61+
search.innerHTML = "<a href=\"http://doc.rust-lang.org/core/?search=" + lt + "\">" + lt + "</a>";
6662
}
6763
populate_site_search();
6864
populate_rust_search();

branches/try/src/doc/reference.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Non-doc comments are interpreted as a form of whitespace.
103103

104104
## Whitespace
105105

106-
Whitespace is any non-empty string containing only the following characters:
106+
Whitespace is any non-empty string containing any the following characters:
107107

108108
- `U+0020` (space, `' '`)
109109
- `U+0009` (tab, `'\t'`)
@@ -130,6 +130,11 @@ of tokens, that immediately and directly denotes the value it evaluates to,
130130
rather than referring to it by name or some other evaluation rule. A literal is
131131
a form of constant expression, so is evaluated (primarily) at compile time.
132132

133+
The optional suffix is only used for certain numeric literals, but is
134+
reserved for future extension, that is, the above gives the lexical
135+
grammar, but a Rust parser will reject everything but the 12 special
136+
cases mentioned in [Number literals](#number-literals) below.
137+
133138
#### Examples
134139

135140
##### Characters and strings
@@ -1557,8 +1562,7 @@ warnings are generated, or otherwise "you used a private item of another module
15571562
and weren't allowed to."
15581563

15591564
By default, everything in Rust is *private*, with one exception. Enum variants
1560-
in a `pub` enum are also public by default. You are allowed to alter this
1561-
default visibility with the `priv` keyword. When an item is declared as `pub`,
1565+
in a `pub` enum are also public by default. When an item is declared as `pub`,
15621566
it can be thought of as being accessible to the outside world. For example:
15631567

15641568
```
@@ -1892,8 +1896,8 @@ release builds.
18921896

18931897
There are two kinds of configuration options, one that is either defined or not
18941898
(`#[cfg(foo)]`), and the other that contains a string that can be checked
1895-
against (`#[cfg(bar = "baz")]`). Currently, only compiler-defined configuration
1896-
options can have the latter form.
1899+
against (`#[cfg(bar = "baz")]` (currently only compiler-defined configuration
1900+
options can have the latter form).
18971901

18981902
```
18991903
// The function is only included in the build when compiling for OSX

branches/try/src/doc/trpl/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ vector. When we try to compile this program, we get an error:
127127

128128
```text
129129
error: cannot borrow `x` as mutable because it is also borrowed as immutable
130-
x.push("foo");
130+
x.push(4);
131131
^
132132
note: previous borrow of `x` occurs here; the immutable borrow prevents
133133
subsequent moves or mutable borrows of `x` until the borrow ends

branches/try/src/doc/trpl/benchmark-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn add_two(a: i32) -> i32 {
1313
}
1414
1515
#[cfg(test)]
16-
mod tests {
16+
mod test {
1717
use super::*;
1818
use test::Bencher;
1919

branches/try/src/doc/trpl/casting-between-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ what it does is very simple, but very scary. It tells Rust to treat a value of
4343
one type as though it were another type. It does this regardless of the
4444
typechecking system, and just completely trusts you.
4545

46-
[intrinsics]: intrinsics.html
46+
[intrinsic]: intrinsics.html
4747

4848
In our previous example, we know that an array of four `u8`s represents a `u32`
4949
properly, and so we want to do the cast. Using `transmute` instead of `as`,

branches/try/src/doc/trpl/inline-assembly.md

Lines changed: 5 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ but you must add the right number of `:` if you skip them:
5858
asm!("xor %eax, %eax"
5959
:
6060
:
61-
: "{eax}"
61+
: "eax"
6262
);
6363
# } }
6464
```
@@ -69,21 +69,21 @@ Whitespace also doesn't matter:
6969
# #![feature(asm)]
7070
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
7171
# fn main() { unsafe {
72-
asm!("xor %eax, %eax" ::: "{eax}");
72+
asm!("xor %eax, %eax" ::: "eax");
7373
# } }
7474
```
7575

7676
## Operands
7777

7878
Input and output operands follow the same format: `:
7979
"constraints1"(expr1), "constraints2"(expr2), ..."`. Output operand
80-
expressions must be mutable lvalues, or not yet assigned:
80+
expressions must be mutable lvalues:
8181

8282
```
8383
# #![feature(asm)]
8484
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
8585
fn add(a: i32, b: i32) -> i32 {
86-
let c: i32;
86+
let mut c = 0;
8787
unsafe {
8888
asm!("add $2, $0"
8989
: "=r"(c)
@@ -100,22 +100,6 @@ fn main() {
100100
}
101101
```
102102

103-
If you would like to use real operands in this position, however,
104-
you are required to put curly braces `{}` around the register that
105-
you want, and you are required to put the specific size of the
106-
operand. This is useful for very low level programming, where
107-
which register you use is important:
108-
109-
```
110-
# #![feature(asm)]
111-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
112-
# unsafe fn read_byte_in(port: u16) -> u8 {
113-
let result: u8;
114-
asm!("in %dx, %al" : "={al}"(result) : "{dx}"(port));
115-
result
116-
# }
117-
```
118-
119103
## Clobbers
120104

121105
Some instructions modify registers which might otherwise have held
@@ -128,7 +112,7 @@ stay valid.
128112
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
129113
# fn main() { unsafe {
130114
// Put the value 0x200 in eax
131-
asm!("mov $$0x200, %eax" : /* no outputs */ : /* no inputs */ : "{eax}");
115+
asm!("mov $$0x200, %eax" : /* no outputs */ : /* no inputs */ : "eax");
132116
# } }
133117
```
134118

@@ -155,14 +139,3 @@ Current valid options are:
155139
the compiler to insert its usual stack alignment code
156140
3. *intel* - use intel syntax instead of the default AT&T.
157141

158-
```
159-
# #![feature(asm)]
160-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
161-
# fn main() {
162-
let result: i32;
163-
unsafe {
164-
asm!("mov eax, 2" : "={eax}"(result) : : : "intel")
165-
}
166-
println!("eax is currently {}", result);
167-
# }
168-
```

branches/try/src/doc/trpl/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ as `unimplemented!` until you’re ready to write them.
765765
# Procedural macros
766766

767767
If Rust’s macro system can’t do what you need, you may want to write a
768-
[compiler plugin](compiler-plugins.html) instead. Compared to `macro_rules!`
768+
[compiler plugin](plugins.html) instead. Compared to `macro_rules!`
769769
macros, this is significantly more work, the interfaces are much less stable,
770770
and bugs can be much harder to track down. In exchange you get the
771771
flexibility of running arbitrary Rust code within the compiler. Syntax

branches/try/src/liballoc/boxed.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ impl<T: ?Sized + Hash> Hash for Box<T> {
240240
impl Box<Any> {
241241
#[inline]
242242
#[stable(feature = "rust1", since = "1.0.0")]
243-
/// Attempt to downcast the box to a concrete type.
244243
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
245244
if self.is::<T>() {
246245
unsafe {
@@ -258,15 +257,11 @@ impl Box<Any> {
258257
}
259258
}
260259

261-
impl Box<Any + Send> {
260+
impl Box<Any+Send> {
262261
#[inline]
263262
#[stable(feature = "rust1", since = "1.0.0")]
264-
/// Attempt to downcast the box to a concrete type.
265-
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any + Send>> {
266-
<Box<Any>>::downcast(self).map_err(|s| unsafe {
267-
// reapply the Send marker
268-
mem::transmute::<Box<Any>, Box<Any + Send>>(s)
269-
})
263+
pub fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
264+
<Box<Any>>::downcast(self)
270265
}
271266
}
272267

branches/try/src/libcore/any.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ pub trait Any: Reflect + 'static {
9797
fn get_type_id(&self) -> TypeId;
9898
}
9999

100-
impl<T: Reflect + 'static> Any for T {
100+
impl<T> Any for T
101+
where T: Reflect + 'static
102+
{
101103
fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
102104
}
103105

@@ -220,7 +222,7 @@ impl TypeId {
220222
/// Returns the `TypeId` of the type this generic function has been
221223
/// instantiated with
222224
#[stable(feature = "rust1", since = "1.0.0")]
223-
pub fn of<T: ?Sized + Reflect + 'static>() -> TypeId {
225+
pub fn of<T: ?Sized + Any>() -> TypeId {
224226
TypeId {
225227
t: unsafe { intrinsics::type_id::<T>() },
226228
}

branches/try/src/libcore/intrinsics.rs

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -139,21 +139,6 @@ extern "rust-intrinsic" {
139139
pub fn atomic_fence_rel();
140140
pub fn atomic_fence_acqrel();
141141

142-
/// A compiler-only memory barrier.
143-
///
144-
/// Memory accesses will never be reordered across this barrier by the compiler,
145-
/// but no instructions will be emitted for it. This is appropriate for operations
146-
/// on the same thread that may be preempted, such as when interacting with signal
147-
/// handlers.
148-
#[cfg(not(stage0))] // SNAP 857ef6e
149-
pub fn atomic_singlethreadfence();
150-
#[cfg(not(stage0))] // SNAP 857ef6e
151-
pub fn atomic_singlethreadfence_acq();
152-
#[cfg(not(stage0))] // SNAP 857ef6e
153-
pub fn atomic_singlethreadfence_rel();
154-
#[cfg(not(stage0))] // SNAP 857ef6e
155-
pub fn atomic_singlethreadfence_acqrel();
156-
157142
/// Aborts the execution of the process.
158143
pub fn abort() -> !;
159144

@@ -270,17 +255,12 @@ extern "rust-intrinsic" {
270255
/// Returns `true` if a type is managed (will be allocated on the local heap)
271256
pub fn owns_managed<T>() -> bool;
272257

273-
/// Calculates the offset from a pointer.
258+
/// Calculates the offset from a pointer. The offset *must* be in-bounds of
259+
/// the object, or one-byte-past-the-end. An arithmetic overflow is also
260+
/// undefined behaviour.
274261
///
275262
/// This is implemented as an intrinsic to avoid converting to and from an
276263
/// integer, since the conversion would throw away aliasing information.
277-
///
278-
/// # Safety
279-
///
280-
/// Both the starting and resulting pointer must be either in bounds or one
281-
/// byte past the end of an allocated object. If either pointer is out of
282-
/// bounds or arithmetic overflow occurs then any further use of the
283-
/// returned value will result in undefined behavior.
284264
pub fn offset<T>(dst: *const T, offset: isize) -> *const T;
285265

286266
/// Copies `count * size_of<T>` bytes from `src` to `dst`. The source
@@ -582,20 +562,3 @@ extern "rust-intrinsic" {
582562
/// cast to a `u64`; if `T` has no discriminant, returns 0.
583563
pub fn discriminant_value<T>(v: &T) -> u64;
584564
}
585-
586-
#[cfg(not(stage0))]
587-
extern "rust-intrinsic" {
588-
/// Performs an unchecked signed division, which results in undefined behavior,
589-
/// in cases where y == 0, or x == int::MIN and y == -1
590-
pub fn unchecked_sdiv<T>(x: T, y: T) -> T;
591-
/// Performs an unchecked unsigned division, which results in undefined behavior,
592-
/// in cases where y == 0
593-
pub fn unchecked_udiv<T>(x: T, y: T) -> T;
594-
595-
/// Returns the remainder of an unchecked signed division, which results in
596-
/// undefined behavior, in cases where y == 0, or x == int::MIN and y == -1
597-
pub fn unchecked_urem<T>(x: T, y: T) -> T;
598-
/// Returns the remainder of an unchecked signed division, which results in
599-
/// undefined behavior, in cases where y == 0
600-
pub fn unchecked_srem<T>(x: T, y: T) -> T;
601-
}

branches/try/src/libcore/marker.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,6 @@ mod impls {
416416
#[rustc_reflect_like]
417417
#[unstable(feature = "core", reason = "requires RFC and more experience")]
418418
#[allow(deprecated)]
419-
#[rustc_on_unimplemented = "`{Self}` does not implement `Any`; \
420-
ensure all type parameters are bounded by `Any`"]
421419
pub trait Reflect {}
422420

423421
impl Reflect for .. { }

0 commit comments

Comments
 (0)