Skip to content

Commit 93d829b

Browse files
committed
---
yaml --- r: 233149 b: refs/heads/beta c: 9bba711 h: refs/heads/master i: 233147: 142c2ba v: v3
1 parent 4ff16e6 commit 93d829b

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
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: ad9a0713fde9a9ee9eb3cb9d1b766300b36435c2
26+
refs/heads/beta: 9bba7110639cbd1d51977d97106d377fdfac7cdf
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/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/beta/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/beta/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/beta/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/beta/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)