Add links between `slice::{copy,clone}_from_slice` in docs.
None
# Save tagged docker images we created and load them if they're available
# Travis saves caches whether the build failed or not, nuke rustsrc if
-# the failure was while updating it (as it may be in an bad state)
+# the failure was while updating it (as it may be in a bad state)
# https://github.com/travis-ci/travis-ci/issues/4472
before_cache:
- docker history -q rust-ci |
#![allow(dead_code)]
#![cfg(windows)]
-use libc::{c_long, c_ulong, c_ulonglong, c_void};
+use libc::{c_long, c_ulong, c_void};
pub type DWORD = c_ulong;
pub type LONG = c_long;
-pub type ULONG_PTR = c_ulonglong;
+pub type ULONG_PTR = usize;
pub type LPVOID = *mut c_void;
pub const EXCEPTION_MAXIMUM_PARAMETERS: usize = 15;
use std::os::windows::raw::HANDLE;
use std::path::Path;
use std::fs::{File, OpenOptions};
- use std::os::raw::{c_ulong, c_ulonglong, c_int};
+ use std::os::raw::{c_ulong, c_int};
type DWORD = c_ulong;
type BOOL = c_int;
- type ULONG_PTR = c_ulonglong;
+ type ULONG_PTR = usize;
type LPOVERLAPPED = *mut OVERLAPPED;
const LOCKFILE_EXCLUSIVE_LOCK: DWORD = 0x00000002;
line: &Line,
width_offset: usize,
code_offset: usize) -> Vec<(usize, Style)> {
- let source_string = file.get_line(line.line_index - 1)
- .unwrap_or("");
+ let source_string = match file.get_line(line.line_index - 1) {
+ Some(s) => s,
+ None => return Vec::new(),
+ };
let line_offset = buffer.num_lines();
// Print out the annotate source lines that correspond with the error
for annotated_file in annotated_files {
+ // we can't annotate anything if the source is unavailable.
+ if annotated_file.file.src.is_none() {
+ continue;
+ }
+
// print out the span location and spacer before we print the annotated source
// to do this, we need to know if this span will be primary
let is_primary = primary_lo.file.name == annotated_file.file.name;
#![cfg_attr(test, allow(dead_code))]
#![unstable(issue = "0", feature = "windows_c")]
-use os::raw::{c_int, c_uint, c_ulong, c_long, c_longlong, c_ushort,};
-use os::raw::{c_char, c_ulonglong};
+use os::raw::{c_int, c_uint, c_ulong, c_long, c_longlong, c_ushort, c_char};
+#[cfg(target_arch = "x86_64")]
+use os::raw::c_ulonglong;
use libc::{wchar_t, size_t, c_void};
use ptr;
pub type WORD = u16;
pub type CHAR = c_char;
pub type HCRYPTPROV = LONG_PTR;
-pub type ULONG_PTR = c_ulonglong;
+pub type ULONG_PTR = usize;
pub type ULONG = c_ulong;
#[cfg(target_arch = "x86_64")]
pub type ULONGLONG = u64;
// JoinHandle
////////////////////////////////////////////////////////////////////////////////
+/// A specialized [`Result`] type for threads.
+///
/// Indicates the manner in which a thread exited.
///
/// A thread that completes without panicking is considered to exit successfully.
+///
+/// # Examples
+///
+/// ```no_run
+/// use std::thread;
+/// use std::fs;
+///
+/// fn copy_in_thread() -> thread::Result<()> {
+/// thread::spawn(move || { fs::copy("foo.txt", "bar.txt").unwrap(); }).join()
+/// }
+///
+/// fn main() {
+/// match copy_in_thread() {
+/// Ok(_) => println!("this is fine"),
+/// Err(_) => println!("thread panicked"),
+/// }
+/// }
+/// ```
+///
+/// [`Result`]: ../../std/result/enum.Result.html
#[stable(feature = "rust1", since = "1.0.0")]
pub type Result<T> = ::result::Result<T, Box<Any + Send + 'static>>;
ExpansionConfig {
crate_name: crate_name,
features: None,
- recursion_limit: 64,
+ recursion_limit: 1024,
trace_mac: false,
should_test: false,
single_step: false,
let (span, e) = self.interpolated_or_expr_span(e)?;
let span_of_tilde = lo;
let mut err = self.diagnostic().struct_span_err(span_of_tilde,
- "`~` can not be used as an unary operator");
+ "`~` can not be used as a unary operator");
err.span_label(span_of_tilde, &"did you mean `!`?");
err.help("use `!` instead of `~` if you meant to perform bitwise negation");
err.emit();
# If this file is modified, then llvm will be (optionally) cleaned and then rebuilt.
# The actual contents of this file do not matter, but to trigger a change on the
# build bots then the contents should be changed so git updates the mtime.
-2017-04-26
+2017-05-06
-error: `~` can not be used as an unary operator
+error: `~` can not be used as a unary operator
--> $DIR/issue-41679.rs:12:13
|
12 | let x = ~1;
--- /dev/null
+// 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.
+
+pub trait Tr {
+ // Note: The function needs to be declared over multiple lines to reproduce
+ // the crash. DO NOT reformat.
+ fn f()
+ where Self: Sized;
+}
--- /dev/null
+// 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.
+
+// aux-build:issue_41652_b.rs
+
+extern crate issue_41652_b;
+
+struct S;
+
+impl issue_41652_b::Tr for S {
+ fn f() {
+ 3.f()
+ //~^ ERROR no method named `f` found for type `{integer}` in the current scope
+ //~| NOTE found the following associated functions
+ //~| NOTE candidate #1 is defined in the trait `issue_41652_b::Tr`
+ }
+}
+
+fn main() {}
--- /dev/null
+error: no method named `f` found for type `{integer}` in the current scope
+ --> $DIR/issue_41652.rs:19:11
+ |
+19 | 3.f()
+ | ^
+ |
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
+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
+