1
Fork 0

Auto merge of #35666 - eddyb:rollup, r=eddyb

Rollup of 30 pull requests

- Successful merges: #34941, #35392, #35444, #35447, #35491, #35533, #35539, #35558, #35573, #35574, #35577, #35586, #35588, #35594, #35596, #35597, #35598, #35606, #35611, #35615, #35616, #35620, #35622, #35640, #35643, #35644, #35646, #35647, #35648, #35661
- Failed merges: #35395, #35415
This commit is contained in:
bors 2016-08-14 15:27:15 -07:00 committed by GitHub
commit 13ff307f07
127 changed files with 534 additions and 219 deletions

2
configure vendored
View file

@ -1013,7 +1013,7 @@ then
LLVM_VERSION=$($LLVM_CONFIG --version) LLVM_VERSION=$($LLVM_CONFIG --version)
case $LLVM_VERSION in case $LLVM_VERSION in
(3.[7-8]*) (3.[7-9]*)
msg "found ok version of LLVM: $LLVM_VERSION" msg "found ok version of LLVM: $LLVM_VERSION"
;; ;;
(*) (*)

View file

@ -7,8 +7,8 @@ CFG_LIB_NAME_i586-unknown-linux-gnu=lib$(1).so
CFG_STATIC_LIB_NAME_i586-unknown-linux-gnu=lib$(1).a CFG_STATIC_LIB_NAME_i586-unknown-linux-gnu=lib$(1).a
CFG_LIB_GLOB_i586-unknown-linux-gnu=lib$(1)-*.so CFG_LIB_GLOB_i586-unknown-linux-gnu=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_i586-unknown-linux-gnu=lib$(1)-*.dylib.dSYM CFG_LIB_DSYM_GLOB_i586-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS) -march=pentium CFG_JEMALLOC_CFLAGS_i586-unknown-linux-gnu := -m32 $(CFLAGS) -march=pentium -Wa,-mrelax-relocations=no
CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -g -fPIC -m32 $(CFLAGS) -march=pentium CFG_GCCISH_CFLAGS_i586-unknown-linux-gnu := -g -fPIC -m32 $(CFLAGS) -march=pentium -Wa,-mrelax-relocations=no
CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) -march=pentium CFG_GCCISH_CXXFLAGS_i586-unknown-linux-gnu := -fno-rtti $(CXXFLAGS) -march=pentium
CFG_GCCISH_LINK_FLAGS_i586-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32 CFG_GCCISH_LINK_FLAGS_i586-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32
CFG_GCCISH_DEF_FLAG_i586-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list= CFG_GCCISH_DEF_FLAG_i586-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=

View file

@ -7,8 +7,8 @@ CFG_INSTALL_ONLY_RLIB_i686-unknown-linux-musl = 1
CFG_LIB_NAME_i686-unknown-linux-musl=lib$(1).so CFG_LIB_NAME_i686-unknown-linux-musl=lib$(1).so
CFG_STATIC_LIB_NAME_i686-unknown-linux-musl=lib$(1).a CFG_STATIC_LIB_NAME_i686-unknown-linux-musl=lib$(1).a
CFG_LIB_GLOB_i686-unknown-linux-musl=lib$(1)-*.so CFG_LIB_GLOB_i686-unknown-linux-musl=lib$(1)-*.so
CFG_JEMALLOC_CFLAGS_i686-unknown-linux-musl := -m32 -Wl,-melf_i386 CFG_JEMALLOC_CFLAGS_i686-unknown-linux-musl := -m32 -Wl,-melf_i386 -Wa,-mrelax-relocations=no
CFG_GCCISH_CFLAGS_i686-unknown-linux-musl := -g -fPIC -m32 -Wl,-melf_i386 CFG_GCCISH_CFLAGS_i686-unknown-linux-musl := -g -fPIC -m32 -Wl,-melf_i386 -Wa,-mrelax-relocations=no
CFG_GCCISH_CXXFLAGS_i686-unknown-linux-musl := CFG_GCCISH_CXXFLAGS_i686-unknown-linux-musl :=
CFG_GCCISH_LINK_FLAGS_i686-unknown-linux-musl := CFG_GCCISH_LINK_FLAGS_i686-unknown-linux-musl :=
CFG_GCCISH_DEF_FLAG_i686-unknown-linux-musl := CFG_GCCISH_DEF_FLAG_i686-unknown-linux-musl :=

View file

@ -870,8 +870,13 @@ impl Build {
// This is a hack, because newer binutils broke things on some vms/distros // This is a hack, because newer binutils broke things on some vms/distros
// (i.e., linking against unknown relocs disabled by the following flag) // (i.e., linking against unknown relocs disabled by the following flag)
// See: https://github.com/rust-lang/rust/issues/34978 // See: https://github.com/rust-lang/rust/issues/34978
if target == "x86_64-unknown-linux-musl" { match target {
base.push("-Wa,-mrelax-relocations=no".into()); "i586-unknown-linux-gnu" |
"i686-unknown-linux-musl" |
"x86_64-unknown-linux-musl" => {
base.push("-Wa,-mrelax-relocations=no".into());
},
_ => {},
} }
return base return base
} }

View file

