Skip to content

Commit ca065ed

Browse files
committed
---
yaml --- r: 150863 b: refs/heads/try2 c: 45e4fad h: refs/heads/master i: 150861: e7c8770 150859: cd8dc17 150855: 5640314 150847: 786a295 v: v3
1 parent 2a827c9 commit ca065ed

File tree

125 files changed

+1262
-2605
lines changed

Some content is hidden

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

125 files changed

+1262
-2605
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 1dec47711dc145fdfd675497fb6adb8ff80354ad
8+
refs/heads/try2: 45e4fad5d0693b9a4ffdcdb572c8f45157eb4baa
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/man/rustc.1

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.TH RUSTC "1" "March 2014" "rustc 0.11-pre" "User Commands"
22
.SH NAME
3-
rustc \- rust compiler
3+
rustc \- The Rust compiler
44
.SH SYNOPSIS
55
.B rustc
66
[\fIOPTIONS\fR] \fIINPUT\fR
@@ -33,9 +33,17 @@ List the symbols defined by a library crate
3333
\fB\-\-no\-trans\fR
3434
Run all passes except translation; no output
3535
.TP
36-
\fB\-g\fR, \fB\-\-debuginfo\fR
36+
\fB\-\-no\-analysis\fR
37+
Parse and expand the source, but run no analysis and produce no output
38+
.TP
39+
\fB\-g\fR
3740
Emit DWARF debug information into object files generated.
3841
.TP
42+
\fB\-\-debuginfo\fR LEVEL
43+
Emit DWARF debug info to the objects created: 0 = no debug info, 1 =
44+
line-tables only (for stacktraces and breakpoints), 2 = full debug
45+
info with variable and type information (same as -g).
46+
.TP
3947
\fB\-O\fR
4048
Equivalent to \fI\-\-opt\-level=2\fR
4149
.TP
@@ -58,6 +66,10 @@ Pretty-print the input instead of compiling; valid types are: normal
5866
expanded, with type annotations), or identified (fully parenthesized,
5967
AST nodes and blocks with IDs)
6068
.TP
69+
\fB\-\-dep-info\fR [FILENAME]
70+
Output dependency info to <filename> after compiling, in o format suitable
71+
for use by Makefiles.
72+
.TP
6173
\fB\-\-sysroot\fR PATH
6274
Override the system root
6375
.TP
@@ -151,15 +163,14 @@ level.
151163
Generates software floating point library calls instead of hardware
152164
instructions.
153165
.TP
154-
\fBgen-crate-map\fR
155-
Forces generate of a toplevel crate map. May be required for logging to work
156-
when rust is embedded into another application.
157-
.TP
158166
\fBprefer-dynamic\fR
159167
Prefers dynamic linking to static linking.
160168
.TP
161169
\fBno-integrated-as\fR
162170
Force usage of an external assembler rather than LLVM's integrated one.
171+
.TP
172+
\fBrelocation-model\fR=[pic,static,dynamic-no-pic]
173+
The relocation model to use. (default: pic)
163174

164175
.SH "EXAMPLES"
165176
To build an executable from a source file with a main function:
@@ -182,7 +193,8 @@ rustdoc
182193
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
183194

184195
.SH "AUTHOR"
185-
See \fBAUTHORS.txt\fR in the Rust source distribution.
196+
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
197+
<\fI[email protected]\fR> is the project leader.
186198

187199
.SH "COPYRIGHT"
188200
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR

branches/try2/man/rustdoc.1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ rustc
9090
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
9191

9292
.SH "AUTHOR"
93-
See \fBAUTHORS.txt\fR in the Rust source distribution.
93+
See \fBAUTHORS.txt\fR in the rust source distribution. Graydon Hoare
94+
<\fI[email protected]\fR> is the project leader.
9495

9596
.SH "COPYRIGHT"
9697
This work is dual-licensed under Apache 2.0 and MIT terms. See \fBCOPYRIGHT\fR

branches/try2/mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ PKG_EXE = dist/$(PKG_NAME)-install.exe
118118
%.ico: $(S)src/etc/pkg/%.ico
119119
cp $< $@
120120

