Skip to content

Commit 71e7d76

Browse files
committed
---
yaml --- r: 137567 b: refs/heads/master c: 3f1ed86 h: refs/heads/master i: 137565: f1ca342 137563: 7bd0e90 137559: a38d5aa 137551: 62f89fa 137535: 531ecc1 v: v3
1 parent f41d70c commit 71e7d76

Some content is hidden

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

43 files changed

+506
-936
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d569dfe37eac393509351c28db01e50e0ca323c2
2+
refs/heads/master: 3f1ed8608d6c049b4f5beab95fe8acd5ae310b76
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: cd53dac86b43e0b46f06ab265b71526242a2fc5e

trunk/configure

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,17 +535,13 @@ probe CFG_LLDB lldb
535535

536536
if [ ! -z "$CFG_GDB" ]
537537
then
538-
# Store GDB's version
538+
# Extract the version
539539
CFG_GDB_VERSION=$($CFG_GDB --version 2>/dev/null | head -1)
540540
putvar CFG_GDB_VERSION
541541
fi
542542

543543
if [ ! -z "$CFG_LLDB" ]
544544
then
545-
# Store LLDB's version
546-
CFG_LLDB_VERSION=$($CFG_LLDB --version 2>/dev/null | head -1)
547-
putvar CFG_LLDB_VERSION
548-
549545
# If CFG_LLDB_PYTHON_DIR is not already set from the outside and valid, try to read it from
550546
# LLDB via the -P commandline options.
551547
if [ -z "$CFG_LLDB_PYTHON_DIR" ] || [ ! -d "$CFG_LLDB_PYTHON_DIR" ]

trunk/mk/tests.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,6 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
625625
--target $(2) \
626626
--host $(3) \
627627
--gdb-version="$(CFG_GDB_VERSION)" \
628-
--lldb-version="$(CFG_LLDB_VERSION)" \
629628
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
630629
--adb-path=$(CFG_ADB) \
631630
--adb-test-dir=$(CFG_ADB_TEST_DIR) \

trunk/src/compiletest/common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,6 @@ pub struct Config {
133133
// Version of GDB
134134
pub gdb_version: Option<String>,
135135

136-
// Version of LLDB
137-
pub lldb_version: Option<String>,
138-
139136
// Path to the android tools
140137
pub android_cross_path: Path,
141138

trunk/src/compiletest/compiletest.rs

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
7171
optflag("", "jit", "run tests under the JIT"),
7272
optopt("", "target", "the target to build for", "TARGET"),
7373
optopt("", "host", "the host to build for", "HOST"),
74-
optopt("", "gdb-version", "the version of GDB used", "VERSION STRING"),
75-
optopt("", "lldb-version", "the version of LLDB used", "VERSION STRING"),
74+
optopt("", "gdb-version", "the version of GDB used", "MAJOR.MINOR"),
7675
optopt("", "android-cross-path", "Android NDK standalone path", "PATH"),
7776
optopt("", "adb-path", "path to the android debugger", "PATH"),
7877
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
@@ -150,7 +149,6 @@ pub fn parse_config(args: Vec<String> ) -> Config {
150149
target: opt_str2(matches.opt_str("target")),
151150
host: opt_str2(matches.opt_str("host")),
152151
gdb_version: extract_gdb_version(matches.opt_str("gdb-version")),
153-
lldb_version: extract_lldb_version(matches.opt_str("lldb-version")),
154152
android_cross_path: opt_path(matches, "android-cross-path"),
155153
adb_path: opt_str2(matches.opt_str("adb-path")),
156154
adb_test_dir: opt_str2(matches.opt_str("adb-test-dir")),
@@ -393,37 +391,3 @@ fn extract_gdb_version(full_version_line: Option<String>) -> Option<String> {
393391
_ => None
394392
}
395393
}
396-
397-
fn extract_lldb_version(full_version_line: Option<String>) -> Option<String> {
398-
// Extract the major LLDB version from the given version string.
399-
// LLDB version strings are different for Apple and non-Apple platforms.
400-
// At the moment, this function only supports the Apple variant, which looks
401-
// like this:
402-
//
403-
// LLDB-179.5 (older versions)
404-
// lldb-300.2.51 (new versions)
405-
//
406-
// We are only interested in the major version number, so this function
407-
// will return `Some("179")` and `Some("300")` respectively.
408-
409-
match full_version_line {
410-
Some(ref full_version_line)
411-
if full_version_line.as_slice().trim().len() > 0 => {
412-
let full_version_line = full_version_line.as_slice().trim();
413-
414-
let re = Regex::new(r"[Ll][Ll][Dd][Bb]-([0-9]+)").unwrap();
415-
416-
match re.captures(full_version_line) {
417-
Some(captures) => {
418-
Some(captures.at(1).to_string())
419-
}
420-
None => {
421-
println!("Could not extract LLDB version from line '{}'",
422-
full_version_line);
423-
None
424-
}
425-
}
426-
},
427-
_ => None
428-
}
429-
}

trunk/src/compiletest/header.rs

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -181,42 +181,14 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
181181
}
182182
}
183183