@ -98,7 +98,8 @@ pub fn check(build: &mut Build) {
if target.contains("rumprun") || if target.contains("rumprun") ||
target.contains("bitrig") || target.contains("bitrig") ||
target.contains("openbsd") || target.contains("openbsd") ||
target.contains("msvc") { target.contains("msvc") ||
target.contains("emscripten") {
build.config.use_jemalloc = false; build.config.use_jemalloc = false;
} }

View file

@ -166,7 +166,7 @@ story. The other half is *using* the `find` function we've written. Let's try
to use it to find the extension in a file name. to use it to find the extension in a file name.
```rust ```rust
# fn find(_: &str, _: char) -> Option<usize> { None } # fn find(haystack: &str, needle: char) -> Option<usize> { haystack.find(needle) }
fn main() { fn main() {
let file_name = "foobar.rs"; let file_name = "foobar.rs";
match find(file_name, '.') { match find(file_name, '.') {
@ -223,7 +223,7 @@ Getting the extension of a file name is a pretty common operation, so it makes
sense to put it into a function: sense to put it into a function:
```rust ```rust
# fn find(_: &str, _: char) -> Option<usize> { None } # fn find(haystack: &str, needle: char) -> Option<usize> { haystack.find(needle) }
// Returns the extension of the given file name, where the extension is defined // Returns the extension of the given file name, where the extension is defined
// as all characters following the first `.`. // as all characters following the first `.`.
// If `file_name` has no `.`, then `None` is returned. // If `file_name` has no `.`, then `None` is returned.
@ -272,7 +272,7 @@ Armed with our new combinator, we can rewrite our `extension_explicit` method
to get rid of the case analysis: to get rid of the case analysis:
```rust ```rust
# fn find(_: &str, _: char) -> Option<usize> { None } # fn find(haystack: &str, needle: char) -> Option<usize> { haystack.find(needle) }
// Returns the extension of the given file name, where the extension is defined // Returns the extension of the given file name, where the extension is defined
// as all characters following the first `.`. // as all characters following the first `.`.
// If `file_name` has no `.`, then `None` is returned. // If `file_name` has no `.`, then `None` is returned.

View file

@ -125,7 +125,7 @@ warning, but it will still print "Hello, world!":
```text ```text
Compiling hello_world v0.0.1 (file:///home/you/projects/hello_world) Compiling hello_world v0.0.1 (file:///home/you/projects/hello_world)
src/main.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variable)] src/main.rs:2:9: 2:10 warning: unused variable: `x`, #[warn(unused_variables)]
on by default on by default
src/main.rs:2 let x: i32; src/main.rs:2 let x: i32;
^ ^

View file

@ -17,7 +17,7 @@ use super::boxed::Box;
use core::ops::Drop; use core::ops::Drop;
use core::cmp; use core::cmp;
/// A low-level utility for more ergonomically allocating, reallocating, and deallocating a /// A low-level utility for more ergonomically allocating, reallocating, and deallocating
/// a buffer of memory on the heap without having to worry about all the corner cases /// a buffer of memory on the heap without having to worry about all the corner cases
/// involved. This type is excellent for building your own data structures like Vec and VecDeque. /// involved. This type is excellent for building your own data structures like Vec and VecDeque.
/// In particular: /// In particular:
@ -534,8 +534,8 @@ impl<T> RawVec<T> {
/// Converts the entire buffer into `Box<[T]>`. /// Converts the entire buffer into `Box<[T]>`.
/// ///
/// While it is not *strictly* Undefined Behavior to call /// While it is not *strictly* Undefined Behavior to call
/// this procedure while some of the RawVec is unintialized, /// this procedure while some of the RawVec is uninitialized,
/// it cetainly makes it trivial to trigger it. /// it certainly makes it trivial to trigger it.
/// ///
/// Note that this will correctly reconstitute any `cap` changes /// Note that this will correctly reconstitute any `cap` changes
/// that may have been performed. (see description of type for details) /// that may have been performed. (see description of type for details)

View file

@ -1152,7 +1152,7 @@ impl String {
self.vec.set_len(len + amt); self.vec.set_len(len + amt);
} }
/// Inserts a string into this `String` at a byte position. /// Inserts a string slice into this `String` at a byte position.
/// ///
/// This is an `O(n)` operation as it requires copying every element in the /// This is an `O(n)` operation as it requires copying every element in the
/// buffer. /// buffer.
@ -1182,8 +1182,7 @@ impl String {
reason = "recent addition", reason = "recent addition",
issue = "35553")] issue = "35553")]
pub fn insert_str(&mut self, idx: usize, string: &str) { pub fn insert_str(&mut self, idx: usize, string: &str) {
let len = self.len(); assert!(idx <= self.len());
assert!(idx <= len);
assert!(self.is_char_boundary(idx)); assert!(self.is_char_boundary(idx));
unsafe { unsafe {

View file

@ -1446,13 +1446,12 @@ impl<T> IntoIterator for Vec<T> {
#[inline] #[inline]
fn into_iter(mut self) -> IntoIter<T> { fn into_iter(mut self) -> IntoIter<T> {
unsafe { unsafe {
let ptr = self.as_mut_ptr(); let begin = self.as_mut_ptr();
assume(!ptr.is_null()); assume(!begin.is_null());
let begin = ptr as *const T;
let end = if mem::size_of::<T>() == 0 { let end = if mem::size_of::<T>() == 0 {
arith_offset(ptr as *const i8, self.len() as isize) as *const T arith_offset(begin as *const i8, self.len() as isize) as *const T
} else { } else {
ptr.offset(self.len() as isize) as *const T begin.offset(self.len() as isize) as *const T
}; };
let buf = ptr::read(&self.buf); let buf = ptr::read(&self.buf);
mem::forget(self); mem::forget(self);
@ -1710,10 +1709,52 @@ impl<'a, T> FromIterator<T> for Cow<'a, [T]> where T: Clone {
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub struct IntoIter<T> { pub struct IntoIter<T> {
_buf: RawVec<T>, _buf: RawVec<T>,
ptr: *const T, ptr: *mut T,
end: *const T, end: *const T,
} }
impl<T> IntoIter<T> {
/// Returns the remaining items of this iterator as a slice.
///
/// # Examples
///
/// ```rust
/// # #![feature(vec_into_iter_as_slice)]
/// let vec = vec!['a', 'b', 'c'];
/// let mut into_iter = vec.into_iter();
/// assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
/// let _ = into_iter.next().unwrap();
/// assert_eq!(into_iter.as_slice(), &['b', 'c']);
/// ```
#[unstable(feature = "vec_into_iter_as_slice", issue = "35601")]
pub fn as_slice(&self) -> &[T] {
unsafe {
slice::from_raw_parts(self.ptr, self.len())
}
}
/// Returns the remaining items of this iterator as a mutable slice.
///
/// # Examples
///
/// ```rust
/// # #![feature(vec_into_iter_as_slice)]
/// let vec = vec!['a', 'b', 'c'];
/// let mut into_iter = vec.into_iter();
/// assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
/// into_iter.as_mut_slice()[2] = 'z';
/// assert_eq!(into_iter.next().unwrap(), 'a');
/// assert_eq!(into_iter.next().unwrap(), 'b');
/// assert_eq!(into_iter.next().unwrap(), 'z');
/// ```
#[unstable(feature = "vec_into_iter_as_slice", issue = "35601")]
pub fn as_mut_slice(&self) -> &mut [T] {
unsafe {
slice::from_raw_parts_mut(self.ptr, self.len())
}
}
}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
unsafe impl<T: Send> Send for IntoIter<T> {} unsafe impl<T: Send> Send for IntoIter<T> {}
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
@ -1726,14 +1767,14 @@ impl<T> Iterator for IntoIter<T> {
#[inline] #[inline]
fn next(&mut self) -> Option<T> { fn next(&mut self) -> Option<T> {
unsafe { unsafe {
if self.ptr == self.end { if self.ptr as *const _ == self.end {
None None
} else { } else {
if mem::size_of::<T>() == 0 { if mem::size_of::<T>() == 0 {
// purposefully don't use 'ptr.offset' because for // purposefully don't use 'ptr.offset' because for
// vectors with 0-size elements this would return the // vectors with 0-size elements this would return the
// same pointer. // same pointer.
self.ptr = arith_offset(self.ptr as *const i8, 1) as *const T; self.ptr = arith_offset(self.ptr as *const i8, 1) as *mut T;
// Use a non-null pointer value // Use a non-null pointer value
Some(ptr::read(EMPTY as *mut T)) Some(ptr::read(EMPTY as *mut T))
@ -1776,7 +1817,7 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
} else { } else {
if mem::size_of::<T>() == 0 { if mem::size_of::<T>() == 0 {
// See above for why 'ptr.offset' isn't used // See above for why 'ptr.offset' isn't used
self.end = arith_offset(self.end as *const i8, -1) as *const T; self.end = arith_offset(self.end as *const i8, -1) as *mut T;
// Use a non-null pointer value // Use a non-null pointer value
Some(ptr::read(EMPTY as *mut T)) Some(ptr::read(EMPTY as *mut T))
@ -1796,9 +1837,7 @@ impl<T> ExactSizeIterator for IntoIter<T> {}
#[stable(feature = "vec_into_iter_clone", since = "1.8.0")] #[stable(feature = "vec_into_iter_clone", since = "1.8.0")]
impl<T: Clone> Clone for IntoIter<T> { impl<T: Clone> Clone for IntoIter<T> {
fn clone(&self) -> IntoIter<T> { fn clone(&self) -> IntoIter<T> {
unsafe { self.as_slice().to_owned().into_iter()
slice::from_raw_parts(self.ptr, self.len()).to_owned().into_iter()
}
} }
} }

View file

@ -28,6 +28,7 @@
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![feature(unicode)] #![feature(unicode)]
#![feature(vec_deque_contains)] #![feature(vec_deque_contains)]
#![feature(vec_into_iter_as_slice)]
extern crate collections; extern crate collections;
extern crate test; extern crate test;

View file

@ -478,6 +478,29 @@ fn test_split_off() {
assert_eq!(vec2, [5, 6]); assert_eq!(vec2, [5, 6]);
} }
#[test]
fn test_into_iter_as_slice() {
let vec = vec!['a', 'b', 'c'];
let mut into_iter = vec.into_iter();
assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
let _ = into_iter.next().unwrap();
assert_eq!(into_iter.as_slice(), &['b', 'c']);
let _ = into_iter.next().unwrap();
let _ = into_iter.next().unwrap();
assert_eq!(into_iter.as_slice(), &[]);
}
#[test]
fn test_into_iter_as_mut_slice() {
let vec = vec!['a', 'b', 'c'];
let mut into_iter = vec.into_iter();
assert_eq!(into_iter.as_slice(), &['a', 'b', 'c']);
into_iter.as_mut_slice()[0] = 'x';
into_iter.as_mut_slice()[1] = 'y';
assert_eq!(into_iter.next().unwrap(), 'x');
assert_eq!(into_iter.as_slice(), &['y', 'c']);
}
#[test] #[test]
fn test_into_iter_count() { fn test_into_iter_count() {
assert_eq!(vec![1, 2, 3].into_iter().count(), 3); assert_eq!(vec![1, 2, 3].into_iter().count(), 3);

View file

@ -146,6 +146,7 @@
use clone::Clone; use clone::Clone;
use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering}; use cmp::{PartialEq, Eq, PartialOrd, Ord, Ordering};
use convert::From;
use default::Default; use default::Default;
use fmt::{self, Debug, Display}; use fmt::{self, Debug, Display};
use marker::{Copy, PhantomData, Send, Sync, Sized, Unsize}; use marker::{Copy, PhantomData, Send, Sync, Sized, Unsize};
@ -329,6 +330,13 @@ impl<T:Ord + Copy> Ord for Cell<T> {
} }
} }
#[stable(feature = "cell_from", since = "1.12.0")]
impl<T: Copy> From<T> for Cell<T> {
fn from(t: T) -> Cell<T> {
Cell::new(t)
}
}
/// A mutable memory location with dynamically checked borrow rules /// A mutable memory location with dynamically checked borrow rules
/// ///
/// See the [module-level documentation](index.html) for more. /// See the [module-level documentation](index.html) for more.
@ -742,6 +750,13 @@ impl<T: ?Sized + Ord> Ord for RefCell<T> {
} }
} }
#[stable(feature = "cell_from", since = "1.12.0")]
impl<T> From<T> for RefCell<T> {
fn from(t: T) -> RefCell<T> {
RefCell::new(t)
}
}
struct BorrowRef<'b> { struct BorrowRef<'b> {
borrow: &'b Cell<BorrowFlag>, borrow: &'b Cell<BorrowFlag>,
} }
@ -1064,3 +1079,10 @@ impl<T: Default> Default for UnsafeCell<T> {
UnsafeCell::new(Default::default()) UnsafeCell::new(Default::default())
} }
} }
#[stable(feature = "cell_from", since = "1.12.0")]
impl<T> From<T> for UnsafeCell<T> {
fn from(t: T) -> UnsafeCell<T> {
UnsafeCell::new(t)
}
}

View file

@ -71,8 +71,8 @@ use result::Result;
/// ///
/// # Generic Impls /// # Generic Impls
/// ///
/// - `AsRef` auto-dereference if the inner type is a reference or a mutable /// - `AsRef` auto-dereferences if the inner type is a reference or a mutable
/// reference (eg: `foo.as_ref()` will work the same if `foo` has type `&mut Foo` or `&&mut Foo`) /// reference (e.g.: `foo.as_ref()` will work the same if `foo` has type `&mut Foo` or `&&mut Foo`)
/// ///
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub trait AsRef<T: ?Sized> { pub trait AsRef<T: ?Sized> {
@ -88,8 +88,8 @@ pub trait AsRef<T: ?Sized> {
/// ///
/// # Generic Impls /// # Generic Impls
/// ///
/// - `AsMut` auto-dereference if the inner type is a reference or a mutable /// - `AsMut` auto-dereferences if the inner type is a reference or a mutable
/// reference (eg: `foo.as_ref()` will work the same if `foo` has type `&mut Foo` or `&&mut Foo`) /// reference (e.g.: `foo.as_ref()` will work the same if `foo` has type `&mut Foo` or `&&mut Foo`)
/// ///
#[stable(feature = "rust1", since = "1.0.0")] #[stable(feature = "rust1", since = "1.0.0")]
pub trait AsMut<T: ?Sized> { pub trait AsMut<T: ?Sized> {

View file

@ -32,7 +32,7 @@
//! atomically-reference-counted shared pointer). //! atomically-reference-counted shared pointer).
//! //!
//! Most atomic types may be stored in static variables, initialized using //! Most atomic types may be stored in static variables, initialized using
//! the provided static initializers like `INIT_ATOMIC_BOOL`. Atomic statics //! the provided static initializers like `ATOMIC_BOOL_INIT`. Atomic statics
//! are often used for lazy global initialization. //! are often used for lazy global initialization.
//! //!
//! //!

View file

@ -132,8 +132,13 @@ fn find_item(item: &Item, ctxt: &mut EntryContext, at_root: bool) {
if ctxt.start_fn.is_none() { if ctxt.start_fn.is_none() {
ctxt.start_fn = Some((item.id, item.span)); ctxt.start_fn = Some((item.id, item.span));
} else { } else {
span_err!(ctxt.session, item.span, E0138, struct_span_err!(
"multiple 'start' functions"); ctxt.session, item.span, E0138,
"multiple 'start' functions")
.span_label(ctxt.start_fn.unwrap().1,
&format!("previous `start` function here"))
.span_label(item.span, &format!("multiple `start` functions"))
.emit();
} }
}, },
EntryPointType::None => () EntryPointType::None => ()

View file

@ -222,7 +222,24 @@ impl<'a, 'gcx, 'lcx, 'tcx> ty::TyS<'tcx> {
ty::TyArray(_, n) => format!("array of {} elements", n), ty::TyArray(_, n) => format!("array of {} elements", n),
ty::TySlice(_) => "slice".to_string(), ty::TySlice(_) => "slice".to_string(),
ty::TyRawPtr(_) => "*-ptr".to_string(), ty::TyRawPtr(_) => "*-ptr".to_string(),
ty::TyRef(_, _) => "&-ptr".to_string(), ty::TyRef(region, tymut) => {
let tymut_string = tymut.to_string();
if tymut_string == "_" || //unknown type name,
tymut_string.len() > 10 || //name longer than saying "reference",
region.to_string() != "" //... or a complex type
{
match tymut {
ty::TypeAndMut{mutbl, ..} => {
format!("{}reference", match mutbl {
hir::Mutability::MutMutable => "mutable ",
_ => ""
})
}
}
} else {
format!("&{}", tymut_string)
}
}
ty::TyFnDef(..) => format!("fn item"), ty::TyFnDef(..) => format!("fn item"),
ty::TyFnPtr(_) => "fn pointer".to_string(), ty::TyFnPtr(_) => "fn pointer".to_string(),
ty::TyTrait(ref inner) => { ty::TyTrait(ref inner) => {

View file

@ -1175,8 +1175,10 @@ impl<'a, 'gcx, 'tcx> Delegate<'tcx> for MutationChecker<'a, 'gcx> {
_: LoanCause) { _: LoanCause) {
match kind { match kind {
MutBorrow => { MutBorrow => {
span_err!(self.cx.tcx.sess, span, E0301, struct_span_err!(self.cx.tcx.sess, span, E0301,
"cannot mutably borrow in a pattern guard") "cannot mutably borrow in a pattern guard")
.span_label(span, &format!("borrowed mutably in pattern guard"))
.emit();
} }
ImmBorrow | UniqueImmBorrow => {} ImmBorrow | UniqueImmBorrow => {}
} }
@ -1185,7 +1187,9 @@ impl<'a, 'gcx, 'tcx> Delegate<'tcx> for MutationChecker<'a, 'gcx> {
fn mutate(&mut self, _: NodeId, span: Span, _: cmt, mode: MutateMode) { fn mutate(&mut self, _: NodeId, span: Span, _: cmt, mode: MutateMode) {
match mode { match mode {
MutateMode::JustWrite | MutateMode::WriteAndRead => { MutateMode::JustWrite | MutateMode::WriteAndRead => {
span_err!(self.cx.tcx.sess, span, E0302, "cannot assign in a pattern guard") struct_span_err!(self.cx.tcx.sess, span, E0302, "cannot assign in a pattern guard")
.span_label(span, &format!("assignment in pattern guard"))
.emit();
} }
MutateMode::Init => {} MutateMode::Init => {}
} }

View file

@ -77,10 +77,14 @@ impl<'a> CheckLoopVisitor<'a> {
match self.cx { match self.cx {
Loop => {} Loop => {}
Closure => { Closure => {
span_err!(self.sess, span, E0267, "`{}` inside of a closure", name); struct_span_err!(self.sess, span, E0267, "`{}` inside of a closure", name)
.span_label(span, &format!("cannot break inside of a closure"))
.emit();
} }
Normal => { Normal => {
span_err!(self.sess, span, E0268, "`{}` outside of loop", name); struct_span_err!(self.sess, span, E0268, "`{}` outside of loop", name)
.span_label(span, &format!("cannot break outside of a loop"))
.emit();
} }
} }
} }

View file

@ -3374,8 +3374,11 @@ impl<'a> Resolver<'a> {
let mut err = match (old_binding.is_extern_crate(), binding.is_extern_crate()) { let mut err = match (old_binding.is_extern_crate(), binding.is_extern_crate()) {
(true, true) => struct_span_err!(self.session, span, E0259, "{}", msg), (true, true) => struct_span_err!(self.session, span, E0259, "{}", msg),
(true, _) | (_, true) if binding.is_import() || old_binding.is_import() => (true, _) | (_, true) if binding.is_import() || old_binding.is_import() => {
struct_span_err!(self.session, span, E0254, "{}", msg), let mut e = struct_span_err!(self.session, span, E0254, "{}", msg);
e.span_label(span, &"already imported");
e
},
(true, _) | (_, true) => struct_span_err!(self.session, span, E0260, "{}", msg), (true, _) | (_, true) => struct_span_err!(self.session, span, E0260, "{}", msg),
_ => match (old_binding.is_import(), binding.is_import()) { _ => match (old_binding.is_import(), binding.is_import()) {
(false, false) => struct_span_err!(self.session, span, E0428, "{}", msg), (false, false) => struct_span_err!(self.session, span, E0428, "{}", msg),

View file

@ -505,7 +505,9 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
} }
Success(binding) if !binding.is_importable() => { Success(binding) if !binding.is_importable() => {
let msg = format!("`{}` is not directly importable", target); let msg = format!("`{}` is not directly importable", target);
span_err!(self.session, directive.span, E0253, "{}", &msg); struct_span_err!(self.session, directive.span, E0253, "{}", &msg)
.span_label(directive.span, &format!("cannot be imported directly"))
.emit();
// Do not import this illegal binding. Import a dummy binding and pretend // Do not import this illegal binding. Import a dummy binding and pretend
// everything is fine // everything is fine
self.import_dummy_binding(module, directive); self.import_dummy_binding(module, directive);

View file

@ -51,10 +51,12 @@ fn equate_intrinsic_type<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
})); }));
let i_n_tps = i_ty.generics.types.len(subst::FnSpace); let i_n_tps = i_ty.generics.types.len(subst::FnSpace);
if i_n_tps != n_tps { if i_n_tps != n_tps {
span_err!(tcx.sess, it.span, E0094, struct_span_err!(tcx.sess, it.span, E0094,
"intrinsic has wrong number of type \ "intrinsic has wrong number of type \
parameters: found {}, expected {}", parameters: found {}, expected {}",
i_n_tps, n_tps); i_n_tps, n_tps)
.span_label(it.span, &format!("expected {} type parameter", n_tps))
.emit();
} else { } else {
require_same_types(ccx, require_same_types(ccx,
TypeOrigin::IntrinsicType(it.span), TypeOrigin::IntrinsicType(it.span),

View file

@ -3520,8 +3520,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
let tcx = self.tcx; let tcx = self.tcx;
if !tcx.expr_is_lval(&lhs) { if !tcx.expr_is_lval(&lhs) {
span_err!(tcx.sess, expr.span, E0070, struct_span_err!(
"invalid left-hand side expression"); tcx.sess, expr.span, E0070,
"invalid left-hand side expression")
.span_label(
expr.span,
&format!("left-hand of expression not valid"))
.emit();
} }
let lhs_ty = self.expr_ty(&lhs); let lhs_ty = self.expr_ty(&lhs);

View file

@ -41,7 +41,13 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
let tcx = self.tcx; let tcx = self.tcx;
if !tcx.expr_is_lval(lhs_expr) { if !tcx.expr_is_lval(lhs_expr) {
span_err!(tcx.sess, lhs_expr.span, E0067, "invalid left-hand side expression"); struct_span_err!(
tcx.sess, lhs_expr.span,
E0067, "invalid left-hand side expression")
.span_label(
lhs_expr.span,
&format!("invalid expression for left-hand side"))
.emit();
} }
} }

View file

@ -526,10 +526,10 @@ pub fn temp_dir() -> PathBuf {
/// Ok("/home/alex/bar") /// Ok("/home/alex/bar")
/// ``` /// ```
/// ///
/// This sort of behavior has been known to [lead to privledge escalation] when /// This sort of behavior has been known to [lead to privilege escalation] when
/// used incorrectly, for example. /// used incorrectly, for example.
/// ///
/// [lead to privledge escalation]: http://securityvulns.com/Wdocument183.html /// [lead to privilege escalation]: http://securityvulns.com/Wdocument183.html
/// ///
/// # Examples /// # Examples
/// ///

View file

@ -25,9 +25,10 @@ use cell::RefCell;
use fmt; use fmt;
use intrinsics; use intrinsics;
use mem; use mem;
use ptr;
use raw; use raw;
use sys_common::rwlock::RWLock;
use sys::stdio::Stderr; use sys::stdio::Stderr;
use sys_common::rwlock::RWLock;
use sys_common::thread_info; use sys_common::thread_info;
use sys_common::util; use sys_common::util;
use thread; use thread;
@ -255,46 +256,77 @@ pub use realstd::rt::update_panic_count;
/// Invoke a closure, capturing the cause of an unwinding panic if one occurs. /// Invoke a closure, capturing the cause of an unwinding panic if one occurs.
pub unsafe fn try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<Any + Send>> { pub unsafe fn try<R, F: FnOnce() -> R>(f: F) -> Result<R, Box<Any + Send>> {
let mut slot = None; struct Data<F, R> {
let mut f = Some(f); f: F,
let ret; r: R,
}
{ // We do some sketchy operations with ownership here for the sake of
let mut to_run = || { // performance. The `Data` structure is never actually fully valid, but
slot = Some(f.take().unwrap()()); // instead it always contains at least one uninitialized field. We can only
}; // pass pointers down to `__rust_maybe_catch_panic` (can't pass objects by
let fnptr = get_call(&mut to_run); // value), so we do all the ownership tracking here manully.
let dataptr = &mut to_run as *mut _ as *mut u8; //
let mut any_data = 0; // Note that this is all invalid if any of these functions unwind, but the
let mut any_vtable = 0; // whole point of this function is to prevent that! As a result we go
let fnptr = mem::transmute::<fn(&mut _), fn(*mut u8)>(fnptr); // through a transition where:
let r = __rust_maybe_catch_panic(fnptr, //
dataptr, // * First, only the closure we're going to call is initialized. The return
&mut any_data, // value is uninitialized.
&mut any_vtable); // * When we make the function call, the `do_call` function below, we take
if r == 0 { // ownership of the function pointer, replacing it with uninitialized
ret = Ok(()); // data. At this point the `Data` structure is entirely uninitialized, but
} else { // it won't drop due to an unwind because it's owned on the other side of
update_panic_count(-1); // the catch panic.
ret = Err(mem::transmute(raw::TraitObject { // * If the closure successfully returns, we write the return value into the
data: any_data as *mut _, // data's return slot. Note that `ptr::write` is used as it's overwriting
vtable: any_vtable as *mut _, // uninitialized data.
})); // * Finally, when we come back out of the `__rust_maybe_catch_panic` we're
// in one of two states:
//
// 1. The closure didn't panic, in which case the return value was
// filled in. We have to be careful to `forget` the closure,
// however, as ownership was passed to the `do_call` function.
// 2. The closure panicked, in which case the return value wasn't
// filled in. In this case the entire `data` structure is invalid,
// so we forget the entire thing.
//
// Once we stack all that together we should have the "most efficient'
// method of calling a catch panic whilst juggling ownership.
let mut any_data = 0;
let mut any_vtable = 0;
let mut data = Data {
f: f,
r: mem::uninitialized(),
};
let r = __rust_maybe_catch_panic(do_call::<F, R>,
&mut data as *mut _ as *mut u8,
&mut any_data,
&mut any_vtable);
return if r == 0 {
let Data { f, r } = data;
mem::forget(f);
debug_assert!(update_panic_count(0) == 0);
Ok(r)
} else {
mem::forget(data);
update_panic_count(-1);
debug_assert!(update_panic_count(0) == 0);
Err(mem::transmute(raw::TraitObject {
data: any_data as *mut _,
vtable: any_vtable as *mut _,
}))
};
fn do_call<F: FnOnce() -> R, R>(data: *mut u8) {
unsafe {
let data = data as *mut Data<F, R>;
let f = ptr::read(&mut (*data).f);
ptr::write(&mut (*data).r, f());
} }
} }
debug_assert!(update_panic_count(0) == 0);
return ret.map(|()| {
slot.take().unwrap()
});
fn get_call<F: FnMut()>(_: &mut F) -> fn(&mut F) {
call
}
fn call<F: FnMut()>(f: &mut F) {
f()
}
} }
/// Determines whether the current thread is unwinding because of panic. /// Determines whether the current thread is unwinding because of panic.

View file

@ -83,11 +83,11 @@ pub fn init() {
} }
} }
#[cfg(not(target_os = "nacl"))] #[cfg(not(any(target_os = "nacl", target_os = "emscripten")))]
unsafe fn reset_sigpipe() { unsafe fn reset_sigpipe() {
assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != !0); assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != !0);
} }
#[cfg(target_os = "nacl")] #[cfg(any(target_os = "nacl", target_os = "emscripten"))]
unsafe fn reset_sigpipe() {} unsafe fn reset_sigpipe() {}
} }

View file

@ -551,11 +551,13 @@ pub fn home_dir() -> Option<PathBuf> {
#[cfg(any(target_os = "android", #[cfg(any(target_os = "android",
target_os = "ios", target_os = "ios",
target_os = "nacl"))] target_os = "nacl",
target_os = "emscripten"))]
unsafe fn fallback() -> Option<OsString> { None } unsafe fn fallback() -> Option<OsString> { None }
#[cfg(not(any(target_os = "android", #[cfg(not(any(target_os = "android",
target_os = "ios", target_os = "ios",
target_os = "nacl")))] target_os = "nacl",
target_os = "emscripten")))]
unsafe fn fallback() -> Option<OsString> { unsafe fn fallback() -> Option<OsString> {
#[cfg(not(target_os = "solaris"))] #[cfg(not(target_os = "solaris"))]
unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd, unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,

View file

@ -81,8 +81,7 @@ impl Thread {
} }
#[cfg(any(target_os = "linux", #[cfg(any(target_os = "linux",
target_os = "android", target_os = "android"))]
target_os = "emscripten"))]
pub fn set_name(name: &CStr) { pub fn set_name(name: &CStr) {
const PR_SET_NAME: libc::c_int = 15; const PR_SET_NAME: libc::c_int = 15;
// pthread wrapper only appeared in glibc 2.12, so we use syscall // pthread wrapper only appeared in glibc 2.12, so we use syscall
@ -118,9 +117,9 @@ impl Thread {
name.as_ptr() as *mut libc::c_void); name.as_ptr() as *mut libc::c_void);
} }
} }
#[cfg(any(target_env = "newlib", target_os = "solaris"))] #[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))]
pub fn set_name(_name: &CStr) { pub fn set_name(_name: &CStr) {
// Newlib and Illumos has no way to set a thread name. // Newlib, Illumos and Emscripten have no way to set a thread name.
} }
pub fn sleep(dur: Duration) { pub fn sleep(dur: Duration) {

View file

@ -314,7 +314,7 @@ declare_features! (
(accepted, issue_5723_bootstrap, "1.0.0", None), (accepted, issue_5723_bootstrap, "1.0.0", None),
(accepted, macro_rules, "1.0.0", None), (accepted, macro_rules, "1.0.0", None),
// Allows using #![no_std] // Allows using #![no_std]
(accepted, no_std, "1.0.0", None), (accepted, no_std, "1.6.0", None),
(accepted, slicing_syntax, "1.0.0", None), (accepted, slicing_syntax, "1.0.0", None),
(accepted, struct_variant, "1.0.0", None), (accepted, struct_variant, "1.0.0", None),
// These are used to test this portion of the compiler, they don't actually // These are used to test this portion of the compiler, they don't actually

View file

@ -3788,19 +3788,18 @@ impl<'a> Parser<'a> {
} }
/// Parse a structure field /// Parse a structure field
fn parse_name_and_ty(&mut self, pr: Visibility, fn parse_name_and_ty(&mut self,
attrs: Vec<Attribute> ) -> PResult<'a, StructField> { lo: BytePos,
let lo = match pr { vis: Visibility,
Visibility::Inherited => self.span.lo, attrs: Vec<Attribute>)
_ => self.last_span.lo, -> PResult<'a, StructField> {
};
let name = self.parse_ident()?; let name = self.parse_ident()?;
self.expect(&token::Colon)?; self.expect(&token::Colon)?;
let ty = self.parse_ty_sum()?; let ty = self.parse_ty_sum()?;
Ok(StructField { Ok(StructField {
span: mk_sp(lo, self.last_span.hi), span: mk_sp(lo, self.last_span.hi),
ident: Some(name), ident: Some(name),
vis: pr, vis: vis,
id: ast::DUMMY_NODE_ID, id: ast::DUMMY_NODE_ID,
ty: ty, ty: ty,
attrs: attrs, attrs: attrs,
@ -5120,10 +5119,11 @@ impl<'a> Parser<'a> {
/// Parse a structure field declaration /// Parse a structure field declaration
pub fn parse_single_struct_field(&mut self, pub fn parse_single_struct_field(&mut self,
lo: BytePos,
vis: Visibility, vis: Visibility,
attrs: Vec<Attribute> ) attrs: Vec<Attribute> )
-> PResult<'a, StructField> { -> PResult<'a, StructField> {
let a_var = self.parse_name_and_ty(vis, attrs)?; let a_var = self.parse_name_and_ty(lo, vis, attrs)?;
match self.token { match self.token {
token::Comma => { token::Comma => {
self.bump(); self.bump();
@ -5144,8 +5144,9 @@ impl<'a> Parser<'a> {
/// Parse an element of a struct definition /// Parse an element of a struct definition
fn parse_struct_decl_field(&mut self) -> PResult<'a, StructField> { fn parse_struct_decl_field(&mut self) -> PResult<'a, StructField> {
let attrs = self.parse_outer_attributes()?; let attrs = self.parse_outer_attributes()?;
let lo = self.span.lo;
let vis = self.parse_visibility(true)?; let vis = self.parse_visibility(true)?;
self.parse_single_struct_field(vis, attrs) self.parse_single_struct_field(lo, vis, attrs)
} }
// If `allow_path` is false, just parse the `pub` in `pub(path)` (but still parse `pub(crate)`) // If `allow_path` is false, just parse the `pub` in `pub(path)` (but still parse `pub(crate)`)

View file

@ -340,6 +340,11 @@ pub struct TokenStream {
ts: InternalTS, ts: InternalTS,
} }
// This indicates the maximum size for a leaf in the concatenation algorithm.
// If two leafs will be collectively smaller than this, they will be merged.
// If a leaf is larger than this, it will be concatenated at the top.
const LEAF_SIZE : usize = 32;
// NB If Leaf access proves to be slow, inroducing a secondary Leaf without the bounds // NB If Leaf access proves to be slow, inroducing a secondary Leaf without the bounds
// for unsliced Leafs may lead to some performance improvemenet. // for unsliced Leafs may lead to some performance improvemenet.
#[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)] #[derive(Clone, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
@ -483,6 +488,37 @@ impl InternalTS {
} }
} }
} }
fn to_vec(&self) -> Vec<&TokenTree> {
let mut res = Vec::with_capacity(self.len());
fn traverse_and_append<'a>(res: &mut Vec<&'a TokenTree>, ts: &'a InternalTS) {
match *ts {
InternalTS::Empty(..) => {},
InternalTS::Leaf { ref tts, offset, len, .. } => {
let mut to_app = tts[offset..offset + len].iter().collect();
res.append(&mut to_app);
}
InternalTS::Node { ref left, ref right, .. } => {
traverse_and_append(res, left);
traverse_and_append(res, right);
}
}
}
traverse_and_append(&mut res, self);
res
}
fn to_tts(&self) -> Vec<TokenTree> {
self.to_vec().into_iter().cloned().collect::<Vec<TokenTree>>()
}
// Returns an internal node's children.
fn children(&self) -> Option<(Rc<InternalTS>, Rc<InternalTS>)> {
match *self {
InternalTS::Node { ref left, ref right, .. } => Some((left.clone(), right.clone())),
_ => None,
}
}
} }
/// TokenStream operators include basic destructuring, boolean operations, `maybe_...` /// TokenStream operators include basic destructuring, boolean operations, `maybe_...`
@ -496,14 +532,17 @@ impl InternalTS {
/// ///
/// `maybe_path_prefix("a::b::c(a,b,c).foo()") -> (a::b::c, "(a,b,c).foo()")` /// `maybe_path_prefix("a::b::c(a,b,c).foo()") -> (a::b::c, "(a,b,c).foo()")`
impl TokenStream { impl TokenStream {
// Construct an empty node with a dummy span.
pub fn mk_empty() -> TokenStream { pub fn mk_empty() -> TokenStream {
TokenStream { ts: InternalTS::Empty(DUMMY_SP) } TokenStream { ts: InternalTS::Empty(DUMMY_SP) }
} }
// Construct an empty node with the provided span.
fn mk_spanned_empty(sp: Span) -> TokenStream { fn mk_spanned_empty(sp: Span) -> TokenStream {
TokenStream { ts: InternalTS::Empty(sp) } TokenStream { ts: InternalTS::Empty(sp) }
} }
// Construct a leaf node with a 0 offset and length equivalent to the input.
fn mk_leaf(tts: Rc<Vec<TokenTree>>, sp: Span) -> TokenStream { fn mk_leaf(tts: Rc<Vec<TokenTree>>, sp: Span) -> TokenStream {
let len = tts.len(); let len = tts.len();
TokenStream { TokenStream {
@ -516,6 +555,7 @@ impl TokenStream {
} }
} }
// Construct a leaf node with the provided values.
fn mk_sub_leaf(tts: Rc<Vec<TokenTree>>, offset: usize, len: usize, sp: Span) -> TokenStream { fn mk_sub_leaf(tts: Rc<Vec<TokenTree>>, offset: usize, len: usize, sp: Span) -> TokenStream {
TokenStream { TokenStream {
ts: InternalTS::Leaf { ts: InternalTS::Leaf {
@ -527,6 +567,7 @@ impl TokenStream {
} }
} }
// Construct an internal node with the provided values.
fn mk_int_node(left: Rc<InternalTS>, fn mk_int_node(left: Rc<InternalTS>,
right: Rc<InternalTS>, right: Rc<InternalTS>,
len: usize, len: usize,
@ -561,11 +602,56 @@ impl TokenStream {
} }
} }
/// Concatenates two TokenStreams into a new TokenStream /// Concatenates two TokenStreams into a new TokenStream.
pub fn concat(left: TokenStream, right: TokenStream) -> TokenStream { pub fn concat(left: TokenStream, right: TokenStream) -> TokenStream {
let new_len = left.len() + right.len(); // This internal procedure performs 'aggressive compacting' during concatenation as
let new_span = combine_spans(left.span(), right.span()); // follows:
TokenStream::mk_int_node(Rc::new(left.ts), Rc::new(right.ts), new_len, new_span) // - If the nodes' combined total total length is less than 32, we copy both of
// them into a new vector and build a new leaf node.
// - If one node is an internal node and the other is a 'small' leaf (length<32),
// we recur down the internal node on the appropriate side.
// - Otherwise, we construct a new internal node that points to them as left and
// right.
fn concat_internal(left: Rc<InternalTS>, right: Rc<InternalTS>) -> TokenStream {
let llen = left.len();
let rlen = right.len();
let len = llen + rlen;
let span = combine_spans(left.span(), right.span());
if len <= LEAF_SIZE {
let mut new_vec = left.to_tts();
let mut rvec = right.to_tts();
new_vec.append(&mut rvec);
return TokenStream::mk_leaf(Rc::new(new_vec), span);
}
match (left.children(), right.children()) {
(Some((lleft, lright)), None) => {
if rlen <= LEAF_SIZE {
let new_right = concat_internal(lright, right);
TokenStream::mk_int_node(lleft, Rc::new(new_right.ts), len, span)
} else {
TokenStream::mk_int_node(left, right, len, span)
}
}
(None, Some((rleft, rright))) => {
if rlen <= LEAF_SIZE {
let new_left = concat_internal(left, rleft);
TokenStream::mk_int_node(Rc::new(new_left.ts), rright, len, span)
} else {
TokenStream::mk_int_node(left, right, len, span)
}
}
(_, _) => TokenStream::mk_int_node(left, right, len, span),
}
}
if left.is_empty() {
right
} else if right.is_empty() {
left
} else {
concat_internal(Rc::new(left.ts), Rc::new(right.ts))
}
} }
/// Indicate if the TokenStream is empty. /// Indicate if the TokenStream is empty.
@ -580,27 +666,13 @@ impl TokenStream {
/// Convert a TokenStream into a vector of borrowed TokenTrees. /// Convert a TokenStream into a vector of borrowed TokenTrees.
pub fn to_vec(&self) -> Vec<&TokenTree> { pub fn to_vec(&self) -> Vec<&TokenTree> {
fn internal_to_vec(ts: &InternalTS) -> Vec<&TokenTree> { self.ts.to_vec()
match *ts {
InternalTS::Empty(..) => Vec::new(),
InternalTS::Leaf { ref tts, offset, len, .. } => {
tts[offset..offset + len].iter().collect()
}
InternalTS::Node { ref left, ref right, .. } => {
let mut v1 = internal_to_vec(left);
let mut v2 = internal_to_vec(right);
v1.append(&mut v2);
v1
}
}
}
internal_to_vec(&self.ts)
} }
/// Convert a TokenStream into a vector of TokenTrees (by cloning the TokenTrees). /// Convert a TokenStream into a vector of TokenTrees (by cloning the TokenTrees).
/// (This operation is an O(n) deep copy of the underlying structure.) /// (This operation is an O(n) deep copy of the underlying structure.)
pub fn to_tts(&self) -> Vec<TokenTree> { pub fn to_tts(&self) -> Vec<TokenTree> {
self.to_vec().into_iter().cloned().collect::<Vec<TokenTree>>() self.ts.to_tts()
} }
/// Return the TokenStream's span. /// Return the TokenStream's span.

View file

@ -60,7 +60,6 @@ pub const unwinder_private_data_size: usize = 2;
pub const unwinder_private_data_size: usize = 2; pub const unwinder_private_data_size: usize = 2;
#[cfg(target_arch = "asmjs")] #[cfg(target_arch = "asmjs")]
// FIXME: Copied from arm. Need to confirm.
pub const unwinder_private_data_size: usize = 20; pub const unwinder_private_data_size: usize = 20;
#[repr(C)] #[repr(C)]

View file

@ -13,4 +13,6 @@ use std::collections::LinkedList;
fn main() { fn main() {
LinkedList::new() += 1; //~ ERROR E0368 LinkedList::new() += 1; //~ ERROR E0368
//~^ ERROR E0067 //~^ ERROR E0067
//~^^ NOTE invalid expression for left-hand side
//~| NOTE cannot use `+=` on type `std::collections::LinkedList<_>`
} }

View file

@ -11,6 +11,7 @@
#![feature(intrinsics)] #![feature(intrinsics)]
extern "rust-intrinsic" { extern "rust-intrinsic" {
fn size_of<T, U>() -> usize; //~ ERROR E0094 fn size_of<T, U>() -> usize; //~ ERROR E0094
//~| NOTE expected 1 type parameter
} }
fn main() { fn main() {

View file

@ -12,6 +12,9 @@
#[start] #[start]
fn foo(argc: isize, argv: *const *const u8) -> isize {} fn foo(argc: isize, argv: *const *const u8) -> isize {}
//~^ NOTE previous `start` function here
#[start] #[start]
fn f(argc: isize, argv: *const *const u8) -> isize {} //~ ERROR E0138 fn f(argc: isize, argv: *const *const u8) -> isize {}
//~^ ERROR E0138
//~| NOTE multiple `start` functions

View file

@ -14,6 +14,8 @@ mod foo {
} }
} }
use foo::MyTrait::do_something; //~ ERROR E0253 use foo::MyTrait::do_something;
//~^ ERROR E0253
//~|NOTE cannot be imported directly
fn main() {} fn main() {}

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
extern crate collections; extern crate collections;
//~^ NOTE previous import of `collections` here
mod foo { mod foo {
pub trait collections { pub trait collections {
@ -16,6 +17,8 @@ mod foo {
} }
} }
use foo::collections; //~ ERROR E0254 use foo::collections;
//~^ ERROR E0254
//~| NOTE already imported
fn main() {} fn main() {}

View file

@ -10,4 +10,5 @@
fn main() { fn main() {
let w = || { break; }; //~ ERROR E0267 let w = || { break; }; //~ ERROR E0267
//~| NOTE cannot break inside of a closure
} }

View file

@ -10,4 +10,5 @@
fn main() { fn main() {
break; //~ ERROR E0268 break; //~ ERROR E0268
//~| NOTE cannot break outside of a loop
} }

View file

@ -12,6 +12,7 @@ fn main() {
match Some(()) { match Some(()) {
None => { }, None => { },
option if option.take().is_none() => {}, //~ ERROR E0301 option if option.take().is_none() => {}, //~ ERROR E0301
//~| NOTE borrowed mutably in pattern guard
Some(_) => { } Some(_) => { }
} }
} }

View file

@ -12,6 +12,7 @@ fn main() {
match Some(()) { match Some(()) {
None => { }, None => { },
option if { option = None; false } => { }, //~ ERROR E0302 option if { option = None; false } => { }, //~ ERROR E0302
//~| NOTE assignment in pattern guard
Some(_) => { } Some(_) => { }
} }
} }

View file

@ -15,5 +15,5 @@ fn main() {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `&[i32]` //~| expected type `&[i32]`
//~| found type `[{integer}; 1]` //~| found type `[{integer}; 1]`
//~| expected &-ptr, found array of 1 elements //~| expected &[i32], found array of 1 elements
} }

View file

@ -21,5 +21,5 @@ pub fn main() {
let _y: &Trait = x; //~ ERROR mismatched types let _y: &Trait = x; //~ ERROR mismatched types
//~| expected type `&Trait` //~| expected type `&Trait`
//~| found type `Box<Trait>` //~| found type `Box<Trait>`
//~| expected &-ptr, found box //~| expected &Trait, found box
} }

View file

@ -42,12 +42,12 @@ fn main() {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `T` //~| expected type `T`
//~| found type `&_` //~| found type `&_`
//~| expected trait T, found &-ptr //~| expected trait T, found reference
let &&&x = &(&1isize as &T); let &&&x = &(&1isize as &T);
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `T` //~| expected type `T`
//~| found type `&_` //~| found type `&_`
//~| expected trait T, found &-ptr //~| expected trait T, found reference
let box box x = box 1isize as Box<T>; let box box x = box 1isize as Box<T>;
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `T` //~| expected type `T`

View file

@ -19,12 +19,12 @@ struct Foo<T: ?Sized> {
} }
pub fn main() { pub fn main() {
// Test that we cannot convert from *-ptr to &-ptr // Test that we cannot convert from *-ptr to &S and &T
let x: *const S = &S; let x: *const S = &S;
let y: &S = x; //~ ERROR mismatched types let y: &S = x; //~ ERROR mismatched types
let y: &T = x; //~ ERROR mismatched types let y: &T = x; //~ ERROR mismatched types
// Test that we cannot convert from *-ptr to &-ptr (mut version) // Test that we cannot convert from *-ptr to &S and &T (mut version)
let x: *mut S = &mut S; let x: *mut S = &mut S;
let y: &S = x; //~ ERROR mismatched types let y: &S = x; //~ ERROR mismatched types
let y: &T = x; //~ ERROR mismatched types let y: &T = x; //~ ERROR mismatched types

View file

@ -17,4 +17,4 @@ fn bar(x: isize) { }
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `fn(&mut __test::test::Bencher)` //~| expected type `fn(&mut __test::test::Bencher)`
//~| found type `fn(isize) {bar}` //~| found type `fn(isize) {bar}`
//~| expected &-ptr, found isize //~| expected mutable reference, found isize

View file

@ -18,5 +18,5 @@ fn main() {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `&str` //~| expected type `&str`
//~| found type `Slice<_>` //~| found type `Slice<_>`
//~| expected &-ptr, found struct `Slice` //~| expected &str, found struct `Slice`
} }

View file

@ -12,7 +12,7 @@ fn f<'r>(p: &'r mut fn(p: &mut ())) {
(*p)(()) //~ ERROR mismatched types (*p)(()) //~ ERROR mismatched types
//~| expected type `&mut ()` //~| expected type `&mut ()`
//~| found type `()` //~| found type `()`
//~| expected &-ptr, found () //~| expected &mut (), found ()
} }
fn main() {} fn main() {}

View file

@ -15,13 +15,13 @@ struct Foo;
impl<'a, T> Fn<(&'a T,)> for Foo { impl<'a, T> Fn<(&'a T,)> for Foo {
extern "rust-call" fn call(&self, (_,): (T,)) {} extern "rust-call" fn call(&self, (_,): (T,)) {}
//~^ ERROR: has an incompatible type for trait //~^ ERROR: has an incompatible type for trait
//~| expected &-ptr //~| expected reference
} }
impl<'a, T> FnMut<(&'a T,)> for Foo { impl<'a, T> FnMut<(&'a T,)> for Foo {
extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {}
//~^ ERROR: has an incompatible type for trait //~^ ERROR: has an incompatible type for trait
//~| expected &-ptr //~| expected reference
} }
impl<'a, T> FnOnce<(&'a T,)> for Foo { impl<'a, T> FnOnce<(&'a T,)> for Foo {
@ -29,7 +29,7 @@ impl<'a, T> FnOnce<(&'a T,)> for Foo {
extern "rust-call" fn call_once(self, (_,): (T,)) {} extern "rust-call" fn call_once(self, (_,): (T,)) {}
//~^ ERROR: has an incompatible type for trait //~^ ERROR: has an incompatible type for trait
//~| expected &-ptr //~| expected reference
} }
fn main() {} fn main() {}

