Skip to content

Commit 3df0301

Browse files
committed
---
yaml --- r: 274924 b: refs/heads/stable c: 310ab5e h: refs/heads/master
1 parent 5d03567 commit 3df0301

File tree

12 files changed

+179
-151
lines changed

12 files changed

+179
-151
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: c49edbc5eefe9526b66c0f922a2ce10bd394b15d
32+
refs/heads/stable: 310ab5ea747110941f14d6aa8dc69cb794f1335d
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/doc/book/strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The second, with a `\`, trims the spaces and the newline:
3939

4040
```rust
4141
let s = "foo\
42-
bar";
42+
bar";
4343

4444
assert_eq!("foobar", s);
4545
```
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#!/usr/bin/env python2
2+
3+
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
4+
# file at the top-level directory of this distribution and at
5+
# http://rust-lang.org/COPYRIGHT.
6+
#
7+
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
8+
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
9+
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
10+
# option. This file may not be copied, modified, or distributed
11+
# except according to those terms.
12+
13+
from __future__ import absolute_import, division, print_function
14+
import argparse
15+
import datetime
16+
import os.path as path
17+
18+
19+
def print_tests(tests):
20+
print('\n'.join([test_tostr(t) for t in tests]))
21+
22+
23+
def read_tests(f):
24+
basename, _ = path.splitext(path.basename(f))
25+
tests = []
26+
for lineno, line in enumerate(open(f), 1):
27+
fields = filter(None, map(str.strip, line.split('\t')))
28+
if not (4 <= len(fields) <= 5) \
29+
or 'E' not in fields[0] or fields[0][0] == '#':
30+
continue
31+
32+
opts, pat, text, sgroups = fields[0:4]
33+
groups = [] # groups as integer ranges
34+
if sgroups == 'NOMATCH':
35+
groups = [None]
36+
elif ',' in sgroups:
37+
noparen = map(lambda s: s.strip('()'), sgroups.split(')('))
38+
for g in noparen:
39+
s, e = map(str.strip, g.split(','))
40+
if s == '?' and e == '?':
41+
groups.append(None)
42+
else:
43+
groups.append((int(s), int(e)))
44+
else:
45+
# This skips tests that should result in an error.
46+
# There aren't many, so I think we can just capture those
47+
# manually. Possibly fix this in future.
48+
continue
49+
50+
if pat == 'SAME':
51+
pat = tests[-1][1]
52+
if '$' in opts:
53+
pat = pat.decode('string_escape')
54+
text = text.decode('string_escape')
55+
if 'i' in opts:
56+
pat = '(?i)%s' % pat
57+
58+
name = '%s_%d' % (basename, lineno)
59+
tests.append((name, pat, text, groups))
60+
return tests
61+
62+
63+
def test_tostr(t):
64+
lineno, pat, text, groups = t
65+
options = map(group_tostr, groups)
66+
return 'mat!{match_%s, r"%s", r"%s", %s}' \
67+
% (lineno, pat, '' if text == "NULL" else text, ', '.join(options))
68+
69+
70+
def group_tostr(g):
71+
if g is None:
72+
return 'None'
73+
else:
74+
return 'Some((%d, %d))' % (g[0], g[1])
75+
76+
77+
if __name__ == '__main__':
78+
parser = argparse.ArgumentParser(
79+
description='Generate match tests from an AT&T POSIX test file.')
80+
aa = parser.add_argument
81+
aa('files', nargs='+',
82+
help='A list of dat AT&T POSIX test files. See src/libregexp/testdata')
83+
args = parser.parse_args()
84+
85+
tests = []
86+
for f in args.files:
87+
tests += read_tests(f)
88+
89+
tpl = '''// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
90+
// file at the top-level directory of this distribution and at
91+
// http://rust-lang.org/COPYRIGHT.
92+
//
93+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
94+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
95+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
96+
// option. This file may not be copied, modified, or distributed
97+
// except according to those terms.
98+
99+
// ignore-tidy-linelength
100+
101+
// DO NOT EDIT. Automatically generated by 'src/etc/regexp-match-tests'
102+
// on {date}.
103+
'''
104+
print(tpl.format(date=str(datetime.datetime.now())))
105+
106+
for f in args.files:
107+
print('// Tests from %s' % path.basename(f))
108+
print_tests(read_tests(f))
109+
print('')

branches/stable/src/libcore/ptr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ pub unsafe fn read<T>(src: *const T) -> T {
127127
tmp
128128
}
129129

130-
#[allow(missing_docs)]
130+
/// Variant of read_and_zero that writes the specific drop-flag byte
131+
/// (which may be more appropriate than zero).
131132
#[inline(always)]
132133
#[unstable(feature = "filling_drop",
133134
reason = "may play a larger role in std::ptr future extensions",

branches/stable/src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3828,7 +3828,7 @@ impl<'tcx> Expectation<'tcx> {
38283828
/// for examples of where this comes up,.
38293829
fn rvalue_hint(tcx: &ty::ctxt<'tcx>, ty: Ty<'tcx>) -> Expectation<'tcx> {
38303830
match tcx.struct_tail(ty).sty {
3831-
ty::TySlice(_) | ty::TyStr | ty::TyTrait(..) => {
3831+
ty::TySlice(_) | ty::TyTrait(..) => {
38323832
ExpectRvalueLikeUnsized(ty)
38333833
}
38343834
_ => ExpectHasType(ty)

branches/stable/src/librustdoc/html/render.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
554554
ty: shortty(item),
555555
name: item.name.clone().unwrap(),
556556
path: fqp[..fqp.len() - 1].join("::"),
557-
desc: Escape(&shorter(item.doc_value())).to_string(),
557+
desc: shorter(item.doc_value()),
558558
parent: Some(did),
559559
search_type: get_index_search_type(&item, parent_basename),
560560
});
@@ -1065,7 +1065,7 @@ impl DocFolder for Cache {
10651065
ty: shortty(&item),
10661066
name: s.to_string(),
10671067
path: path.join("::").to_string(),
1068-
desc: Escape(&shorter(item.doc_value())).to_string(),
1068+
desc: shorter(item.doc_value()),
10691069
parent: parent,
10701070
search_type: get_index_search_type(&item, parent_basename),
10711071
});
@@ -1501,17 +1501,11 @@ impl<'a> Item<'a> {
15011501
true, |component| {
15021502
path.push(component.to_string());
15031503
});
1504-
// If the span points into an external macro the
1505-
// source-file will be bogus, i.e `<foo macros>`
1506-
if Path::new(&self.item.source.filename).is_file() {
1507-
Some(format!("{root}src/{krate}/{path}.html#{href}",
1508-
root = self.cx.root_path,
1509-
krate = self.cx.layout.krate,
1510-
path = path.join("/"),
1511-
href = href))
1512-
} else {
1513-
None
1514-
}
1504+
Some(format!("{root}src/{krate}/{path}.html#{href}",
1505+
root = self.cx.root_path,
1506+
krate = self.cx.layout.krate,
1507+
path = path.join("/"),
1508+
href = href))
15151509

15161510
// If this item is not part of the local crate, then things get a little
15171511
// trickier. We don't actually know the span of the external item, but

branches/stable/src/libstd/fs.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,26 +2151,6 @@ mod tests {
21512151
"foo");
21522152
}
21532153

2154-
#[test]
2155-
fn read_link() {
2156-
if cfg!(windows) {
2157-
// directory symlink
2158-
assert_eq!(check!(fs::read_link(r"C:\Users\All Users")).to_str().unwrap(),
2159-
r"C:\ProgramData");
2160-
// junction
2161-
assert_eq!(check!(fs::read_link(r"C:\Users\Default User")).to_str().unwrap(),
2162-
r"C:\Users\Default");
2163-
// junction with special permissions
2164-
assert_eq!(check!(fs::read_link(r"C:\Documents and Settings\")).to_str().unwrap(),
2165-
r"C:\Users");
2166-
}
2167-
let tmpdir = tmpdir();
2168-
let link = tmpdir.join("link");
2169-
if !got_symlink_permission(&tmpdir) { return };
2170-
check!(symlink_file(&"foo", &link));
2171-
assert_eq!(check!(fs::read_link(&link)).to_str().unwrap(), "foo");
2172-
}
2173-
21742154
#[test]
21752155
fn readlink_not_symlink() {
21762156
let tmpdir = tmpdir();

branches/stable/src/libstd/sys/windows/c.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ pub const MAXIMUM_REPARSE_DATA_BUFFER_SIZE: usize = 16 * 1024;
240240
pub const FSCTL_GET_REPARSE_POINT: DWORD = 0x900a8;
241241
pub const IO_REPARSE_TAG_SYMLINK: DWORD = 0xa000000c;
242242
pub const IO_REPARSE_TAG_MOUNT_POINT: DWORD = 0xa0000003;
243-
pub const SYMLINK_FLAG_RELATIVE: DWORD = 0x00000001;
244243
pub const FSCTL_SET_REPARSE_POINT: DWORD = 0x900a4;
245244
pub const FSCTL_DELETE_REPARSE_POINT: DWORD = 0x900ac;
246245

@@ -534,15 +533,6 @@ pub struct SYMBOLIC_LINK_REPARSE_BUFFER {
534533
pub PathBuffer: WCHAR,
535534
}
536535

537-
#[repr(C)]
538-
pub struct MOUNT_POINT_REPARSE_BUFFER {
539-
pub SubstituteNameOffset: c_ushort,
540-
pub SubstituteNameLength: c_ushort,
541-
pub PrintNameOffset: c_ushort,
542-
pub PrintNameLength: c_ushort,
543-
pub PathBuffer: WCHAR,
544-
}
545-
546536
pub type LPPROGRESS_ROUTINE = ::option::Option<unsafe extern "system" fn(
547537
TotalFileSize: LARGE_INTEGER,
548538
TotalBytesTransferred: LARGE_INTEGER,

0 commit comments

Comments
 (0)