184-
fn ignore_lldb(config: &Config, line: &str) -> bool {
185-
if config.mode != common::DebugInfoLldb {
186-
return false;
187-
}
188-
189-
if parse_name_directive(line, "ignore-lldb") {
190-
return true;
191-
}
192-
193-
match config.lldb_version {
194-
Some(ref actual_version) => {
195-
if line.contains("min-lldb-version") {
196-
let min_version = line.trim()
197-
.split(' ')
198-
.last()
199-
.expect("Malformed lldb version directive");
200-
// Ignore if actual version is smaller the minimum required
201-
// version
202-
lldb_version_to_int(actual_version.as_slice()) <
203-
lldb_version_to_int(min_version.as_slice())
204-
} else {
205-
false
206-
}
207-
}
208-
None => false
209-
}
210-
}
211-
212184
let val = iter_header(testfile, |ln| {
213185
!parse_name_directive(ln, "ignore-test") &&
214186
!parse_name_directive(ln, ignore_target(config).as_slice()) &&
215187
!parse_name_directive(ln, ignore_stage(config).as_slice()) &&
216188
!(config.mode == common::Pretty && parse_name_directive(ln, "ignore-pretty")) &&
217189
!(config.target != config.host && parse_name_directive(ln, "ignore-cross-compile")) &&
218190
!ignore_gdb(config, ln) &&
219-
!ignore_lldb(config, ln)
191+
!(config.mode == common::DebugInfoLldb && parse_name_directive(ln, "ignore-lldb"))
220192
});
221193

222194
!val
@@ -358,12 +330,3 @@ pub fn gdb_version_to_int(version_string: &str) -> int {
358330

359331
return major * 1000 + minor;
360332
}
361-
362-
pub fn lldb_version_to_int(version_string: &str) -> int {
363-
let error_string = format!(
364-
"Encountered LLDB version string with unexpected format: {}",
365-
version_string);
366-
let error_string = error_string.as_slice();
367-
let major: int = FromStr::from_str(version_string).expect(error_string);
368-
return major;
369-
}

trunk/src/compiletest/runtest.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -626,17 +626,6 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
626626

627627
let exe_file = make_exe_name(config, testfile);
628628

