Skip to content

Commit 84c7c93

Browse files
committed
---
yaml --- r: 150965 b: refs/heads/try2 c: 4401f88 h: refs/heads/master i: 150963: bca3e93 v: v3
1 parent 665bf0d commit 84c7c93

Some content is hidden

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

79 files changed

+1843
-936
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 80bd17643234239ea556e25a8ff56c2164eb6313
8+
refs/heads/try2: 4401f88688eec9052f292ce3b3b8cb96da2853f2
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/compiletest/header.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub struct TestProps {
1717
pub error_patterns: Vec<~str> ,
1818
// Extra flags to pass to the compiler
1919
pub compile_flags: Option<~str>,
20+
// Extra flags to pass when the compiled code is run (such as --bench)
21+
pub run_flags: Option<~str>,
2022
// If present, the name of a file that this test should match when
2123
// pretty-printed
2224
pub pp_exact: Option<Path>,
@@ -42,6 +44,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
4244
let mut aux_builds = Vec::new();
4345
let mut exec_env = Vec::new();
4446
let mut compile_flags = None;
47+
let mut run_flags = None;
4548
let mut pp_exact = None;
4649
let mut debugger_cmds = Vec::new();
4750
let mut check_lines = Vec::new();
@@ -58,6 +61,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
5861
compile_flags = parse_compile_flags(ln);
5962
}
6063

64+
if run_flags.is_none() {
65+
run_flags = parse_run_flags(ln);
66+
}
67+
6168
if pp_exact.is_none() {
6269
pp_exact = parse_pp_exact(ln, testfile);
6370
}
@@ -96,9 +103,11 @@ pub fn load_props(testfile: &Path) -> TestProps {
96103

97104
true
98105
});
99-
return TestProps {
106+
107+
TestProps {
100108
error_patterns: error_patterns,
101109
compile_flags: compile_flags,
110+
run_flags: run_flags,
102111
pp_exact: pp_exact,
103112
aux_builds: aux_builds,
104113
exec_env: exec_env,
@@ -107,7 +116,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
107116
force_host: force_host,
108117
check_stdout: check_stdout,
109118
no_prefer_dynamic: no_prefer_dynamic,
110-
};
119+
}
111120
}
112121

113122
pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
@@ -160,6 +169,10 @@ fn parse_compile_flags(line: &str) -> Option<~str> {
160169
parse_name_value_directive(line, "compile-flags".to_owned())
161170
}
162171

172+
fn parse_run_flags(line: &str) -> Option<~str> {
173+
parse_name_value_directive(line, ~"run-flags")
174+
}
175+
163176
fn parse_debugger_cmd(line: &str) -> Option<~str> {
164177
parse_name_value_directive(line, "debugger".to_owned())
165178
}

branches/try2/src/compiletest/runtest.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,14 +835,19 @@ fn make_exe_name(config: &config, testfile: &Path) -> Path {
835835
f
836836
}
837837

838-
fn make_run_args(config: &config, _props: &TestProps, testfile: &Path) ->
838+
fn make_run_args(config: &config, props: &TestProps, testfile: &Path) ->
839839
ProcArgs {
840840
// If we've got another tool to run under (valgrind),
841841
// then split apart its command
842842
let mut args = split_maybe_args(&config.runtool);
843843
let exe_file = make_exe_name(config, testfile);
844+
844845
// FIXME (#9639): This needs to handle non-utf8 paths
845846
args.push(exe_file.as_str().unwrap().to_owned());
847+
848+
// Add the arguments in the run_flags directive
849+
args.push_all_move(split_maybe_args(&props.run_flags));
850+
846851
let prog = args.shift().unwrap();
847852
return ProcArgs {prog: prog, args: args};
848853
}

branches/try2/src/doc/complement-cheatsheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ let x: int = 42;
2929
let y: ~str = format!("{:t}", x); // binary
3030
let y: ~str = format!("{:o}", x); // octal
3131
let y: ~str = format!("{:x}", x); // lowercase hexadecimal
32-
let y: ~str = format!("{:X}", x); // uppercase hexidecimal
32+
let y: ~str = format!("{:X}", x); // uppercase hexadecimal
3333
~~~
3434