View file

@ -12,6 +12,7 @@ macro_rules! not_an_lvalue {
($thing:expr) => { ($thing:expr) => {
$thing = 42; $thing = 42;
//~^ ERROR invalid left-hand side expression //~^ ERROR invalid left-hand side expression
//~^^ NOTE left-hand of expression not valid
} }
} }

View file

@ -13,7 +13,7 @@ macro_rules! foo {
fn bar(d: u8) { } fn bar(d: u8) { }
bar(&mut $d); bar(&mut $d);
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected u8, found &-ptr //~| expected u8, found &mut u8
//~| expected type `u8` //~| expected type `u8`
//~| found type `&mut u8` //~| found type `&mut u8`
}} }}

View file

@ -52,7 +52,7 @@ fn main() {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `(bool, bool)` //~| expected type `(bool, bool)`
//~| found type `&_` //~| found type `&_`
//~| expected tuple, found &-ptr //~| expected tuple, found reference
} }

View file

@ -13,5 +13,5 @@ fn main() {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `()` //~| expected type `()`
//~| found type `&_` //~| found type `&_`
//~| expected (), found &-ptr //~| expected (), found reference
} }

View file

@ -15,7 +15,7 @@ impl<'a> BarStruct {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `Box<BarStruct>` //~| expected type `Box<BarStruct>`
//~| found type `&'a mut BarStruct` //~| found type `&'a mut BarStruct`
//~| expected box, found &-ptr //~| expected box, found mutable reference
} }
fn main() {} fn main() {}

