diff --git a/.travis.yml b/.travis.yml index 7251a46cc5878..2a5f755ebff3d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -218,10 +218,6 @@ before_install: echo '{"ipv6":true,"fixed-cidr-v6":"fd9a:8454:6789:13f7::/64"}' | sudo tee /etc/docker/daemon.json; sudo service docker restart; fi - - date - - sudo atq || true - - sudo grep -rE 'shutdown|poweroff|halt' /var/spool/cron || true - - sudo grep -E 'google-clock-skew|ntpd|startup-script' /var/log/syslog || true install: - case "$TRAVIS_OS_NAME" in @@ -278,8 +274,6 @@ after_success: du . | sort -nr | head -n100 after_failure: - # Requested by travis to debug "shutting down NOW" errors - - sudo tail -n 500 /var/log/syslog - > echo "#### Build failed; Disk usage after running script:"; df -h; diff --git a/src/Cargo.lock b/src/Cargo.lock index a8308eb403896..99b768ab1a92e 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -100,7 +100,7 @@ name = "backtrace" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)", + "backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -109,7 +109,7 @@ dependencies = [ [[package]] name = "backtrace-sys" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3125,7 +3125,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum assert_cli 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98589b0e465a6c510d95fceebd365bb79bedece7f6e18a480897f2015f85ec51" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" -"checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e" +"checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" "checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32" diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index b1ee636644ec7..3a7714d32fa17 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -119,10 +119,6 @@ fi # goes ahead and sets it for all builders. args="$args --privileged" -if [ "$CI" != "" ]; then - args="$args --dns 8.8.8.8 --dns 8.8.4.4 --dns 1.1.1.1 --dns 1.0.0.1" -fi - exec docker \ run \ --volume "$root_dir:/checkout:ro" \ diff --git a/src/doc/unstable-book/src/library-features/future-atomic-orderings.md b/src/doc/unstable-book/src/library-features/future-atomic-orderings.md deleted file mode 100644 index 40c2ef2db0551..0000000000000 --- a/src/doc/unstable-book/src/library-features/future-atomic-orderings.md +++ /dev/null @@ -1,5 +0,0 @@ -# `future_atomic_orderings` - -This feature is internal to the Rust compiler and is not intended for general use. - ------------------------- diff --git a/src/doc/unstable-book/src/library-features/io-error-internals.md b/src/doc/unstable-book/src/library-features/io-error-internals.md deleted file mode 100644 index 5bee18d33d61b..0000000000000 --- a/src/doc/unstable-book/src/library-features/io-error-internals.md +++ /dev/null @@ -1,5 +0,0 @@ -# `io_error_internals` - -This feature is internal to the Rust compiler and is not intended for general use. - ------------------------- diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 178ae62dd3dfa..e85bf1dfcad23 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -120,6 +120,7 @@ #![feature(const_slice_len)] #![feature(const_str_as_bytes)] #![feature(const_str_len)] +#![feature(non_exhaustive)] #[prelude_import] #[allow(unused)] diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 5bb713f576741..617e067e0787e 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -185,6 +185,7 @@ unsafe impl Sync for AtomicPtr {} /// [nomicon]: ../../../nomicon/atomics.html #[stable(feature = "rust1", since = "1.0.0")] #[derive(Copy, Clone, Debug)] +#[non_exhaustive] pub enum Ordering { /// No ordering constraints, only atomic operations. /// @@ -256,10 +257,6 @@ pub enum Ordering { /// [`AcqRel`]: https://llvm.org/docs/Atomics.html#acquirerelease #[stable(feature = "rust1", since = "1.0.0")] SeqCst, - // Prevent exhaustive matching to allow for future extension - #[doc(hidden)] - #[unstable(feature = "future_atomic_orderings", issue = "0")] - __Nonexhaustive, } /// An [`AtomicBool`] initialized to `false`. @@ -1954,7 +1951,6 @@ fn strongest_failure_ordering(order: Ordering) -> Ordering { SeqCst => SeqCst, Acquire => Acquire, AcqRel => Acquire, - __Nonexhaustive => __Nonexhaustive, } } @@ -1966,7 +1962,6 @@ unsafe fn atomic_store(dst: *mut T, val: T, order: Ordering) { SeqCst => intrinsics::atomic_store(dst, val), Acquire => panic!("there is no such thing as an acquire store"), AcqRel => panic!("there is no such thing as an acquire/release store"), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -1978,7 +1973,6 @@ unsafe fn atomic_load(dst: *const T, order: Ordering) -> T { SeqCst => intrinsics::atomic_load(dst), Release => panic!("there is no such thing as a release load"), AcqRel => panic!("there is no such thing as an acquire/release load"), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -1991,7 +1985,6 @@ unsafe fn atomic_swap(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_xchg_acqrel(dst, val), Relaxed => intrinsics::atomic_xchg_relaxed(dst, val), SeqCst => intrinsics::atomic_xchg(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2004,7 +1997,6 @@ unsafe fn atomic_add(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_xadd_acqrel(dst, val), Relaxed => intrinsics::atomic_xadd_relaxed(dst, val), SeqCst => intrinsics::atomic_xadd(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2017,7 +2009,6 @@ unsafe fn atomic_sub(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_xsub_acqrel(dst, val), Relaxed => intrinsics::atomic_xsub_relaxed(dst, val), SeqCst => intrinsics::atomic_xsub(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2039,8 +2030,6 @@ unsafe fn atomic_compare_exchange(dst: *mut T, (AcqRel, Relaxed) => intrinsics::atomic_cxchg_acqrel_failrelaxed(dst, old, new), (SeqCst, Relaxed) => intrinsics::atomic_cxchg_failrelaxed(dst, old, new), (SeqCst, Acquire) => intrinsics::atomic_cxchg_failacq(dst, old, new), - (__Nonexhaustive, _) => panic!("invalid memory ordering"), - (_, __Nonexhaustive) => panic!("invalid memory ordering"), (_, AcqRel) => panic!("there is no such thing as an acquire/release failure ordering"), (_, Release) => panic!("there is no such thing as a release failure ordering"), _ => panic!("a failure ordering can't be stronger than a success ordering"), @@ -2065,8 +2054,6 @@ unsafe fn atomic_compare_exchange_weak(dst: *mut T, (AcqRel, Relaxed) => intrinsics::atomic_cxchgweak_acqrel_failrelaxed(dst, old, new), (SeqCst, Relaxed) => intrinsics::atomic_cxchgweak_failrelaxed(dst, old, new), (SeqCst, Acquire) => intrinsics::atomic_cxchgweak_failacq(dst, old, new), - (__Nonexhaustive, _) => panic!("invalid memory ordering"), - (_, __Nonexhaustive) => panic!("invalid memory ordering"), (_, AcqRel) => panic!("there is no such thing as an acquire/release failure ordering"), (_, Release) => panic!("there is no such thing as a release failure ordering"), _ => panic!("a failure ordering can't be stronger than a success ordering"), @@ -2082,7 +2069,6 @@ unsafe fn atomic_and(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_and_acqrel(dst, val), Relaxed => intrinsics::atomic_and_relaxed(dst, val), SeqCst => intrinsics::atomic_and(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2094,7 +2080,6 @@ unsafe fn atomic_nand(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_nand_acqrel(dst, val), Relaxed => intrinsics::atomic_nand_relaxed(dst, val), SeqCst => intrinsics::atomic_nand(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2106,7 +2091,6 @@ unsafe fn atomic_or(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_or_acqrel(dst, val), Relaxed => intrinsics::atomic_or_relaxed(dst, val), SeqCst => intrinsics::atomic_or(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2118,7 +2102,6 @@ unsafe fn atomic_xor(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_xor_acqrel(dst, val), Relaxed => intrinsics::atomic_xor_relaxed(dst, val), SeqCst => intrinsics::atomic_xor(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2131,7 +2114,6 @@ unsafe fn atomic_max(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_max_acqrel(dst, val), Relaxed => intrinsics::atomic_max_relaxed(dst, val), SeqCst => intrinsics::atomic_max(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2144,7 +2126,6 @@ unsafe fn atomic_min(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_min_acqrel(dst, val), Relaxed => intrinsics::atomic_min_relaxed(dst, val), SeqCst => intrinsics::atomic_min(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2157,7 +2138,6 @@ unsafe fn atomic_umax(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_umax_acqrel(dst, val), Relaxed => intrinsics::atomic_umax_relaxed(dst, val), SeqCst => intrinsics::atomic_umax(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2170,7 +2150,6 @@ unsafe fn atomic_umin(dst: *mut T, val: T, order: Ordering) -> T { AcqRel => intrinsics::atomic_umin_acqrel(dst, val), Relaxed => intrinsics::atomic_umin_relaxed(dst, val), SeqCst => intrinsics::atomic_umin(dst, val), - __Nonexhaustive => panic!("invalid memory ordering"), } } @@ -2260,7 +2239,6 @@ pub fn fence(order: Ordering) { AcqRel => intrinsics::atomic_fence_acqrel(), SeqCst => intrinsics::atomic_fence(), Relaxed => panic!("there is no such thing as a relaxed fence"), - __Nonexhaustive => panic!("invalid memory ordering"), } } } @@ -2350,7 +2328,6 @@ pub fn compiler_fence(order: Ordering) { AcqRel => intrinsics::atomic_singlethreadfence_acqrel(), SeqCst => intrinsics::atomic_singlethreadfence(), Relaxed => panic!("there is no such thing as a relaxed compiler fence"), - __Nonexhaustive => panic!("invalid memory ordering"), } } } diff --git a/src/libproc_macro/diagnostic.rs b/src/libproc_macro/diagnostic.rs index 51e7647f36cc2..af7790164183c 100644 --- a/src/libproc_macro/diagnostic.rs +++ b/src/libproc_macro/diagnostic.rs @@ -16,6 +16,7 @@ use syntax_pos::MultiSpan; /// An enum representing a diagnostic level. #[unstable(feature = "proc_macro_diagnostic", issue = "38356")] #[derive(Copy, Clone, Debug)] +#[non_exhaustive] pub enum Level { /// An error. Error, @@ -25,8 +26,6 @@ pub enum Level { Note, /// A help message. Help, - #[doc(hidden)] - __Nonexhaustive, } /// A structure representing a diagnostic message and associated children diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 66afe36e7cb9a..b54054752eaf1 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -36,6 +36,7 @@ #![feature(staged_api)] #![feature(lang_items)] #![feature(optin_builtin_traits)] +#![feature(non_exhaustive)] #![recursion_limit="256"] diff --git a/src/libproc_macro/rustc.rs b/src/libproc_macro/rustc.rs index a54c695f6376f..21229d3299d7e 100644 --- a/src/libproc_macro/rustc.rs +++ b/src/libproc_macro/rustc.rs @@ -278,7 +278,6 @@ impl Level { Level::Warning => errors::Level::Warning, Level::Note => errors::Level::Note, Level::Help => errors::Level::Help, - Level::__Nonexhaustive => unreachable!("Level::__Nonexhaustive"), } } } diff --git a/src/librustc_apfloat/ieee.rs b/src/librustc_apfloat/ieee.rs index 45279f18117c1..87d59d2e763cb 100644 --- a/src/librustc_apfloat/ieee.rs +++ b/src/librustc_apfloat/ieee.rs @@ -2306,24 +2306,14 @@ mod sig { /// One, not zero, based LSB. That is, returns 0 for a zeroed significand. pub(super) fn olsb(limbs: &[Limb]) -> usize { - for (i, &limb) in limbs.iter().enumerate() { - if limb != 0 { - return i * LIMB_BITS + limb.trailing_zeros() as usize + 1; - } - } - - 0 + limbs.iter().enumerate().find(|(_, &limb)| limb != 0).map_or(0, + |(i, limb)| i * LIMB_BITS + limb.trailing_zeros() as usize + 1) } /// One, not zero, based MSB. That is, returns 0 for a zeroed significand. pub(super) fn omsb(limbs: &[Limb]) -> usize { - for (i, &limb) in limbs.iter().enumerate().rev() { - if limb != 0 { - return (i + 1) * LIMB_BITS - limb.leading_zeros() as usize; - } - } - - 0 + limbs.iter().enumerate().rfind(|(_, &limb)| limb != 0).map_or(0, + |(i, limb)| (i + 1) * LIMB_BITS - limb.leading_zeros() as usize) } /// Comparison (unsigned) of two significands. diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 0361718eb7337..35ef6327de5fd 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -365,6 +365,9 @@ impl std::error::Error for EncoderError { } impl From for EncoderError { + /// Converts a [`fmt::Error`] into `EncoderError` + /// + /// This conversion does not allocate memory. fn from(err: fmt::Error) -> EncoderError { EncoderError::FmtError(err) } } @@ -1387,10 +1390,9 @@ impl Stack { // Used by Parser to test whether the top-most element is an index. fn last_is_index(&self) -> bool { - if let Some(InternalIndex(_)) = self.stack.last() { - true - } else { - false + match self.stack.last() { + Some(InternalIndex(_)) => true, + _ => false, } } diff --git a/src/libstd/build.rs b/src/libstd/build.rs index 26d93f97e69f3..016e7adb4c914 100644 --- a/src/libstd/build.rs +++ b/src/libstd/build.rs @@ -104,7 +104,8 @@ fn build_libbacktrace(target: &str) -> Result<(), ()> { } else { build.file("../libbacktrace/elf.c"); - if target.contains("64") { + let pointer_width = env::var("CARGO_CFG_TARGET_POINTER_WIDTH").unwrap(); + if pointer_width == "64" { build.define("BACKTRACE_ELF_SIZE", "64"); } else { build.define("BACKTRACE_ELF_SIZE", "32"); diff --git a/src/libstd/io/error.rs b/src/libstd/io/error.rs index 02a3ce8b9c4d4..3e50988a68ba2 100644 --- a/src/libstd/io/error.rs +++ b/src/libstd/io/error.rs @@ -97,6 +97,7 @@ struct Custom { #[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] #[stable(feature = "rust1", since = "1.0.0")] #[allow(deprecated)] +#[non_exhaustive] pub enum ErrorKind { /// An entity was not found, often a file. #[stable(feature = "rust1", since = "1.0.0")] @@ -180,15 +181,6 @@ pub enum ErrorKind { /// read. #[stable(feature = "read_exact", since = "1.6.0")] UnexpectedEof, - - /// A marker variant that tells the compiler that users of this enum cannot - /// match it exhaustively. - #[unstable(feature = "io_error_internals", - reason = "better expressed through extensible enums that this \ - enum cannot be exhaustively matched against", - issue = "0")] - #[doc(hidden)] - __Nonexhaustive, } impl ErrorKind { @@ -212,7 +204,6 @@ impl ErrorKind { ErrorKind::Interrupted => "operation interrupted", ErrorKind::Other => "other os error", ErrorKind::UnexpectedEof => "unexpected end of file", - ErrorKind::__Nonexhaustive => unreachable!() } } } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 5d463225ae93b..60ad330bb9b72 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -311,6 +311,7 @@ #![feature(doc_keyword)] #![feature(panic_info_message)] #![feature(panic_implementation)] +#![feature(non_exhaustive)] #![default_lib_allocator] diff --git a/src/libstd/sys/cloudabi/abi/cloudabi.rs b/src/libstd/sys/cloudabi/abi/cloudabi.rs index 2909db5098e58..cd9a5ad448f58 100644 --- a/src/libstd/sys/cloudabi/abi/cloudabi.rs +++ b/src/libstd/sys/cloudabi/abi/cloudabi.rs @@ -121,6 +121,7 @@ include!("bitflags.rs"); /// File or memory access pattern advisory information. #[repr(u8)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[non_exhaustive] pub enum advice { /// The application expects that it will not access the /// specified data in the near future. @@ -140,12 +141,12 @@ pub enum advice { /// The application expects to access the specified data /// in the near future. WILLNEED = 6, - #[doc(hidden)] _NonExhaustive = -1 as isize as u8, } /// Enumeration describing the kind of value stored in [`auxv`](struct.auxv.html). #[repr(u32)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[non_exhaustive] pub enum auxtype { /// Base address of the binary argument data provided to /// [`proc_exec()`](fn.proc_exec.html). @@ -210,12 +211,12 @@ pub enum auxtype { SYSINFO_EHDR = 262, /// Thread ID of the initial thread of the process. TID = 261, - #[doc(hidden)] _NonExhaustive = -1 as isize as u32, } /// Identifiers for clocks. #[repr(u32)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[non_exhaustive] pub enum clockid { /// The system-wide monotonic clock, which is defined as a /// clock measuring real time, whose value cannot be @@ -232,7 +233,6 @@ pub enum clockid { REALTIME = 3, /// The CPU-time clock associated with the current thread. THREAD_CPUTIME_ID = 4, - #[doc(hidden)] _NonExhaustive = -1 as isize as u32, } /// A userspace condition variable. @@ -267,6 +267,7 @@ pub const DIRCOOKIE_START: dircookie = dircookie(0); /// exclusively or merely provided for alignment with POSIX. #[repr(u16)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[non_exhaustive] pub enum errno { /// No error occurred. System call completed successfully. SUCCESS = 0, @@ -422,7 +423,6 @@ pub enum errno { XDEV = 75, /// Extension: Capabilities insufficient. NOTCAPABLE = 76, - #[doc(hidden)] _NonExhaustive = -1 as isize as u16, } bitflags! { @@ -438,6 +438,7 @@ bitflags! { /// Type of a subscription to an event or its occurrence. #[repr(u8)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[non_exhaustive] pub enum eventtype { /// The time value of clock [`subscription.union.clock.clock_id`](struct.subscription_clock.html#structfield.clock_id) /// has reached timestamp [`subscription.union.clock.timeout`](struct.subscription_clock.html#structfield.timeout). @@ -463,7 +464,6 @@ pub enum eventtype { /// The process associated with process descriptor /// [`subscription.union.proc_terminate.fd`](struct.subscription_proc_terminate.html#structfield.fd) has terminated. PROC_TERMINATE = 7, - #[doc(hidden)] _NonExhaustive = -1 as isize as u8, } /// Exit code generated by a process when exiting. @@ -530,6 +530,7 @@ pub type filesize = u64; /// The type of a file descriptor or file. #[repr(u8)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[non_exhaustive] pub enum filetype { /// The type of the file descriptor or file is unknown or /// is different from any of the other types specified. @@ -558,7 +559,6 @@ pub enum filetype { SOCKET_STREAM = 130, /// The file refers to a symbolic link inode. SYMBOLIC_LINK = 144, - #[doc(hidden)] _NonExhaustive = -1 as isize as u8, } bitflags! { @@ -847,12 +847,12 @@ bitflags! { /// memory. #[repr(u8)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[non_exhaustive] pub enum scope { /// The object is stored in private memory. PRIVATE = 4, /// The object is stored in shared memory. SHARED = 8, - #[doc(hidden)] _NonExhaustive = -1 as isize as u8, } bitflags! { @@ -878,6 +878,7 @@ bitflags! { /// Signal condition. #[repr(u8)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[non_exhaustive] pub enum signal { /// Process abort signal. /// @@ -983,7 +984,6 @@ pub enum signal { /// /// Action: Terminates the process. XFSZ = 26, - #[doc(hidden)] _NonExhaustive = -1 as isize as u8, } bitflags! { @@ -1049,6 +1049,7 @@ pub type userdata = u64; /// should be set. #[repr(u8)] #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[non_exhaustive] pub enum whence { /// Seek relative to current position. CUR = 1, @@ -1056,7 +1057,6 @@ pub enum whence { END = 2, /// Seek relative to start-of-file. SET = 3, - #[doc(hidden)] _NonExhaustive = -1 as isize as u8, } /// Auxiliary vector entry. diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index f837bead6a085..395e5c9865232 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -1922,6 +1922,11 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute], err.emit(); } + // Some features are known to be incomplete and using them is likely to have + // unanticipated results, such as compiler crashes. We warn the user about these + // to alert them. + let incomplete_features = ["generic_associated_types"]; + let mut features = Features::new(); let mut edition_enabled_features = FxHashMap(); @@ -1957,6 +1962,16 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute], continue }; + if incomplete_features.iter().any(|f| *f == name.as_str()) { + span_handler.struct_span_warn( + mi.span, + &format!( + "the feature `{}` is incomplete and may cause the compiler to crash", + name + ) + ).emit(); + } + if let Some(edition) = ALL_EDITIONS.iter().find(|e| name == e.feature_name()) { if *edition <= crate_edition { continue diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 5913c63bfaa5f..bdf25618f474e 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -67,6 +67,7 @@ pub struct StringReader<'a> { span_src_raw: Span, open_braces: Vec<(token::DelimToken, Span)>, crate override_span: Option, + last_unclosed_found_span: Option, } impl<'a> StringReader<'a> { @@ -216,6 +217,7 @@ impl<'a> StringReader<'a> { span_src_raw: syntax_pos::DUMMY_SP, open_braces: Vec::new(), override_span, + last_unclosed_found_span: None, } } diff --git a/src/libsyntax/parse/lexer/tokentrees.rs b/src/libsyntax/parse/lexer/tokentrees.rs index 1e7855e68ddc6..e2fd7faf90387 100644 --- a/src/libsyntax/parse/lexer/tokentrees.rs +++ b/src/libsyntax/parse/lexer/tokentrees.rs @@ -81,16 +81,23 @@ impl<'a> StringReader<'a> { // Incorrect delimiter. token::CloseDelim(other) => { let token_str = token_to_string(&self.token); - let msg = format!("incorrect close delimiter: `{}`", token_str); - let mut err = self.sess.span_diagnostic.struct_span_err(self.span, &msg); - // This is a conservative error: only report the last unclosed delimiter. - // The previous unclosed delimiters could actually be closed! The parser - // just hasn't gotten to them yet. - if let Some(&(_, sp)) = self.open_braces.last() { - err.span_note(sp, "unclosed delimiter"); - }; - err.emit(); - + if self.last_unclosed_found_span != Some(self.span) { + // do not complain about the same unclosed delimiter multiple times + self.last_unclosed_found_span = Some(self.span); + let msg = format!("incorrect close delimiter: `{}`", token_str); + let mut err = self.sess.span_diagnostic.struct_span_err( + self.span, + &msg, + ); + err.span_label(self.span, "incorrect close delimiter"); + // This is a conservative error: only report the last unclosed + // delimiter. The previous unclosed delimiters could actually be + // closed! The parser just hasn't gotten to them yet. + if let Some(&(_, sp)) = self.open_braces.last() { + err.span_label(sp, "unclosed delimiter"); + }; + err.emit(); + } self.open_braces.pop().unwrap(); // If the incorrect delimiter matches an earlier opening @@ -122,7 +129,8 @@ impl<'a> StringReader<'a> { // matching opening delimiter). let token_str = token_to_string(&self.token); let msg = format!("unexpected close delimiter: `{}`", token_str); - let err = self.sess.span_diagnostic.struct_span_err(self.span, &msg); + let mut err = self.sess.span_diagnostic.struct_span_err(self.span, &msg); + err.span_label(self.span, "unexpected close delimiter"); Err(err) }, _ => { diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b1e1cdee2ee8e..345464c666425 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4719,7 +4719,12 @@ impl<'a> Parser<'a> { if !self.eat(&token::OpenDelim(token::Brace)) { let sp = self.span; let tok = self.this_token_to_string(); + let mut do_not_suggest_help = false; let mut e = self.span_fatal(sp, &format!("expected `{{`, found `{}`", tok)); + if self.token.is_keyword(keywords::In) || self.token == token::Colon { + do_not_suggest_help = true; + e.span_label(sp, "expected `{`"); + } // Check to see if the user has written something like // @@ -4729,7 +4734,8 @@ impl<'a> Parser<'a> { // Which is valid in other languages, but not Rust. match self.parse_stmt_without_recovery(false) { Ok(Some(stmt)) => { - if self.look_ahead(1, |t| t == &token::OpenDelim(token::Brace)) { + if self.look_ahead(1, |t| t == &token::OpenDelim(token::Brace)) + || do_not_suggest_help { // if the next token is an open brace (e.g., `if a b {`), the place- // inside-a-block suggestion would be more likely wrong than right return Err(e); diff --git a/src/libsyntax_ext/deriving/default.rs b/src/libsyntax_ext/deriving/default.rs index 958116f7809bb..adbc5828b8fb8 100644 --- a/src/libsyntax_ext/deriving/default.rs +++ b/src/libsyntax_ext/deriving/default.rs @@ -76,8 +76,8 @@ fn default_substructure(cx: &mut ExtCtxt, trait_span: Span, substr: &Substructur } } StaticEnum(..) => { - span_err_if_not_stage0!(cx, trait_span, E0665, - "`Default` cannot be derived for enums, only structs"); + span_err!(cx, trait_span, E0665, + "`Default` cannot be derived for enums, only structs"); // let compilation continue cx.expr_usize(trait_span, 0) } diff --git a/src/libsyntax_ext/deriving/mod.rs b/src/libsyntax_ext/deriving/mod.rs index 2f5e42d2f7b17..ae47a028bc386 100644 --- a/src/libsyntax_ext/deriving/mod.rs +++ b/src/libsyntax_ext/deriving/mod.rs @@ -19,17 +19,6 @@ use syntax::ptr::P; use syntax::symbol::Symbol; use syntax_pos::Span; -macro_rules! span_err_if_not_stage0 { - ($cx:expr, $sp:expr, $code:ident, $text:tt) => { - #[cfg(not(stage0))] { - span_err!($cx, $sp, $code, $text) - } - #[cfg(stage0)] { - $cx.span_err($sp, $text) - } - } -} - macro path_local($x:ident) { generic::ty::Path::new_local(stringify!($x)) } diff --git a/src/test/ui-fulldeps/invalid-punct-ident-4.stderr b/src/test/ui-fulldeps/invalid-punct-ident-4.stderr index 4493e37eeb273..669a1eb583921 100644 --- a/src/test/ui-fulldeps/invalid-punct-ident-4.stderr +++ b/src/test/ui-fulldeps/invalid-punct-ident-4.stderr @@ -2,7 +2,7 @@ error: unexpected close delimiter: `)` --> $DIR/invalid-punct-ident-4.rs:16:1 | LL | lexer_failure!(); //~ ERROR proc macro panicked - | ^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^ unexpected close delimiter error: proc macro panicked --> $DIR/invalid-punct-ident-4.rs:16:1 diff --git a/src/test/ui/E0660.rs b/src/test/ui/E0660.rs index 82ef38e96cded..2981e4ea8b3a3 100644 --- a/src/test/ui/E0660.rs +++ b/src/test/ui/E0660.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0660.stderr b/src/test/ui/E0660.stderr index fcf3e9a255273..e8acb282be94d 100644 --- a/src/test/ui/E0660.stderr +++ b/src/test/ui/E0660.stderr @@ -1,11 +1,11 @@ error[E0660]: malformed inline assembly - --> $DIR/E0660.rs:17:5 + --> $DIR/E0660.rs:15:5 | LL | asm!("nop" "nop"); | ^^^^^^^^^^^^^^^^^^ error[E0660]: malformed inline assembly - --> $DIR/E0660.rs:19:5 + --> $DIR/E0660.rs:17:5 | LL | asm!("nop" "nop" : "=r"(a)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/E0661.rs b/src/test/ui/E0661.rs index 7f8a0d8b57420..2410eba02451f 100644 --- a/src/test/ui/E0661.rs +++ b/src/test/ui/E0661.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0661.stderr b/src/test/ui/E0661.stderr index d8b974d424074..90aeca5612ae4 100644 --- a/src/test/ui/E0661.stderr +++ b/src/test/ui/E0661.stderr @@ -1,5 +1,5 @@ error[E0661]: output operand constraint lacks '=' or '+' - --> $DIR/E0661.rs:17:18 + --> $DIR/E0661.rs:15:18 | LL | asm!("nop" : "r"(a)); | ^^^ diff --git a/src/test/ui/E0662.rs b/src/test/ui/E0662.rs index 6adb11c56169c..700540fd1e0c0 100644 --- a/src/test/ui/E0662.rs +++ b/src/test/ui/E0662.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0662.stderr b/src/test/ui/E0662.stderr index 215e3a6d2f023..31655ca198794 100644 --- a/src/test/ui/E0662.stderr +++ b/src/test/ui/E0662.stderr @@ -1,5 +1,5 @@ error[E0662]: input operand constraint contains '=' - --> $DIR/E0662.rs:18:12 + --> $DIR/E0662.rs:16:12 | LL | : "=test"("a") //~ ERROR E0662 | ^^^^^^^ diff --git a/src/test/ui/E0663.rs b/src/test/ui/E0663.rs index 9eb05ada4a82a..dea2b9156b7e9 100644 --- a/src/test/ui/E0663.rs +++ b/src/test/ui/E0663.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0663.stderr b/src/test/ui/E0663.stderr index 123aa73eccc5e..0a287620f20e1 100644 --- a/src/test/ui/E0663.stderr +++ b/src/test/ui/E0663.stderr @@ -1,5 +1,5 @@ error[E0663]: input operand constraint contains '+' - --> $DIR/E0663.rs:18:12 + --> $DIR/E0663.rs:16:12 | LL | : "+test"("a") //~ ERROR E0663 | ^^^^^^^ diff --git a/src/test/ui/E0664.rs b/src/test/ui/E0664.rs index 738ffc18e3827..9773f604c468b 100644 --- a/src/test/ui/E0664.rs +++ b/src/test/ui/E0664.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #![feature(asm)] fn main() { diff --git a/src/test/ui/E0664.stderr b/src/test/ui/E0664.stderr index 570811729be85..1e79c84cbc8c4 100644 --- a/src/test/ui/E0664.stderr +++ b/src/test/ui/E0664.stderr @@ -1,5 +1,5 @@ error[E0664]: clobber should not be surrounded by braces - --> $DIR/E0664.rs:19:12 + --> $DIR/E0664.rs:17:12 | LL | : "{eax}" //~ ERROR E0664 | ^^^^^^^ diff --git a/src/test/ui/E0665.rs b/src/test/ui/E0665.rs index 8888bedf01687..0a0bd3f59052c 100644 --- a/src/test/ui/E0665.rs +++ b/src/test/ui/E0665.rs @@ -8,8 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// ignore-stage1 - #[derive(Default)] //~ ERROR E0665 enum Food { Sweet, diff --git a/src/test/ui/E0665.stderr b/src/test/ui/E0665.stderr index c97e9e5ea89d0..268224cac3826 100644 --- a/src/test/ui/E0665.stderr +++ b/src/test/ui/E0665.stderr @@ -1,5 +1,5 @@ error[E0665]: `Default` cannot be derived for enums, only structs - --> $DIR/E0665.rs:13:10 + --> $DIR/E0665.rs:11:10 | LL | #[derive(Default)] //~ ERROR E0665 | ^^^^^^^ diff --git a/src/test/parse-fail/issue-10636-1.rs b/src/test/ui/issue-10636-1.rs similarity index 86% rename from src/test/parse-fail/issue-10636-1.rs rename to src/test/ui/issue-10636-1.rs index 398fe8c5b8cf3..fdd50773593a8 100644 --- a/src/test/parse-fail/issue-10636-1.rs +++ b/src/test/ui/issue-10636-1.rs @@ -12,4 +12,8 @@ struct Obj { //~ NOTE: unclosed delimiter member: usize -) //~ ERROR: incorrect close delimiter +) +//~^ ERROR incorrect close delimiter +//~| NOTE incorrect close delimiter + +fn main() {} diff --git a/src/test/ui/issue-10636-1.stderr b/src/test/ui/issue-10636-1.stderr new file mode 100644 index 0000000000000..af80e259fbd25 --- /dev/null +++ b/src/test/ui/issue-10636-1.stderr @@ -0,0 +1,11 @@ +error: incorrect close delimiter: `)` + --> $DIR/issue-10636-1.rs:15:1 + | +LL | struct Obj { //~ NOTE: unclosed delimiter + | - unclosed delimiter +LL | member: usize +LL | ) + | ^ incorrect close delimiter + +error: aborting due to previous error + diff --git a/src/test/ui/issue-51602.rs b/src/test/ui/issue-51602.rs new file mode 100644 index 0000000000000..a3edecb94f7c5 --- /dev/null +++ b/src/test/ui/issue-51602.rs @@ -0,0 +1,15 @@ +// Copyright 2018 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main(){ + if i in 1..10 { + break; + } +} diff --git a/src/test/ui/issue-51602.stderr b/src/test/ui/issue-51602.stderr new file mode 100644 index 0000000000000..ac079b452c5eb --- /dev/null +++ b/src/test/ui/issue-51602.stderr @@ -0,0 +1,10 @@ +error: expected `{`, found `in` + --> $DIR/issue-51602.rs:12:10 + | +LL | if i in 1..10 { + | -- ^^ expected `{` + | | + | this `if` statement has a condition, but no block + +error: aborting due to previous error + diff --git a/src/test/ui/macros/macros-nonfatal-errors.rs b/src/test/ui/macros/macros-nonfatal-errors.rs index 7290d18beb74e..2815e1be70983 100644 --- a/src/test/ui/macros/macros-nonfatal-errors.rs +++ b/src/test/ui/macros/macros-nonfatal-errors.rs @@ -10,7 +10,6 @@ // normalize-stderr-test: "The system cannot find the file specified\." -> "No such file or directory" // ignore-tidy-linelength -// ignore-stage1 // test that errors in a (selection) of macros don't kill compilation // immediately, so that we get more errors listed at a time. diff --git a/src/test/ui/macros/macros-nonfatal-errors.stderr b/src/test/ui/macros/macros-nonfatal-errors.stderr index efb2c248813d7..084042acc974d 100644 --- a/src/test/ui/macros/macros-nonfatal-errors.stderr +++ b/src/test/ui/macros/macros-nonfatal-errors.stderr @@ -1,47 +1,47 @@ error[E0665]: `Default` cannot be derived for enums, only structs - --> $DIR/macros-nonfatal-errors.rs:21:10 + --> $DIR/macros-nonfatal-errors.rs:20:10 | LL | #[derive(Default)] //~ ERROR | ^^^^^^^ error: inline assembly must be a string literal - --> $DIR/macros-nonfatal-errors.rs:25:10 + --> $DIR/macros-nonfatal-errors.rs:24:10 | LL | asm!(invalid); //~ ERROR | ^^^^^^^ error: concat_idents! requires ident args. - --> $DIR/macros-nonfatal-errors.rs:27:5 + --> $DIR/macros-nonfatal-errors.rs:26:5 | LL | concat_idents!("not", "idents"); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:29:17 + --> $DIR/macros-nonfatal-errors.rs:28:17 | LL | option_env!(invalid); //~ ERROR | ^^^^^^^ error: expected string literal - --> $DIR/macros-nonfatal-errors.rs:30:10 + --> $DIR/macros-nonfatal-errors.rs:29:10 | LL | env!(invalid); //~ ERROR | ^^^^^^^ error: expected string literal - --> $DIR/macros-nonfatal-errors.rs:31:10 + --> $DIR/macros-nonfatal-errors.rs:30:10 | LL | env!(foo, abr, baz); //~ ERROR | ^^^ error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined - --> $DIR/macros-nonfatal-errors.rs:32:5 + --> $DIR/macros-nonfatal-errors.rs:31:5 | LL | env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST"); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0658]: non-ident macro paths are experimental (see issue #35896) - --> $DIR/macros-nonfatal-errors.rs:34:5 + --> $DIR/macros-nonfatal-errors.rs:33:5 | LL | foo::blah!(); //~ ERROR | ^^^^^^^^^ @@ -49,7 +49,7 @@ LL | foo::blah!(); //~ ERROR = help: add #![feature(use_extern_macros)] to the crate attributes to enable error: format argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:36:13 + --> $DIR/macros-nonfatal-errors.rs:35:13 | LL | format!(invalid); //~ ERROR | ^^^^^^^ @@ -59,37 +59,37 @@ LL | format!("{}", invalid); //~ ERROR | ^^^^^ error: argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:38:14 + --> $DIR/macros-nonfatal-errors.rs:37:14 | LL | include!(invalid); //~ ERROR | ^^^^^^^ error: argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:40:18 + --> $DIR/macros-nonfatal-errors.rs:39:18 | LL | include_str!(invalid); //~ ERROR | ^^^^^^^ error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2) - --> $DIR/macros-nonfatal-errors.rs:41:5 + --> $DIR/macros-nonfatal-errors.rs:40:5 | LL | include_str!("i'd be quite surprised if a file with this name existed"); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: argument must be a string literal - --> $DIR/macros-nonfatal-errors.rs:42:20 + --> $DIR/macros-nonfatal-errors.rs:41:20 | LL | include_bytes!(invalid); //~ ERROR | ^^^^^^^ error: couldn't read $DIR/i'd be quite surprised if a file with this name existed: No such file or directory (os error 2) - --> $DIR/macros-nonfatal-errors.rs:43:5 + --> $DIR/macros-nonfatal-errors.rs:42:5 | LL | include_bytes!("i'd be quite surprised if a file with this name existed"); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: trace_macros! accepts only `true` or `false` - --> $DIR/macros-nonfatal-errors.rs:45:5 + --> $DIR/macros-nonfatal-errors.rs:44:5 | LL | trace_macros!(invalid); //~ ERROR | ^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/parser-recovery-2.stderr b/src/test/ui/parser-recovery-2.stderr index 7b5206073522f..1025dad3af773 100644 --- a/src/test/ui/parser-recovery-2.stderr +++ b/src/test/ui/parser-recovery-2.stderr @@ -1,14 +1,11 @@ error: incorrect close delimiter: `)` --> $DIR/parser-recovery-2.rs:18:5 | -LL | ) //~ ERROR incorrect close delimiter: `)` - | ^ - | -note: unclosed delimiter - --> $DIR/parser-recovery-2.rs:16:14 - | LL | fn bar() { - | ^ + | - unclosed delimiter +LL | let x = foo(); //~ ERROR cannot find function `foo` in this scope +LL | ) //~ ERROR incorrect close delimiter: `)` + | ^ incorrect close delimiter error: unexpected token: `;` --> $DIR/parser-recovery-2.rs:22:15 diff --git a/src/test/ui/resolve/token-error-correct-2.stderr b/src/test/ui/resolve/token-error-correct-2.stderr index 7abc1ba47810b..fcd4b4888b0ad 100644 --- a/src/test/ui/resolve/token-error-correct-2.stderr +++ b/src/test/ui/resolve/token-error-correct-2.stderr @@ -1,14 +1,11 @@ error: incorrect close delimiter: `)` --> $DIR/token-error-correct-2.rs:16:5 | -LL | ) //~ ERROR: incorrect close delimiter: `)` - | ^ - | -note: unclosed delimiter - --> $DIR/token-error-correct-2.rs:14:12 - | LL | if foo { - | ^ + | - unclosed delimiter +LL | //~^ ERROR: cannot find value `foo` +LL | ) //~ ERROR: incorrect close delimiter: `)` + | ^ incorrect close delimiter error[E0425]: cannot find value `foo` in this scope --> $DIR/token-error-correct-2.rs:14:8 diff --git a/src/test/ui/resolve/token-error-correct-3.stderr b/src/test/ui/resolve/token-error-correct-3.stderr index 24186d94acce9..a546c2704d915 100644 --- a/src/test/ui/resolve/token-error-correct-3.stderr +++ b/src/test/ui/resolve/token-error-correct-3.stderr @@ -1,14 +1,11 @@ error: incorrect close delimiter: `}` --> $DIR/token-error-correct-3.rs:30:9 | -LL | } else { //~ ERROR: incorrect close delimiter: `}` - | ^ - | -note: unclosed delimiter - --> $DIR/token-error-correct-3.rs:24:21 - | LL | callback(path.as_ref(); //~ ERROR expected one of - | ^ + | - unclosed delimiter +... +LL | } else { //~ ERROR: incorrect close delimiter: `}` + | ^ incorrect close delimiter error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` --> $DIR/token-error-correct-3.rs:24:35 diff --git a/src/test/ui/resolve/token-error-correct.rs b/src/test/ui/resolve/token-error-correct.rs index c88f823839dad..39c664e270c45 100644 --- a/src/test/ui/resolve/token-error-correct.rs +++ b/src/test/ui/resolve/token-error-correct.rs @@ -15,4 +15,3 @@ fn main() { //~^ ERROR: expected expression, found `;` } //~^ ERROR: incorrect close delimiter: `}` -//~| ERROR: incorrect close delimiter: `}` diff --git a/src/test/ui/resolve/token-error-correct.stderr b/src/test/ui/resolve/token-error-correct.stderr index c6d32c6726ea5..1e246b6f085bd 100644 --- a/src/test/ui/resolve/token-error-correct.stderr +++ b/src/test/ui/resolve/token-error-correct.stderr @@ -1,26 +1,11 @@ error: incorrect close delimiter: `}` --> $DIR/token-error-correct.rs:16:1 | -LL | } - | ^ - | -note: unclosed delimiter - --> $DIR/token-error-correct.rs:14:12 - | LL | foo(bar(; - | ^ - -error: incorrect close delimiter: `}` - --> $DIR/token-error-correct.rs:16:1 - | + | - unclosed delimiter +LL | //~^ ERROR: expected expression, found `;` LL | } - | ^ - | -note: unclosed delimiter - --> $DIR/token-error-correct.rs:14:8 - | -LL | foo(bar(; - | ^ + | ^ incorrect close delimiter error: expected expression, found `;` --> $DIR/token-error-correct.rs:14:13 @@ -28,5 +13,5 @@ error: expected expression, found `;` LL | foo(bar(; | ^ expected expression -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors diff --git a/src/test/ui/rfc1598-generic-associated-types/collections.rs b/src/test/ui/rfc1598-generic-associated-types/collections.rs index e71166ed65bba..a6dbb03d379db 100644 --- a/src/test/ui/rfc1598-generic-associated-types/collections.rs +++ b/src/test/ui/rfc1598-generic-associated-types/collections.rs @@ -9,10 +9,11 @@ // except according to those terms. #![feature(generic_associated_types)] +//~^ WARNING the feature `generic_associated_types` is incomplete #![feature(associated_type_defaults)] -//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a -//follow-up PR +// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a +// follow-up PR. // A Collection trait and collection families. Based on // http://smallcultfollowing.com/babysteps/blog/2016/11/03/ diff --git a/src/test/ui/rfc1598-generic-associated-types/collections.stderr b/src/test/ui/rfc1598-generic-associated-types/collections.stderr index 8c31ab2ca88e4..0e7d6ace1bb1d 100644 --- a/src/test/ui/rfc1598-generic-associated-types/collections.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/collections.stderr @@ -1,29 +1,35 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/collections.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0109]: type parameters are not allowed on this type - --> $DIR/collections.rs:65:90 + --> $DIR/collections.rs:66:90 | LL | fn floatify(ints: &C) -> <>::Family as CollectionFamily>::Member | ^^^ type parameter not allowed error[E0109]: type parameters are not allowed on this type - --> $DIR/collections.rs:77:69 + --> $DIR/collections.rs:78:69 | LL | fn floatify_sibling(ints: &C) -> >::Sibling | ^^^ type parameter not allowed error[E0109]: type parameters are not allowed on this type - --> $DIR/collections.rs:26:71 + --> $DIR/collections.rs:27:71 | LL | <>::Family as CollectionFamily>::Member; | ^ type parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/collections.rs:33:50 + --> $DIR/collections.rs:34:50 | LL | fn iterate<'iter>(&'iter self) -> Self::Iter<'iter>; | ^^^^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/collections.rs:59:50 + --> $DIR/collections.rs:60:50 | LL | fn iterate<'iter>(&'iter self) -> Self::Iter<'iter> { | ^^^^^ lifetime parameter not allowed diff --git a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs index 0429410031526..88a660b3a5afe 100644 --- a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs +++ b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.rs @@ -9,11 +9,12 @@ // except according to those terms. #![feature(generic_associated_types)] +//~^ WARNING the feature `generic_associated_types` is incomplete use std::ops::Deref; -//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a -//follow-up PR +// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a +// follow-up PR. trait Foo { type Bar<'a, 'b>; diff --git a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr index 1746122eb49f4..5c85698fa55c7 100644 --- a/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/construct_with_other_type.stderr @@ -1,17 +1,23 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/construct_with_other_type.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/construct_with_other_type.rs:26:46 + --> $DIR/construct_with_other_type.rs:27:46 | LL | type Baa<'a>: Deref as Foo>::Bar<'a, 'static>>; | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/construct_with_other_type.rs:26:63 + --> $DIR/construct_with_other_type.rs:27:63 | LL | type Baa<'a>: Deref as Foo>::Bar<'a, 'static>>; | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/construct_with_other_type.rs:34:40 + --> $DIR/construct_with_other_type.rs:35:40 | LL | type Baa<'a> = &'a ::Bar<'a, 'static>; | ^^ lifetime parameter not allowed diff --git a/src/test/ui/rfc1598-generic-associated-types/empty_generics.rs b/src/test/ui/rfc1598-generic-associated-types/empty_generics.rs index b12c075d13291..d8a2a1b73f7ef 100644 --- a/src/test/ui/rfc1598-generic-associated-types/empty_generics.rs +++ b/src/test/ui/rfc1598-generic-associated-types/empty_generics.rs @@ -9,6 +9,7 @@ // except according to those terms. #![feature(generic_associated_types)] +//~^ WARNING the feature `generic_associated_types` is incomplete trait Foo { type Bar<,>; diff --git a/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr b/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr index aff3044e9a14d..2670c3aa142b2 100644 --- a/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/empty_generics.stderr @@ -1,8 +1,14 @@ error: expected one of `>`, identifier, or lifetime, found `,` - --> $DIR/empty_generics.rs:14:14 + --> $DIR/empty_generics.rs:15:14 | LL | type Bar<,>; | ^ expected one of `>`, identifier, or lifetime here +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/empty_generics.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + error: aborting due to previous error diff --git a/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.rs b/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.rs new file mode 100644 index 0000000000000..7f48408b369fd --- /dev/null +++ b/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.rs @@ -0,0 +1,16 @@ +// Copyright 2018 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// run-pass + +#![feature(generic_associated_types)] +//~^ WARNING the feature `generic_associated_types` is incomplete + +fn main() {} diff --git a/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr b/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr new file mode 100644 index 0000000000000..67682dcb8fb1b --- /dev/null +++ b/src/test/ui/rfc1598-generic-associated-types/gat-incomplete-warning.stderr @@ -0,0 +1,6 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/gat-incomplete-warning.rs:13:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr b/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr new file mode 100644 index 0000000000000..97d5482735f86 --- /dev/null +++ b/src/test/ui/rfc1598-generic-associated-types/generic-associated-types-where.stderr @@ -0,0 +1,6 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/generic-associated-types-where.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs index 263b3cb42eb4f..267272ded8c06 100644 --- a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs +++ b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.rs @@ -9,11 +9,12 @@ // except according to those terms. #![feature(generic_associated_types)] +//~^ WARNING the feature `generic_associated_types` is incomplete use std::ops::Deref; -//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a -//follow-up PR +// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a +// follow-up PR. trait Iterable { type Item<'a>; diff --git a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr index d48c21477b310..79b29902ccdf0 100644 --- a/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/generic_associated_type_undeclared_lifetimes.stderr @@ -1,29 +1,35 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/generic_associated_type_undeclared_lifetimes.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0261]: use of undeclared lifetime name `'b` - --> $DIR/generic_associated_type_undeclared_lifetimes.rs:22:37 + --> $DIR/generic_associated_type_undeclared_lifetimes.rs:23:37 | LL | + Deref>; | ^^ undeclared lifetime error[E0261]: use of undeclared lifetime name `'undeclared` - --> $DIR/generic_associated_type_undeclared_lifetimes.rs:26:41 + --> $DIR/generic_associated_type_undeclared_lifetimes.rs:27:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'undeclared>; | ^^^^^^^^^^^ undeclared lifetime error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/generic_associated_type_undeclared_lifetimes.rs:20:47 + --> $DIR/generic_associated_type_undeclared_lifetimes.rs:21:47 | LL | type Iter<'a>: Iterator> | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/generic_associated_type_undeclared_lifetimes.rs:22:37 + --> $DIR/generic_associated_type_undeclared_lifetimes.rs:23:37 | LL | + Deref>; | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/generic_associated_type_undeclared_lifetimes.rs:26:41 + --> $DIR/generic_associated_type_undeclared_lifetimes.rs:27:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'undeclared>; | ^^^^^^^^^^^ lifetime parameter not allowed diff --git a/src/test/ui/rfc1598-generic-associated-types/iterable.rs b/src/test/ui/rfc1598-generic-associated-types/iterable.rs index 38967dbbe4530..b52b6e024219a 100644 --- a/src/test/ui/rfc1598-generic-associated-types/iterable.rs +++ b/src/test/ui/rfc1598-generic-associated-types/iterable.rs @@ -9,11 +9,12 @@ // except according to those terms. #![feature(generic_associated_types)] +//~^ WARNING the feature `generic_associated_types` is incomplete use std::ops::Deref; -//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a -//follow-up PR +// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a +// follow-up PR. trait Iterable { type Item<'a>; diff --git a/src/test/ui/rfc1598-generic-associated-types/iterable.stderr b/src/test/ui/rfc1598-generic-associated-types/iterable.stderr index 737a29ec2c8be..de3563c14eb7c 100644 --- a/src/test/ui/rfc1598-generic-associated-types/iterable.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/iterable.stderr @@ -1,35 +1,41 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/iterable.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/iterable.rs:20:47 + --> $DIR/iterable.rs:21:47 | LL | type Iter<'a>: Iterator>; | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/iterable.rs:49:53 + --> $DIR/iterable.rs:50:53 | LL | fn make_iter<'a, I: Iterable>(it: &'a I) -> I::Iter<'a> { | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/iterable.rs:54:60 + --> $DIR/iterable.rs:55:60 | LL | fn get_first<'a, I: Iterable>(it: &'a I) -> Option> { | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/iterable.rs:23:41 + --> $DIR/iterable.rs:24:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'a>; | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/iterable.rs:32:41 + --> $DIR/iterable.rs:33:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'a> { | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/iterable.rs:43:41 + --> $DIR/iterable.rs:44:41 | LL | fn iter<'a>(&'a self) -> Self::Iter<'a> { | ^^ lifetime parameter not allowed diff --git a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs index 51527d4117c2c..82e82e6dbccaf 100644 --- a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs +++ b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.rs @@ -9,12 +9,13 @@ // except according to those terms. #![feature(generic_associated_types)] +//~^ WARNING the feature `generic_associated_types` is incomplete #![feature(associated_type_defaults)] -//FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a -//follow-up PR +// FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a +// follow-up PR. -//FIXME(#44265): Update expected errors once E110 is resolved, now does not get past `trait Foo` +// FIXME(#44265): Update expected errors once E110 is resolved, now does not get past `trait Foo`. trait Foo { type A<'a>; diff --git a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr index c8d37a51fa96b..e47daf2ae1bba 100644 --- a/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/parameter_number_and_kind.stderr @@ -1,29 +1,35 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/parameter_number_and_kind.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/parameter_number_and_kind.rs:26:27 + --> $DIR/parameter_number_and_kind.rs:27:27 | LL | type FOk = Self::E<'static, T>; | ^^^^^^^ lifetime parameter not allowed error[E0109]: type parameters are not allowed on this type - --> $DIR/parameter_number_and_kind.rs:26:36 + --> $DIR/parameter_number_and_kind.rs:27:36 | LL | type FOk = Self::E<'static, T>; | ^ type parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/parameter_number_and_kind.rs:29:26 + --> $DIR/parameter_number_and_kind.rs:30:26 | LL | type FErr1 = Self::E<'static, 'static>; // Error | ^^^^^^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/parameter_number_and_kind.rs:31:29 + --> $DIR/parameter_number_and_kind.rs:32:29 | LL | type FErr2 = Self::E<'static, T, u32>; // Error | ^^^^^^^ lifetime parameter not allowed error[E0109]: type parameters are not allowed on this type - --> $DIR/parameter_number_and_kind.rs:31:38 + --> $DIR/parameter_number_and_kind.rs:32:38 | LL | type FErr2 = Self::E<'static, T, u32>; // Error | ^ type parameter not allowed diff --git a/src/test/ui/rfc1598-generic-associated-types/pointer_family.rs b/src/test/ui/rfc1598-generic-associated-types/pointer_family.rs index cbeeb1d6ca7b2..0300ad06194e7 100644 --- a/src/test/ui/rfc1598-generic-associated-types/pointer_family.rs +++ b/src/test/ui/rfc1598-generic-associated-types/pointer_family.rs @@ -9,8 +9,9 @@ // except according to those terms. #![feature(generic_associated_types)] +//~^ WARNING the feature `generic_associated_types` is incomplete -//FIXME(#44265): "type parameter not allowed" errors will be addressed in a follow-up PR +// FIXME(#44265): "type parameter not allowed" errors will be addressed in a follow-up PR. use std::rc::Rc; use std::sync::Arc; diff --git a/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr b/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr index 3e772eee4f492..3be0481dc67e8 100644 --- a/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/pointer_family.stderr @@ -1,23 +1,29 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/pointer_family.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0109]: type parameters are not allowed on this type - --> $DIR/pointer_family.rs:46:21 + --> $DIR/pointer_family.rs:47:21 | LL | bar: P::Pointer, | ^^^^^^ type parameter not allowed error[E0109]: type parameters are not allowed on this type - --> $DIR/pointer_family.rs:21:42 + --> $DIR/pointer_family.rs:22:42 | LL | fn new(value: T) -> Self::Pointer; | ^ type parameter not allowed error[E0109]: type parameters are not allowed on this type - --> $DIR/pointer_family.rs:29:42 + --> $DIR/pointer_family.rs:30:42 | LL | fn new(value: T) -> Self::Pointer { | ^ type parameter not allowed error[E0109]: type parameters are not allowed on this type - --> $DIR/pointer_family.rs:39:42 + --> $DIR/pointer_family.rs:40:42 | LL | fn new(value: T) -> Self::Pointer { | ^ type parameter not allowed diff --git a/src/test/ui/rfc1598-generic-associated-types/shadowing.stderr b/src/test/ui/rfc1598-generic-associated-types/shadowing.stderr new file mode 100644 index 0000000000000..f2d626f921c89 --- /dev/null +++ b/src/test/ui/rfc1598-generic-associated-types/shadowing.stderr @@ -0,0 +1,6 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/shadowing.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + diff --git a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs index 522ddb5dc135e..aa90886fdfd65 100644 --- a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs +++ b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.rs @@ -9,8 +9,9 @@ // except according to those terms. #![feature(generic_associated_types)] +//~^ WARNING the feature `generic_associated_types` is incomplete -//FIXME(#44265): "lifetime parameter not allowed on this type" errors will be addressed in a +// FIXME(#44265): "lifetime parameter not allowed on this type" errors will be addressed in a // follow-up PR use std::fmt::Display; diff --git a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr index 12e206cbd476a..4aca8d476877b 100644 --- a/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr +++ b/src/test/ui/rfc1598-generic-associated-types/streaming_iterator.stderr @@ -1,29 +1,35 @@ +warning: the feature `generic_associated_types` is incomplete and may cause the compiler to crash + --> $DIR/streaming_iterator.rs:11:12 + | +LL | #![feature(generic_associated_types)] + | ^^^^^^^^^^^^^^^^^^^^^^^^ + error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/streaming_iterator.rs:27:41 + --> $DIR/streaming_iterator.rs:28:41 | LL | bar: ::Item<'static>, | ^^^^^^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/streaming_iterator.rs:35:64 + --> $DIR/streaming_iterator.rs:36:64 | LL | fn foo(iter: T) where T: StreamingIterator, for<'a> T::Item<'a>: Display { /* ... */ } | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/streaming_iterator.rs:21:48 + --> $DIR/streaming_iterator.rs:22:48 | LL | fn next<'a>(&'a self) -> Option>; | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/streaming_iterator.rs:47:37 + --> $DIR/streaming_iterator.rs:48:37 | LL | type Item<'a> = (usize, I::Item<'a>); | ^^ lifetime parameter not allowed error[E0110]: lifetime parameters are not allowed on this type - --> $DIR/streaming_iterator.rs:49:48 + --> $DIR/streaming_iterator.rs:50:48 | LL | fn next<'a>(&'a self) -> Option> { | ^^ lifetime parameter not allowed diff --git a/src/test/ui/token/issue-10636-2.stderr b/src/test/ui/token/issue-10636-2.stderr index 6c0053f2f8597..634191bb5ef4e 100644 --- a/src/test/ui/token/issue-10636-2.stderr +++ b/src/test/ui/token/issue-10636-2.stderr @@ -1,14 +1,11 @@ error: incorrect close delimiter: `}` --> $DIR/issue-10636-2.rs:18:1 | -LL | } //~ ERROR: incorrect close delimiter - | ^ - | -note: unclosed delimiter - --> $DIR/issue-10636-2.rs:15:15 - | LL | option.map(|some| 42; - | ^ + | - unclosed delimiter +... +LL | } //~ ERROR: incorrect close delimiter + | ^ incorrect close delimiter error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` --> $DIR/issue-10636-2.rs:15:25 diff --git a/src/tools/tidy/src/unstable_book.rs b/src/tools/tidy/src/unstable_book.rs index 6b573908de902..62296f73f016b 100644 --- a/src/tools/tidy/src/unstable_book.rs +++ b/src/tools/tidy/src/unstable_book.rs @@ -60,6 +60,7 @@ pub fn collect_unstable_book_section_file_names(dir: &path::Path) -> BTreeSet