Skip to content

Commit 22770ee

Browse files
committed
---
yaml --- r: 236482 b: refs/heads/auto c: 2ec89c7 h: refs/heads/master v: v3
1 parent f9fcb21 commit 22770ee

File tree

26 files changed

+278
-208
lines changed

26 files changed

+278
-208
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: ded2370a740e7d3b3bd631012f1a724c11b315cf
11+
refs/heads/auto: 2ec89c727950c954d6503f8d777adc14cabb5248
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,12 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
12951295
putvar CFG_MSVC_LIB_PATH_${bits}
12961296
;;
12971297

1298+
*-rumprun-netbsd)
1299+
step_msg "targeting rumprun-netbsd, disabling jemalloc"
1300+
CFG_DISABLE_JEMALLOC=1
1301+
putvar CFG_DISABLE_JEMALLOC
1302+
;;
1303+
12981304
*)
12991305
;;
13001306
esac
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# x86_64-rumprun-netbsd configuration
2+
CROSS_PREFIX_x86_64-rumprun-netbsd=x86_64-rumprun-netbsd-
3+
CC_x86_64-rumprun-netbsd=gcc
4+
CXX_x86_64-rumprun-netbsd=g++
5+
CPP_x86_64-rumprun-netbsd=gcc -E
6+
AR_x86_64-rumprun-netbsd=ar
7+
CFG_INSTALL_ONLY_RLIB_x86_64-rumprun-netbsd = 1
8+
CFG_LIB_NAME_x86_64-rumprun-netbsd=lib$(1).so
9+
CFG_STATIC_LIB_NAME_x86_64-rumprun-netbsd=lib$(1).a
10+
CFG_LIB_GLOB_x86_64-rumprun-netbsd=lib$(1)-*.so
11+
CFG_JEMALLOC_CFLAGS_x86_64-rumprun-netbsd := -m64
12+
CFG_GCCISH_CFLAGS_x86_64-rumprun-netbsd := -Wall -Werror -g -fPIC -m64
13+
CFG_GCCISH_CXXFLAGS_x86_64-rumprun-netbsd :=
14+
CFG_GCCISH_LINK_FLAGS_x86_64-rumprun-netbsd :=
15+
CFG_GCCISH_DEF_FLAG_x86_64-rumprun-netbsd :=
16+
CFG_LLC_FLAGS_x86_64-rumprun-netbsd :=
17+
CFG_INSTALL_NAME_x86_64-rumprun-netbsd =
18+
CFG_EXE_SUFFIX_x86_64-rumprun-netbsd =
19+
CFG_WINDOWSY_x86_64-rumprun-netbsd :=
20+
CFG_UNIXY_x86_64-rumprun-netbsd := 1
21+
CFG_LDPATH_x86_64-rumprun-netbsd :=
22+
CFG_RUN_x86_64-rumprun-netbsd=$(2)
23+
CFG_RUN_TARG_x86_64-rumprun-netbsd=$(call CFG_RUN_x86_64-rumprun-netbsd,,$(2))
24+
CFG_GNU_TRIPLE_x86_64-rumprun-netbsd := x86_64-rumprun-netbsd

branches/auto/src/doc/reference.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ mod foo {
881881
}
882882
883883
use foo::example::iter; // good: foo is at crate root
884-
// use example::iter; // bad: core is not at the crate root
884+
// use example::iter; // bad: example is not at the crate root
885885
use self::baz::foobaz; // good: self refers to module 'foo'
886886
use foo::bar::foobar; // good: foo is at crate root
887887

branches/auto/src/libcollections/str.rs

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,25 +1157,21 @@ impl str {
11571157
core_str::StrExt::rmatches(self, pat)
11581158
}
11591159