629-
match config.lldb_version {
630-
Some(ref version) => {
631-
println!("NOTE: compiletest thinks it is using LLDB version {}",
632-
version.as_slice());
633-
}
634-
_ => {
635-
println!("NOTE: compiletest does not know which version of \
636-
LLDB it is using");
637-
}
638-
}
639-
640629
// Parse debugger commands etc from test files
641630
let DebuggerCommands {
642631
commands,

trunk/src/doc/guide-macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ forbidden.
8787

8888
Otherwise, the invocation syntax is free-form.
8989

90-
To take a fragment of Rust code as an argument, write `$` followed by a name
90+
To take as an argument a fragment of Rust code, write `$` followed by a name
9191
(for use on the right-hand side), followed by a `:`, followed by a *fragment
9292
specifier*. The fragment specifier denotes the sort of fragment to match. The
9393
most common fragment specifiers are:

trunk/src/doc/guide.md

Lines changed: 59 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -914,23 +914,12 @@ or 'breaks up,' the tuple, and assigns the bits to three bindings.
914914

915915
This pattern is very powerful, and we'll see it repeated more later.
916916

917-
There also a few things you can do with a tuple as a whole, without
918-
destructuring. You can assign one tuple into another, if they have the same
919-
arity and contained types.
920-
921-
```rust
922-
let mut x = (1i, 2i);
923-
let y = (2i, 3i);
924-
925-
x = y;
926-
```
927-
928-
You can also check for equality with `==`. Again, this will only compile if the
929-
tuples have the same type.
917+
The last thing to say about tuples is that they are only equivalent if
918+
the arity, types, and values are all identical.
930919

931920
```rust
932921
let x = (1i, 2i, 3i);
933-
let y = (2i, 2i, 4i);
922+
let y = (2i, 3i, 4i);
934923

935924
if x == y {
936925
println!("yes");
@@ -939,7 +928,7 @@ if x == y {
939928
}
940929
```
941930

942-
This will print `no`, because some of the values aren't equal.
931+
This will print `no`, as the values aren't equal.
943932

944933
One other use of tuples is to return multiple values from a function:
945934

@@ -5212,8 +5201,8 @@ We can check this out using a special flag to `rustc`. This code, in a file
52125201

52135202
```{rust}
52145203
fn main() {
5215-
let x = 5i;
5216-
println!("x is: {}", x);
5204+
let x = "Hello";
5205+
println!("x is: {:s}", x);
52175206
}
52185207
```
52195208

@@ -5225,19 +5214,32 @@ give us this huge result:
52255214
#![no_std]
52265215
#![feature(globs)]
52275216
#[phase(plugin, link)]
5228-
extern crate "std" as std;
5229-
extern crate "native" as rt;
5230-
#[prelude_import]
5217+
extern crate std = "std";
5218+
extern crate rt = "native";
52315219
use std::prelude::*;
52325220
fn main() {
5233-
let x = 5i;
5221+
let x = "Hello";
52345222
match (&x,) {
52355223
(__arg0,) => {
52365224
#[inline]
52375225
#[allow(dead_code)]
5238-
static __STATIC_FMTSTR: [&'static str, ..1u] = ["x is: "];
5226+
static __STATIC_FMTSTR: [::std::fmt::rt::Piece<'static>, ..2u] =
5227+
[::std::fmt::rt::String("x is: "),
5228+
::std::fmt::rt::Argument(::std::fmt::rt::Argument{position:
5229+
::std::fmt::rt::ArgumentNext,
5230+
format:
5231+
::std::fmt::rt::FormatSpec{fill:
5232+
' ',
5233+
align:
5234+
::std::fmt::rt::AlignUnknown,
5235+
flags:
5236+
0u,
5237+
precision:
5238+
::std::fmt::rt::CountImplied,
5239+
width:
5240+
::std::fmt::rt::CountImplied,},})];
52395241
let __args_vec =
5240-
&[::std::fmt::argument(::std::fmt::secret_show, __arg0)];
5242+
&[::std::fmt::argument(::std::fmt::secret_string, __arg0)];
52415243
let __args =
52425244
unsafe {
52435245
::std::fmt::Arguments::new(__STATIC_FMTSTR, __args_vec)
@@ -5248,16 +5250,45 @@ fn main() {
52485250
}
52495251
```
52505252

5253+
Intense. Here's a trimmed down version that's a bit easier to read:
5254+
5255+
```{rust,ignore}
5256+
fn main() {
5257+
let x = 5i;
5258+
match (&x,) {
5259+
(__arg0,) => {
5260+
static __STATIC_FMTSTR: =
5261+
[String("x is: "),
5262+
Argument(Argument {
5263+
position: ArgumentNext,
5264+
format: FormatSpec {
5265+
fill: ' ',
5266+
align: AlignUnknown,
5267+
flags: 0u,
5268+
precision: CountImplied,
5269+
width: CountImplied,
5270+
},
5271+
},
5272+
];
5273+
let __args_vec = &[argument(secret_string, __arg0)];
5274+
let __args = unsafe { Arguments::new(__STATIC_FMTSTR, __args_vec) };
5275+
5276+
println_args(&__args)
5277+
}
5278+
};
5279+
}
5280+
```
5281+
52515282
Whew! This isn't too terrible. You can see that we still `let x = 5i`,
52525283
but then things get a little bit hairy. Three more bindings get set: a
52535284
static format string, an argument vector, and the arguments. We then
52545285
invoke the `println_args` function with the generated arguments.
52555286

5256-
This is the code that Rust actually compiles. You can see all of the extra
5257-
information that's here. We get all of the type safety and options that it
5258-
provides, but at compile time, and without needing to type all of this out.
5259-
This is how macros are powerful. Without them, you would need to type all of
5260-
this by hand to get a type checked `println`.
5287+
This is the code (well, the full version) that Rust actually compiles. You can
5288+
see all of the extra information that's here. We get all of the type safety and
5289+
options that it provides, but at compile time, and without needing to type all
5290+
of this out. This is how macros are powerful. Without them, you would need to
5291+
type all of this by hand to get a type checked `println`.
52615292

52625293
For more on macros, please consult [the Macros Guide](guide-macros.html).
52635294
Macros are a very advanced and still slightly experimental feature, but don't

0 commit comments

Comments
 (0)