Skip to content

Commit bd6a920

Browse files
committed
---
yaml --- r: 223225 b: refs/heads/auto c: 9bba711 h: refs/heads/master i: 223223: ca51120 v: v3
1 parent 83d1f07 commit bd6a920

File tree

6 files changed

+23
-19
lines changed

6 files changed

+23
-19
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: ad9a0713fde9a9ee9eb3cb9d1b766300b36435c2
11+
refs/heads/auto: 9bba7110639cbd1d51977d97106d377fdfac7cdf
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/doc/trpl/advanced-linking.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ Static linking refers to the process of creating output that contain all
3838
required libraries and so don't need libraries installed on every system where
3939
you want to use your compiled project. Pure-Rust dependencies are statically
4040
linked by default so you can use created binaries and libraries without
41-
installing the Rust everywhere. By contrast, native libraries
42-
(e.g. `libc` and `libm`) usually dynamically linked, but it is possible to
41+
installing Rust everywhere. By contrast, native libraries
42+
(e.g. `libc` and `libm`) are usually dynamically linked, but it is possible to
4343
change this and statically link them as well.
4444

45-
Linking is a very platform dependent topic — on some platforms, static linking
46-
may not be possible at all! This section assumes some basic familiarity with
45+
Linking is a very platform-dependent topic, and static linking may not even be
46+
possible on some platforms! This section assumes some basic familiarity with
4747
linking on your platform of choice.
4848

4949
## Linux
@@ -71,8 +71,7 @@ Dynamic linking on Linux can be undesirable if you wish to use new library
7171
features on old systems or target systems which do not have the required
7272
dependencies for your program to run.
7373

74-
Static linking is supported via an alternative `libc`, `musl` - this must be
75-
enabled at Rust compile-time with some prerequisites available. You can compile
74+
Static linking is supported via an alternative `libc`, `musl`. You can compile
7675
your own version of Rust with `musl` enabled and install it into a custom
7776
directory with the instructions below:
7877

@@ -123,7 +122,7 @@ $ du -h musldist/bin/rustc
123122
```
124123

125124
You now have a build of a `musl`-enabled Rust! Because we've installed it to a
126-
custom prefix we need to make sure our system can the binaries and appropriate
125+
custom prefix we need to make sure our system can find the binaries and appropriate
127126
libraries when we try and run it:
128127

129128
```text

branches/auto/src/doc/trpl/lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ We previously talked a little about [function syntax][functions], but we didn’
8181
discuss the `<>`s after a function’s name. A function can have ‘generic
8282
parameters’ between the `<>`s, of which lifetimes are one kind. We’ll discuss
8383
other kinds of generics [later in the book][generics], but for now, let’s
84-
just focus on the lifteimes aspect.
84+
just focus on the lifetimes aspect.
8585

8686
[functions]: functions.html
8787
[generics]: generics.html

branches/auto/src/librustc/metadata/creader.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ impl<'a> CrateReader<'a> {
261261
let loader::Library { dylib, rlib, metadata } = lib;
262262

263263
let cnum_map = self.resolve_crate_deps(root, metadata.as_slice(), span);
264+
let staged_api = self.is_staged_api(metadata.as_slice());
264265

265266
let cmeta = Rc::new( cstore::crate_metadata {
266267
name: name.to_string(),
@@ -270,6 +271,7 @@ impl<'a> CrateReader<'a> {
270271
cnum: cnum,
271272
codemap_import_info: RefCell::new(vec![]),
272273
span: span,
274+
staged_api: staged_api
273275
});
274276

275277
let source = cstore::CrateSource {
@@ -283,6 +285,17 @@ impl<'a> CrateReader<'a> {
283285
(cnum, cmeta, source)
284286
}
285287

288+
fn is_staged_api(&self, data: &[u8]) -> bool {
289+
let attrs = decoder::get_crate_attributes(data);
290+
for attr in &attrs {
291+
if &attr.name()[..] == "staged_api" {
292+
match attr.node.value.node { ast::MetaWord(_) => return true, _ => (/*pass*/) }
293+
}
294+
}
295+
296+
return false;
297+
}
298+
286299
fn resolve_crate(&mut self,
287300
root: &Option<CratePaths>,
288301
ident: &str,

branches/auto/src/librustc/metadata/csearch.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ use rbml::reader;
2222
use std::rc::Rc;
2323
use syntax::ast;
2424
use syntax::attr;
25-
use syntax::attr::AttrMetaMethods;
2625
use syntax::diagnostic::expect;
2726

2827
use std::collections::hash_map::HashMap;
@@ -386,15 +385,7 @@ pub fn get_stability(cstore: &cstore::CStore,
386385
}
387386

388387
pub fn is_staged_api(cstore: &cstore::CStore, krate: ast::CrateNum) -> bool {
389-
let cdata = cstore.get_crate_data(krate);
390-
let attrs = decoder::get_crate_attributes(cdata.data());
391-
for attr in &attrs {
392-
if &attr.name()[..] == "staged_api" {
393-
match attr.node.value.node { ast::MetaWord(_) => return true, _ => (/*pass*/) }
394-
}
395-
}
396-
397-
return false;
388+
cstore.get_crate_data(krate).staged_api
398389
}
399390

400391
pub fn get_repr_attrs(cstore: &cstore::CStore, def: ast::DefId)

branches/auto/src/librustc/metadata/cstore.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ pub struct crate_metadata {
6363
pub cnum: ast::CrateNum,
6464
pub codemap_import_info: RefCell<Vec<ImportedFileMap>>,
6565
pub span: codemap::Span,
66+
pub staged_api: bool
6667
}
6768

6869
#[derive(Copy, Debug, PartialEq, Clone)]

0 commit comments

Comments
 (0)