View file

@ -27,11 +27,11 @@ fn main() {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `&std::option::Option<{integer}>` //~| expected type `&std::option::Option<{integer}>`
//~| found type `std::option::Option<_>` //~| found type `std::option::Option<_>`
//~| expected &-ptr, found enum `std::option::Option` //~| expected reference, found enum `std::option::Option`
None => () None => ()
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `&std::option::Option<{integer}>` //~| expected type `&std::option::Option<{integer}>`
//~| found type `std::option::Option<_>` //~| found type `std::option::Option<_>`
//~| expected &-ptr, found enum `std::option::Option` //~| expected reference, found enum `std::option::Option`
} }
} }

View file

@ -21,7 +21,7 @@ fn main() {
Foo::bar(x); //~ ERROR mismatched types Foo::bar(x); //~ ERROR mismatched types
//~| expected type `&Foo` //~| expected type `&Foo`
//~| found type `Foo` //~| found type `Foo`
//~| expected &-ptr, found struct `Foo` //~| expected &Foo, found struct `Foo`
Foo::bar(&42); //~ ERROR mismatched types Foo::bar(&42); //~ ERROR mismatched types
//~| expected type `&Foo` //~| expected type `&Foo`
//~| found type `&{integer}` //~| found type `&{integer}`

View file

@ -36,7 +36,7 @@ fn main() {
y: 3, y: 3,
}; };
let ans = s("what"); //~ ERROR mismatched types let ans = s("what"); //~ ERROR mismatched types
//~^ NOTE expected isize, found &-ptr //~^ NOTE expected isize, found reference
//~| NOTE expected type //~| NOTE expected type
//~| NOTE found type //~| NOTE found type
let ans = s(); let ans = s();

