"advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"cargotest 0.1.0",
- "chrono 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"crates-io 0.9.0",
"crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
"curl 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-[[package]]
-name = "chrono"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "num 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "clap"
version = "2.19.3"
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "redox_syscall"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "regex"
version = "0.1.80"
name = "tidy"
version = "0.1.0"
-[[package]]
-name = "time"
-version = "0.1.37"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
- "redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "toml"
version = "0.1.30"
"checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32"
"checksum cargo 0.20.0 (git+https://github.com/rust-lang/cargo)" = "<none>"
"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c"
-"checksum chrono 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d9123be86fd2a8f627836c235ecdf331fdd067ecf7ac05aa1a68fbcf2429f056"
"checksum clap 2.19.3 (registry+https://github.com/rust-lang/crates.io-index)" = "95b78f3fe0fc94c13c731714363260e04b557a637166f33a4570d3189d642374"
"checksum cmake 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "92278eb79412c8f75cfc89e707a1bb3a6490b68f7f2e78d15c774f30fe701122"
"checksum crossbeam 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0c5ea215664ca264da8a9d9c3be80d2eaf30923c259d03e870388eb927508f97"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum racer 2.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b0d72b3afd67882adfca61d609fafb8d7aa5f9e814f12c32fcc6e171995920e8"
"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d"
-"checksum redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "29dbdfd4b9df8ab31dec47c6087b7b13cbf4a776f335e4de8efba8288dda075b"
"checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f"
"checksum regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4278c17d0f6d62dfef0ab00028feb45bd7d2102843f80763474eeb1be8a10c01"
"checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957"
"checksum thread-id 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8df7875b676fddfadffd96deea3b1124e5ede707d4884248931077518cf1f773"
"checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5"
"checksum thread_local 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c85048c6260d17cf486ceae3282d9fb6b90be220bf5b28c400f5485ffc29f0c7"
-"checksum time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3"
"checksum toml 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "0590d72182e50e879c4da3b11c6488dae18fccb1ae0c7a3eda18e16795844796"
"checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4"
"checksum toml 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bd86ad9ebee246fdedd610e0f6d0587b754a3d81438db930a244d0480ed7878f"
shutil.move(tp, fp)
shutil.rmtree(os.path.join(dst, fname))
-def run(args, verbose=False, exception=False, cwd=None):
+def run(args, verbose=False, exception=False, cwd=None, env=None):
if verbose:
print("running: " + ' '.join(args))
sys.stdout.flush()
# Use Popen here instead of call() as it apparently allows powershell on
# Windows to not lock up waiting for input presumably.
- ret = subprocess.Popen(args, cwd=cwd)
+ ret = subprocess.Popen(args, cwd=cwd, env=env)
code = ret.wait()
if code != 0:
err = "failed to run: " + ' '.join(args)
raise Exception("no cargo executable found at `%s`" % self.cargo())
args = [self.cargo(), "build", "--manifest-path",
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")]
+ if self.verbose:
+ args.append("--verbose")
+ if self.verbose > 1:
+ args.append("--verbose")
if self.use_locked_deps:
args.append("--locked")
if self.use_vendored_sources:
args.append("--frozen")
- self.run(args, env)
-
- def run(self, args, env=None, cwd=None):
- proc = subprocess.Popen(args, env=env, cwd=cwd)
- ret = proc.wait()
- if ret != 0:
- sys.exit(ret)
+ run(args, env=env, verbose=self.verbose)
def output(self, args, env=None, cwd=None):
default_encoding = sys.getdefaultencoding()
path = line[1:].split(' ')[1]
submodules.append([path, line[0]])
- self.run(["git", "submodule", "sync"], cwd=self.rust_root)
+ run(["git", "submodule", "sync"], cwd=self.rust_root)
for submod in submodules:
path, status = submod
submod_path = os.path.join(self.rust_root, path)
if status == ' ':
- self.run(["git", "reset", "--hard"], cwd=submod_path)
- self.run(["git", "clean", "-fdx"], cwd=submod_path)
+ run(["git", "reset", "--hard"], cwd=submod_path)
+ run(["git", "clean", "-fdx"], cwd=submod_path)
elif status == '+':
- self.run(["git", "submodule", "update", path], cwd=self.rust_root)
- self.run(["git", "reset", "--hard"], cwd=submod_path)
- self.run(["git", "clean", "-fdx"], cwd=submod_path)
+ run(["git", "submodule", "update", path], cwd=self.rust_root)
+ run(["git", "reset", "--hard"], cwd=submod_path)
+ run(["git", "clean", "-fdx"], cwd=submod_path)
elif status == '-':
- self.run(["git", "submodule", "init", path], cwd=self.rust_root)
- self.run(["git", "submodule", "update", path], cwd=self.rust_root)
+ run(["git", "submodule", "init", path], cwd=self.rust_root)
+ run(["git", "submodule", "update", path], cwd=self.rust_root)
else:
raise ValueError('unknown submodule status: ' + status)
except:
pass
+ if '\nverbose = 2' in rb.config_toml:
+ rb.verbose = 2
+ elif '\nverbose = 1' in rb.config_toml:
+ rb.verbose = 1
+
rb.use_vendored_sources = '\nvendor = true' in rb.config_toml or \
'CFG_ENABLE_VENDOR' in rb.config_mk
env["BUILD"] = rb.build
env["SRC"] = rb.rust_root
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
- rb.run(args, env)
+ run(args, env=env, verbose=rb.verbose)
def main():
start_time = time()
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
impl<T> RangeArgument<T> for RangeInclusive<T> {
fn start(&self) -> Bound<&T> {
- match *self {
- RangeInclusive::Empty{ ref at } => Included(at),
- RangeInclusive::NonEmpty { ref start, .. } => Included(start),
- }
+ Included(&self.start)
}
fn end(&self) -> Bound<&T> {
- match *self {
- RangeInclusive::Empty{ ref at } => Excluded(at),
- RangeInclusive::NonEmpty { ref end, .. } => Included(end),
- }
+ Included(&self.end)
}
}
#[inline]
fn next(&mut self) -> Option<A> {
- use ops::RangeInclusive::*;
-
- // this function has a sort of odd structure due to borrowck issues
- // we may need to replace self.range, so borrows of start and end need to end early
-
- let (finishing, n) = match self.range {
- Empty { .. } => return None, // empty iterators yield no values
-
- NonEmpty { ref mut start, ref mut end } => {
- let rev = self.step_by.is_negative();
-
- // march start towards (maybe past!) end and yield the old value
- if (rev && start >= end) ||
- (!rev && start <= end)
- {
- match start.step(&self.step_by) {
- Some(mut n) => {
- mem::swap(start, &mut n);
- (None, Some(n)) // yield old value, remain non-empty
- },
- None => {
- let mut n = end.clone();
- mem::swap(start, &mut n);
- (None, Some(n)) // yield old value, remain non-empty
- }
- }
- } else {
- // found range in inconsistent state (start at or past end), so become empty
- (Some(end.replace_zero()), None)
- }
- }
- };
+ let rev = self.step_by.is_negative();
- // turn into an empty iterator if we've reached the end
- if let Some(end) = finishing {
- self.range = Empty { at: end };
+ if (rev && self.range.start >= self.range.end) ||
+ (!rev && self.range.start <= self.range.end)
+ {
+ match self.range.start.step(&self.step_by) {
+ Some(n) => {
+ Some(mem::replace(&mut self.range.start, n))
+ },
+ None => {
+ let last = self.range.start.replace_one();
+ self.range.end.replace_zero();
+ self.step_by.replace_one();
+ Some(last)
+ },
+ }
+ }
+ else {
+ None
}
-
- n
}
#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
- use ops::RangeInclusive::*;
-
- match self.range {
- Empty { .. } => (0, Some(0)),
-
- NonEmpty { ref start, ref end } =>
- match Step::steps_between(start,
- end,
- &self.step_by) {
- Some(hint) => (hint.saturating_add(1), hint.checked_add(1)),
- None => (0, None)
- }
+ match Step::steps_between(&self.range.start,
+ &self.range.end,
+ &self.step_by) {
+ Some(hint) => (hint.saturating_add(1), hint.checked_add(1)),
+ None => (0, None)
}
}
}
#[inline]
fn next(&mut self) -> Option<A> {
- use ops::RangeInclusive::*;
-
- // this function has a sort of odd structure due to borrowck issues
- // we may need to replace self, so borrows of self.start and self.end need to end early
-
- let (finishing, n) = match *self {
- Empty { .. } => (None, None), // empty iterators yield no values
-
- NonEmpty { ref mut start, ref mut end } => {
- if start == end {
- (Some(end.replace_one()), Some(start.replace_one()))
- } else if start < end {
- let mut n = start.add_one();
- mem::swap(&mut n, start);
-
- // if the iterator is done iterating, it will change from
- // NonEmpty to Empty to avoid unnecessary drops or clones,
- // we'll reuse either start or end (they are equal now, so
- // it doesn't matter which) to pull out end, we need to swap
- // something back in
-
- (if n == *end { Some(end.replace_one()) } else { None },
- // ^ are we done yet?
- Some(n)) // < the value to output
- } else {
- (Some(start.replace_one()), None)
- }
- }
- };
-
- // turn into an empty iterator if this is the last value
- if let Some(end) = finishing {
- *self = Empty { at: end };
+ use cmp::Ordering::*;
+
+ match self.start.partial_cmp(&self.end) {
+ Some(Less) => {
+ let n = self.start.add_one();
+ Some(mem::replace(&mut self.start, n))
+ },
+ Some(Equal) => {
+ let last = self.start.replace_one();
+ self.end.replace_zero();
+ Some(last)
+ },
+ _ => None,
}
-
- n
}
#[inline]
fn size_hint(&self) -> (usize, Option<usize>) {
- use ops::RangeInclusive::*;
-
- match *self {
- Empty { .. } => (0, Some(0)),
+ if !(self.start <= self.end) {
+ return (0, Some(0));
+ }
- NonEmpty { ref start, ref end } =>
- match Step::steps_between_by_one(start, end) {
- Some(hint) => (hint.saturating_add(1), hint.checked_add(1)),
- None => (0, None),
- }
+ match Step::steps_between_by_one(&self.start, &self.end) {
+ Some(hint) => (hint.saturating_add(1), hint.checked_add(1)),
+ None => (0, None),
}
}
}
{
#[inline]
fn next_back(&mut self) -> Option<A> {
- use ops::RangeInclusive::*;
-
- // see Iterator::next for comments
-
- let (finishing, n) = match *self {
- Empty { .. } => return None,
-
- NonEmpty { ref mut start, ref mut end } => {
- if start == end {
- (Some(start.replace_one()), Some(end.replace_one()))
- } else if start < end {
- let mut n = end.sub_one();
- mem::swap(&mut n, end);
-
- (if n == *start { Some(start.replace_one()) } else { None },
- Some(n))
- } else {
- (Some(end.replace_one()), None)
- }
- }
- };
-
- if let Some(start) = finishing {
- *self = Empty { at: start };
+ use cmp::Ordering::*;
+
+ match self.start.partial_cmp(&self.end) {
+ Some(Less) => {
+ let n = self.end.sub_one();
+ Some(mem::replace(&mut self.end, n))
+ },
+ Some(Equal) => {
+ let last = self.end.replace_zero();
+ self.start.replace_one();
+ Some(last)
+ },
+ _ => None,
}
-
- n
}
}
/// The `Drop` trait is used to run some code when a value goes out of scope.
/// This is sometimes called a 'destructor'.
///
+/// When a value goes out of scope, if it implements this trait, it will have
+/// its `drop` method called. Then any fields the value contains will also
+/// be dropped recursively.
+///
+/// Because of the recursive dropping, you do not need to implement this trait
+/// unless your type needs its own destructor logic.
+///
/// # Examples
///
/// A trivial implementation of `Drop`. The `drop` method is called when `_x`
/// let _x = HasDrop;
/// }
/// ```
+///
+/// Showing the recursive nature of `Drop`. When `outer` goes out of scope, the
+/// `drop` method will be called first for `Outer`, then for `Inner`. Therefore
+/// `main` prints `Dropping Outer!` and then `Dropping Inner!`.
+///
+/// ```
+/// struct Inner;
+/// struct Outer(Inner);
+///
+/// impl Drop for Inner {
+/// fn drop(&mut self) {
+/// println!("Dropping Inner!");
+/// }
+/// }
+///
+/// impl Drop for Outer {
+/// fn drop(&mut self) {
+/// println!("Dropping Outer!");
+/// }
+/// }
+///
+/// fn main() {
+/// let _x = Outer(Inner);
+/// }
+/// ```
+///
+/// Because variables are dropped in the reverse order they are declared,
+/// `main` will print `Declared second!` and then `Declared first!`.
+///
+/// ```
+/// struct PrintOnDrop(&'static str);
+///
+/// fn main() {
+/// let _first = PrintOnDrop("Declared first!");
+/// let _second = PrintOnDrop("Declared second!");
+/// }
+/// ```
#[lang = "drop"]
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Drop {
/// ```
/// #![feature(inclusive_range,inclusive_range_syntax)]
/// fn main() {
-/// assert_eq!((3...5), std::ops::RangeInclusive::NonEmpty{ start: 3, end: 5 });
+/// assert_eq!((3...5), std::ops::RangeInclusive{ start: 3, end: 5 });
/// assert_eq!(3+4+5, (3...5).sum());
///
/// let arr = [0, 1, 2, 3];
/// ```
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
-pub enum RangeInclusive<Idx> {
- /// Empty range (iteration has finished)
+pub struct RangeInclusive<Idx> {
+ /// The lower bound of the range (inclusive).
#[unstable(feature = "inclusive_range",
reason = "recently added, follows RFC",
issue = "28237")]
- Empty {
- /// The point at which iteration finished
- #[unstable(feature = "inclusive_range",
- reason = "recently added, follows RFC",
- issue = "28237")]
- at: Idx
- },
- /// Non-empty range (iteration will yield value(s))
+ pub start: Idx,
+ /// The upper bound of the range (inclusive).
#[unstable(feature = "inclusive_range",
reason = "recently added, follows RFC",
issue = "28237")]
- NonEmpty {
- /// The lower bound of the range (inclusive).
- #[unstable(feature = "inclusive_range",
- reason = "recently added, follows RFC",
- issue = "28237")]
- start: Idx,
- /// The upper bound of the range (inclusive).
- #[unstable(feature = "inclusive_range",
- reason = "recently added, follows RFC",
- issue = "28237")]
- end: Idx,
- },
+ pub end: Idx,
}
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
impl<Idx: fmt::Debug> fmt::Debug for RangeInclusive<Idx> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
- use self::RangeInclusive::*;
-
- match *self {
- Empty { ref at } => write!(fmt, "[empty range @ {:?}]", at),
- NonEmpty { ref start, ref end } => write!(fmt, "{:?}...{:?}", start, end),
- }
+ write!(fmt, "{:?}...{:?}", self.start, self.end)
}
}
/// }
/// ```
pub fn contains(&self, item: Idx) -> bool {
- if let &RangeInclusive::NonEmpty{ref start, ref end} = self {
- (*start <= item) && (item <= *end)
- } else { false }
+ self.start <= item && item <= self.end
}
}
#[inline]
fn get(self, slice: &[T]) -> Option<&[T]> {
- match self {
- ops::RangeInclusive::Empty { .. } => Some(&[]),
- ops::RangeInclusive::NonEmpty { end, .. } if end == usize::max_value() => None,
- ops::RangeInclusive::NonEmpty { start, end } => (start..end + 1).get(slice),
- }
+ if self.end == usize::max_value() { None }
+ else { (self.start..self.end + 1).get(slice) }
}
#[inline]
fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> {
- match self {
- ops::RangeInclusive::Empty { .. } => Some(&mut []),
- ops::RangeInclusive::NonEmpty { end, .. } if end == usize::max_value() => None,
- ops::RangeInclusive::NonEmpty { start, end } => (start..end + 1).get_mut(slice),
- }
+ if self.end == usize::max_value() { None }
+ else { (self.start..self.end + 1).get_mut(slice) }
}
#[inline]
unsafe fn get_unchecked(self, slice: &[T]) -> &[T] {
- match self {
- ops::RangeInclusive::Empty { .. } => &[],
- ops::RangeInclusive::NonEmpty { start, end } => (start..end + 1).get_unchecked(slice),
- }
+ (self.start..self.end + 1).get_unchecked(slice)
}
#[inline]
unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] {
- match self {
- ops::RangeInclusive::Empty { .. } => &mut [],
- ops::RangeInclusive::NonEmpty { start, end } => {
- (start..end + 1).get_unchecked_mut(slice)
- }
- }
+ (self.start..self.end + 1).get_unchecked_mut(slice)
}
#[inline]
fn index(self, slice: &[T]) -> &[T] {
- match self {
- ops::RangeInclusive::Empty { .. } => &[],
- ops::RangeInclusive::NonEmpty { end, .. } if end == usize::max_value() => {
- panic!("attempted to index slice up to maximum usize");
- },
- ops::RangeInclusive::NonEmpty { start, end } => (start..end + 1).index(slice),
- }
+ assert!(self.end != usize::max_value(),
+ "attempted to index slice up to maximum usize");
+ (self.start..self.end + 1).index(slice)
}
#[inline]
fn index_mut(self, slice: &mut [T]) -> &mut [T] {
- match self {
- ops::RangeInclusive::Empty { .. } => &mut [],
- ops::RangeInclusive::NonEmpty { end, .. } if end == usize::max_value() => {
- panic!("attempted to index slice up to maximum usize");
- },
- ops::RangeInclusive::NonEmpty { start, end } => (start..end + 1).index_mut(slice),
- }
+ assert!(self.end != usize::max_value(),
+ "attempted to index slice up to maximum usize");
+ (self.start..self.end + 1).index_mut(slice)
}
}
+#[cfg(stage0)] // The bootstrap compiler has a different `...` desugar
+fn inclusive(start: usize, end: usize) -> ops::RangeInclusive<usize> {
+ ops::RangeInclusive { start, end }
+}
+#[cfg(not(stage0))]
+fn inclusive(start: usize, end: usize) -> ops::RangeInclusive<usize> {
+ start...end
+}
+
#[unstable(feature = "inclusive_range", reason = "recently added, follows RFC", issue = "28237")]
impl<T> SliceIndex<[T]> for ops::RangeToInclusive<usize> {
type Output = [T];
#[inline]
fn get(self, slice: &[T]) -> Option<&[T]> {
- (0...self.end).get(slice)
+ inclusive(0, self.end).get(slice)
}
#[inline]
fn get_mut(self, slice: &mut [T]) -> Option<&mut [T]> {
- (0...self.end).get_mut(slice)
+ inclusive(0, self.end).get_mut(slice)
}
#[inline]
unsafe fn get_unchecked(self, slice: &[T]) -> &[T] {
- (0...self.end).get_unchecked(slice)
+ inclusive(0, self.end).get_unchecked(slice)
}
#[inline]
unsafe fn get_unchecked_mut(self, slice: &mut [T]) -> &mut [T] {
- (0...self.end).get_unchecked_mut(slice)
+ inclusive(0, self.end).get_unchecked_mut(slice)
}
#[inline]
fn index(self, slice: &[T]) -> &[T] {
- (0...self.end).index(slice)
+ inclusive(0, self.end).index(slice)
}
#[inline]
fn index_mut(self, slice: &mut [T]) -> &mut [T] {
- (0...self.end).index_mut(slice)
+ inclusive(0, self.end).index_mut(slice)
}
}
#[inline]
fn index(&self, index: ops::RangeInclusive<usize>) -> &str {
- match index {
- ops::RangeInclusive::Empty { .. } => "",
- ops::RangeInclusive::NonEmpty { end, .. } if end == usize::max_value() =>
- panic!("attempted to index slice up to maximum usize"),
- ops::RangeInclusive::NonEmpty { start, end } =>
- self.index(start .. end+1)
- }
+ assert!(index.end != usize::max_value(),
+ "attempted to index str up to maximum usize");
+ self.index(index.start .. index.end+1)
}
}
+
#[unstable(feature = "inclusive_range",
reason = "recently added, follows RFC",
issue = "28237")]
#[inline]
fn index(&self, index: ops::RangeToInclusive<usize>) -> &str {
- self.index(0...index.end)
+ assert!(index.end != usize::max_value(),
+ "attempted to index str up to maximum usize");
+ self.index(.. index.end+1)
}
}
impl ops::IndexMut<ops::RangeInclusive<usize>> for str {
#[inline]
fn index_mut(&mut self, index: ops::RangeInclusive<usize>) -> &mut str {
- match index {
- ops::RangeInclusive::Empty { .. } => &mut self[0..0], // `&mut ""` doesn't work
- ops::RangeInclusive::NonEmpty { end, .. } if end == usize::max_value() =>
- panic!("attempted to index str up to maximum usize"),
- ops::RangeInclusive::NonEmpty { start, end } =>
- self.index_mut(start .. end+1)
- }
+ assert!(index.end != usize::max_value(),
+ "attempted to index str up to maximum usize");
+ self.index_mut(index.start .. index.end+1)
}
}
#[unstable(feature = "inclusive_range",
impl ops::IndexMut<ops::RangeToInclusive<usize>> for str {
#[inline]
fn index_mut(&mut self, index: ops::RangeToInclusive<usize>) -> &mut str {
- self.index_mut(0...index.end)
+ assert!(index.end != usize::max_value(),
+ "attempted to index str up to maximum usize");
+ self.index_mut(.. index.end+1)
}
}
type Output = str;
#[inline]
fn get(self, slice: &str) -> Option<&Self::Output> {
- match self {
- ops::RangeInclusive::Empty { .. } => 0..0,
- ops::RangeInclusive::NonEmpty { start, end } => start..end+1,
- }.get(slice)
+ (self.start..self.end+1).get(slice)
}
#[inline]
fn get_mut(self, slice: &mut str) -> Option<&mut Self::Output> {
- match self {
- ops::RangeInclusive::Empty { .. } => 0..0,
- ops::RangeInclusive::NonEmpty { start, end } => start..end+1,
- }.get_mut(slice)
+ (self.start..self.end+1).get_mut(slice)
}
#[inline]
unsafe fn get_unchecked(self, slice: &str) -> &Self::Output {
- match self {
- ops::RangeInclusive::Empty { .. } => 0..0,
- ops::RangeInclusive::NonEmpty { start, end } => start..end+1,
- }.get_unchecked(slice)
+ (self.start..self.end+1).get_unchecked(slice)
}
#[inline]
unsafe fn get_unchecked_mut(self, slice: &mut str) -> &mut Self::Output {
- match self {
- ops::RangeInclusive::Empty { .. } => 0..0,
- ops::RangeInclusive::NonEmpty { start, end } => start..end+1,
- }.get_unchecked_mut(slice)
+ (self.start..self.end+1).get_unchecked_mut(slice)
}
#[inline]
fn index(self, slice: &str) -> &Self::Output {
- match self {
- ops::RangeInclusive::Empty { .. } => 0..0,
- ops::RangeInclusive::NonEmpty { start, end } => start..end+1,
- }.index(slice)
+ (self.start..self.end+1).index(slice)
}
#[inline]
fn index_mut(self, slice: &mut str) -> &mut Self::Output {
- match self {
- ops::RangeInclusive::Empty { .. } => 0..0,
- ops::RangeInclusive::NonEmpty { start, end } => start..end+1,
- }.index_mut(slice)
+ (self.start..self.end+1).index_mut(slice)
}
}
#![feature(fmt_internals)]
#![feature(iterator_step_by)]
#![feature(i128_type)]
+#![feature(inclusive_range)]
#![feature(iter_rfind)]
#![feature(libc)]
#![feature(nonzero)]
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-use core::ops::{Range, RangeFull, RangeFrom, RangeTo};
+use core::ops::{Range, RangeFull, RangeFrom, RangeTo, RangeInclusive};
// Test the Range structs without the syntactic sugar.
// Not much to test.
let _ = RangeFull;
}
+
+#[test]
+fn test_range_inclusive() {
+ let mut r = RangeInclusive { start: 1i8, end: 2 };
+ assert_eq!(r.next(), Some(1));
+ assert_eq!(r.next(), Some(2));
+ assert_eq!(r.next(), None);
+
+ r = RangeInclusive { start: 127i8, end: 127 };
+ assert_eq!(r.next(), Some(127));
+ assert_eq!(r.next(), None);
+
+ r = RangeInclusive { start: -128i8, end: -128 };
+ assert_eq!(r.next_back(), Some(-128));
+ assert_eq!(r.next_back(), None);
+
+ // degenerate
+ r = RangeInclusive { start: 1, end: -1 };
+ assert_eq!(r.size_hint(), (0, Some(0)));
+ assert_eq!(r.next(), None);
+}
\ No newline at end of file
ExprKind::Range(ref e1, ref e2, lims) => {
use syntax::ast::RangeLimits::*;
- let (path, variant) = match (e1, e2, lims) {
- (&None, &None, HalfOpen) => ("RangeFull", None),
- (&Some(..), &None, HalfOpen) => ("RangeFrom", None),
- (&None, &Some(..), HalfOpen) => ("RangeTo", None),
- (&Some(..), &Some(..), HalfOpen) => ("Range", None),
- (&None, &Some(..), Closed) => ("RangeToInclusive", None),
- (&Some(..), &Some(..), Closed) => ("RangeInclusive", Some("NonEmpty")),
+ let path = match (e1, e2, lims) {
+ (&None, &None, HalfOpen) => "RangeFull",
+ (&Some(..), &None, HalfOpen) => "RangeFrom",
+ (&None, &Some(..), HalfOpen) => "RangeTo",
+ (&Some(..), &Some(..), HalfOpen) => "Range",
+ (&None, &Some(..), Closed) => "RangeToInclusive",
+ (&Some(..), &Some(..), Closed) => "RangeInclusive",
(_, &None, Closed) =>
panic!(self.diagnostic().span_fatal(
e.span, "inclusive range with no end")),
let is_unit = fields.is_empty();
let unstable_span = self.allow_internal_unstable("...", e.span);
let struct_path =
- iter::once("ops").chain(iter::once(path)).chain(variant)
+ iter::once("ops").chain(iter::once(path))
.collect::<Vec<_>>();
let struct_path = self.std_path(unstable_span, &struct_path, is_unit);
let struct_path = hir::QPath::Resolved(None, P(struct_path));
fn abort_msg(err_count: usize) -> String {
match err_count {
0 => "aborting with no errors (maybe a bug?)".to_owned(),
- 1 => "aborting due to previous error".to_owned(),
- e => format!("aborting due to {} previous errors", e),
+ _ => "aborting due to previous error(s)".to_owned(),
}
}
return;
}
- 1 => s = "aborting due to previous error".to_string(),
- _ => {
- s = format!("aborting due to {} previous errors", self.err_count.get());
- }
+ _ => s = "aborting due to previous error(s)".to_string(),
}
panic!(self.fatal(&s));
use sys_common;
use sys_common::thread_info;
use thread::Thread;
+ #[cfg(not(feature = "backtrace"))]
+ use mem;
sys::init();
sys::args::init(argc, argv);
// Let's run some code!
+ #[cfg(feature = "backtrace")]
let res = panic::catch_unwind(|| {
::sys_common::backtrace::__rust_begin_short_backtrace(main)
});
+ #[cfg(not(feature = "backtrace"))]
+ let res = panic::catch_unwind(mem::transmute::<_, fn()>(main));
sys_common::cleanup();
res.is_err()
};
-/* Copyright (c) 2010-2011 Dmitry Vyukov. All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY DMITRY VYUKOV "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
- * SHALL DMITRY VYUKOV OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are
- * those of the authors and should not be interpreted as representing official
- * policies, either expressed or implied, of Dmitry Vyukov.
- */
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
//! A mostly lock-free multi-producer, single consumer queue.
//!
-/* Copyright (c) 2010-2011 Dmitry Vyukov. All rights reserved.
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * 1. Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY DMITRY VYUKOV "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
- * SHALL DMITRY VYUKOV OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are
- * those of the authors and should not be interpreted as representing official
- * policies, either expressed or implied, of Dmitry Vyukov.
- */
-
-// http://www.1024cores.net/home/lock-free-algorithms/queues/unbounded-spsc-queue
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
//! A single-producer single-consumer concurrent queue
//!
//! concurrently between two threads. This data structure is safe to use and
//! enforces the semantics that there is one pusher and one popper.
+// http://www.1024cores.net/home/lock-free-algorithms/queues/unbounded-spsc-queue
+
use alloc::boxed::Box;
use core::ptr;
use core::cell::UnsafeCell;
pub unsafe fn destroy(key: Key) {
keys().remove(&key);
}
+
+#[inline]
+pub fn requires_synchronized_create() -> bool {
+ false
+}
}
unsafe {
thread_info::set(imp::guard::current(), their_thread);
+ #[cfg(feature = "backtrace")]
let try_result = panic::catch_unwind(panic::AssertUnwindSafe(|| {
::sys_common::backtrace::__rust_begin_short_backtrace(f)
}));
+ #[cfg(not(feature = "backtrace"))]
+ let try_result = panic::catch_unwind(panic::AssertUnwindSafe(f));
*their_packet.get() = Some(try_result);
}
};
/// want to specify the stack size or the name of the thread, use this API
/// instead.
///
+/// As you can see in the signature of `spawn` there are two constraints on
+/// both the closure given to `spawn` and its return value, let's explain them:
+///
+/// - The `'static` constraint means that the closure and its return value
+/// must have a lifetime of the whole program execution. The reason for this
+/// is that threads can `detach` and outlive the lifetime they have been
+/// created in.
+/// Indeed if the thread, and by extension its return value, can outlive their
+/// caller, we need to make sure that they will be valid afterwards, and since
+/// we *can't* know when it will return we need to have them valid as long as
+/// possible, that is until the end of the program, hence the `'static`
+/// lifetime.
+/// - The [`Send`] constraint is because the closure will need to be passed
+/// *by value* from the thread where it is spawned to the new thread. Its
+/// return value will need to be passed from the new thread to the thread
+/// where it is `join`ed.
+/// As a reminder, the [`Send`] marker trait, expresses that it is safe to be
+/// passed from thread to thread. [`Sync`] expresses that it is safe to have a
+/// reference be passed from thread to thread.
+///
/// # Panics
///
/// Panics if the OS fails to create a thread; use [`Builder::spawn`]
/// [`panic`]: ../../std/macro.panic.html
/// [`Builder::spawn`]: ../../std/thread/struct.Builder.html#method.spawn
/// [`Builder`]: ../../std/thread/struct.Builder.html
+/// [`Send`]: ../../std/marker/trait.Send.html
+/// [`Sync`]: ../../std/marker/trait.Sync.html
#[stable(feature = "rust1", since = "1.0.0")]
pub fn spawn<F, T>(f: F) -> JoinHandle<T> where
F: FnOnce() -> T, F: Send + 'static, T: Send + 'static
pub fn parse<'a, T, F>(&self, sess: &'a ParseSess, mut f: F) -> PResult<'a, T>
where F: FnMut(&mut Parser<'a>) -> PResult<'a, T>,
{
- let mut parser = Parser::new(sess, self.tokens.clone(), None, false);
+ let mut parser = Parser::new(sess, self.tokens.clone(), None, false, false);
let result = f(&mut parser)?;
if parser.token != token::Eof {
parser.unexpected()?;
Success(())
}
-pub fn parse(sess: &ParseSess, tts: TokenStream, ms: &[TokenTree], directory: Option<Directory>)
+pub fn parse(sess: &ParseSess,
+ tts: TokenStream,
+ ms: &[TokenTree],
+ directory: Option<Directory>,
+ recurse_into_modules: bool)
-> NamedParseResult {
- let mut parser = Parser::new(sess, tts, directory, true);
+ let mut parser = Parser::new(sess, tts, directory, recurse_into_modules, true);
let mut cur_eis = SmallVector::one(initial_matcher_pos(ms.to_owned(), parser.span.lo));
let mut next_eis = Vec::new(); // or proceed normally
path: cx.current_expansion.module.directory.clone(),
ownership: cx.current_expansion.directory_ownership,
};
- let mut p = Parser::new(cx.parse_sess(), tts, Some(directory), false);
+ let mut p = Parser::new(cx.parse_sess(), tts, Some(directory), true, false);
p.root_module_name = cx.current_expansion.module.mod_path.last()
.map(|id| id.name.as_str().to_string());
ast::ItemKind::MacroDef(ref body) => body.clone().into(),
_ => unreachable!(),
};
- let argument_map = match parse(sess, body, &argument_gram, None) {
+ let argument_map = match parse(sess, body, &argument_gram, None, true) {
Success(m) => m,
Failure(sp, tok) => {
let s = parse_failure_msg(tok);
match ASCII_ARRAY.iter().find(|&&(c, _)| c == ascii_char) {
Some(&(ascii_char, ascii_name)) => {
let msg =
- format!("unicode character '{}' ({}) looks much like '{}' ({}), but it's not",
+ format!("unicode character '{}' ({}) looks like '{}' ({}), but it's not",
ch, u_name, ascii_char, ascii_name);
err.span_help(span, &msg);
},
// Create a new parser from a source string
pub fn new_parser_from_source_str(sess: &ParseSess, name: String, source: String)
-> Parser {
- filemap_to_parser(sess, sess.codemap().new_filemap(name, source))
+ let mut parser = filemap_to_parser(sess, sess.codemap().new_filemap(name, source));
+ parser.recurse_into_file_modules = false;
+ parser
}
/// Create a new parser, handling errors as appropriate
/// Given stream and the `ParseSess`, produce a parser
pub fn stream_to_parser(sess: &ParseSess, stream: TokenStream) -> Parser {
- Parser::new(sess, stream, None, false)
+ Parser::new(sess, stream, None, true, false)
}
/// Parse a string representing a character literal into its final form.
Err(_) => panic!("could not get snippet"),
}
}
+
+ // This tests that when parsing a string (rather than a file) we don't try
+ // and read in a file for a module declaration and just parse a stub.
+ // See `recurse_into_file_modules` in the parser.
+ #[test]
+ fn out_of_line_mod() {
+ let sess = ParseSess::new(FilePathMapping::empty());
+ let item = parse_item_from_source_str(
+ "foo".to_owned(),
+ "mod foo { struct S; mod this_does_not_exist; }".to_owned(),
+ &sess,
+ ).unwrap().unwrap();
+
+ if let ast::ItemKind::Mod(ref m) = item.node {
+ assert!(m.items.len() == 2);
+ } else {
+ panic!();
+ }
+ }
}
pub obsolete_set: HashSet<ObsoleteSyntax>,
/// Used to determine the path to externally loaded source files
pub directory: Directory,
+ /// Whether to parse sub-modules in other files.
+ pub recurse_into_file_modules: bool,
/// Name of the root module this parser originated from. If `None`, then the
/// name is not known. This does not change while the parser is descending
/// into modules, and sub-parsers have new values for this name.
pub cfg_mods: bool,
}
+
struct TokenCursor {
frame: TokenCursorFrame,
stack: Vec<TokenCursorFrame>,
pub fn new(sess: &'a ParseSess,
tokens: TokenStream,
directory: Option<Directory>,
+ recurse_into_file_modules: bool,
desugar_doc_comments: bool)
-> Self {
let mut parser = Parser {
prev_token_kind: PrevTokenKind::Other,
restrictions: Restrictions::empty(),
obsolete_set: HashSet::new(),
+ recurse_into_file_modules: recurse_into_file_modules,
directory: Directory { path: PathBuf::new(), ownership: DirectoryOwnership::Owned },
root_module_name: None,
expected_tokens: Vec::new(),
let tok = parser.next_tok();
parser.token = tok.tok;
parser.span = tok.sp;
+
if let Some(directory) = directory {
parser.directory = directory;
} else if parser.span != syntax_pos::DUMMY_SP {
parser.directory.path = PathBuf::from(sess.codemap().span_to_filename(parser.span));
parser.directory.path.pop();
}
+
parser.process_potential_macro_variable();
parser
}
mem::replace(&mut self.directory.ownership, DirectoryOwnership::UnownedViaBlock);
let item = self.parse_item_(attrs.clone(), false, true)?;
self.directory.ownership = old_directory_ownership;
+
match item {
Some(i) => Stmt {
id: ast::DUMMY_NODE_ID,
let id = self.parse_ident()?;
if self.check(&token::Semi) {
self.bump();
- if in_cfg {
+ if in_cfg && self.recurse_into_file_modules {
// This mod is in an external file. Let's go get it!
let ModulePathSuccess { path, directory_ownership, warn } =
self.submod_path(id, &outer_attrs, id_span)?;
} else {
let old_directory = self.directory.clone();
self.push_directory(id, &outer_attrs);
+
self.expect(&token::OpenDelim(token::Brace))?;
let mod_inner_lo = self.span;
let attrs = self.parse_inner_attributes()?;
let module = self.parse_mod_items(&token::CloseDelim(token::Brace), mod_inner_lo)?;
+
self.directory = old_directory;
Ok((id, ItemKind::Mod(module), Some(attrs)))
}
fn submod_path(&mut self,
id: ast::Ident,
outer_attrs: &[ast::Attribute],
- id_sp: Span) -> PResult<'a, ModulePathSuccess> {
+ id_sp: Span)
+ -> PResult<'a, ModulePathSuccess> {
if let Some(path) = Parser::submod_path_from_attr(outer_attrs, &self.directory.path) {
return Ok(ModulePathSuccess {
directory_ownership: match path.file_name().and_then(|s| s.to_str()) {
path: cx.current_expansion.module.directory.clone(),
ownership: cx.current_expansion.directory_ownership,
};
- macro_parser::parse(cx.parse_sess(), tts, mtch, Some(directory))
+ macro_parser::parse(cx.parse_sess(), tts, mtch, Some(directory), true)
}
/// Check if this TokenTree is equal to the other, regardless of span information.
// except according to those terms.
// aux-build:attr_proc_macro.rs
-// gate-test-proc_macro
#![feature(use_extern_macros)]
extern crate attr_proc_macro;
fn main() {
let _ = Foo;
-}
\ No newline at end of file
+}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// gate-test-global_asm
-
global_asm!(""); //~ ERROR `global_asm!` is not stable
fn main() {}
// except according to those terms.
// compile-flags: -Z parse-only
-// ignore-tidy-linelength
fn main() {
let y = 0;
//~^ ERROR unknown start of token: \u{37e}
- //~^^ HELP unicode character ';' (Greek Question Mark) looks much like ';' (Semicolon), but it's not
+ //~^^ HELP unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it's not
}
short.next();
assert_eq!(long.size_hint(), (255, Some(255)));
assert_eq!(short.size_hint(), (0, Some(0)));
- assert_eq!(short, RangeInclusive::Empty { at: 42 });
+ assert_eq!(short, 1...0);
assert_eq!(long.len(), 255);
assert_eq!(short.len(), 0);
for i in 3...251 {
assert_eq!(long.next(), Some(i));
}
- assert_eq!(long, RangeInclusive::Empty { at: 251 });
+ assert_eq!(long, 1...0);
// check underflow
let mut narrow = 1...0;
assert_eq!(narrow.next_back(), None);
- assert_eq!(narrow, RangeInclusive::Empty { at: 0 });
+ assert_eq!(narrow, 1...0);
let mut zero = 0u8...0;
assert_eq!(zero.next_back(), Some(0));
assert_eq!(zero.next_back(), None);
- assert_eq!(zero, RangeInclusive::Empty { at: 0 });
+ assert_eq!(zero, 1...0);
let mut high = 255u8...255;
assert_eq!(high.next_back(), Some(255));
assert_eq!(high.next_back(), None);
- assert_eq!(high, RangeInclusive::Empty { at: 255 });
+ assert_eq!(high, 1...0);
// what happens if you have a nonsense range?
let mut nonsense = 10...5;
assert_eq!(nonsense.next(), None);
- assert_eq!(nonsense, RangeInclusive::Empty { at: 10 });
+ assert_eq!(nonsense, 10...5);
// output
assert_eq!(format!("{:?}", 0...10), "0...10");
assert_eq!(format!("{:?}", ...10), "...10");
- assert_eq!(format!("{:?}", long), "[empty range @ 251]");
+ assert_eq!(format!("{:?}", long), "1...0");
}
15 | Box::new(|| x) //~ ERROR cannot move out of captured outer variable
| ^ cannot move out of captured outer variable in an `Fn` closure
-error: aborting due to previous error
+error: aborting due to previous error(s)
21 | y.into_iter();
| ^ cannot move out of captured outer variable in an `Fn` closure
-error: aborting due to previous error
+error: aborting due to previous error(s)
49 | match Some(A) {
| ^^^^^^^ patterns `Some(B)`, `Some(C)`, `Some(D)` and 2 more not covered
-error: aborting due to 8 previous errors
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
15 | impl C { fn f() {} }
| --------- other definition for `f`
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | unsafe impl Send for &'static Foo { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
100 | let y = &mut x;
| ^ cannot borrow mutably
-error: aborting due to previous error
+error: aborting due to previous error(s)
101 | }
| - first borrow ends here
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to previous error
+error: aborting due to previous error(s)
| | second mutable borrow occurs here
| first mutable borrow occurs here
-error: aborting due to previous error
+error: aborting due to previous error(s)
43 | fn baz(&self) {}
| ---------------- other definition for `baz`
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
| | hint: to prevent move, use `ref _s` or `ref mut _s`
| cannot move out of here
-error: aborting due to previous error
+error: aborting due to previous error(s)
14 | \tbar;
| \t^^^ not found in this scope
-error: aborting due to previous error
+error: aborting due to previous error(s)
11 | extern "路濫狼á́́" fn foo() {}
| ^^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
14 | x + 1;
| ^
-error: aborting due to previous error
+error: aborting due to previous error(s)
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #37166 <https://github.com/rust-lang/rust/issues/37166>
-error: aborting due to previous error
+error: aborting due to previous error(s)
22 | | }
| |_____^ impl has extra requirement `'a: 'b`
-error: aborting due to previous error
+error: aborting due to previous error(s)
22 | fn foo() where 'a: 'b { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `'a: 'b`
-error: aborting due to previous error
+error: aborting due to previous error(s)
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #37166 <https://github.com/rust-lang/rust/issues/37166>
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: expected type `fn(&E, F) -> F`
found type `fn(&E, G) -> G`
-error: aborting due to previous error
+error: aborting due to previous error(s)
25 | fn b<F: Sync, G>(&self, _x: F) -> F { panic!() } //~ ERROR E0276
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `F: std::marker::Sync`
-error: aborting due to previous error
+error: aborting due to previous error(s)
76 | fn method<G: Getter<usize>>(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `G: Getter<usize>`
-error: aborting due to 7 previous errors
+error: aborting due to previous error(s)
26 | | }
| |_____^ impl has extra requirement `U: Iterator<B>`
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | z: fn() -> Foo + 'a,
| ^^^^^^^^^^^^^^^^ perhaps you forgot parentheses?
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
<Bar as Foo<i32>>
<Bar as Foo<u8>>
-error: aborting due to previous error
+error: aborting due to previous error(s)
<Bar as Foo<u8>>
and 2 others
-error: aborting due to previous error
+error: aborting due to previous error(s)
23 | (&mut self).bar();
| ^^^^ cannot borrow mutably
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
| try removing `&mut` here
| cannot reborrow mutably
-error: aborting due to previous error
+error: aborting due to previous error(s)
| try removing `&mut` here
| cannot reborrow mutably
-error: aborting due to previous error
+error: aborting due to previous error(s)
30 | s.x += 1;
| ^^^^^^^^ cannot mutably borrow immutable field
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
17 | f.baz;
| ^^^ did you mean `bar`?
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | f.zz;
| ^^ unknown field
-error: aborting due to previous error
+error: aborting due to previous error(s)
| try removing `&mut` here
| cannot reborrow mutably
-error: aborting due to previous error
+error: aborting due to previous error(s)
13 | use Foo1;
| ^^^^ no `Foo1` in the root
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
27 | self.s.push('x');
| ^^^^^^ assignment into an immutable reference
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | self.s.push('x');
| ^^^^^^ cannot borrow as mutable
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | self.s.push('x');
| ^^^^^^ cannot borrow as mutable
-error: aborting due to previous error
+error: aborting due to previous error(s)
16 | f.s.push('x');
| ^^^ assignment into an immutable reference
-error: aborting due to previous error
+error: aborting due to previous error(s)
58 | *x.0 = 1;
| ^^^^^^^^ cannot borrow as mutable
-error: aborting due to 12 previous errors
+error: aborting due to previous error(s)
and 2 others
= note: required by `Foo::bar`
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
|
= note: method `xxx` has no receiver
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= help: use `::<...>` instead of `<...>` if you meant to specify type arguments
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
13 | buf.iter_mut();
| ^^^ cannot borrow as mutable
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= help: use `!` instead of `~` if you meant to perform bitwise negation
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: required because it appears within the type `A`
= note: required by `is_send`
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: expected type `&Bottom`
found type `&Top`
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
|
= note: the trait cannot require that `Self : Sized`
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
43 | | }
| |_^
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
= note: if you intended to print `}`, you can escape it using `}}`
= note: this error originates in a macro outside of the current crate
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= help: closure was moved because it only implements `FnOnce`
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: expected type `impl Foo` (i32)
found type `impl Foo` (u32)
-error: aborting due to 6 previous errors
+error: aborting due to previous error(s)
11 | pub mod baz;
| ^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: consider adding a `#![type_length_limit="2097152"]` attribute to your crate
-error: aborting due to previous error
+error: aborting due to previous error(s)
| help: consider using a reference instead `&f.v[0]`
| cannot move out of indexed content
-error: aborting due to previous error
+error: aborting due to previous error(s)
| | ...and here (use `ref b` or `ref mut b`)
| hint: to prevent move, use `ref a` or `ref mut a`
-error: aborting due to previous error
+error: aborting due to previous error(s)
note: candidate #1 is defined in the trait `issue_41652_b::Tr`
= help: to disambiguate the method call, write `issue_41652_b::Tr::f(3)` instead
-error: aborting due to previous error
+error: aborting due to previous error(s)
13 | | }
| |_^
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `x` or `y`
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | | }
| |_^
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | | }
| |_^
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | x.push(z);
| ^
-error: aborting due to previous error
+error: aborting due to previous error(s)
16 | let a: &mut Vec<Ref<i32>> = x;
| ^
-error: aborting due to previous error
+error: aborting due to previous error(s)
16 | let a: &mut Vec<Ref<i32>> = x;
| ^
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: consider using a `let` binding to increase its lifetime
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: `-D non-snake-case` implied by `-D bad-style`
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: `-F non-snake-case` implied by `-F bad-style`
-error: aborting due to previous error
+error: aborting due to previous error(s)
28 | #![warn(bad_style)]
| ^^^^^^^^^
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
22 | break 22
| ^^^^^^^^ can only break with a value inside `loop`
-error: aborting due to previous error
+error: aborting due to previous error(s)
12 | println!(3 + 4);
| ^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
= help: `$NAME` should be written as `{NAME}`
= note: shell formatting not supported; see the documentation for `std::fmt`
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
56 | let _ = fake_anon_field_expr!();
| ----------------------- in this macro invocation
-error: aborting due to 6 previous errors
+error: aborting due to previous error(s)
28 | call_nested_expr_sum!();
| ------------------------ in this macro invocation
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
28 | myprintln!("{}");
| ----------------- in this macro invocation
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: expected type `fn(&Bar)`
found type `fn(&mut Bar)`
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: required by `foo`
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
= note: expected type `&{integer}`
found type `{integer}`
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: expected type `X<X<_, std::string::String>, _>`
found type `X<X<_, {integer}>, _>`
-error: aborting due to 6 previous errors
+error: aborting due to previous error(s)
|
= help: the trait `std::cmp::PartialEq<std::result::Result<{integer}, _>>` is not implemented for `{integer}`
-error: aborting due to 7 previous errors
+error: aborting due to previous error(s)
81 | vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>();
| ^
-error: aborting due to 34 previous errors
+error: aborting due to previous error(s)
| |
| expected closure that takes 2 arguments
-error: aborting due to 7 previous errors
+error: aborting due to previous error(s)
= note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:18:9: 18:15]`
= note: required by `baz`
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
21 | const fn f() -> u32 { 22 }
| ^^^^^ trait fns cannot be const
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: required by `apply`
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
= note: expected type `()`
found type `*mut Trait`
-error: aborting due to previous error
+error: aborting due to previous error(s)
38 | cast!(2);
| --------- in this macro invocation
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
= note: expected type `bool` (type parameter)
found type `bool` (bool)
-error: aborting due to previous error
+error: aborting due to previous error(s)
| requires `for<'r> std::ops::FnOnce<(&'r &str,)>`
| expected &str, found str
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
34 | fn ugh(&[bar]: &u32) {
| ^^^^^ pattern cannot match with input type `u32`
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
= note: expected type `u32`
found type `()`
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: the method `unwrap` exists but the following trait bounds were not satisfied:
`Foo : std::fmt::Debug`
-error: aborting due to previous error
+error: aborting due to previous error(s)
45 | let ans = s("burma", "shave");
| ^^^^^^^^^^^^^^^^ expected 1 parameter
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
= note: expected type `std::boxed::Box<Foo + std::marker::Send + 'static>`
found type `std::boxed::Box<Foo + 'static>`
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: expected type `fn(&mut Bar, &mut Bar)`
found type `fn(&mut Bar, &Bar)`
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: required by `call_it`
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
21 | match proto {
| ^^^^^ pattern `C(QA)` not covered
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: `Type` from trait: `type Type;`
= note: `method` from trait: `fn(&Self, std::string::String) -> <Self as m1::X>::Type`
-error: aborting due to previous error
+error: aborting due to previous error(s)
14 | foo();
| ^^^ cannot infer type for `X`
-error: aborting due to previous error
+error: aborting due to previous error(s)
13 | pub(crate) () fn foo() {}
| ^
-error: aborting due to previous error
+error: aborting due to previous error(s)
16 | pub(crate) () foo: usize,
| ^
-error: aborting due to previous error
+error: aborting due to previous error(s)
13 | pub (.) fn afn() {}
| ^
-error: aborting due to previous error
+error: aborting due to previous error(s)
33 | pub (in x) non_parent_invalid: usize,
| ^
-error: aborting due to 5 previous errors
+error: aborting due to previous error(s)
13 | #![deny(unreachable_code)]
| ^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
| ^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
-error: aborting due to previous error
+error: aborting due to previous error(s)
25 | let x: [usize; 2] = [22, return];
| ^^^^^^^^^^^^
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
36 | *{return; &mut i} = 22;
| ^^^^^^
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
13 | #![deny(unreachable_code)]
| ^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
28 | bar(return);
| ^^^^^^^^^^^
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
14 | #![deny(unreachable_code)]
| ^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
| ^^^^^^^^^^^^^^^^
= note: this error originates in a macro outside of the current crate
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
31 | Foo.bar(return);
| ^^^^^^^^^^^^^^^
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
14 | #![deny(unreachable_code)]
| ^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
14 | #![deny(unreachable_code)]
| ^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
40 | let x = Foo { a: 22, b: return };
| ^^^^^^^^^^^^^^^^^^^^^^^^
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
25 | let x: (usize, usize) = (2, return);
| ^^^^^^^^^^^
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
14 | #![deny(unreachable_code)]
| ^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
18 | let x: ! = ! { return; 22 };
| ^^^^^^^^^^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
= note: lifetime parameter `'b` declared on fn `bar` appears only in the return type, but here is required to be higher-ranked, which means that `'b` must appear in both argument and return types
= note: this error is the result of a recent bug fix; for more information, see issue #33685 <https://github.com/rust-lang/rust/issues/33685>
-error: aborting due to previous error
+error: aborting due to previous error(s)
help: possible candidate is found in another module, you can import it into scope
| use namespaced_enums::Foo::C;
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
error: main function not found
-error: aborting due to 25 previous errors
+error: aborting due to previous error(s)
| use std::io::Result;
| use std::thread::Result;
-error: aborting due to previous error
+error: aborting due to previous error(s)
help: possible candidate is found in another module, you can import it into scope
| use SomeEnum::E;
-error: aborting due to previous error
+error: aborting due to previous error(s)
16 | let f = Foo::Variant(42);
| ^^^^^^^^^^^^ did you mean `Foo::Variant { /* fields */ }`?
-error: aborting due to previous error
+error: aborting due to previous error(s)
22 | let homura = issue_19452_aux::Homura::Madoka;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ did you mean `issue_19452_aux::Homura::Madoka { /* fields */ }`?
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
| ^^^^^^^^^^^^^^^^^^^
= note: ...which then again requires processing `<impl at $DIR/issue-23305.rs:15:1: 15:20>`, completing the cycle.
-error: aborting due to previous error
+error: aborting due to previous error(s)
122 | self += 1;
| ^^^^ `self` value is only available in methods with `self` parameter
-error: aborting due to 17 previous errors
+error: aborting due to previous error(s)
11 | fn foo(_: Self) {
| ^^^^ `Self` is only available in traits and impls
-error: aborting due to previous error
+error: aborting due to previous error(s)
20 | let any: &Any = &Bar; //~ ERROR expected value, found trait `Bar`
| ^^^ not a value
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: method `bar` has no receiver
-error: aborting due to previous error
+error: aborting due to previous error(s)
| did you mean `handle`?
| did you mean `Handle { /* fields */ }`?
-error: aborting due to previous error
+error: aborting due to previous error(s)
= help: the trait `std::marker::Sized` is not implemented for `I + 'static`
= note: all local variables must have a statically known size
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | let _m = Monster(); //~ ERROR expected function, found struct `Monster`
| ^^^^^^^ did you mean `Monster { /* fields */ }`?
-error: aborting due to previous error
+error: aborting due to previous error(s)
32 | let b: m::first = m::second; // Misspelled item in module.
| ^^^^^^ did you mean `Second`?
-error: aborting due to 8 previous errors
+error: aborting due to previous error(s)
45 | xcrate::m::n::Z; //~ ERROR tuple struct `Z` is private
| ^^^^^^^^^^^^^^^
-error: aborting due to 8 previous errors
+error: aborting due to previous error(s)
52 | method;
| ^^^^^^ did you mean `self.method(...)`?
-error: aborting due to 9 previous errors
+error: aborting due to previous error(s)
12 | assert(true);
| ^^^^^^ did you mean `assert!(...)`?
-error: aborting due to previous error
+error: aborting due to previous error(s)
38 | method();
| ^^^^^^ did you mean `self.method(...)`?
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
error: main function not found
-error: aborting due to 10 previous errors
+error: aborting due to previous error(s)
14 | if foo {
| ^^^ not found in this scope
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
= note: expected type `()`
found type `std::result::Result<bool, std::io::Error>`
-error: aborting due to previous error
+error: aborting due to previous error(s)
14 | foo(bar(;
| ^^^ not found in this scope
-error: aborting due to 7 previous errors
+error: aborting due to previous error(s)
| did you mean `S`?
| did you mean `A { /* fields */ }`?
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
| did you mean `self.cx`?
| `self` value is only available in methods with `self` parameter
-error: aborting due to previous error
+error: aborting due to previous error(s)
18 | impl Foo for Bar {}
| ^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
-error: aborting due to previous error
+error: aborting due to previous error(s)
15 | let c = f(2, 3); //~ ERROR E0057
| ^^^^ expected 1 parameter
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ListNode` representable
-error: aborting due to previous error
+error: aborting due to previous error(s)
31 | Bar(&'a mut bool),
| ------------- this field does not implement `Copy`
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
27 | const F : Foo = Foo { a : 0 };
| ^^^^^^^^^^^^^ constants cannot have destructors
-error: aborting due to previous error
+error: aborting due to previous error(s)
11 | #[inline(unknown)] //~ ERROR E0535
| ^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
11 | #[cfg(not())] //~ ERROR E0536
| ^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
11 | #[cfg(unknown())] //~ ERROR E0537
| ^^^^^^^
-error: aborting due to previous error
+error: aborting due to previous error(s)
143 | *x.y_mut() = 3; //~ ERROR cannot borrow
| ^ cannot borrow as mutable
-error: aborting due to 10 previous errors
+error: aborting due to previous error(s)
63 | **x = 3; //~ ERROR cannot borrow
| ^^ cannot borrow as mutable
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
72 | foo(f);
| ^ cannot move out of captured outer variable in an `FnMut` closure
-error: aborting due to 5 previous errors
+error: aborting due to previous error(s)
27 | x.h(); //~ ERROR cannot borrow
| ^ cannot borrow as mutable
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | x.push(format!("this is broken"));
| ^ cannot borrow as mutable
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: consider using a `let` binding to increase its lifetime
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
29 | x.borrowed_mut(); //~ ERROR cannot borrow
| ^ cannot borrow as mutable
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: consider using a `let` binding to increase its lifetime
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: expected type `_`
found type `std::boxed::Box<_>`
-error: aborting due to 5 previous errors
+error: aborting due to previous error(s)
| |
| `*a` dropped here while still borrowed
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 6 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 6 previous errors
+error: aborting due to previous error(s)
|
= note: `fmt` from trait: `fn(&Self, &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error>`
-error: aborting due to 7 previous errors
+error: aborting due to previous error(s)
23 | }
| - borrowed value needs to live until here
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: consider using a `let` binding to increase its lifetime
-error: aborting due to previous error
+error: aborting due to previous error(s)
| |
| `y` dropped here while still borrowed
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: `Item` from trait: `type Item;`
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: `Output` from trait: `type Output;`
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: `Target` from trait: `type Target;`
-error: aborting due to previous error
+error: aborting due to previous error(s)
16 | #![deny(warnings)]
| ^^^^^^^^
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: expected type `&Self`
found type `&SomeType`
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: required by `Tr::C`
-error: aborting due to previous error
+error: aborting due to previous error(s)
found type `std::string::String`
= note: this error originates in a macro outside of the current crate
-error: aborting due to previous error
+error: aborting due to previous error(s)
19 | bar(1, 2, 3);
| ^^^^^^^ expected 2 parameters
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
|
= help: add #![feature(custom_attribute)] to the crate attributes to enable
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to previous error
+error: aborting due to previous error(s)
| ^^^^^^^^^^^^^^^
= help: to disambiguate the method call, write `F::foo(a)` instead
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
|
= note: an implementation of `std::ops::Add` might be missing for `World`
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
| | pattern doesn't bind `c`
| pattern doesn't bind `c`
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to previous error
+error: aborting due to previous error(s)
= help: items from traits can only be used if the trait is implemented and in scope; the following trait defines an item `is_str`, perhaps you need to implement it:
= help: candidate #1: `ManyImplTrait`
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
44 | | }
| |_^
-error: aborting due to 8 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to previous error
+error: aborting due to previous error(s)
= note: expected type `()`
found type `[closure@$DIR/move-closure.rs:15:17: 15:27]`
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `ListNode` representable
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= help: the trait `std::ops::Add<()>` is not implemented for `u32`
-error: aborting due to previous error
+error: aborting due to previous error(s)
25 | a.push_str("foo");
| ^ cannot borrow as mutable
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
20 | }
| - borrowed value needs to live until here
-error: aborting due to previous error
+error: aborting due to previous error(s)
17 | pub(crate) bar: u8,
| ^^^^^^^^^^^^^^^^^^ field already declared
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
21 | }
| - borrowed value needs to live until here
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `Bar` representable
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
20 | }
| - borrowed value needs to live until here
-error: aborting due to previous error
+error: aborting due to previous error(s)
23 | }
| - temporary value needs to live until here
-error: aborting due to previous error
+error: aborting due to previous error(s)
| |
| `tmp0` dropped here while still borrowed
-error: aborting due to previous error
+error: aborting due to previous error(s)
23 | }
| - borrowed value needs to live until here
-error: aborting due to previous error
+error: aborting due to previous error(s)
24 | x += 1; //~ ERROR cannot assign
| ^^^^^^ assignment to borrowed `x` occurs here
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
30 | }
| - borrowed value needs to live until here
-error: aborting due to previous error
+error: aborting due to previous error(s)
35 | }
| - borrowed value needs to live until here
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
44 | }
| - borrowed value needs to live until here
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
49 | drop(y); //~ ERROR cannot move out
| ^ move out of `y` occurs here
-error: aborting due to 6 previous errors
+error: aborting due to previous error(s)
19 | }
| - temporary value needs to live until here
-error: aborting due to previous error
+error: aborting due to previous error(s)
14 | println!("☃{}", tup[0]);
| ^^^^^^ help: to access tuple elements, use `tup.0`
-error: aborting due to previous error
+error: aborting due to previous error(s)
16 | fn homura<T: Deref<Trget = i32>>(_: T) {}
| ^^^^^^^^^^^ associated type `Trget` not found
-error: aborting due to previous error
+error: aborting due to previous error(s)
18 | println!("Hello {}", fob);
| ^^^ did you mean `foo`?
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
|
= note: values in a scope are dropped in the opposite order they are created
-error: aborting due to 2 previous errors
+error: aborting due to previous error(s)
33 | }
| - borrowed value needs to live until here
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: type must satisfy the static lifetime
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= help: use `(o.closure)(...)` if you meant to call the function stored in the `closure` field
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= help: use `((*self.container).f3)(...)` if you meant to call the function stored in the `f3` field
-error: aborting due to 11 previous errors
+error: aborting due to previous error(s)
|
= help: use `(demo.example)(...)` if you meant to call the function stored in the `example` field
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= help: use `(s.c_fn_ptr)(...)` if you meant to call the function stored in the `c_fn_ptr` field
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
26 | let dog_age = dog.dog_age();
| ^^^^^^^ private field, not a method
-error: aborting due to previous error
+error: aborting due to previous error(s)
| | unexpected token
| help: try parenthesizing the first index `((1, (2, 3)).1).1`
-error: aborting due to previous error
+error: aborting due to previous error(s)
15 | FAIL
| ^^^^ expected one of `!` or `::` here
-error: aborting due to previous error
+error: aborting due to previous error(s)
error: main function not found
-error: aborting due to 4 previous errors
+error: aborting due to previous error(s)
error: main function not found
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
37 | ignored_pat!() => (), //~ NOTE caused by the macro expansion here
| ^^^^^^^^^^^^^^
-error: aborting due to 3 previous errors
+error: aborting due to previous error(s)
19 | FAIL
| ^^^^ expected one of `!` or `::` here
-error: aborting due to previous error
+error: aborting due to previous error(s)
| |
| consider giving `x` a type
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to previous error
+error: aborting due to previous error(s)
|
= note: this error originates in a macro outside of the current crate
-error: aborting due to previous error
+error: aborting due to previous error(s)
14 | [];
| ^^ cannot infer type for `[_; 0]`
-error: aborting due to previous error
+error: aborting due to previous error(s)
21 | | }
| |_^ cannot infer type for `&'a T`
-error: aborting due to previous error
+error: aborting due to previous error(s)
12 | let x = |_| { };
| ^ consider giving this closure parameter a type
-error: aborting due to previous error
+error: aborting due to previous error(s)
-Subproject commit 397359840ecad02d5fe69b2a0cf328e98235ffea
+Subproject commit 9fcdbb44fec18d10c086b6aba8143bc06a199761
}
let filen_underscore = filename.replace("-","_").replace(".rs","");
- test_filen_gate(&filen_underscore, &mut features);
+ let filename_is_gate_test = test_filen_gate(&filen_underscore, &mut features);
contents.truncate(0);
t!(t!(File::open(&file), &file).read_to_string(&mut contents));
},
None => continue,
};
- let found_feature = features.get_mut(feature_name)
- .map(|v| { v.has_gate_test = true; () })
- .is_some();
-
- let found_lib_feature = features.get_mut(feature_name)
- .map(|v| { v.has_gate_test = true; () })
- .is_some();
-
- if !(found_feature || found_lib_feature) {
- err(&format!("gate-test test found referencing a nonexistent feature '{}'",
- feature_name));
+ match features.get_mut(feature_name) {
+ Some(f) => {
+ if filename_is_gate_test {
+ err(&format!("The file is already marked as gate test \
+ through its name, no need for a \
+ 'gate-test-{}' comment",
+ feature_name));
+ }
+ f.has_gate_test = true;
+ }
+ None => {
+ err(&format!("gate-test test found referencing a nonexistent feature '{}'",
+ feature_name));
+ }
}
}
});
}
});
lib_features
-}
\ No newline at end of file
+}