Skip to content

Commit d179ba3

Browse files
committed
Merge remote-tracking branch 'rust-lang/master'
Conflicts: src/libcore/cmp.rs src/libcore/fmt/mod.rs src/libcore/iter.rs src/libcore/marker.rs src/libcore/num/f32.rs src/libcore/num/f64.rs src/libcore/result.rs src/libcore/str/mod.rs src/librustc/lint/builtin.rs src/librustc/lint/context.rs src/libstd/sync/mpsc/mod.rs src/libstd/sync/poison.rs
2 parents de54986 + c80e556 commit d179ba3

Some content is hidden

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

88 files changed

+5483
-557
lines changed

configure

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ need_ok() {
2828

2929
need_cmd() {
3030
if command -v $1 >/dev/null 2>&1
31-
then msg "found $1"
32-
else err "need $1"
31+
then msg "found program $1"
32+
else err "need program $1"
3333
fi
3434
}
3535

@@ -340,6 +340,7 @@ need_cmd date
340340
need_cmd tr
341341
need_cmd sed
342342
need_cmd file
343+
need_cmd make
343344

344345
msg "inspecting environment"
345346

@@ -645,6 +646,8 @@ probe CFG_ISCC iscc
645646
probe CFG_JAVAC javac
646647
probe CFG_ANTLR4 antlr4
647648
probe CFG_GRUN grun
649+
probe CFG_FLEX flex
650+
probe CFG_BISON bison
648651
probe CFG_PANDOC pandoc
649652
probe CFG_PDFLATEX pdflatex
650653
probe CFG_XELATEX xelatex

mk/grammar.mk

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ B = $(CFG_BUILD_DIR)/$(CFG_BUILD)/stage2/
1414
L = $(B)lib/rustlib/$(CFG_BUILD)/lib
1515
LD = $(CFG_BUILD)/stage2/lib/rustlib/$(CFG_BUILD)/lib/
1616
RUSTC = $(STAGE2_T_$(CFG_BUILD)_H_$(CFG_BUILD))
17+
ifeq ($(CFG_OSTYPE),apple-darwin)
18+
FLEX_LDFLAGS=-ll
19+
else
20+
FLEX_LDFLAGS=-lfl
21+
endif
1722

1823
# Run the reference lexer against libsyntax and compare the tokens and spans.
1924
# If "// ignore-lexer-test" is present in the file, it will be ignored.
@@ -67,3 +72,46 @@ $(info cfg: javac not available, skipping lexer test...)
6772
check-lexer:
6873

6974
endif
75+
76+
$(BG)lex.yy.c: $(SG)lexer.l $(BG)
77+
@$(call E, flex: $@)
78+
$(Q)$(CFG_FLEX) -o $@ $<
79+
80+
$(BG)lexer-lalr.o: $(BG)lex.yy.c $(BG)parser-lalr.tab.h
81+
@$(call E, cc: $@)
82+
$(Q)$(CFG_CC) -include $(BG)parser-lalr.tab.h -c -o $@ $<
83+
84+
$(BG)parser-lalr.tab.c $(BG)parser-lalr.tab.h: $(SG)parser-lalr.y
85+
@$(call E, bison: $@)
86+
$(Q)$(CFG_BISON) $< --output=$(BG)parser-lalr.tab.c --defines=$(BG)parser-lalr.tab.h \
87+
--name-prefix=rs --warnings=error=all
88+
89+
$(BG)parser-lalr.o: $(BG)parser-lalr.tab.c
90+
@$(call E, cc: $@)
91+
$(Q)$(CFG_CC) -c -o $@ $<
92+
93+
$(BG)parser-lalr-main.o: $(SG)parser-lalr-main.c
94+
@$(call E, cc: $@)
95+
$(Q)$(CFG_CC) -std=c99 -c -o $@ $<
96+
97+
$(BG)parser-lalr: $(BG)parser-lalr.o $(BG)parser-lalr-main.o $(BG)lexer-lalr.o
98+
@$(call E, cc: $@)
99+
$(Q)$(CFG_CC) -o $@ $^ $(FLEX_LDFLAGS)
100+
101+
102+
ifdef CFG_FLEX
103+
ifdef CFG_BISON
104+
check-grammar: $(BG) $(BG)parser-lalr
105+
$(info Verifying grammar ...)
106+
$(SG)testparser.py -p $(BG)parser-lalr -s $(S)src
107+
108+
else
109+
$(info cfg: bison not available, skipping parser test...)
110+
check-grammar:
111+
112+
endif
113+
else
114+
$(info cfg: flex not available, skipping parser test...)
115+
check-grammar:
116+
117+
endif

mk/main.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
3030
CFG_DISABLE_UNSTABLE_FEATURES=1
3131
endif
3232
ifeq ($(CFG_RELEASE_CHANNEL),beta)
33-
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
34-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
33+
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
34+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta$(CFG_PRERELEASE_VERSION)
3535
CFG_DISABLE_UNSTABLE_FEATURES=1
3636
endif
3737
ifeq ($(CFG_RELEASE_CHANNEL),nightly)

src/compiletest/common.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,20 @@ pub use self::Mode::*;
1212
use std::fmt;
1313
use std::str::FromStr;
1414

15+
#[cfg(stage0)] // NOTE: remove impl after snapshot
16+
#[derive(Clone, PartialEq, Show)]
17+
pub enum Mode {
18+
CompileFail,
19+
RunFail,
20+
RunPass,
21+
RunPassValgrind,
22+
Pretty,
23+
DebugInfoGdb,
24+
DebugInfoLldb,
25+
Codegen
26+
}
27+
28+
#[cfg(not(stage0))] // NOTE: remove cfg after snapshot
1529
#[derive(Clone, PartialEq, Debug)]
1630
pub enum Mode {
1731
CompileFail,
@@ -24,6 +38,7 @@ pub enum Mode {
2438
Codegen
2539
}
2640

41+
2742
impl Copy for Mode {}
2843

2944
impl FromStr for Mode {

src/doc/reference.md

Lines changed: 2 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,136 +2291,7 @@ The name `str_eq` has a special meaning to the Rust compiler, and the presence
22912291
of this definition means that it will use this definition when generating calls
22922292
to the string equality function.
22932293

2294-
A complete list of the built-in language items follows:
2295-
2296-
#### Built-in Traits
2297-
2298-
* `copy`
2299-
: Types that do not move ownership when used by-value.
2300-
* `drop`
2301-
: Have destructors.
2302-
* `send`
2303-
: Able to be sent across thread boundaries.
2304-
* `sized`
2305-
: Has a size known at compile time.
2306-
* `sync`
2307-
: Able to be safely shared between threads when aliased.
2308-
2309-
#### Operators
2310-
2311-
These language items are traits:
2312-
2313-
* `add`
2314-
: Elements can be added (for example, integers and floats).
2315-
* `sub`
2316-
: Elements can be subtracted.
2317-
* `mul`
2318-
: Elements can be multiplied.
2319-
* `div`
2320-
: Elements have a division operation.
2321-
* `rem`
2322-
: Elements have a remainder operation.
2323-
* `neg`
2324-
: Elements can be negated arithmetically.
2325-
* `not`
2326-
: Elements can be negated logically.
2327-
* `bitxor`
2328-
: Elements have an exclusive-or operation.
2329-
* `bitand`
2330-
: Elements have a bitwise `and` operation.
2331-
* `bitor`
2332-
: Elements have a bitwise `or` operation.
2333-
* `shl`
2334-
: Elements have a left shift operation.
2335-
* `shr`
2336-
: Elements have a right shift operation.
2337-
* `index`
2338-
: Elements can be indexed.
2339-
* `index_mut`
2340-
: ___Needs filling in___
2341-
* `eq`
2342-
: Elements can be compared for equality.
2343-
* `ord`
2344-
: Elements have a partial ordering.
2345-
* `deref`
2346-
: `*` can be applied, yielding a reference to another type.
2347-
* `deref_mut`
2348-
: `*` can be applied, yielding a mutable reference to another type.
2349-
2350-
These are functions:
2351-
2352-
* `fn`
2353-
: ___Needs filling in___
2354-
* `fn_mut`
2355-
: ___Needs filling in___
2356-
* `fn_once`
2357-
: ___Needs filling in___
2358-
* `str_eq`
2359-
: Compare two strings (`&str`) for equality.
2360-
* `strdup_uniq`
2361-
: Return a new unique string
2362-
containing a copy of the contents of a unique string.
2363-
2364-
#### Types
2365-
2366-
* `type_id`
2367-
: The type returned by the `type_id` intrinsic.
2368-
* `unsafe`
2369-
: A type whose contents can be mutated through an immutable reference.
2370-
2371-
#### Marker types
2372-
2373-
These types help drive the compiler's analysis
2374-
2375-
* `begin_unwind`
2376-
: ___Needs filling in___
2377-
* `no_copy_bound`
2378-
: This type does not implement "copy", even if eligible.
2379-
* `eh_personality`
2380-
: ___Needs filling in___
2381-
* `exchange_free`
2382-
: Free memory that was allocated on the exchange heap.
2383-
* `exchange_malloc`
2384-
: Allocate memory on the exchange heap.
2385-
* `closure_exchange_malloc`
2386-
: ___Needs filling in___
2387-
* `panic`
2388-
: Abort the program with an error.
2389-
* `fail_bounds_check`
2390-
: Abort the program with a bounds check error.
2391-
* `free`
2392-
: Free memory that was allocated on the managed heap.
2393-
* `gc`
2394-
: ___Needs filling in___
2395-
* `exchange_heap`
2396-
: ___Needs filling in___
2397-
* `iterator`
2398-
: ___Needs filling in___
2399-
* `contravariant_lifetime`
2400-
: The lifetime parameter should be considered contravariant.
2401-
* `covariant_lifetime`
2402-
: The lifetime parameter should be considered covariant.
2403-
* `invariant_lifetime`
2404-
: The lifetime parameter should be considered invariant.
2405-
* `malloc`
2406-
: Allocate memory on the managed heap.
2407-
* `owned_box`
2408-
: ___Needs filling in___
2409-
* `stack_exhausted`
2410-
: ___Needs filling in___
2411-
* `start`
2412-
: ___Needs filling in___
2413-
* `contravariant_type`
2414-
: The type parameter should be considered contravariant.
2415-
* `covariant_type`
2416-
: The type parameter should be considered covariant.
2417-
* `invariant_type`
2418-
: The type parameter should be considered invariant.
2419-
* `ty_desc`
2420-
: ___Needs filling in___
2421-
2422-
> **Note:** This list is likely to become out of date. We should auto-generate
2423-
> it from `librustc/middle/lang_items.rs`.
2294+
A complete list of the built-in language items will be added in the future.
24242295

24252296
### Inline attributes
24262297

@@ -2581,9 +2452,7 @@ The currently implemented features of the reference compiler are:
25812452
declare a `static` as being unique per-thread leveraging
25822453
LLVM's implementation which works in concert with the kernel
25832454
loader and dynamic linker. This is not necessarily available
2584-
on all platforms, and usage of it is discouraged (rust
2585-
focuses more on thread-local data instead of thread-local
2586-
data).
2455+
on all platforms, and usage of it is discouraged.
25872456

25882457
* `trace_macros` - Allows use of the `trace_macros` macro, which is a nasty
25892458
hack that will certainly be removed.

src/doc/trpl/installing-rust.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ If not, there are a number of places where you can get help. The easiest is
8383
you can access through
8484
[Mibbit](http://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust). Click
8585
that link, and you'll be chatting with other Rustaceans (a silly nickname we
86-
call ourselves), and we can help you out. Other great resources include [our
87-
forum](http://discuss.rust-lang.org/), [the /r/rust
88-
subreddit](http://www.reddit.com/r/rust), and [Stack
86+
call ourselves), and we can help you out. Other great resources include [the
87+
/r/rust subreddit](http://www.reddit.com/r/rust), and [Stack
8988
Overflow](http://stackoverflow.com/questions/tagged/rust).

0 commit comments

Comments
 (0)