121-
$(PKG_EXE): rust.iss modpath.iss upgrade.iss LICENSE.txt rust-logo.ico \
121+
$(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \
122122
$(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
123123
dist-prepare-win
124124
$(CFG_PYTHON) $(S)src/etc/copy-runtime-deps.py tmp/dist/win/bin

branches/try2/mk/prepare.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@
2020
# PREPARE_TARGETS - the target triples, space separated
2121
# PREPARE_DEST_DIR - the directory to put the image
2222

23+
24+
# On windows we install from stage3, but on unix only stage2
25+
ifdef CFG_WINDOWSY_$(CFG_BUILD)
26+
PREPARE_STAGE=3
27+
else
2328
PREPARE_STAGE=2
29+
endif
2430

2531
DEFAULT_PREPARE_DIR_CMD = umask 022 && mkdir -p
2632
DEFAULT_PREPARE_BIN_CMD = install -m755

branches/try2/src/doc/complement-lang-faq.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Some examples that demonstrate different aspects of the language:
2727

2828
You may also be interested in browsing [GitHub's Rust][github-rust] page.
2929

30-
[github-rust]: https://github.com/trending?l=rust
30+
[github-rust]: https://github.com/languages/Rust
3131

3232
## Does it run on Windows?
3333

@@ -141,14 +141,8 @@ export RUST_LOG=hello
141141
./hello
142142
```
143143

144-
**Long answer** RUST_LOG takes a 'logging spec' that consists of a
145-
comma-separated list of paths, where a path consists of the crate name and
146-
sequence of module names, each separated by double-colons. For standalone .rs
147-
files the crate is implicitly named after the source file, so in the above
148-
example we were setting RUST_LOG to the name of the hello crate. Multiple paths
149-
can be combined to control the exact logging you want to see. For example, when
150-
debugging linking in the compiler you might set
151-
`RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath`
152-
For a full description see [the language reference][1].
144+
**Long answer** RUST_LOG takes a 'logging spec' that consists of a comma-separated list of paths, where a path consists of the crate name and sequence of module names, each separated by double-colons. For standalone .rs files the crate is implicitly named after the source file, so in the above example we were setting RUST_LOG to the name of the hello crate. Multiple paths can be combined to control the exact logging you want to see. For example, when debugging linking in the compiler you might set `RUST_LOG=rustc::metadata::creader,rustc::util::filesearch,rustc::back::rpath`
145+
146+
If you aren't sure which paths you need, try setting RUST_LOG to `::help` and running your program. This will print a list of paths available for logging. For a full description see [the language reference][1].
153147

154148
[1]:http://doc.rust-lang.org/doc/master/rust.html#logging-system

branches/try2/src/doc/guide-unsafe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ use std::cast;
7070
let mut x: u8 = 1;
7171
7272
let ref_1: &mut u8 = &mut x;
73-
let ref_2: &mut u8 = unsafe { cast::transmute_mut_lifetime(ref_1) };
73+
let ref_2: &mut u8 = unsafe { cast::transmute_mut_region(ref_1) };
7474
7575
// oops, ref_1 and ref_2 point to the same piece of data (x) and are
7676
// both usable

branches/try2/src/doc/rust.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,10 +1586,10 @@ pub struct Bar {
15861586
field: int
15871587
}
15881588
1589-
// Declare a public enum with two public variants
1589+
// Declare a public enum with public and private variants
15901590
pub enum State {
15911591
PubliclyAccessibleState,
1592-
PubliclyAccessibleState2,
1592+
priv PrivatelyAccessibleState
15931593
}
15941594
~~~~
15951595

@@ -4056,6 +4056,10 @@ crate name the crate is given a default name that matches the source file,
40564056
with the extension removed. In that case, to turn on logging for a program
40574057
compiled from, e.g. `helloworld.rs`, `RUST_LOG` should be set to `helloworld`.
40584058

4059+
As a convenience, the logging spec can also be set to a special pseudo-crate,
4060+
`::help`. In this case, when the application starts, the runtime will
4061+
simply output a list of loaded modules containing log expressions, then exit.
4062+
40594063
#### Logging Expressions
40604064

40614065
Rust provides several macros to log information. Here's a simple Rust program

branches/try2/src/etc/emacs/rust-mode.el

Lines changed: 51 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,17 @@
33
;; Version: 0.2.0
44
;; Author: Mozilla
55
;; Url: https://github.com/mozilla/rust
6-
;; Keywords: languages
7-
8-
;;; Commentary:
9-
;;
10-
11-
;;; Code:
126

7+
(eval-when-compile (require 'cl))
138
(eval-when-compile (require 'misc))
149

15-
;; for GNU Emacs < 24.3
16-
(eval-when-compile
17-
(unless (fboundp 'setq-local)
18-
(defmacro setq-local (var val)
19-
"Set variable VAR to value VAL in current buffer."
20-
(list 'set (list 'make-local-variable (list 'quote var)) val))))
21-
2210
;; Syntax definitions and helpers
2311
(defvar rust-mode-syntax-table
2412
(let ((table (make-syntax-table)))
2513

2614
;; Operators
27-
(dolist (i '(?+ ?- ?* ?/ ?& ?| ?^ ?! ?< ?> ?~ ?@))
28-
(modify-syntax-entry i "." table))
15+
(loop for i in '(?+ ?- ?* ?/ ?& ?| ?^ ?! ?< ?> ?~ ?@)
16+
do (modify-syntax-entry i "." table))
2917

3018
;; Strings
3119
(modify-syntax-entry ?\" "\"" table)
@@ -42,14 +30,10 @@
4230

4331
table))
4432

45-
(defgroup rust-mode nil
46-
"Support for Rust code."
47-
:link '(url-link "http://www.rust-lang.org/")
48-
:group 'languages)
33+
(defgroup rust-mode nil "Support for Rust code.")
4934

5035
(defcustom rust-indent-offset 4
51-
"Indent Rust code by this number of spaces."
52-
:type 'integer
36+
"*Indent Rust code by this number of spaces."
5337
:group 'rust-mode)
5438

5539
(defun rust-paren-level () (nth 0 (syntax-ppss)))
@@ -242,16 +226,17 @@
242226
)
243227

244228
;; Item definitions
245-
(mapcar #'(lambda (x)
246-
(list (rust-re-item-def (car x))
247-
1 (cdr x)))
248-
'(("enum" . font-lock-type-face)
249-
("struct" . font-lock-type-face)
250-
("type" . font-lock-type-face)
251-
("mod" . font-lock-type-face)
252-
("use" . font-lock-type-face)
253-
("fn" . font-lock-function-name-face)
254-
("static" . font-lock-constant-face)))))
229+
(loop for (item . face) in
230+
231+
'(("enum" . font-lock-type-face)
232+
("struct" . font-lock-type-face)
233+
("type" . font-lock-type-face)
234+
("mod" . font-lock-type-face)
235+
("use" . font-lock-type-face)
236+
("fn" . font-lock-function-name-face)
237+
("static" . font-lock-constant-face))
238+
239+
collect `(,(rust-re-item-def item) 1 ,face))))
255240