1160-
/// An iterator over the start and end indices of the disjoint matches
1161-
/// of a pattern within `self`.
1160+
/// An iterator over the disjoint matches of a pattern within `self` as well
1161+
/// as the index that the match starts at.
11621162
///
11631163
/// For matches of `pat` within `self` that overlap, only the indices
1164-
/// corresponding to the first
1165-
/// match are returned.
1164+
/// corresponding to the first match are returned.
11661165
///
1167-
/// The pattern can be a simple `&str`, `char`, or a closure that
1168-
/// determines if a character matches.
1169-
/// Additional libraries might provide more complex patterns like
1170-
/// regular expressions.
1166+
/// The pattern can be a simple `&str`, `char`, or a closure that determines
1167+
/// if a character matches. Additional libraries might provide more complex
1168+
/// patterns like regular expressions.
11711169
///
11721170
/// # Iterator behavior
11731171
///
11741172
/// The returned iterator will be double ended if the pattern allows a
1175-
/// reverse search
1176-
/// and forward/reverse search yields the same elements. This is true for,
1177-
/// eg, `char` but not
1178-
/// for `&str`.
1173+
/// reverse search and forward/reverse search yields the same elements. This
1174+
/// is true for, eg, `char` but not for `&str`.
11791175
///
11801176
/// If the pattern allows a reverse search but its results might differ
11811177
/// from a forward search, `rmatch_indices()` can be used.
@@ -1185,42 +1181,36 @@ impl str {
11851181
/// ```
11861182
/// #![feature(str_match_indices)]
11871183
///
1188-
/// let v: Vec<(usize, usize)> = "abcXXXabcYYYabc".match_indices("abc").collect();
1189-
/// assert_eq!(v, [(0, 3), (6, 9), (12, 15)]);
1184+
/// let v: Vec<_> = "abcXXXabcYYYabc".match_indices("abc").collect();
1185+
/// assert_eq!(v, [(0, "abc"), (6, "abc"), (12, "abc")]);
11901186
///
1191-
/// let v: Vec<(usize, usize)> = "1abcabc2".match_indices("abc").collect();
1192-
/// assert_eq!(v, [(1, 4), (4, 7)]);
1187+
/// let v: Vec<_> = "1abcabc2".match_indices("abc").collect();
1188+
/// assert_eq!(v, [(1, "abc"), (4, "abc")]);
11931189
///
1194-
/// let v: Vec<(usize, usize)> = "ababa".match_indices("aba").collect();
1195-
/// assert_eq!(v, [(0, 3)]); // only the first `aba`
1190+
/// let v: Vec<_> = "ababa".match_indices("aba").collect();
1191+
/// assert_eq!(v, [(0, "aba")]); // only the first `aba`
11961192
/// ```
11971193
#[unstable(feature = "str_match_indices",
11981194
reason = "might have its iterator type changed",
11991195
issue = "27743")]
1200-
// NB: Right now MatchIndices yields `(usize, usize)`, but it would
1201-
// be more consistent with `matches` and `char_indices` to return `(usize, &str)`
12021196
pub fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P> {
12031197
core_str::StrExt::match_indices(self, pat)
12041198
}
12051199