View file

@ -1,30 +0,0 @@
// Copyright 2015 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.
// Regression test for issue #26083
// Test that span for public struct fields start at `pub` instead of the identifier
struct Foo {
pub bar: u8,
pub
//~^ error: field `bar` is already declared [E0124]
bar: u8,
pub bar:
//~^ error: field `bar` is already declared [E0124]
u8,
bar:
//~^ error: field `bar` is already declared [E0124]
u8,
}
fn main() { }

View file

@ -38,7 +38,7 @@ fn main() {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `usize` //~| expected type `usize`
//~| found type `&'static str` //~| found type `&'static str`
//~| expected usize, found &-ptr //~| expected usize, found reference
//~| ERROR expected `usize` for repeat count, found string literal [E0306] //~| ERROR expected `usize` for repeat count, found string literal [E0306]
//~| expected `usize` //~| expected `usize`
let f = [0; -4_isize]; let f = [0; -4_isize];

View file

@ -12,6 +12,7 @@
// ignore-android: FIXME(#10356) // ignore-android: FIXME(#10356)
// ignore-windows: std::dynamic_lib does not work on Windows well // ignore-windows: std::dynamic_lib does not work on Windows well
// ignore-musl // ignore-musl
// ignore-emscripten no dynamic linking
extern crate linkage_visibility as foo; extern crate linkage_visibility as foo;

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// exec-env:RUST_LOG=logging_enabled=info // exec-env:RUST_LOG=logging_enabled=info
// ignore-emscripten: FIXME(#31622)
#![feature(rustc_private)] #![feature(rustc_private)]

View file

@ -11,6 +11,7 @@
// ignore-windows // ignore-windows
// exec-env:RUST_LOG=debug // exec-env:RUST_LOG=debug
// compile-flags:-C debug-assertions=y // compile-flags:-C debug-assertions=y
// ignore-emscripten: FIXME(#31622)
#![feature(rustc_private)] #![feature(rustc_private)]

View file

@ -12,7 +12,7 @@
// ignore-pretty: does not work well with `--test` // ignore-pretty: does not work well with `--test`
#![feature(quote, rustc_private)] #![feature(quote, rustc_private)]
#![deny(unused_variable)] #![deny(unused_variables)]
extern crate syntax; extern crate syntax;

View file

@ -17,6 +17,7 @@
// compile-flags:-g -Cllvm-args=-enable-tail-merge=0 // compile-flags:-g -Cllvm-args=-enable-tail-merge=0
// ignore-pretty as this critically relies on line numbers // ignore-pretty as this critically relies on line numbers
// ignore-emscripten spawning processes is not supported
use std::io; use std::io;
use std::io::prelude::*; use std::io::prelude::*;

View file

@ -10,6 +10,7 @@
// no-pretty-expanded FIXME #15189 // no-pretty-expanded FIXME #15189
// ignore-android FIXME #17520 // ignore-android FIXME #17520
// ignore-emscripten spawning processes is not supported
// compile-flags:-g // compile-flags:-g
use std::env; use std::env;

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// ignore-windows - this is a unix-specific test // ignore-windows - this is a unix-specific test
// ignore-emscripten
#![feature(process_exec, libc)] #![feature(process_exec, libc)]

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// ignore-windows - this is a unix-specific test // ignore-windows - this is a unix-specific test
// ignore-emscripten
// ignore-pretty // ignore-pretty
#![feature(process_exec)] #![feature(process_exec)]

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// compile-flags: -Z force-dropflag-checks=on // compile-flags: -Z force-dropflag-checks=on
// ignore-emscripten
// Quick-and-dirty test to ensure -Z force-dropflag-checks=on works as // Quick-and-dirty test to ensure -Z force-dropflag-checks=on works as
// expected. Note that the inlined drop-flag is slated for removal // expected. Note that the inlined drop-flag is slated for removal

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten no threads support
#![allow(unknown_features)] #![allow(unknown_features)]
#![feature(box_syntax)] #![feature(box_syntax)]

View file

@ -11,7 +11,7 @@
// pretty-expanded FIXME #23616 // pretty-expanded FIXME #23616
#![allow(dead_assignment)] #![allow(dead_assignment)]
#![allow(unused_variable)] #![allow(unused_variables)]
enum Animal { enum Animal {
Dog (String, f64), Dog (String, f64),

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten
use std::env::args; use std::env::args;
use std::process::Command; use std::process::Command;

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten
#![feature(path)] #![feature(path)]

View file

@ -9,7 +9,7 @@
// except according to those terms. // except according to those terms.
// exec-env:TEST_EXEC_ENV=22 // exec-env:TEST_EXEC_ENV=22
// ignore-emscripten FIXME: issue #31622
use std::env; use std::env;

View file

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616 // pretty-expanded FIXME #23616
#![allow(unused_variable)] #![allow(unused_variables)]
pub fn main() { pub fn main() {
// We should be able to type infer inside of ||s. // We should be able to type infer inside of ||s.

View file

@ -11,7 +11,7 @@
// pretty-expanded FIXME #23616 // pretty-expanded FIXME #23616
#![allow(dead_assignment)] #![allow(dead_assignment)]
#![allow(unused_variable)] #![allow(unused_variables)]
#![allow(unknown_features)] #![allow(unknown_features)]
#![feature(box_syntax)] #![feature(box_syntax)]

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten No support for threads
#![allow(unknown_features)] #![allow(unknown_features)]
#![feature(std_misc)] #![feature(std_misc)]

View file

@ -24,7 +24,8 @@ mod rusti {
target_os = "dragonfly", target_os = "dragonfly",
target_os = "netbsd", target_os = "netbsd",
target_os = "openbsd", target_os = "openbsd",
target_os = "solaris"))] target_os = "solaris",
target_os = "emscripten"))]
mod m { mod m {
#[main] #[main]
#[cfg(target_arch = "x86")] #[cfg(target_arch = "x86")]

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten
// Make sure that if a process doesn't have its stdio/stderr descriptors set up // Make sure that if a process doesn't have its stdio/stderr descriptors set up
// that we don't die in a large ball of fire // that we don't die in a large ball of fire

View file

@ -12,6 +12,7 @@
// aux-build:issue-12133-dylib.rs // aux-build:issue-12133-dylib.rs
// aux-build:issue-12133-dylib2.rs // aux-build:issue-12133-dylib2.rs
// ignore-musl // ignore-musl
// ignore-emscripten no dylib support
// pretty-expanded FIXME #23616 // pretty-expanded FIXME #23616

View file

@ -16,7 +16,7 @@ extern crate issue12660aux;
use issue12660aux::{my_fn, MyStruct}; use issue12660aux::{my_fn, MyStruct};
#[allow(path_statement)] #[allow(path_statements)]
fn main() { fn main() {
my_fn(MyStruct); my_fn(MyStruct);
MyStruct; MyStruct;

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// ignore-aarch64 // ignore-aarch64
// ignore-emscripten
#![feature(io, process_capture)] #![feature(io, process_capture)]
use std::env; use std::env;

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten
#![feature(io, process_capture)] #![feature(io, process_capture)]

View file

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616 // pretty-expanded FIXME #23616
#![allow(unused_variable)] #![allow(unused_variables)]
struct T { f: extern "Rust" fn() } struct T { f: extern "Rust" fn() }
struct S { f: extern "Rust" fn() } struct S { f: extern "Rust" fn() }

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten
use std::env; use std::env;
use std::process::Command; use std::process::Command;

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// ignore-aarch64 // ignore-aarch64
// ignore-emscripten
use std::process::Command; use std::process::Command;
use std::env; use std::env;

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// ignore-aarch64 // ignore-aarch64
// ignore-emscripten
#![feature(std_misc, os)] #![feature(std_misc, os)]
#[cfg(unix)] #[cfg(unix)]

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// pretty-expanded FIXME #23616 // pretty-expanded FIXME #23616
// ignore-emscripten
use std::thread::Builder; use std::thread::Builder;

View file

@ -0,0 +1,13 @@
// Copyright 2016 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.
#[allow(dead_code)]
static X: &'static str = &*"";
fn main() {}

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten
use std::thread; use std::thread;
use std::env; use std::env;
use std::process::Command; use std::process::Command;

View file

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten
// compile-flags: -Z orbit=off // compile-flags: -Z orbit=off
// (blows the stack with MIR trans and no optimizations) // (blows the stack with MIR trans and no optimizations)

View file

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
// aux-build:issue-29485.rs // aux-build:issue-29485.rs
// ignore-emscripten
#[feature(recover)] #[feature(recover)]

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten
// Previously libstd would set stdio descriptors of a child process // Previously libstd would set stdio descriptors of a child process
// by `dup`ing the requested descriptors to inherit directly into the // by `dup`ing the requested descriptors to inherit directly into the
// stdio descriptors. This, however, would incorrectly handle cases // stdio descriptors. This, however, would incorrectly handle cases

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
// ignore-emscripten
use std::process::{Command, Stdio}; use std::process::{Command, Stdio};
use std::env; use std::env;
use std::sync::{Mutex, RwLock}; use std::sync::{Mutex, RwLock};

View file

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616 // pretty-expanded FIXME #23616
#![allow(path_statement)] #![allow(path_statements)]
#![allow(unknown_features)] #![allow(unknown_features)]
#![feature(box_syntax)] #![feature(box_syntax)]

View file

@ -12,7 +12,7 @@
// `e` is a type which requires a destructor. // `e` is a type which requires a destructor.
#![allow(path_statement)] #![allow(path_statements)]
struct A { n: isize } struct A { n: isize }
struct B; struct B;

View file

@ -13,7 +13,7 @@
// (Closes #7911) Test that we can use the same self expression // (Closes #7911) Test that we can use the same self expression
// with different mutability in macro in two methods // with different mutability in macro in two methods
#![allow(unused_variable)] // unused foobar_immut + foobar_mut #![allow(unused_variables)] // unused foobar_immut + foobar_mut
trait FooBar { trait FooBar {
fn dummy(&self) { } fn dummy(&self) { }
} }

View file

@ -10,6 +10,7 @@
// ignore-windows // ignore-windows
// ignore-macos // ignore-macos
// ignore-emscripten
// aux-build:linkage1.rs // aux-build:linkage1.rs
#![feature(linkage)] #![feature(linkage)]

View file

@ -12,7 +12,7 @@
#![allow(dead_assignment)] #![allow(dead_assignment)]
#![allow(unreachable_code)] #![allow(unreachable_code)]
#![allow(unused_variable)] #![allow(unused_variables)]
fn test(_cond: bool) { fn test(_cond: bool) {
let v: isize; let v: isize;

View file

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616 // pretty-expanded FIXME #23616
#![allow(unused_variable)] #![allow(unused_variables)]
pub fn main() { pub fn main() {
let mut i: isize = 0; let mut i: isize = 0;

Some files were not shown because too many files have changed in this diff Show more