256241
(defun rust-fill-prefix-for-comment-start (line-start)
257242
"Determine what to use for `fill-prefix' based on what is at the beginning of a line."
@@ -365,17 +350,17 @@
365350

366351
;;; Imenu support
367352
(defvar rust-imenu-generic-expression
368-
(append (mapcar #'(lambda (x)
369-
(list nil (rust-re-item-def x) 1))
370-
'("enum" "struct" "type" "mod" "fn" "trait"))
353+
(append (loop for item in
354+
'("enum" "struct" "type" "mod" "fn" "trait")
355+
collect `(nil ,(rust-re-item-def item) 1))
371356
`(("Impl" ,(rust-re-item-def "impl") 1)))
372357
"Value for `imenu-generic-expression' in Rust mode.
373358
374359
Create a flat index of the item definitions in a Rust file.
375360
376361
Imenu will show all the enums, structs, etc. at the same level.
377-
Implementations will be shown under the `Impl` subheading. Use
378-
idomenu (imenu with `ido-mode') for best mileage.")
362+
Implementations will be shown under the `Impl` subheading.
363+
Use idomenu (imenu with ido-mode) for best mileage.")
379364

380365
;;; Defun Motions
381366

@@ -384,7 +369,8 @@ idomenu (imenu with `ido-mode') for best mileage.")
384369
(concat "^\\s-*\\(?:priv\\|pub\\)?\\s-*"
385370
(regexp-opt
386371
'("enum" "struct" "type" "mod" "use" "fn" "static" "impl"
387-
"extern" "impl" "static" "trait"))))
372+
"extern" "impl" "static" "trait"
373+
))))
388374

