Skip to content

Commit 7f4482c

Browse files
committed
---
yaml --- r: 124599 b: refs/heads/auto c: 56fafe2 h: refs/heads/master i: 124597: 020be38 124595: 5f7ed8b 124591: e5aca1b v: v3
1 parent 9bdaa38 commit 7f4482c

File tree

16 files changed

+538
-182
lines changed

16 files changed

+538
-182
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 6f99a27886023acf4d10efb4d56c89c88ffee9be
16+
refs/heads/auto: 56fafe28ee17a4aa48795083ee08be744f068067
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/docs.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
3030
guide-tasks guide-container guide-pointers guide-testing \
3131
guide-runtime complement-bugreport \
3232
complement-lang-faq complement-design-faq complement-project-faq rust \
33-
rustdoc guide-unsafe
33+
rustdoc guide-unsafe guide-strings
3434

3535
PDF_DOCS := tutorial rust
3636

branches/auto/src/doc/guide-strings.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
% The Strings Guide
22

3-
# Strings
4-
53
Strings are an important concept to master in any programming language. If you
64
come from a managed language background, you may be surprised at the complexity
75
of string handling in a systems programming language. Efficient access and
@@ -14,7 +12,7 @@ Additionally, strings are not null-terminated and can contain null bytes.
1412

1513
Rust has two main types of strings: `&str` and `String`.
1614

17-
## &str
15+
# &str
1816

1917
The first kind is a `&str`. This is pronounced a 'string slice.' String literals
2018
are of the type `&str`:
@@ -38,7 +36,7 @@ Like vector slices, string slices are simply a pointer plus a length. This
3836
means that they're a 'view' into an already-allocated string, such as a
3937
`&'static str` or a `String`.
4038

41-
## String
39+
# String
4240

4341
A `String` is a heap-allocated string. This string is growable, and is also
4442
guaranteed to be UTF-8.
@@ -73,9 +71,9 @@ let x: &[u8] = &[b'a', b'b'];
7371
let stack_str: &str = str::from_utf8(x).unwrap();
7472
```
7573

76-
## Best Practices
74+
# Best Practices
7775

78-
### `String` vs. `&str`
76+
## `String` vs. `&str`
7977

8078
In general, you should prefer `String` when you need ownership, and `&str` when
8179
you just need to borrow a string. This is very similar to using `Vec<T>` vs. `&[T]`,
@@ -98,7 +96,7 @@ need, and it can make your lifetimes more complex. Furthermore, you can pass
9896
either kind of string into `foo` by using `.as_slice()` on any `String` you
9997
need to pass in, so the `&str` version is more flexible.
10098

101-
### Comparisons
99+
## Comparisons
102100

103101
To compare a String to a constant string, prefer `as_slice()`...
104102

@@ -123,7 +121,7 @@ fn compare(string: String) {
123121
Converting a `String` to a `&str` is cheap, but converting the `&str` to a
124122
`String` involves an allocation.
125123

126-
## Other Documentation
124+
# Other Documentation
127125

128126
* [the `&str` API documentation](/std/str/index.html)
129127
* [the `String` API documentation](std/string/index.html)

branches/auto/src/doc/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ li {list-style-type: none; }
1313

1414
# Guides
1515

16+
* [Strings](guide-strings.html)
1617
* [Pointers](guide-pointers.html)
1718
* [References and Lifetimes](guide-lifetimes.html)
1819
* [Containers and Iterators](guide-container.html)

branches/auto/src/librustc/lib.rs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -68,42 +68,42 @@ pub mod back {
6868
}
6969

7070
pub mod middle {
71-
pub mod def;
72-
pub mod trans;
73-
pub mod ty;
74-
pub mod ty_fold;
75-
pub mod subst;
76-
pub mod resolve;
77-
pub mod resolve_lifetime;
78-
pub mod typeck;
71+
pub mod astencode;
72+
pub mod borrowck;
73+
pub mod cfg;
74+
pub mod check_const;
7975
pub mod check_loop;
8076
pub mod check_match;
81-
pub mod check_const;
8277
pub mod check_static;
83-
pub mod borrowck;
78+
pub mod const_eval;
8479
pub mod dataflow;
85-
pub mod mem_categorization;
86-
pub mod liveness;
87-
pub mod kind;
80+
pub mod dead;
81+
pub mod def;
82+
pub mod dependency_format;
83+
pub mod effect;
84+
pub mod entry;
85+
pub mod expr_use_visitor;
8886
pub mod freevars;
89-
pub mod pat_util;
90-
pub mod region;
91-
pub mod const_eval;
92-
pub mod astencode;
87+
pub mod graph;
88+
pub mod intrinsicck;
89+
pub mod kind;
9390
pub mod lang_items;
91+
pub mod liveness;
92+
pub mod mem_categorization;
93+
pub mod pat_util;
9494
pub mod privacy;
95-
pub mod entry;
96-
pub mod effect;
9795
pub mod reachable;
98-
pub mod graph;
99-
pub mod cfg;
100-
pub mod dead;
101-
pub mod expr_use_visitor;
102-
pub mod dependency_format;
103-
pub mod weak_lang_items;
96+
pub mod region;
97+
pub mod resolve;
98+
pub mod resolve_lifetime;
10499
pub mod save;
105-
pub mod intrinsicck;
106100
pub mod stability;
101+
pub mod subst;
102+
pub mod trans;
103+
pub mod ty;
104+
pub mod ty_fold;
105+
pub mod typeck;
106+
pub mod weak_lang_items;
107107
}
108108

109109
pub mod front {

0 commit comments

Comments
 (0)