1206-
/// An iterator over the start and end indices of the disjoint matches of
1207-
/// a pattern within
1208-
/// `self`, yielded in reverse order.
1200+
/// An iterator over the disjoint matches of a pattern within `self`,
1201+
/// yielded in reverse order along with the index of the match.
12091202
///
12101203
/// For matches of `pat` within `self` that overlap, only the indices
1211-
/// corresponding to the last
1212-
/// match are returned.
1204+
/// corresponding to the last match are returned.
12131205
///
1214-
/// The pattern can be a simple `&str`, `char`, or a closure that
1215-
/// determines if a character matches.
1216-
/// Additional libraries might provide more complex patterns like
1217-
/// regular expressions.
1206+
/// The pattern can be a simple `&str`, `char`, or a closure that determines
1207+
/// if a character matches. Additional libraries might provide more complex
1208+
/// patterns like regular expressions.
12181209
///
12191210
/// # Iterator behavior
12201211
///
1221-
/// The returned iterator requires that the pattern supports a
1222-
/// reverse search,
1223-
/// and it will be double ended if a forward/reverse search yields
1212+
/// The returned iterator requires that the pattern supports a reverse
1213+
/// search, and it will be double ended if a forward/reverse search yields
12241214
/// the same elements.
12251215
///
12261216
/// For iterating from the front, `match_indices()` can be used.
@@ -1230,20 +1220,18 @@ impl str {
12301220
/// ```
12311221
/// #![feature(str_match_indices)]
12321222
///
1233-
/// let v: Vec<(usize, usize)> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
1234-
/// assert_eq!(v, [(12, 15), (6, 9), (0, 3)]);
1223+
/// let v: Vec<_> = "abcXXXabcYYYabc".rmatch_indices("abc").collect();
1224+
/// assert_eq!(v, [(12, "abc"), (6, "abc"), (0, "abc")]);
12351225
///
1236-
/// let v: Vec<(usize, usize)> = "1abcabc2".rmatch_indices("abc").collect();
1237-
/// assert_eq!(v, [(4, 7), (1, 4)]);
1226+
/// let v: Vec<_> = "1abcabc2".rmatch_indices("abc").collect();
1227+
/// assert_eq!(v, [(4, "abc"), (1, "abc")]);
12381228
///
1239-
/// let v: Vec<(usize, usize)> = "ababa".rmatch_indices("aba").collect();
1240-
/// assert_eq!(v, [(2, 5)]); // only the last `aba`
1229+
/// let v: Vec<_> = "ababa".rmatch_indices("aba").collect();
1230+
/// assert_eq!(v, [(2, "aba")]); // only the last `aba`
12411231
/// ```
12421232
#[unstable(feature = "str_match_indices",
12431233
reason = "might have its iterator type changed",
12441234
issue = "27743")]
1245-
// NB: Right now RMatchIndices yields `(usize, usize)`, but it would
1246-
// be more consistent with `rmatches` and `char_indices` to return `(usize, &str)`
12471235
pub fn rmatch_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> RMatchIndices<'a, P>
12481236
where P::Searcher: ReverseSearcher<'a>
12491237
{
@@ -1416,10 +1404,10 @@ impl str {
14161404
pub fn replace(&self, from: &str, to: &str) -> String {
14171405
let mut result = String::new();
14181406
let mut last_end = 0;
1419-
for (start, end) in self.match_indices(from) {
1407+
for (start, part) in self.match_indices(from) {
14201408
result.push_str(unsafe { self.slice_unchecked(last_end, start) });
14211409
result.push_str(to);
1422-
last_end = end;
1410+
last_end = start + part.len();
14231411
}
14241412
result.push_str(unsafe { self.slice_unchecked(last_end, self.len()) });
14251413
result

branches/auto/src/libcollections/string.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,8 +1041,8 @@ impl ops::DerefMut for String {
10411041
#[unstable(feature = "str_parse_error", reason = "may want to be replaced with \
10421042
Void if it ever exists",
10431043
issue = "27734")]
1044-
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
1045-
pub struct ParseError(());
1044+
#[derive(Copy)]
1045+
pub enum ParseError {}
10461046

10471047
#[stable(feature = "rust1", since = "1.0.0")]
10481048
impl FromStr for String {
@@ -1053,6 +1053,26 @@ impl FromStr for String {
10531053
}
10541054
}
10551055

1056+
impl Clone for ParseError {
1057+
fn clone(&self) -> ParseError {
1058+
match *self {}
1059+
}
1060+
}
1061+
1062+
impl fmt::Debug for ParseError {
1063+
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
1064+
match *self {}
1065+
}
1066+
}
1067+
1068+
impl PartialEq for ParseError {
1069+
fn eq(&self, _: &ParseError) -> bool {
1070+
match *self {}
1071+
}
1072+
}
1073+
1074+
impl Eq for ParseError {}
1075+
10561076
/// A generic trait for converting a value to a string
10571077
#[stable(feature = "rust1", since = "1.0.0")]
10581078
pub trait ToString {

branches/auto/src/libcollectionstest/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,7 +1047,7 @@ fn test_pattern_deref_forward() {
10471047
fn test_empty_match_indices() {
10481048
let data = "aä中!";
10491049
let vec: Vec<_> = data.match_indices("").collect();
1050-
assert_eq!(vec, [(0, 0), (1, 1), (3, 3), (6, 6), (7, 7)]);
1050+
assert_eq!(vec, [(0, ""), (1, ""), (3, ""), (6, ""), (7, "")]);
10511051
}
10521052

10531053
#[test]
@@ -1477,7 +1477,7 @@ generate_iterator_test! {
14771477

14781478
generate_iterator_test! {
14791479
double_ended_match_indices {
1480-
("a1b2c3", char::is_numeric) -> [(1, 2), (3, 4), (5, 6)];
1480+
("a1b2c3", char::is_numeric) -> [(1, "1"), (3, "2"), (5, "3")];
14811481
}
14821482
with str::match_indices, str::rmatch_indices;
14831483
}

branches/auto/src/libcore/str/mod.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,19 @@ struct MatchIndicesInternal<'a, P: Pattern<'a>>(P::Searcher);
729729

730730
impl<'a, P: Pattern<'a>> MatchIndicesInternal<'a, P> {
731731
#[inline]
732-
fn next(&mut self) -> Option<(usize, usize)> {
733-
self.0.next_match()
732+
fn next(&mut self) -> Option<(usize, &'a str)> {
733+
self.0.next_match().map(|(start, end)| unsafe {
734+
(start, self.0.haystack().slice_unchecked(start, end))
735+
})
734736
}
735737

736738
#[inline]
737-
fn next_back(&mut self) -> Option<(usize, usize)>
739+
fn next_back(&mut self) -> Option<(usize, &'a str)>
738740
where P::Searcher: ReverseSearcher<'a>
739741
{
740-
self.0.next_match_back()
742+
self.0.next_match_back().map(|(start, end)| unsafe {
743+
(start, self.0.haystack().slice_unchecked(start, end))
744+
})
741745
}
742746
}
743747

@@ -753,7 +757,7 @@ generate_pattern_iterators! {
753757
reason = "type may be removed or have its iterator impl changed",
754758
issue = "27743")]
755759
internal:
756-
MatchIndicesInternal yielding ((usize, usize));
760+
MatchIndicesInternal yielding ((usize, &'a str));
757761
delegate double ended;
758762
}
759763

branches/auto/src/liblibc/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
html_playground_url = "https://play.rust-lang.org/",
2525
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
2626
#![cfg_attr(test, feature(test))]
27+
#![feature(cfg_target_vendor)]
2728

2829
//! Bindings for the C standard library and other platform libraries
2930
//!
@@ -143,7 +144,10 @@ pub use funcs::bsd43::*;
143144

144145
// On NaCl, these libraries are static. Thus it would be a Bad Idea to link them
145146
// in when creating a test crate.
146-
#[cfg(not(any(windows, target_env = "musl", all(target_os = "nacl", test))))]
147+
#[cfg(not(any(windows,
148+
target_env = "musl",
149+
all(target_os = "nacl", test),
150+
all(target_os = "netbsd", target_vendor = "rumprun"))))]
147151
#[link(name = "c")]
148152
#[link(name = "m")]
149153
extern {}

branches/auto/src/librustc/middle/check_const.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -709,20 +709,26 @@ fn check_expr<'a, 'tcx>(v: &mut CheckCrateVisitor<'a, 'tcx>,
709709
if !is_const {
710710
v.add_qualif(ConstQualif::NOT_CONST);
711711
if v.mode != Mode::Var {
712+
fn span_limited_call_error(tcx: &ty::ctxt, span: Span, s: &str) {
713+
span_err!(tcx.sess, span, E0015, "{}", s);
714+
}
715+
712716
// FIXME(#24111) Remove this check when const fn stabilizes
713717
if let UnstableFeatures::Disallow = v.tcx.sess.opts.unstable_features {
714-
span_err!(v.tcx.sess, e.span, E0015,
715-
"function calls in {}s are limited to \
716-
struct and enum constructors", v.msg());
718+
span_limited_call_error(&v.tcx, e.span,
719+
&format!("function calls in {}s are limited to \
720+
struct and enum constructors",
721+
v.msg()));
717722
v.tcx.sess.span_note(e.span,
718723
"a limited form of compile-time function \
719724
evaluation is available on a nightly \
720725
compiler via `const fn`");
721726
} else {
722-
span_err!(v.tcx.sess, e.span, E0015,
723-
"function calls in {}s are limited to \
724-
constant functions, \
725-
struct and enum constructors", v.msg());
727+
span_limited_call_error(&v.tcx, e.span,
728+
&format!("function calls in {}s are limited \
729+
to constant functions, \
730+
struct and enum constructors",
731+
v.msg()));
726732
}
727733
}
728734
}

branches/auto/src/librustc/session/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ fn split_msg_into_multilines(msg: &str) -> Option<String> {
331331
let first = msg.match_indices("expected").filter(|s| {
332332
s.0 > 0 && (msg.char_at_reverse(s.0) == ' ' ||
333333
msg.char_at_reverse(s.0) == '(')
334-
}).map(|(a, b)| (a - 1, b));
334+
}).map(|(a, b)| (a - 1, a + b.len()));
335335
let second = msg.match_indices("found").filter(|s| {
336336
msg.char_at_reverse(s.0) == ' '
337-
}).map(|(a, b)| (a - 1, b));
337+
}).map(|(a, b)| (a - 1, a + b.len()));
338338

339339
let mut new_msg = String::new();
340340
let mut head = 0;

branches/auto/src/librustc_back/target/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ impl Target {
411411
x86_64_unknown_bitrig,
412412
x86_64_unknown_openbsd,
413413
x86_64_unknown_netbsd,
414+
x86_64_rumprun_netbsd,
414415

415416
x86_64_apple_darwin,
416417
i686_apple_darwin,
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use target::Target;
12+
13+
pub fn target() -> Target {
14+
let mut base = super::netbsd_base::opts();
15+
base.pre_link_args.push("-m64".to_string());
16+
base.linker = "x86_64-rumprun-netbsd-gcc".to_string();
17+
base.ar = "x86_64-rumprun-netbsd-ar".to_string();
18+
19+
base.dynamic_linking = false;
20+
base.has_rpath = false;
21+
base.position_independent_executables = false;
22+
base.disable_redzone = true;
23+
base.no_default_libraries = false;
24+
25+
Target {
26+
llvm_target: "x86_64-rumprun-netbsd".to_string(),
27+
target_endian: "little".to_string(),
28+
target_pointer_width: "64".to_string(),
29+
arch: "x86_64".to_string(),
30+
target_os: "netbsd".to_string(),
31+
target_env: "".to_string(),
32+
target_vendor: "rumprun".to_string(),
33+
options: base,
34+
}
35+
}

branches/auto/src/librustdoc/html/static/playpen.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
/*globals $: true, rootPath: true */
1313

1414
document.addEventListener('DOMContentLoaded', function() {
15+
'use strict';
16+
1517
if (!window.playgroundUrl) {
1618
return;
1719
}

0 commit comments

Comments
 (0)