389375
(defun rust-beginning-of-defun (&optional arg)
390376
"Move backward to the beginning of the current defun.
@@ -425,43 +411,52 @@ This is written mainly to be used as `end-of-defun-function' for Rust."
425411
(define-derived-mode rust-mode rust-parent-mode "Rust"
426412
"Major mode for Rust code."
427413
:group 'rust-mode
428-
:syntax-table rust-mode-syntax-table
414+
415+
;; Basic syntax
416+
(set-syntax-table rust-mode-syntax-table)
429417

430418
;; Indentation
431-
(setq-local indent-line-function 'rust-mode-indent-line)
419+
(set (make-local-variable 'indent-line-function)
420+
'rust-mode-indent-line)
432421

433422
;; Fonts
434-
(setq-local font-lock-defaults '(rust-mode-font-lock-keywords nil nil nil nil))
423+
(set (make-local-variable 'font-lock-defaults)
424+
'(rust-mode-font-lock-keywords nil nil nil nil))
435425

436426
;; Misc
437-
(setq-local comment-start "// ")
438-
(setq-local comment-end "")
439-
(setq-local indent-tabs-mode nil)
427+
(set (make-local-variable 'comment-start) "// ")
428+
(set (make-local-variable 'comment-end) "")
429+
(set (make-local-variable 'indent-tabs-mode) nil)
440430

441431
;; Allow paragraph fills for comments
442-
(setq-local comment-start-skip "\\(?://[/!]*\\|/\\*[*!]?\\)[[:space:]]*")
443-
(setq-local paragraph-start
432+
(set (make-local-variable 'comment-start-skip)
433+
"\\(?://[/!]*\\|/\\*[*!]?\\)[[:space:]]*")
434+
(set (make-local-variable 'paragraph-start)
444435
(concat "[[:space:]]*\\(?:" comment-start-skip "\\|\\*/?[[:space:]]*\\|\\)$"))
445-
(setq-local paragraph-separate paragraph-start)
446-
(setq-local normal-auto-fill-function 'rust-do-auto-fill)
447-
(setq-local fill-paragraph-function 'rust-fill-paragraph)
448-
(setq-local fill-forward-paragraph-function 'rust-fill-forward-paragraph)
449-
(setq-local adaptive-fill-function 'rust-find-fill-prefix)
450-
(setq-local comment-multi-line t)
451-
(setq-local comment-line-break-function 'rust-comment-indent-new-line)
452-
(setq-local imenu-generic-expression rust-imenu-generic-expression)
453-
(setq-local beginning-of-defun-function 'rust-beginning-of-defun)
454-
(setq-local end-of-defun-function 'rust-end-of-defun))
436+
(set (make-local-variable 'paragraph-separate) paragraph-start)
437+
(set (make-local-variable 'normal-auto-fill-function) 'rust-do-auto-fill)
438+
(set (make-local-variable 'fill-paragraph-function) 'rust-fill-paragraph)
439+
(set (make-local-variable 'fill-forward-paragraph-function) 'rust-fill-forward-paragraph)
440+
(set (make-local-variable 'adaptive-fill-function) 'rust-find-fill-prefix)
441+
(set (make-local-variable 'comment-multi-line) t)
442+
(set (make-local-variable 'comment-line-break-function) 'rust-comment-indent-new-line)
443+
(set (make-local-variable 'imenu-generic-expression) rust-imenu-generic-expression)
444+
(set (make-local-variable 'beginning-of-defun-function) 'rust-beginning-of-defun)
445+
(set (make-local-variable 'end-of-defun-function) 'rust-end-of-defun)
446+
)
447+
455448

456449
;;;###autoload
457-
(add-to-list 'auto-mode-alist '("\\.rs\\'" . rust-mode))
450+
(add-to-list 'auto-mode-alist '("\\.rs$" . rust-mode))
458451

459452
(defun rust-mode-reload ()
460453
(interactive)
461454
(unload-feature 'rust-mode)
462455
(require 'rust-mode)
463456
(rust-mode))
464457

458+
(provide 'rust-mode)
459+
465460
;; Issue #6887: Rather than inheriting the 'gnu compilation error
466461
;; regexp (which is broken on a few edge cases), add our own 'rust
467462
;; compilation error regexp and use it instead.
@@ -485,6 +480,4 @@ See `compilation-error-regexp-alist for help on their format.")
485480
(cons 'rustc rustc-compilation-regexps))
486481
(add-to-list 'compilation-error-regexp-alist 'rustc)))
487482

488-
(provide 'rust-mode)
489-
490483
;;; rust-mode.el ends here

branches/try2/src/etc/pkg/modpath.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ begin
164164
end;
165165
166166
167-
procedure ModPathCurStepChanged(CurStep: TSetupStep);
167+
procedure CurStepChanged(CurStep: TSetupStep);
168168
var
169169
taskname: String;
170170
begin

branches/try2/src/etc/pkg/rust.iss

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,4 @@ begin
4949
setArrayLength(Result, 1)
5050
Result[0] := ExpandConstant('{app}\bin');
5151
end;
52-
53-
#include "modpath.iss"
54-
#include "upgrade.iss"
55-
56-
// Both modpath.iss and upgrade.iss want to overload CurStepChanged.
57-
// This version does the overload then delegates to each.
58-
59-
procedure CurStepChanged(CurStep: TSetupStep);
60-
begin
61-
UpgradeCurStepChanged(CurStep);
62-
ModPathCurStepChanged(CurStep);
63-
end;
52+
#include "modpath.iss"

0 commit comments

Comments
 (0)