Skip to content

Commit b4bc43e

Browse files
committed
---
yaml --- r: 81578 b: refs/heads/snap-stage3 c: a6d7fe6 h: refs/heads/master v: v3
1 parent 7a5c0f2 commit b4bc43e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+449
-392
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 16fc6a694cac35ce962e98e180354cbce6a72f54
4+
refs/heads/snap-stage3: a6d7fe6209bb31cc46ec5ba60e16b789b5c91914
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial-ffi.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,18 +415,21 @@ fn main() {
415415

416416
Most foreign code exposes a C ABI, and Rust uses the platform's C calling convention by default when
417417
calling foreign functions. Some foreign functions, most notably the Windows API, use other calling
418-
conventions. Rust provides a way to tell the compiler which convention to use:
418+
conventions. Rust provides the `abi` attribute as a way to hint to the compiler which calling
419+
convention to use:
419420

420421
~~~~
421422
#[cfg(target_os = "win32")]
423+
#[abi = "stdcall"]
422424
#[link_name = "kernel32"]
423-
extern "stdcall" {
425+
extern {
424426
fn SetEnvironmentVariableA(n: *u8, v: *u8) -> int;
425427
}
426428
~~~~
427429

428-
This applies to the entire `extern` block, and must be either `"cdecl"` or
429-
`"stdcall"`. The compiler may eventually support other calling conventions.
430+
The `abi` attribute applies to a foreign module (it cannot be applied to a single function within a
431+
module), and must be either `"cdecl"` or `"stdcall"`. The compiler may eventually support other
432+
calling conventions.
430433

431434
# Interoperability with foreign code
432435

branches/snap-stage3/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,7 +2811,7 @@ For every crate you can define a number of metadata items, such as link name, ve
28112811
You can also toggle settings that have crate-global consequences. Both mechanism
28122812
work by providing attributes in the crate root.
28132813

2814-
For example, Rust uniquely identifies crates by their link metadata, which includes
2814+
For example, Rust uniquely identifies crates by their link metadate, which includes
28152815
the link name and the version. It also hashes the filename and the symbols in a binary
28162816
based on the link metadata, allowing you to use two different versions of the same library in a crate
28172817
without conflict.
@@ -2916,7 +2916,7 @@ As well as this line into every module body:
29162916
use std::prelude::*;
29172917
~~~
29182918

2919-
The role of the `prelude` module is to re-export common definitions from `std`.
2919+
The role of the `prelude` module is to re-exports common definitions from `std`.
29202920

29212921
This allows you to use common types and functions like `Option<T>` or `println`
29222922
without needing to import them. And if you need something from `std` that's not in the prelude,

branches/snap-stage3/src/libextra/time.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ static NSEC_PER_SEC: i32 = 1_000_000_000_i32;
1919
pub mod rustrt {
2020
use super::Tm;
2121

22-
extern "cdecl" {
22+
#[abi = "cdecl"]
23+
extern {
2324
pub fn get_time(sec: &mut i64, nsec: &mut i32);
2425
pub fn precise_time_ns(ns: &mut u64);
2526
pub fn rust_tzset();

branches/snap-stage3/src/libextra/unicode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ pub mod icu {
162162

163163
// #[link_name = "icuuc"]
164164
#[link_args = "-licuuc"]
165-
extern "cdecl" {
165+
#[abi = "cdecl"]
166+
extern {
166167
pub fn u_hasBinaryProperty(c: UChar32, which: UProperty) -> UBool;
167168
pub fn u_isdigit(c: UChar32) -> UBool;
168169
pub fn u_islower(c: UChar32) -> UBool;

branches/snap-stage3/src/librustc/lib/llvm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ pub mod llvm {
300300

301301
#[link_args = "-Lrustllvm -lrustllvm"]
302302
#[link_name = "rustllvm"]
303-
extern "cdecl" {
303+
#[abi = "cdecl"]
304+
extern {
304305
/* Create and destroy contexts. */
305306
pub fn LLVMContextCreate() -> ContextRef;
306307
pub fn LLVMContextDispose(C: ContextRef);

branches/snap-stage3/src/librustdoc/clean.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,6 @@ pub struct Struct {
685685
struct_type: doctree::StructType,
686686
generics: Generics,
687687
fields: ~[Item],
688-
fields_stripped: bool,
689688
}
690689

691690
impl Clean<Item> for doctree::Struct {
@@ -700,7 +699,6 @@ impl Clean<Item> for doctree::Struct {
700699
struct_type: self.struct_type,
701700
generics: self.generics.clean(),
702701
fields: self.fields.clean(),
703-
fields_stripped: false,
704702
}),
705703
}
706704
}
@@ -713,15 +711,13 @@ impl Clean<Item> for doctree::Struct {
713711
pub struct VariantStruct {
714712
struct_type: doctree::StructType,
715713
fields: ~[Item],
716-
fields_stripped: bool,
717714
}
718715

719716
impl Clean<VariantStruct> for syntax::ast::struct_def {
720717
fn clean(&self) -> VariantStruct {
721718
VariantStruct {
722719
struct_type: doctree::struct_type_from_def(self),
723720
fields: self.fields.clean(),
724-
fields_stripped: false,
725721
}
726722
}
727723
}
@@ -730,7 +726,6 @@ impl Clean<VariantStruct> for syntax::ast::struct_def {
730726
pub struct Enum {
731727
variants: ~[Item],
732728
generics: Generics,
733-
variants_stripped: bool,
734729
}
735730

736731
impl Clean<Item> for doctree::Enum {
@@ -744,7 +739,6 @@ impl Clean<Item> for doctree::Enum {
744739
inner: EnumItem(Enum {
745740
variants: self.variants.clean(),
746741
generics: self.generics.clean(),
747-
variants_stripped: false,
748742
}),
749743
}
750744
}

branches/snap-stage3/src/librustdoc/fold.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ pub trait DocFolder {
2727
StructItem(i) => {
2828
let mut i = i;
2929
let mut foo = ~[]; swap(&mut foo, &mut i.fields);
30-
let num_fields = foo.len();
3130
i.fields.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
32-
i.fields_stripped |= num_fields != i.fields.len();
3331
StructItem(i)
3432
},
3533
ModuleItem(i) => {
@@ -38,9 +36,7 @@ pub trait DocFolder {
3836
EnumItem(i) => {
3937
let mut i = i;
4038
let mut foo = ~[]; swap(&mut foo, &mut i.variants);
41-
let num_variants = foo.len();
4239
i.variants.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
43-
i.variants_stripped |= num_variants != i.variants.len();
4440
EnumItem(i)
4541
},
4642
TraitItem(i) => {
@@ -77,9 +73,7 @@ pub trait DocFolder {
7773
StructVariant(j) => {
7874
let mut j = j;
7975
let mut foo = ~[]; swap(&mut foo, &mut j.fields);
80-
let num_fields = foo.len();
8176
j.fields.extend(&mut foo.move_iter().filter_map(c));
82-
j.fields_stripped |= num_fields != j.fields.len();
8377
VariantItem(Variant {kind: StructVariant(j), ..i2})
8478
},
8579
_ => VariantItem(i2)

branches/snap-stage3/src/librustdoc/html/render.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,8 +1265,7 @@ fn render_method(w: &mut io::Writer, meth: &clean::Item, withlink: bool) {
12651265

12661266
fn item_struct(w: &mut io::Writer, it: &clean::Item, s: &clean::Struct) {
12671267
write!(w, "<pre class='struct'>");
1268-
render_struct(w, it, Some(&s.generics), s.struct_type, s.fields,
1269-
s.fields_stripped, "", true);
1268+
render_struct(w, it, Some(&s.generics), s.struct_type, s.fields, "", true);
12701269
write!(w, "</pre>");
12711270

12721271
document(w, it);
@@ -1313,18 +1312,14 @@ fn item_enum(w: &mut io::Writer, it: &clean::Item, e: &clean::Enum) {
13131312
}
13141313
clean::StructVariant(ref s) => {
13151314
render_struct(w, v, None, s.struct_type, s.fields,
1316-
s.fields_stripped, " ", false);
1315+
" ", false);
13171316
}
13181317
}
13191318
}
13201319
_ => unreachable!()
13211320
}
13221321
write!(w, ",\n");
13231322
}
1324-
1325-
if e.variants_stripped {
1326-
write!(w, " // some variants omitted\n");
1327-
}
13281323
write!(w, "\\}");
13291324
}
13301325
write!(w, "</pre>");
@@ -1348,7 +1343,6 @@ fn render_struct(w: &mut io::Writer, it: &clean::Item,
13481343
g: Option<&clean::Generics>,
13491344
ty: doctree::StructType,
13501345
fields: &[clean::Item],
1351-
fields_stripped: bool,
13521346
tab: &str,
13531347
structhead: bool) {
13541348
write!(w, "{}{}{}",
@@ -1374,10 +1368,6 @@ fn render_struct(w: &mut io::Writer, it: &clean::Item,
13741368
_ => unreachable!()
13751369
}
13761370
}
1377-
1378-
if fields_stripped {
1379-
write!(w, " // some fields omitted\n{}", tab);
1380-
}
13811371
write!(w, "\\}");
13821372
}
13831373
doctree::Tuple | doctree::Newtype => {

branches/snap-stage3/src/librustdoc/passes.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,17 @@ pub fn strip_private(mut crate: clean::Crate) -> plugins::PluginResult {
7070
}
7171
}
7272

73-
// These are public-by-default (if the enum/struct was public)
74-
clean::VariantItem(*) | clean::StructFieldItem(*) => {
73+
// These are public-by-default (if the enum was public)
74+
clean::VariantItem(*) => {
7575
if i.visibility == Some(ast::private) {
7676
return None;
7777
}
7878
}
7979

80+
// We show these regardless of whether they're public/private
81+
// because it's useful to see sometimes
82+
clean::StructFieldItem(*) => {}
83+
8084
// handled below
8185
clean::ModuleItem(*) => {}
8286

branches/snap-stage3/src/librustdoc/rustdoc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub mod passes;
4848
pub mod plugins;
4949
pub mod visit_ast;
5050

51-
pub static SCHEMA_VERSION: &'static str = "0.8.1";
51+
pub static SCHEMA_VERSION: &'static str = "0.8.0";
5252

5353
type Pass = (&'static str, // name
5454
extern fn(clean::Crate) -> plugins::PluginResult, // fn

branches/snap-stage3/src/libstd/io.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ pub type fd_t = c_int;
7676
pub mod rustrt {
7777
use libc;
7878

79+
#[abi = "cdecl"]
7980
#[link_name = "rustrt"]
80-
extern "cdecl" {
81+
extern {
8182
pub fn rust_get_stdin() -> *libc::FILE;
8283
pub fn rust_get_stdout() -> *libc::FILE;
8384
pub fn rust_get_stderr() -> *libc::FILE;

0 commit comments

Comments
 (0)