Skip to content

Commit 64b4494

Browse files
committed
---
yaml --- r: 49468 b: refs/heads/master c: d8c0da3 h: refs/heads/master v: v3
1 parent 4c944d6 commit 64b4494

File tree

5 files changed

+116
-260
lines changed

5 files changed

+116
-260
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 2cbfe6d19d2feb531b746217a6313474755bf025
2+
refs/heads/master: d8c0da39402818db2d41369826956538ba9672e1
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea

trunk/doc/tutorial.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -579,21 +579,30 @@ Structs are quite similar to C structs and are even laid out the same way in
579579
memory (so you can read from a Rust struct in C, and vice-versa). Use the dot
580580
operator to access struct fields, as in `mypoint.x`.
581581

582-
Inherited mutability means that any field of a struct may be mutable, if the
583-
struct is in a mutable slot (or a field of a struct in a mutable slot, and
584-
so forth).
585-
586582
~~~~
587-
struct Stack {
588-
content: ~[int],
589-
head: uint
583+
struct Point {
584+
x: float,
585+
y: float
590586
}
591587
~~~~
592588

593-
With a value (say, `mystack`) of such a type in a mutable location, you can do
594-
`mystack.head += 1`. But in an immutable location, such an assignment to a
589+
Inherited mutability means that any field of a struct may be mutable, if the
590+
struct is in a mutable slot (or a field of a struct in a mutable slot, and
591+
so forth).
592+
593+
With a value (say, `mypoint`) of such a type in a mutable location, you can do
594+
`mypoint.y += 1.0`. But in an immutable location, such an assignment to a
595595
struct without inherited mutability would result in a type error.
596596

597+
~~~~ {.xfail-test}
598+
# struct Point { x: float, y: float }
599+
let mut mypoint = Point { x: 1.0, y: 1.0 };
600+
let origin = Point { x: 0.0, y: 0.0 };
601+
602+
mypoint.y += 1.0; // mypoint is mutable, and its fields as well
603+
origin.y += 1.0; // ERROR: assigning to immutable field
604+
~~~~
605+
597606
`match` patterns destructure structs. The basic syntax is
598607
`Name { fieldname: pattern, ... }`:
599608

trunk/mk/install.mk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ install-host: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD_TRIPLE)_H_$(CFG_BUILD_TRIPLE))
113113
$(Q)$(call INSTALL,$(HB2),$(PHB),rustdoc$(X_$(CFG_BUILD_TRIPLE)))
114114
$(Q)$(call INSTALL,$(HB2),$(PHB),rusti$(X_$(CFG_BUILD_TRIPLE)))
115115
$(Q)$(call INSTALL,$(HB2),$(PHB),rust$(X_$(CFG_BUILD_TRIPLE)))
116+
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUSTC_$(CFG_BUILD_TRIPLE)))
117+
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUSTPKG_$(CFG_BUILD_TRIPLE)))
118+
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUSTDOC_$(CFG_BUILD_TRIPLE)))
119+
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUSTI_$(CFG_BUILD_TRIPLE)))
120+
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_LIBRUST_$(CFG_BUILD_TRIPLE)))
116121
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(CORELIB_GLOB_$(CFG_BUILD_TRIPLE)))
117122
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(STDLIB_GLOB_$(CFG_BUILD_TRIPLE)))
118123
$(Q)$(call INSTALL_LIB,$(HL),$(PHL),$(LIBRUSTC_GLOB_$(CFG_BUILD_TRIPLE)))
@@ -137,6 +142,11 @@ uninstall:
137142
$(Q)rm -f $(PHB)/rust$(X_$(CFG_BUILD_TRIPLE))
138143
$(Q)rm -f $(PHB)/rustdoc$(X_$(CFG_BUILD_TRIPLE))
139144
$(Q)rm -f $(PHL)/$(CFG_RUSTLLVM_$(CFG_BUILD_TRIPLE))
145+
$(Q)rm -f $(PHL)/$(CFG_LIBRUSTPKG_$(CFG_BUILD_TRIPLE))
146+
$(Q)rm -f $(PHL)/$(CFG_LIBRUSTC_$(CFG_BUILD_TRIPLE))
147+
$(Q)rm -f $(PHL)/$(CFG_LIBRUSTDOC_$(CFG_BUILD_TRIPLE))
148+
$(Q)rm -f $(PHL)/$(CFG_LIBRUSTI_$(CFG_BUILD_TRIPLE))
149+
$(Q)rm -f $(PHL)/$(CFG_LIBRUST_$(CFG_BUILD_TRIPLE))
140150
$(Q)rm -f $(PHL)/$(CFG_RUNTIME_$(CFG_BUILD_TRIPLE))
141151
$(Q)for i in \
142152
$(call HOST_LIB_FROM_HL_GLOB,$(CORELIB_GLOB_$(CFG_BUILD_TRIPLE))) \

trunk/src/libcore/trie.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,13 @@ impl<T> Map<uint, T> for TrieMap<T> {
136136
}
137137
}
138138

139-
impl<T> TrieMap<T> {
139+
pub impl<T> TrieMap<T> {
140140
/// Create an empty TrieMap
141141
#[inline(always)]
142142
static pure fn new() -> TrieMap<T> {
143143
TrieMap{root: TrieNode::new(), length: 0}
144144
}
145-
}
146145

147-
impl<T> TrieMap<T> {
148146
/// Visit all keys in reverse order
149147
#[inline(always)]
150148
pure fn each_key_reverse(&self, f: &fn(&uint) -> bool) {

0 commit comments

Comments
 (0)