3535
**String to int, in non-base-10**

branches/try2/src/doc/guide-ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ Besides classical synchronization mechanisms like mutexes, one possibility in
337337
Rust is to use channels (in `std::comm`) to forward data from the C thread
338338
that invoked the callback into a Rust task.
339339

340-
If an asychronous callback targets a special object in the Rust address space
340+
If an asynchronous callback targets a special object in the Rust address space
341341
it is also absolutely necessary that no more callbacks are performed by the
342342
C library after the respective Rust object gets destroyed.
343343
This can be achieved by unregistering the callback in the object's

branches/try2/src/doc/guide-lifetimes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ points at a static constant).
561561

562562
Lifetimes can be named and referenced. For example, the special lifetime
563563
`'static`, which does not go out of scope, can be used to create global
564-
variables and communicate between tasks (see the manual for usecases).
564+
variables and communicate between tasks (see the manual for use cases).
565565

566566
## Parameter Lifetimes
567567

branches/try2/src/doc/intro.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ Now here's the exciting part:
226226
because `numbers` is an owned type,
227227
when it is sent across the channel,
228228
it is actually *moved*,
229-
transfering ownership of `numbers` between tasks.
229+
transferring ownership of `numbers` between tasks.
230230
This ownership transfer is *very fast* -
231231
in this case simply copying a pointer -
232232
while also ensuring that the original owning task cannot create data races by continuing to read or write to `numbers` in parallel with the new owner.
@@ -318,7 +318,7 @@ fn main() {
318318
This is almost exactly the same,
319319
except that this time `numbers` is first put into an `Arc`.
320320
`Arc::new` creates the `Arc`,
321-
`.clone()` makes another `Arc` that referrs to the same contents.
321+
`.clone()` makes another `Arc` that refers to the same contents.
322322
So we clone the `Arc` for each task,
323323
send that clone down the channel,
324324
and then use it to print out a number.

branches/try2/src/doc/rust.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Raw string literals do not process any escapes. They start with the character
295295
`U+0022` (double-quote) character. The _raw string body_ is not defined in the
296296
EBNF grammar above: it can contain any sequence of Unicode characters and is
297297
terminated only by another `U+0022` (double-quote) character, followed by the
298-
same number of `U+0023` (`#`) characters that preceeded the opening `U+0022`
298+
same number of `U+0023` (`#`) characters that preceded the opening `U+0022`
299299
(double-quote) character.
300300

301301
All Unicode characters contained in the raw string body represent themselves,
@@ -1214,6 +1214,22 @@ struct Cookie;
12141214
let c = [Cookie, Cookie, Cookie, Cookie];
12151215
~~~~
12161216

1217+
By using the `struct_inherit` feature gate, structures may use single inheritance. A Structure may only
1218+
inherit from a single other structure, called the _super-struct_. The inheriting structure (sub-struct)
1219+
acts as if all fields in the super-struct were present in the sub-struct. Fields declared in a sub-struct
1220+
must not have the same name as any field in any (transitive) super-struct. All fields (both declared
1221+
and inherited) must be specified in any initializers. Inheritance between structures does not give
1222+
subtyping or coercion. The super-struct and sub-struct must be defined in the same crate. The super-struct
1223+
must be declared using the `virtual` keyword.
1224+
For example:
1225+
1226+
~~~~ {.ignore}
1227+
virtual struct Sup { x: int }
1228+
struct Sub : Sup { y: int }
1229+
let s = Sub {x: 10, y: 11};
1230+
let sx = s.x;
1231+
~~~~
1232+
12171233
### Enumerations
12181234

12191235
An _enumeration_ is a simultaneous definition of a nominal [enumerated type](#enumerated-types) as well as a set of *constructors*,
@@ -2240,7 +2256,7 @@ fn main() {
22402256
Certain aspects of Rust may be implemented in the compiler, but they're not
22412257
necessarily ready for every-day use. These features are often of "prototype
22422258
quality" or "almost production ready", but may not be stable enough to be
2243-
considered a full-fleged language feature.
2259+
considered a full-fledged language feature.
22442260

22452261
For this reason, Rust recognizes a special crate-level attribute of the form:
22462262

@@ -3989,7 +4005,7 @@ dependencies will be used:
39894005
could only be found in an `rlib` format. Remember that `staticlib` formats
39904006
are always ignored by `rustc` for crate-linking purposes.
39914007

3992-
2. If a static library is being produced, all upstream dependecies are
4008+
2. If a static library is being produced, all upstream dependencies are
39934009
required to be available in `rlib` formats. This requirement stems from the
39944010
same reasons that a dynamic library must have all dynamic dependencies.
39954011

branches/try2/src/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1883,8 +1883,8 @@ impl Shape {
18831883

18841884
let s = Circle(Point { x: 1.0, y: 2.0 }, 3.0);
18851885

1886-
(~s).draw_owned();
18871886
(&s).draw_reference();
1887+
(~s).draw_owned();
18881888
s.draw_value();
18891889
~~~
18901890

branches/try2/src/librustc/front/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ fn fold_struct(cx: &Context, def: &ast::StructDef) -> @ast::StructDef {
151151
@ast::StructDef {
152152
fields: fields.collect(),
153153
ctor_id: def.ctor_id,
154+
super_struct: def.super_struct.clone(),
155+
is_virtual: def.is_virtual,
154156
}
155157
}
156158

branches/try2/src/librustc/front/feature_gate.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
//! enabled.
1717
//!
1818
//! Features are enabled in programs via the crate-level attributes of
19-
//! #[feature(...)] with a comma-separated list of features.
19+
//! #![feature(...)] with a comma-separated list of features.
2020
2121
use middle::lint;
2222

@@ -55,6 +55,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
5555
("default_type_params", Active),
5656
("quote", Active),
5757
("linkage", Active),
58+
("struct_inherit", Active),
5859

5960
// These are used to test this portion of the compiler, they don't actually
6061
// mean anything
@@ -190,11 +191,22 @@ impl<'a> Visitor<()> for Context<'a> {
190191
}
191192
}
192193

193-
ast::ItemStruct(..) => {
194+
ast::ItemStruct(struct_definition, _) => {
194195
if attr::contains_name(i.attrs.as_slice(), "simd") {
195196
self.gate_feature("simd", i.span,
196197
"SIMD types are experimental and possibly buggy");
197198
}
199+
match struct_definition.super_struct {
200+
Some(ref path) => self.gate_feature("struct_inherit", path.span,
201+
"struct inheritance is experimental \
202+
and possibly buggy"),
203+
None => {}
204+
}
205+
if struct_definition.is_virtual {
206+
self.gate_feature("struct_inherit", i.span,
207+
"struct inheritance (`virtual` keyword) is \
208+
experimental and possibly buggy");
209+
}
198210
}
199211

200212
_ => {}
@@ -312,7 +324,7 @@ pub fn check_crate(sess: &Session, krate: &ast::Crate) {
312324
match attr.meta_item_list() {
313325
None => {
314326
sess.span_err(attr.span, "malformed feature attribute, \
315-
expected #[feature(...)]");
327+
expected #![feature(...)]");
316328
}
317329
Some(list) => {
318330
for &mi in list.iter() {

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ pub mod llvm {
709709
pub fn LLVMSetGC(Fn: ValueRef, Name: *c_char);
710710
pub fn LLVMAddFunctionAttr(Fn: ValueRef, PA: c_uint);
711711
pub fn LLVMAddFunctionAttrString(Fn: ValueRef, Name: *c_char);
712+
pub fn LLVMRemoveFunctionAttrString(Fn: ValueRef, Name: *c_char);
712713
pub fn LLVMGetFunctionAttr(Fn: ValueRef) -> c_ulonglong;
713714

714715
pub fn LLVMAddReturnAttribute(Fn: ValueRef, PA: c_uint);

0 commit comments

Comments
 (0)