Auto merge of #53433 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

Successful merges:

 - #52946 (Documented impl From on line 367 of libserialize/json.rs)
 - #53234 (Remove Travis shutdown debug scripts, and remove CI-specific DNS settings)
 - #53313 (Two small improvements)
 - #53360 (Addressed #51602)
 - #53364 (Warn if the user tries to use GATs)
 - #53373 (Tweak unclosed delimiter parser error)
 - #53377 (std: Use target_pointer_width for BACKTRACE_ELF_SIZE)
 - #53395 (Use #[non_exhaustive] on internal enums)
 - #53399 (Tidy: ignore non-Markdown files when linting for the Unstable Book)
 - #53412 (syntax_ext: remove leftover span_err_if_not_stage0 macro.)
This commit is contained in:
bors 2018-08-16 17:53:29 +00:00
commit b2028828db
68 changed files with 297 additions and 245 deletions

View File

@ -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;

View File

@ -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"

View File

@ -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" \

View File

@ -1,5 +0,0 @@
# `future_atomic_orderings`
This feature is internal to the Rust compiler and is not intended for general use.
------------------------

View File

@ -1,5 +0,0 @@
# `io_error_internals`
This feature is internal to the Rust compiler and is not intended for general use.
------------------------

View File

@ -120,6 +120,7 @@
#![feature(const_slice_len)]
#![feature(const_str_as_bytes)]
#![feature(const_str_len)]
#![feature(non_exhaustive)]
#[prelude_import]
#[allow(unused)]

View File

@ -185,6 +185,7 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
/// [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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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<T>(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"),
}
}
}

View File

@ -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

View File

@ -36,6 +36,7 @@
#![feature(staged_api)]
#![feature(lang_items)]
#![feature(optin_builtin_traits)]
#![feature(non_exhaustive)]
#![recursion_limit="256"]

View File

@ -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"),
}
}
}

View File

@ -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.

View File

@ -365,6 +365,9 @@ impl std::error::Error for EncoderError {
}
impl From<fmt::Error> 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,
}
}

View File

@ -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");

View File

@ -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!()
}
}
}

View File

@ -311,6 +311,7 @@
#![feature(doc_keyword)]
#![feature(panic_info_message)]
#![feature(panic_implementation)]
#![feature(non_exhaustive)]
#![default_lib_allocator]

View File

@ -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.

View File

@ -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

View File

@ -67,6 +67,7 @@ pub struct StringReader<'a> {
span_src_raw: Span,
open_braces: Vec<(token::DelimToken, Span)>,
crate override_span: Option<Span>,
last_unclosed_found_span: Option<Span>,
}
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,
}
}

View File

@ -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)
},
_ => {

View File

@ -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);

View File

@ -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)
}

View File

@ -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))
}

View File

@ -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

View File

@ -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() {

View File

@ -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));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -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() {

View File

@ -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));
| ^^^

View File

@ -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() {

View File

@ -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
| ^^^^^^^

View File

@ -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() {

View File

@ -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
| ^^^^^^^

View File

@ -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() {

View File

@ -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
| ^^^^^^^

View File

@ -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,

View File

@ -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
| ^^^^^^^

View File

@ -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() {}

View File

@ -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

View File

@ -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 <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.
fn main(){
if i in 1..10 {
break;
}
}

View File

@ -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

View File

@ -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.

View File

@ -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
| ^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -15,4 +15,3 @@ fn main() {
//~^ ERROR: expected expression, found `;`
}
//~^ ERROR: incorrect close delimiter: `}`
//~| ERROR: incorrect close delimiter: `}`

View File

@ -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

View File

@ -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/

View File

@ -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<C>(ints: &C) -> <<C as Collection<i32>>::Family as CollectionFamily>::Member<f32>
| ^^^ 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<C>(ints: &C) -> <C as Collection<i32>>::Sibling<f32>
| ^^^ 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 | <<Self as Collection<T>>::Family as CollectionFamily>::Member<U>;
| ^ 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

View File

@ -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>;

View File

@ -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<Target = <Self::Quux<'a> 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<Target = <Self::Quux<'a> 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 <T as Foo>::Bar<'a, 'static>;
| ^^ lifetime parameter not allowed

View File

@ -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<,>;

View File

@ -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

View File

@ -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 <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.
// run-pass
#![feature(generic_associated_types)]
//~^ WARNING the feature `generic_associated_types` is incomplete
fn main() {}

View File

@ -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)]
| ^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -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)]
| ^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -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>;

View File

@ -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<Target = Self::Item<'b>>;
| ^^ 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<Item = Self::Item<'a>>
| ^^ 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<Target = Self::Item<'b>>;
| ^^ 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

View File

@ -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>;

View File

@ -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<Item = Self::Item<'a>>;
| ^^ 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<I::Item<'a>> {
| ^^ 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

View File

@ -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>;

View File

@ -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<T> = 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<T> = 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<T> = 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<T> = Self::E<'static, T, u32>; // Error
| ^ type parameter not allowed

View File

@ -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;

View File

@ -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<String>,
| ^^^^^^ 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<T>(value: T) -> Self::Pointer<T>;
| ^ 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<T>(value: T) -> Self::Pointer<T> {
| ^ 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<T>(value: T) -> Self::Pointer<T> {
| ^ type parameter not allowed

View File

@ -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)]
| ^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -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;

View File

@ -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: <T as StreamingIterator>::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<T>(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<Self::Item<'a>>;
| ^^ 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<Self::Item<'a>> {
| ^^ lifetime parameter not allowed

View File

@ -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

View File

@ -60,6 +60,7 @@ pub fn collect_unstable_book_section_file_names(dir: &path::Path) -> BTreeSet<St
.map(|entry| entry.expect("could not read directory entry"))
.filter(dir_entry_is_file)
.map(|entry| entry.file_name().into_string().unwrap())
.filter(|n| n.ends_with(".md"))
.map(|n| n.trim_right_matches(".md").to_owned())
.collect()
}