Skip to content

Commit 00c2bee

Browse files
committed
---
yaml --- r: 112121 b: refs/heads/try c: 787f415 h: refs/heads/master i: 112119: 9264d68 v: v3
1 parent a2312bf commit 00c2bee

File tree

125 files changed

+2599
-1245
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

+2599
-1245
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: a692e9b1234ff6573b0cfbc39394d9222eb38f81
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: b5dd3f05fe95168b5569d0f519636149479eb6ac
5-
refs/heads/try: 111178d028f7bfdd74854da8b03b2b427563c24f
5+
refs/heads/try: 787f4151e3ac32ffe455c2d3fd991def36be9758
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/man/rustc.1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ rustdoc
193193
See <\fBhttps://github.com/mozilla/rust/issues\fR> for issues.
194194

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

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

branches/try/man/rustdoc.1

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ 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. Graydon Hoare
94-
<\fI[email protected]\fR> is the project leader.
93+
See \fBAUTHORS.txt\fR in the Rust source distribution.
9594

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

branches/try/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 LICENSE.txt rust-logo.ico \
121+
$(PKG_EXE): rust.iss modpath.iss upgrade.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/try/mk/prepare.mk

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@
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
2823
PREPARE_STAGE=2
29-
endif
3024

3125
DEFAULT_PREPARE_DIR_CMD = umask 022 && mkdir -p
3226
DEFAULT_PREPARE_BIN_CMD = install -m755

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

Lines changed: 10 additions & 4 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/languages/Rust
30+
[github-rust]: https://github.com/trending?l=rust
3131

3232
## Does it run on Windows?
3333

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

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].
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].
147153

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

branches/try/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_region(ref_1) };
73+
let ref_2: &mut u8 = unsafe { cast::transmute_mut_lifetime(ref_1) };
7474
7575
// oops, ref_1 and ref_2 point to the same piece of data (x) and are
7676
// both usable

branches/try/src/doc/rust.md

Lines changed: 2 additions & 6 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 public and private variants
1589+
// Declare a public enum with two public variants
15901590
pub enum State {
15911591
PubliclyAccessibleState,
1592-
priv PrivatelyAccessibleState
1592+
PubliclyAccessibleState2,
15931593
}
15941594
~~~~
15951595

@@ -4056,10 +4056,6 @@ 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-
40634059
#### Logging Expressions
40644060

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

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

Lines changed: 58 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,29 @@
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:
612

7-
(eval-when-compile (require 'cl))
813
(eval-when-compile (require 'misc))
914

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+
1022
;; Syntax definitions and helpers
1123
(defvar rust-mode-syntax-table
1224
(let ((table (make-syntax-table)))
1325

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

1830
;; Strings
1931
(modify-syntax-entry ?\" "\"" table)
@@ -30,10 +42,14 @@
3042

3143
table))
3244

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

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

3955
(defun rust-paren-level () (nth 0 (syntax-ppss)))
@@ -226,17 +242,16 @@
226242
)
227243

228244
;; Item definitions
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))))
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)))))
240255

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

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

365380
;;; Defun Motions
366381

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

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

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

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

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

431441
;; Allow paragraph fills for comments
432-
(set (make-local-variable 'comment-start-skip)
433-
"\\(?://[/!]*\\|/\\*[*!]?\\)[[:space:]]*")
434-
(set (make-local-variable 'paragraph-start)
442+
(setq-local comment-start-skip "\\(?://[/!]*\\|/\\*[*!]?\\)[[:space:]]*")
443+
(setq-local paragraph-start
435444
(concat "[[:space:]]*\\(?:" comment-start-skip "\\|\\*/?[[:space:]]*\\|\\)$"))
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-
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))
448455

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

452459
(defun rust-mode-reload ()
453460
(interactive)
454461
(unload-feature 'rust-mode)
455462
(require 'rust-mode)
456463
(rust-mode))
457464

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

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

branches/try/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 CurStepChanged(CurStep: TSetupStep);
167+
procedure ModPathCurStepChanged(CurStep: TSetupStep);
168168
var
169169
taskname: String;
170170
begin

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,15 @@ begin
4949
setArrayLength(Result, 1)
5050
Result[0] := ExpandConstant('{app}\bin');
5151
end;
52-
#include "modpath.iss"
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;

branches/try/src/etc/pkg/upgrade.iss

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// The following code taken from https://stackoverflow.com/questions/2000296/innosetup-how-to-automatically-uninstall-previous-installed-version
2+
// It performs upgrades by running the uninstaller before the install
3+
4+
/////////////////////////////////////////////////////////////////////
5+
function GetUninstallString(): String;
6+
var
7+
sUnInstPath: String;
8+
sUnInstallString: String;
9+
begin
10+
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\Rust_is1');
11+
sUnInstallString := '';
12+
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
13+
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
14+
Result := sUnInstallString;
15+
end;
16+
17+
18+
/////////////////////////////////////////////////////////////////////
19+
function IsUpgrade(): Boolean;
20+
begin
21+
Result := (GetUninstallString() <> '');
22+
end;
23+
24+
25+
/////////////////////////////////////////////////////////////////////
26+
function UnInstallOldVersion(): Integer;
27+
var
28+
sUnInstallString: String;
29+
iResultCode: Integer;
30+
begin
31+
// Return Values:
32+
// 1 - uninstall string is empty
33+
// 2 - error executing the UnInstallString
34+
// 3 - successfully executed the UnInstallString
35+
36+
// default return value
37+
Result := 0;
38+
39+
// get the uninstall string of the old app
40+
sUnInstallString := GetUninstallString();
41+
if sUnInstallString <> '' then begin
42+
sUnInstallString := RemoveQuotes(sUnInstallString);
43+
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
44+
Result := 3
45+
else
46+
Result := 2;
47+
end else
48+
Result := 1;
49+
end;
50+
51+
/////////////////////////////////////////////////////////////////////
52+
procedure UpgradeCurStepChanged(CurStep: TSetupStep);
53+
begin
54+
if (CurStep=ssInstall) then
55+
begin
56+
if (IsUpgrade()) then
57+
begin
58+
UnInstallOldVersion();
59+
end;
60+
end;
61+
end;

0 commit comments

Comments
 (0)