1
Fork 0

Auto merge of #78028 - JohnTitor:rollup-jt3hikb, r=JohnTitor

Rollup of 10 pull requests

Successful merges:

 - #75209 (Suggest imports of unresolved macros)
 - #77547 (stabilize union with 'ManuallyDrop' fields and 'impl Drop for Union')
 - #77827 (Don't link to nightly primitives on stable channel)
 - #77855 (resolve: further improvements to "try using the enum's variant" diagnostic)
 - #77900 (Use fdatasync for File::sync_data on more OSes)
 - #77925 (Suggest minimal subset features in `incomplete_features` lint)
 - #77971 (Deny broken intra-doc links in linkchecker)
 - #77991 (Bump backtrace-rs)
 - #77992 (instrument-coverage: try our best to not ICE)
 - #78013 (Fix sidebar scroll on mobile devices)

Failed merges:

r? `@ghost`
This commit is contained in:
bors 2020-10-16 20:43:27 +00:00
commit e3051d8c24
154 changed files with 667 additions and 275 deletions

View file

@ -1744,6 +1744,10 @@ dependencies = [
[[package]] [[package]]
name = "linkchecker" name = "linkchecker"
version = "0.1.0" version = "0.1.0"
dependencies = [
"once_cell",
"regex",
]
[[package]] [[package]]
name = "linked-hash-map" name = "linked-hash-map"

View file

@ -9,4 +9,4 @@ llvm_asm!("nop" "nop");
Considering that this would be a long explanation, we instead recommend you Considering that this would be a long explanation, we instead recommend you
take a look at the [`llvm_asm`] chapter of the Unstable book: take a look at the [`llvm_asm`] chapter of the Unstable book:
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html [`llvm_asm`]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

View file

@ -10,4 +10,4 @@ llvm_asm!("nop" : "r"(a));
Considering that this would be a long explanation, we instead recommend you Considering that this would be a long explanation, we instead recommend you
take a look at the [`llvm_asm`] chapter of the Unstable book: take a look at the [`llvm_asm`] chapter of the Unstable book:
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html [`llvm_asm`]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

View file

@ -13,4 +13,4 @@ llvm_asm!("xor %eax, %eax"
Considering that this would be a long explanation, we instead recommend you Considering that this would be a long explanation, we instead recommend you
take a look at the [`llvm_asm`] chapter of the Unstable book: take a look at the [`llvm_asm`] chapter of the Unstable book:
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html [`llvm_asm`]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

View file

@ -13,4 +13,4 @@ llvm_asm!("xor %eax, %eax"
Considering that this would be a long explanation, we instead recommend you Considering that this would be a long explanation, we instead recommend you
take a look at the [`llvm_asm`] chapter of the Unstable book: take a look at the [`llvm_asm`] chapter of the Unstable book:
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html [`llvm_asm`]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

View file

@ -13,4 +13,4 @@ llvm_asm!("mov $$0x200, %eax"
Considering that this would be a long explanation, we instead recommend you Considering that this would be a long explanation, we instead recommend you
take a look at the [`llvm_asm`] chapter of the Unstable book: take a look at the [`llvm_asm`] chapter of the Unstable book:
[llvm_asm]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html [`llvm_asm`]: https://doc.rust-lang.org/stable/unstable-book/library-features/llvm-asm.html

View file

@ -2288,12 +2288,20 @@ impl EarlyLintPass for IncompleteFeatures {
n, n, n, n,
)); ));
} }
if HAS_MIN_FEATURES.contains(&name) {
builder.help(&format!(
"consider using `min_{}` instead, which is more stable and complete",
name,
));
}
builder.emit(); builder.emit();
}) })
}); });
} }
} }
const HAS_MIN_FEATURES: &[Symbol] = &[sym::const_generics, sym::specialization];
declare_lint! { declare_lint! {
/// The `invalid_value` lint detects creating a value that is not valid, /// The `invalid_value` lint detects creating a value that is not valid,
/// such as a NULL reference. /// such as a NULL reference.

View file

@ -22,9 +22,7 @@ use rustc_middle::ty::query::Providers;
use rustc_middle::ty::TyCtxt; use rustc_middle::ty::TyCtxt;
use rustc_span::def_id::DefId; use rustc_span::def_id::DefId;
use rustc_span::source_map::original_sp; use rustc_span::source_map::original_sp;
use rustc_span::{ use rustc_span::{BytePos, CharPos, Pos, SourceFile, Span, Symbol, SyntaxContext};
BytePos, CharPos, FileName, Pos, RealFileName, SourceFile, Span, Symbol, SyntaxContext,
};
use std::cmp::Ordering; use std::cmp::Ordering;
@ -549,13 +547,7 @@ impl<'a, 'tcx> Instrumentor<'a, 'tcx> {
let mir_body = &self.mir_body; let mir_body = &self.mir_body;
let body_span = self.body_span(); let body_span = self.body_span();
let source_file = source_map.lookup_source_file(body_span.lo()); let source_file = source_map.lookup_source_file(body_span.lo());
let file_name = match &source_file.name { let file_name = Symbol::intern(&source_file.name.to_string());
FileName::Real(RealFileName::Named(path)) => Symbol::intern(&path.to_string_lossy()),
_ => bug!(
"source_file.name should be a RealFileName, but it was: {:?}",
source_file.name
),
};
debug!("instrumenting {:?}, span: {}", def_id, source_map.span_to_string(body_span)); debug!("instrumenting {:?}, span: {}", def_id, source_map.span_to_string(body_span));

View file

@ -13,15 +13,13 @@ use rustc_hir::{Generics, HirId, Item, StructField, TraitRef, Ty, TyKind, Varian
use rustc_middle::hir::map::Map; use rustc_middle::hir::map::Map;
use rustc_middle::middle::privacy::AccessLevels; use rustc_middle::middle::privacy::AccessLevels;
use rustc_middle::middle::stability::{DeprecationEntry, Index}; use rustc_middle::middle::stability::{DeprecationEntry, Index};
use rustc_middle::ty::query::Providers; use rustc_middle::ty::{self, query::Providers, TyCtxt};
use rustc_middle::ty::TyCtxt;
use rustc_session::lint; use rustc_session::lint;
use rustc_session::lint::builtin::INEFFECTIVE_UNSTABLE_TRAIT_IMPL; use rustc_session::lint::builtin::INEFFECTIVE_UNSTABLE_TRAIT_IMPL;
use rustc_session::parse::feature_err; use rustc_session::parse::feature_err;
use rustc_session::Session; use rustc_session::Session;
use rustc_span::symbol::{sym, Symbol}; use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span; use rustc_span::{Span, DUMMY_SP};
use rustc_trait_selection::traits::misc::can_type_implement_copy;
use std::cmp::Ordering; use std::cmp::Ordering;
use std::mem::replace; use std::mem::replace;
@ -711,27 +709,35 @@ impl Visitor<'tcx> for Checker<'tcx> {
// so semi-randomly perform it here in stability.rs // so semi-randomly perform it here in stability.rs
hir::ItemKind::Union(..) if !self.tcx.features().untagged_unions => { hir::ItemKind::Union(..) if !self.tcx.features().untagged_unions => {
let def_id = self.tcx.hir().local_def_id(item.hir_id); let def_id = self.tcx.hir().local_def_id(item.hir_id);
let adt_def = self.tcx.adt_def(def_id);
let ty = self.tcx.type_of(def_id); let ty = self.tcx.type_of(def_id);
let (adt_def, substs) = match ty.kind() {
ty::Adt(adt_def, substs) => (adt_def, substs),
_ => bug!(),
};
if adt_def.has_dtor(self.tcx) { // Non-`Copy` fields are unstable, except for `ManuallyDrop`.
feature_err( let param_env = self.tcx.param_env(def_id);
&self.tcx.sess.parse_sess, for field in &adt_def.non_enum_variant().fields {
sym::untagged_unions, let field_ty = field.ty(self.tcx, substs);
item.span, if !field_ty.ty_adt_def().map_or(false, |adt_def| adt_def.is_manually_drop())
"unions with `Drop` implementations are unstable", && !field_ty.is_copy_modulo_regions(self.tcx.at(DUMMY_SP), param_env)
) {
.emit(); if field_ty.needs_drop(self.tcx, param_env) {
} else { // Avoid duplicate error: This will error later anyway because fields
let param_env = self.tcx.param_env(def_id); // that need drop are not allowed.
if can_type_implement_copy(self.tcx, param_env, ty).is_err() { self.tcx.sess.delay_span_bug(
feature_err( item.span,
&self.tcx.sess.parse_sess, "union should have been rejected due to potentially dropping field",
sym::untagged_unions, );
item.span, } else {
"unions with non-`Copy` fields are unstable", feature_err(
) &self.tcx.sess.parse_sess,
.emit(); sym::untagged_unions,
self.tcx.def_span(field.did),
"unions with non-`Copy` fields other than `ManuallyDrop<T>` are unstable",
)
.emit();
}
} }
} }
} }

View file

@ -922,6 +922,17 @@ impl<'a> Resolver<'a> {
); );
self.add_typo_suggestion(err, suggestion, ident.span); self.add_typo_suggestion(err, suggestion, ident.span);
let import_suggestions = self.lookup_import_candidates(
ident,
Namespace::MacroNS,
parent_scope,
|res| match res {
Res::Def(DefKind::Macro(MacroKind::Bang), _) => true,
_ => false,
},
);
show_candidates(err, None, &import_suggestions, false, true);
if macro_kind == MacroKind::Derive && (ident.name == sym::Send || ident.name == sym::Sync) { if macro_kind == MacroKind::Derive && (ident.name == sym::Send || ident.name == sym::Sync) {
let msg = format!("unsafe traits like `{}` should be implemented explicitly", ident); let msg = format!("unsafe traits like `{}` should be implemented explicitly", ident);
err.span_note(ident.span, &msg); err.span_note(ident.span, &msg);

View file

@ -1330,58 +1330,17 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
let suggest_only_tuple_variants = let suggest_only_tuple_variants =
matches!(source, PathSource::TupleStruct(..)) || source.is_call(); matches!(source, PathSource::TupleStruct(..)) || source.is_call();
let mut suggestable_variants = if suggest_only_tuple_variants { if suggest_only_tuple_variants {
// Suggest only tuple variants regardless of whether they have fields and do not // Suggest only tuple variants regardless of whether they have fields and do not
// suggest path with added parenthesis. // suggest path with added parenthesis.
variants let mut suggestable_variants = variants
.iter() .iter()
.filter(|(.., kind)| *kind == CtorKind::Fn) .filter(|(.., kind)| *kind == CtorKind::Fn)
.map(|(variant, ..)| path_names_to_string(variant)) .map(|(variant, ..)| path_names_to_string(variant))
.collect::<Vec<_>>() .collect::<Vec<_>>();
} else {
variants
.iter()
.filter(|(_, def_id, kind)| {
// Suggest only variants that have no fields (these can definitely
// be constructed).
let has_fields =
self.r.field_names.get(&def_id).map(|f| f.is_empty()).unwrap_or(false);
match kind {
CtorKind::Const => true,
CtorKind::Fn | CtorKind::Fictive if has_fields => true,
_ => false,
}
})
.map(|(variant, _, kind)| (path_names_to_string(variant), kind))
.map(|(variant_str, kind)| {
// Add constructor syntax where appropriate.
match kind {
CtorKind::Const => variant_str,
CtorKind::Fn => format!("({}())", variant_str),
CtorKind::Fictive => format!("({} {{}})", variant_str),
}
})
.collect::<Vec<_>>()
};
let non_suggestable_variant_count = variants.len() - suggestable_variants.len(); let non_suggestable_variant_count = variants.len() - suggestable_variants.len();
if !suggestable_variants.is_empty() {
let msg = if non_suggestable_variant_count == 0 && suggestable_variants.len() == 1 {
"try using the enum's variant"
} else {
"try using one of the enum's variants"
};
err.span_suggestions(
span,
msg,
suggestable_variants.drain(..),
Applicability::MaybeIncorrect,
);
}
if suggest_only_tuple_variants {
let source_msg = if source.is_call() { let source_msg = if source.is_call() {
"to construct" "to construct"
} else if matches!(source, PathSource::TupleStruct(..)) { } else if matches!(source, PathSource::TupleStruct(..)) {
@ -1390,6 +1349,21 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
unreachable!() unreachable!()
}; };
if !suggestable_variants.is_empty() {
let msg = if non_suggestable_variant_count == 0 && suggestable_variants.len() == 1 {
format!("try {} the enum's variant", source_msg)
} else {
format!("try {} one of the enum's variants", source_msg)
};
err.span_suggestions(
span,
&msg,
suggestable_variants.drain(..),
Applicability::MaybeIncorrect,
);
}
// If the enum has no tuple variants.. // If the enum has no tuple variants..
if non_suggestable_variant_count == variants.len() { if non_suggestable_variant_count == variants.len() {
err.help(&format!("the enum has no tuple variants {}", source_msg)); err.help(&format!("the enum has no tuple variants {}", source_msg));
@ -1408,24 +1382,76 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
)); ));
} }
} else { } else {
let made_suggestion = non_suggestable_variant_count != variants.len(); let needs_placeholder = |def_id: DefId, kind: CtorKind| {
if made_suggestion { let has_no_fields =
if non_suggestable_variant_count == 1 { self.r.field_names.get(&def_id).map(|f| f.is_empty()).unwrap_or(false);
err.help( match kind {
"you might have meant to use the enum's other variant that has fields", CtorKind::Const => false,
); CtorKind::Fn | CtorKind::Fictive if has_no_fields => false,
} else if non_suggestable_variant_count >= 1 { _ => true,
err.help(
"you might have meant to use one of the enum's other variants that \
have fields",
);
}
} else {
if non_suggestable_variant_count == 1 {
err.help("you might have meant to use the enum's variant");
} else if non_suggestable_variant_count >= 1 {
err.help("you might have meant to use one of the enum's variants");
} }
};
let mut suggestable_variants = variants
.iter()
.filter(|(_, def_id, kind)| !needs_placeholder(*def_id, *kind))
.map(|(variant, _, kind)| (path_names_to_string(variant), kind))
.map(|(variant, kind)| match kind {
CtorKind::Const => variant,
CtorKind::Fn => format!("({}())", variant),
CtorKind::Fictive => format!("({} {{}})", variant),
})
.collect::<Vec<_>>();
if !suggestable_variants.is_empty() {
let msg = if suggestable_variants.len() == 1 {
"you might have meant to use the following enum variant"
} else {
"you might have meant to use one of the following enum variants"
};
err.span_suggestions(
span,
msg,
suggestable_variants.drain(..),
Applicability::MaybeIncorrect,
);
}
let mut suggestable_variants_with_placeholders = variants
.iter()
.filter(|(_, def_id, kind)| needs_placeholder(*def_id, *kind))
.map(|(variant, _, kind)| (path_names_to_string(variant), kind))
.filter_map(|(variant, kind)| match kind {
CtorKind::Fn => Some(format!("({}(/* fields */))", variant)),
CtorKind::Fictive => Some(format!("({} {{ /* fields */ }})", variant)),
_ => None,
})
.collect::<Vec<_>>();
if !suggestable_variants_with_placeholders.is_empty() {
let msg = match (
suggestable_variants.is_empty(),
suggestable_variants_with_placeholders.len(),
) {
(true, 1) => "the following enum variant is available",
(true, _) => "the following enum variants are available",
(false, 1) => "alternatively, the following enum variant is available",
(false, _) => "alternatively, the following enum variants are also available",
};
err.span_suggestions(
span,
msg,
suggestable_variants_with_placeholders.drain(..),
Applicability::HasPlaceholders,
);
}
};
if def_id.is_local() {
if let Some(span) = self.def_span(def_id) {
err.span_note(span, "the enum is defined here");
} }
} }
} }

View file

@ -348,8 +348,7 @@ pub(super) fn check_union(tcx: TyCtxt<'_>, id: hir::HirId, span: Span) {
check_packed(tcx, span, def); check_packed(tcx, span, def);
} }
/// When the `#![feature(untagged_unions)]` gate is active, /// Check that the fields of the `union` do not need dropping.
/// check that the fields of the `union` does not contain fields that need dropping.
pub(super) fn check_union_fields(tcx: TyCtxt<'_>, span: Span, item_def_id: LocalDefId) -> bool { pub(super) fn check_union_fields(tcx: TyCtxt<'_>, span: Span, item_def_id: LocalDefId) -> bool {
let item_type = tcx.type_of(item_def_id); let item_type = tcx.type_of(item_def_id);
if let ty::Adt(def, substs) = item_type.kind() { if let ty::Adt(def, substs) = item_type.kind() {

@ -1 +1 @@
Subproject commit 893fbb23688e98376e54c26b59432a2966a8cc96 Subproject commit a6dd47bd588c882e735675a1379d2b61719fa380

View file

@ -89,13 +89,11 @@ impl fmt::Display for AllocError {
pub unsafe trait AllocRef { pub unsafe trait AllocRef {
/// Attempts to allocate a block of memory. /// Attempts to allocate a block of memory.
/// ///
/// On success, returns a [`NonNull<[u8]>`] meeting the size and alignment guarantees of `layout`. /// On success, returns a [`NonNull<[u8]>`][NonNull] meeting the size and alignment guarantees of `layout`.
/// ///
/// The returned block may have a larger size than specified by `layout.size()`, and may or may /// The returned block may have a larger size than specified by `layout.size()`, and may or may
/// not have its contents initialized. /// not have its contents initialized.
/// ///
/// [`NonNull<[u8]>`]: NonNull
///
/// # Errors /// # Errors
/// ///
/// Returning `Err` indicates that either memory is exhausted or `layout` does not meet /// Returning `Err` indicates that either memory is exhausted or `layout` does not meet
@ -146,7 +144,7 @@ pub unsafe trait AllocRef {
/// Attempts to extend the memory block. /// Attempts to extend the memory block.
/// ///
/// Returns a new [`NonNull<[u8]>`] containing a pointer and the actual size of the allocated /// Returns a new [`NonNull<[u8]>`][NonNull] containing a pointer and the actual size of the allocated
/// memory. The pointer is suitable for holding data described by `new_layout`. To accomplish /// memory. The pointer is suitable for holding data described by `new_layout`. To accomplish
/// this, the allocator may extend the allocation referenced by `ptr` to fit the new layout. /// this, the allocator may extend the allocation referenced by `ptr` to fit the new layout.
/// ///
@ -158,8 +156,6 @@ pub unsafe trait AllocRef {
/// If this method returns `Err`, then ownership of the memory block has not been transferred to /// If this method returns `Err`, then ownership of the memory block has not been transferred to
/// this allocator, and the contents of the memory block are unaltered. /// this allocator, and the contents of the memory block are unaltered.
/// ///
/// [`NonNull<[u8]>`]: NonNull
///
/// # Safety /// # Safety
/// ///
/// * `ptr` must denote a block of memory [*currently allocated*] via this allocator. /// * `ptr` must denote a block of memory [*currently allocated*] via this allocator.
@ -271,7 +267,7 @@ pub unsafe trait AllocRef {
/// Attempts to shrink the memory block. /// Attempts to shrink the memory block.
/// ///
/// Returns a new [`NonNull<[u8]>`] containing a pointer and the actual size of the allocated /// Returns a new [`NonNull<[u8]>`][NonNull] containing a pointer and the actual size of the allocated
/// memory. The pointer is suitable for holding data described by `new_layout`. To accomplish /// memory. The pointer is suitable for holding data described by `new_layout`. To accomplish
/// this, the allocator may shrink the allocation referenced by `ptr` to fit the new layout. /// this, the allocator may shrink the allocation referenced by `ptr` to fit the new layout.
/// ///
@ -283,8 +279,6 @@ pub unsafe trait AllocRef {
/// If this method returns `Err`, then ownership of the memory block has not been transferred to /// If this method returns `Err`, then ownership of the memory block has not been transferred to
/// this allocator, and the contents of the memory block are unaltered. /// this allocator, and the contents of the memory block are unaltered.
/// ///
/// [`NonNull<[u8]>`]: NonNull
///
/// # Safety /// # Safety
/// ///
/// * `ptr` must denote a block of memory [*currently allocated*] via this allocator. /// * `ptr` must denote a block of memory [*currently allocated*] via this allocator.

View file

@ -134,6 +134,7 @@ pub const fn identity<T>(x: T) -> T {
/// want to accept all references that can be converted to [`&str`] as an argument. /// want to accept all references that can be converted to [`&str`] as an argument.
/// Since both [`String`] and [`&str`] implement `AsRef<str>` we can accept both as input argument. /// Since both [`String`] and [`&str`] implement `AsRef<str>` we can accept both as input argument.
/// ///
/// [`&str`]: primitive@str
/// [`Option<T>`]: Option /// [`Option<T>`]: Option
/// [`Result<T, E>`]: Result /// [`Result<T, E>`]: Result
/// [`Borrow`]: crate::borrow::Borrow /// [`Borrow`]: crate::borrow::Borrow

View file

@ -122,6 +122,9 @@ pub trait DoubleEndedIterator: Iterator {
/// assert_eq!(iter.advance_back_by(0), Ok(())); /// assert_eq!(iter.advance_back_by(0), Ok(()));
/// assert_eq!(iter.advance_back_by(100), Err(1)); // only `&3` was skipped /// assert_eq!(iter.advance_back_by(100), Err(1)); // only `&3` was skipped
/// ``` /// ```
///
/// [`Ok(())`]: Ok
/// [`Err(k)`]: Err
#[inline] #[inline]
#[unstable(feature = "iter_advance_by", reason = "recently added", issue = "77404")] #[unstable(feature = "iter_advance_by", reason = "recently added", issue = "77404")]
fn advance_back_by(&mut self, n: usize) -> Result<(), usize> { fn advance_back_by(&mut self, n: usize) -> Result<(), usize> {

View file

@ -289,12 +289,12 @@ pub trait Iterator {
/// This method will eagerly skip `n` elements by calling [`next`] up to `n` /// This method will eagerly skip `n` elements by calling [`next`] up to `n`
/// times until [`None`] is encountered. /// times until [`None`] is encountered.
/// ///
/// `advance_by(n)` will return [`Ok(())`] if the iterator successfully advances by /// `advance_by(n)` will return [`Ok(())`][Ok] if the iterator successfully advances by
/// `n` elements, or [`Err(k)`] if [`None`] is encountered, where `k` is the number /// `n` elements, or [`Err(k)`][Err] if [`None`] is encountered, where `k` is the number
/// of elements the iterator is advanced by before running out of elements (i.e. the /// of elements the iterator is advanced by before running out of elements (i.e. the
/// length of the iterator). Note that `k` is always less than `n`. /// length of the iterator). Note that `k` is always less than `n`.
/// ///
/// Calling `advance_by(0)` does not consume any elements and always returns [`Ok(())`]. /// Calling `advance_by(0)` does not consume any elements and always returns [`Ok(())`][Ok].
/// ///
/// [`next`]: Iterator::next /// [`next`]: Iterator::next
/// ///

View file

@ -131,7 +131,7 @@
#![feature(transparent_unions)] #![feature(transparent_unions)]
#![feature(unboxed_closures)] #![feature(unboxed_closures)]
#![feature(unsized_locals)] #![feature(unsized_locals)]
#![feature(untagged_unions)] #![cfg_attr(bootstrap, feature(untagged_unions))]
#![feature(unwind_attributes)] #![feature(unwind_attributes)]
#![feature(variant_count)] #![feature(variant_count)]
#![feature(tbm_target_feature)] #![feature(tbm_target_feature)]

View file

@ -687,6 +687,7 @@ impl<T> Option<T> {
/// assert_eq!(Some(4).filter(is_even), Some(4)); /// assert_eq!(Some(4).filter(is_even), Some(4));
/// ``` /// ```
/// ///
/// [`Some(t)`]: Some
#[inline] #[inline]
#[stable(feature = "option_filter", since = "1.27.0")] #[stable(feature = "option_filter", since = "1.27.0")]
pub fn filter<P: FnOnce(&T) -> bool>(self, predicate: P) -> Self { pub fn filter<P: FnOnce(&T) -> bool>(self, predicate: P) -> Self {

View file

@ -229,6 +229,16 @@ pub(crate) struct FatPtr<T> {
pub(crate) len: usize, pub(crate) len: usize,
} }
// Manual impl needed to avoid `T: Clone` bound.
impl<T> Clone for FatPtr<T> {
fn clone(&self) -> Self {
*self
}
}
// Manual impl needed to avoid `T: Copy` bound.
impl<T> Copy for FatPtr<T> {}
/// Forms a raw slice from a pointer and a length. /// Forms a raw slice from a pointer and a length.
/// ///
/// The `len` argument is the number of **elements**, not the number of bytes. /// The `len` argument is the number of **elements**, not the number of bytes.

View file

@ -1383,7 +1383,8 @@ impl CStr {
/// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a /// [`U+FFFD REPLACEMENT CHARACTER`][U+FFFD] and return a
/// [`Cow`]`::`[`Owned`]`(`[`String`]`)` with the result. /// [`Cow`]`::`[`Owned`]`(`[`String`]`)` with the result.
/// ///
/// [`str`]: prim@str /// [`str`]: primitive@str
/// [`&str`]: primitive@str
/// [`Borrowed`]: Cow::Borrowed /// [`Borrowed`]: Cow::Borrowed
/// [`Owned`]: Cow::Owned /// [`Owned`]: Cow::Owned
/// [U+FFFD]: crate::char::REPLACEMENT_CHARACTER /// [U+FFFD]: crate::char::REPLACEMENT_CHARACTER

View file

@ -319,7 +319,7 @@
#![feature(unsafe_block_in_unsafe_fn)] #![feature(unsafe_block_in_unsafe_fn)]
#![feature(unsafe_cell_get_mut)] #![feature(unsafe_cell_get_mut)]
#![feature(unsafe_cell_raw_get)] #![feature(unsafe_cell_raw_get)]
#![feature(untagged_unions)] #![cfg_attr(bootstrap, feature(untagged_unions))]
#![feature(unwind_attributes)] #![feature(unwind_attributes)]
#![feature(vec_into_raw_parts)] #![feature(vec_into_raw_parts)]
#![feature(wake_trait)] #![feature(wake_trait)]

View file

@ -787,11 +787,25 @@ impl File {
unsafe fn os_datasync(fd: c_int) -> c_int { unsafe fn os_datasync(fd: c_int) -> c_int {
libc::fcntl(fd, libc::F_FULLFSYNC) libc::fcntl(fd, libc::F_FULLFSYNC)
} }
#[cfg(target_os = "linux")] #[cfg(any(
target_os = "freebsd",
target_os = "linux",
target_os = "android",
target_os = "netbsd",
target_os = "openbsd"
))]
unsafe fn os_datasync(fd: c_int) -> c_int { unsafe fn os_datasync(fd: c_int) -> c_int {
libc::fdatasync(fd) libc::fdatasync(fd)
} }
#[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "linux")))] #[cfg(not(any(
target_os = "android",
target_os = "freebsd",
target_os = "ios",
target_os = "linux",
target_os = "macos",
target_os = "netbsd",
target_os = "openbsd"
)))]
unsafe fn os_datasync(fd: c_int) -> c_int { unsafe fn os_datasync(fd: c_int) -> c_int {
libc::fsync(fd) libc::fsync(fd)
} }

@ -1 +1 @@
Subproject commit 79ab7776929c66db83203397958fa7037d5d9a30 Subproject commit ca8169e69b479f615855d0eece7e318138fcfc00

View file

@ -10,6 +10,8 @@ Adds a free `default()` function to the `std::default` module. This function
just forwards to [`Default::default()`], but may remove repetition of the word just forwards to [`Default::default()`], but may remove repetition of the word
"default" from the call site. "default" from the call site.
[`Default::default()`]: https://doc.rust-lang.org/nightly/std/default/trait.Default.html#tymethod.default
Here is an example: Here is an example:
```rust ```rust

View file

@ -14,6 +14,7 @@ use rustc_ast::{self as ast, AttrStyle};
use rustc_ast::{FloatTy, IntTy, UintTy}; use rustc_ast::{FloatTy, IntTy, UintTy};
use rustc_attr::{Stability, StabilityLevel}; use rustc_attr::{Stability, StabilityLevel};
use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_feature::UnstableFeatures;
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::def::Res; use rustc_hir::def::Res;
use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
@ -679,9 +680,13 @@ impl Attributes {
"../".repeat(depth) "../".repeat(depth)
} }
Some(&(_, _, ExternalLocation::Remote(ref s))) => s.to_string(), Some(&(_, _, ExternalLocation::Remote(ref s))) => s.to_string(),
Some(&(_, _, ExternalLocation::Unknown)) | None => { Some(&(_, _, ExternalLocation::Unknown)) | None => String::from(
String::from("https://doc.rust-lang.org/nightly") if UnstableFeatures::from_environment().is_nightly_build() {
} "https://doc.rust-lang.org/nightly"
} else {
"https://doc.rust-lang.org"
},
),
}; };
// This is a primitive so the url is done "by hand". // This is a primitive so the url is done "by hand".
let tail = fragment.find('#').unwrap_or_else(|| fragment.len()); let tail = fragment.find('#').unwrap_or_else(|| fragment.len());

View file

@ -2716,10 +2716,6 @@ function defocusSearchBar() {
}; };
} }
window.onresize = function() {
hideSidebar();
};
if (main) { if (main) {
onEachLazy(main.getElementsByClassName("loading-content"), function(e) { onEachLazy(main.getElementsByClassName("loading-content"), function(e) {
e.remove(); e.remove();

View file

@ -6,6 +6,7 @@ LL | #![feature(const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/match_arr_unknown_len.rs:6:9 --> $DIR/match_arr_unknown_len.rs:6:9

View file

@ -6,6 +6,7 @@ LL | #![feature(associated_type_defaults, specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0053]: method `make` has an incompatible type for trait error[E0053]: method `make` has an incompatible type for trait
--> $DIR/defaults-specialization.rs:19:18 --> $DIR/defaults-specialization.rs:19:18

View file

@ -6,6 +6,7 @@ LL | #![feature(const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error[E0158]: const parameters cannot be referenced in patterns error[E0158]: const parameters cannot be referenced in patterns
--> $DIR/const-param.rs:7:9 --> $DIR/const-param.rs:7:9

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0391]: cycle detected when building specialization graph of trait `Trait` error[E0391]: cycle detected when building specialization graph of trait `Trait`
--> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:9:1 --> $DIR/coherence-inherited-assoc-ty-cycle-err.rs:9:1

View file

@ -14,6 +14,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error[E0771]: use of non-static lifetime `'a` in const generic error[E0771]: use of non-static lifetime `'a` in const generic
--> $DIR/issue-56445.rs:9:26 --> $DIR/issue-56445.rs:9:26

View file

@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error[E0277]: the trait bound `T: Copy` is not satisfied error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-61336-2.rs:10:5 --> $DIR/issue-61336-2.rs:10:5

View file

@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error[E0277]: the trait bound `T: Copy` is not satisfied error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/issue-61336.rs:10:5 --> $DIR/issue-61336.rs:10:5

View file

@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![cfg_attr(full, feature(const_generics))]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error: constant expression depends on a generic parameter error: constant expression depends on a generic parameter
--> $DIR/issue-61747.rs:8:23 --> $DIR/issue-61747.rs:8:23

View file

@ -6,6 +6,7 @@ LL | #![feature(const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error: constant expression depends on a generic parameter error: constant expression depends on a generic parameter
--> $DIR/unify-fixpoint.rs:9:32 --> $DIR/unify-fixpoint.rs:9:32

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -68,7 +68,6 @@ enum N<F> where F: Fn() -> _ {
union O<F> where F: Fn() -> _ { union O<F> where F: Fn() -> _ {
//~^ ERROR the type placeholder `_` is not allowed within types on item signatures //~^ ERROR the type placeholder `_` is not allowed within types on item signatures
//~| ERROR unions with non-`Copy` fields are unstable
foo: F, foo: F,
} }

View file

@ -57,19 +57,6 @@ LL | type J = ty!(u8);
| |
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0658]: unions with non-`Copy` fields are unstable
--> $DIR/bad-assoc-ty.rs:69:1
|
LL | / union O<F> where F: Fn() -> _ {
LL | |
LL | |
LL | | foo: F,
LL | | }
| |_^
|
= note: see issue #55149 <https://github.com/rust-lang/rust/issues/55149> for more information
= help: add `#![feature(untagged_unions)]` to the crate attributes to enable
error[E0223]: ambiguous associated type error[E0223]: ambiguous associated type
--> $DIR/bad-assoc-ty.rs:1:10 --> $DIR/bad-assoc-ty.rs:1:10
| |
@ -215,7 +202,7 @@ LL | union O<F, T> where F: Fn() -> T {
| ^^^ ^ | ^^^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:75:29 --> $DIR/bad-assoc-ty.rs:74:29
| |
LL | trait P<F> where F: Fn() -> _ { LL | trait P<F> where F: Fn() -> _ {
| ^ not allowed in type signatures | ^ not allowed in type signatures
@ -226,7 +213,7 @@ LL | trait P<F, T> where F: Fn() -> T {
| ^^^ ^ | ^^^ ^
error[E0121]: the type placeholder `_` is not allowed within types on item signatures error[E0121]: the type placeholder `_` is not allowed within types on item signatures
--> $DIR/bad-assoc-ty.rs:80:38 --> $DIR/bad-assoc-ty.rs:79:38
| |
LL | fn foo<F>(_: F) where F: Fn() -> _ {} LL | fn foo<F>(_: F) where F: Fn() -> _ {}
| ^ not allowed in type signatures | ^ not allowed in type signatures
@ -236,7 +223,7 @@ help: use type parameters instead
LL | fn foo<F, T>(_: F) where F: Fn() -> T {} LL | fn foo<F, T>(_: F) where F: Fn() -> T {}
| ^^^ ^ | ^^^ ^
error: aborting due to 29 previous errors error: aborting due to 28 previous errors
Some errors have detailed explanations: E0121, E0223, E0658. Some errors have detailed explanations: E0121, E0223.
For more information about an error, try `rustc --explain E0121`. For more information about an error, try `rustc --explain E0121`.

View file

@ -2,7 +2,7 @@ error[E0423]: expected function, tuple struct or tuple variant, found enum `Opti
--> $DIR/issue-43871-enum-instead-of-variant.rs:19:13 --> $DIR/issue-43871-enum-instead-of-variant.rs:19:13
| |
LL | let x = Option(1); LL | let x = Option(1);
| ^^^^^^ help: try using one of the enum's variants: `std::option::Option::Some` | ^^^^^^ help: try to construct one of the enum's variants: `std::option::Option::Some`
| |
= help: you might have meant to construct the enum's non-tuple variant = help: you might have meant to construct the enum's non-tuple variant
@ -10,7 +10,7 @@ error[E0532]: expected tuple struct or tuple variant, found enum `Option`
--> $DIR/issue-43871-enum-instead-of-variant.rs:21:12 --> $DIR/issue-43871-enum-instead-of-variant.rs:21:12
| |
LL | if let Option(_) = x { LL | if let Option(_) = x {
| ^^^^^^ help: try using one of the enum's variants: `std::option::Option::Some` | ^^^^^^ help: try to match against one of the enum's variants: `std::option::Option::Some`
| |
= help: you might have meant to match against the enum's non-tuple variant = help: you might have meant to match against the enum's non-tuple variant
@ -18,9 +18,14 @@ error[E0532]: expected tuple struct or tuple variant, found enum `Example`
--> $DIR/issue-43871-enum-instead-of-variant.rs:27:12 --> $DIR/issue-43871-enum-instead-of-variant.rs:27:12
| |
LL | if let Example(_) = y { LL | if let Example(_) = y {
| ^^^^^^^ help: try using one of the enum's variants: `Example::Ex` | ^^^^^^^ help: try to match against one of the enum's variants: `Example::Ex`
| |
= help: you might have meant to match against the enum's non-tuple variant = help: you might have meant to match against the enum's non-tuple variant
note: the enum is defined here
--> $DIR/issue-43871-enum-instead-of-variant.rs:1:1
|
LL | enum Example { Ex(String), NotEx }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0423]: expected function, tuple struct or tuple variant, found enum `Void` error[E0423]: expected function, tuple struct or tuple variant, found enum `Void`
--> $DIR/issue-43871-enum-instead-of-variant.rs:31:13 --> $DIR/issue-43871-enum-instead-of-variant.rs:31:13
@ -29,6 +34,11 @@ LL | let y = Void();
| ^^^^ | ^^^^
| |
= help: the enum has no tuple variants to construct = help: the enum has no tuple variants to construct
note: the enum is defined here
--> $DIR/issue-43871-enum-instead-of-variant.rs:3:1
|
LL | enum Void {}
| ^^^^^^^^^^^^
error[E0423]: expected function, tuple struct or tuple variant, found enum `ManyVariants` error[E0423]: expected function, tuple struct or tuple variant, found enum `ManyVariants`
--> $DIR/issue-43871-enum-instead-of-variant.rs:33:13 --> $DIR/issue-43871-enum-instead-of-variant.rs:33:13
@ -38,6 +48,17 @@ LL | let z = ManyVariants();
| |
= help: the enum has no tuple variants to construct = help: the enum has no tuple variants to construct
= help: you might have meant to construct one of the enum's non-tuple variants = help: you might have meant to construct one of the enum's non-tuple variants
note: the enum is defined here
--> $DIR/issue-43871-enum-instead-of-variant.rs:5:1
|
LL | / enum ManyVariants {
LL | | One,
LL | | Two,
LL | | Three,
... |
LL | | Ten,
LL | | }
| |_^
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View file

@ -1,7 +1,7 @@
// run-pass // run-pass
// ignore-wasm32-bare compiled with panic=abort by default // ignore-wasm32-bare compiled with panic=abort by default
#![feature(generators, generator_trait, untagged_unions)] #![feature(generators, generator_trait)]
#![feature(bindings_after_at)] #![feature(bindings_after_at)]
#![allow(unused_assignments)] #![allow(unused_assignments)]

View file

@ -1,5 +1,3 @@
#![feature(untagged_unions)]
use std::cell::Cell; use std::cell::Cell;
use std::ops::Deref; use std::ops::Deref;
use std::mem::ManuallyDrop; use std::mem::ManuallyDrop;

View file

@ -1,5 +1,5 @@
error[E0597]: `v` does not live long enough error[E0597]: `v` does not live long enough
--> $DIR/dropck-union.rs:39:18 --> $DIR/dropck-union.rs:37:18
| |
LL | v.0.set(Some(&v)); LL | v.0.set(Some(&v));
| ^^ borrowed value does not live long enough | ^^ borrowed value does not live long enough

View file

@ -3,6 +3,9 @@ error: cannot find macro `macro_two` in this scope
| |
LL | macro_two!(); LL | macro_two!();
| ^^^^^^^^^ | ^^^^^^^^^
|
= note: consider importing this macro:
two_macros::macro_two
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0520]: `fly` specializes an item from a parent `impl`, but that item is not marked `default` error[E0520]: `fly` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/E0520.rs:17:5 --> $DIR/E0520.rs:17:5

View file

@ -6,6 +6,7 @@ LL | #![feature(const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error[E0730]: cannot pattern-match on an array without a fixed length error[E0730]: cannot pattern-match on an array without a fixed length
--> $DIR/E0730.rs:6:9 --> $DIR/E0730.rs:6:9

View file

@ -6,6 +6,7 @@ LL | #![feature(const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error[E0771]: use of non-static lifetime `'a` in const generic error[E0771]: use of non-static lifetime `'a` in const generic
--> $DIR/E0771.rs:4:41 --> $DIR/E0771.rs:4:41

View file

@ -1,3 +1,5 @@
// ignore-tidy-linelength
union U1 { // OK union U1 { // OK
a: u8, a: u8,
} }
@ -6,15 +8,23 @@ union U2<T: Copy> { // OK
a: T, a: T,
} }
union U3 { //~ ERROR unions with non-`Copy` fields are unstable union U22<T> { // OK
a: std::mem::ManuallyDrop<T>,
}
union U3 {
a: String, //~ ERROR unions may not contain fields that need dropping a: String, //~ ERROR unions may not contain fields that need dropping
} }
union U4<T> { //~ ERROR unions with non-`Copy` fields are unstable union U32 { // field that does not drop but is not `Copy`, either -- this is the real feature gate test!
a: std::cell::RefCell<i32>, //~ ERROR unions with non-`Copy` fields other than `ManuallyDrop<T>` are unstable
}
union U4<T> {
a: T, //~ ERROR unions may not contain fields that need dropping a: T, //~ ERROR unions may not contain fields that need dropping
} }
union U5 { //~ ERROR unions with `Drop` implementations are unstable union U5 { // Having a drop impl is OK
a: u8, a: u8,
} }

View file

@ -1,61 +1,37 @@
error[E0658]: unions with non-`Copy` fields are unstable error[E0658]: unions with non-`Copy` fields other than `ManuallyDrop<T>` are unstable
--> $DIR/feature-gate-untagged_unions.rs:9:1 --> $DIR/feature-gate-untagged_unions.rs:20:5
| |
LL | / union U3 { LL | a: std::cell::RefCell<i32>,
LL | | a: String, | ^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | | }
| |_^
|
= note: see issue #55149 <https://github.com/rust-lang/rust/issues/55149> for more information
= help: add `#![feature(untagged_unions)]` to the crate attributes to enable
error[E0658]: unions with non-`Copy` fields are unstable
--> $DIR/feature-gate-untagged_unions.rs:13:1
|
LL | / union U4<T> {
LL | | a: T,
LL | | }
| |_^
|
= note: see issue #55149 <https://github.com/rust-lang/rust/issues/55149> for more information
= help: add `#![feature(untagged_unions)]` to the crate attributes to enable
error[E0658]: unions with `Drop` implementations are unstable
--> $DIR/feature-gate-untagged_unions.rs:17:1
|
LL | / union U5 {
LL | | a: u8,
LL | | }
| |_^
| |
= note: see issue #55149 <https://github.com/rust-lang/rust/issues/55149> for more information = note: see issue #55149 <https://github.com/rust-lang/rust/issues/55149> for more information
= help: add `#![feature(untagged_unions)]` to the crate attributes to enable = help: add `#![feature(untagged_unions)]` to the crate attributes to enable
error[E0740]: unions may not contain fields that need dropping error[E0740]: unions may not contain fields that need dropping
--> $DIR/feature-gate-untagged_unions.rs:10:5 --> $DIR/feature-gate-untagged_unions.rs:16:5
| |
LL | a: String, LL | a: String,
| ^^^^^^^^^ | ^^^^^^^^^
| |
note: `std::mem::ManuallyDrop` can be used to wrap the type note: `std::mem::ManuallyDrop` can be used to wrap the type
--> $DIR/feature-gate-untagged_unions.rs:10:5 --> $DIR/feature-gate-untagged_unions.rs:16:5
| |
LL | a: String, LL | a: String,
| ^^^^^^^^^ | ^^^^^^^^^
error[E0740]: unions may not contain fields that need dropping error[E0740]: unions may not contain fields that need dropping
--> $DIR/feature-gate-untagged_unions.rs:14:5 --> $DIR/feature-gate-untagged_unions.rs:24:5
| |
LL | a: T, LL | a: T,
| ^^^^ | ^^^^
| |
note: `std::mem::ManuallyDrop` can be used to wrap the type note: `std::mem::ManuallyDrop` can be used to wrap the type
--> $DIR/feature-gate-untagged_unions.rs:14:5 --> $DIR/feature-gate-untagged_unions.rs:24:5
| |
LL | a: T, LL | a: T,
| ^^^^ | ^^^^
error: aborting due to 5 previous errors error: aborting due to 3 previous errors
Some errors have detailed explanations: E0658, E0740. Some errors have detailed explanations: E0658, E0740.
For more information about an error, try `rustc --explain E0658`. For more information about an error, try `rustc --explain E0658`.

View file

@ -24,7 +24,17 @@ error[E0423]: expected value, found enum `B`
--> $DIR/glob-resolve1.rs:24:5 --> $DIR/glob-resolve1.rs:24:5
| |
LL | B; LL | B;
| ^ help: try using the enum's variant: `B::B1` | ^
|
note: the enum is defined here
--> $DIR/glob-resolve1.rs:12:5
|
LL | pub enum B { B1 }
| ^^^^^^^^^^^^^^^^^
help: you might have meant to use the following enum variant
|
LL | B::B1;
| ^^^^^
error[E0425]: cannot find value `C` in this scope error[E0425]: cannot find value `C` in this scope
--> $DIR/glob-resolve1.rs:25:5 --> $DIR/glob-resolve1.rs:25:5

View file

@ -6,6 +6,7 @@ LL | #![feature(decl_macro, rustc_attrs, const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -3,6 +3,9 @@ error: cannot find macro `print` in this scope
| |
LL | print!(); LL | print!();
| ^^^^^ | ^^^^^
|
= note: consider importing this macro:
std::print
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,6 +4,9 @@ error: cannot find macro `panic` in this scope
LL | assert_eq!(0, 0); LL | assert_eq!(0, 0);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
| |
= note: consider importing one of these items:
core::panic
std::panic
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0433]: failed to resolve: use of undeclared type `Vec` error[E0433]: failed to resolve: use of undeclared type `Vec`

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/equality.rs:15:5 --> $DIR/equality.rs:15:5

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/equality2.rs:25:18 --> $DIR/equality2.rs:25:18

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -12,6 +12,7 @@ LL | #![feature(const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error: aborting due to previous error; 1 warning emitted error: aborting due to previous error; 1 warning emitted

View file

@ -4,8 +4,18 @@ error[E0423]: expected value, found enum `A`
LL | A.foo(); LL | A.foo();
| ^ | ^
| |
= help: you might have meant to use one of the enum's other variants that have fields note: the enum is defined here
help: try using one of the enum's variants --> $DIR/issue-73427.rs:1:1
|
LL | / enum A {
LL | | StructWithFields { x: () },
LL | | TupleWithFields(()),
LL | | Struct {},
LL | | Tuple(),
LL | | Unit,
LL | | }
| |_^
help: you might have meant to use one of the following enum variants
| |
LL | (A::Struct {}).foo(); LL | (A::Struct {}).foo();
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
@ -13,6 +23,12 @@ LL | (A::Tuple()).foo();
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
LL | A::Unit.foo(); LL | A::Unit.foo();
| ^^^^^^^ | ^^^^^^^
help: the following enum variants are available
|
LL | (A::StructWithFields { /* fields */ }).foo();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | (A::TupleWithFields(/* fields */)).foo();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0423]: expected value, found enum `B` error[E0423]: expected value, found enum `B`
--> $DIR/issue-73427.rs:31:5 --> $DIR/issue-73427.rs:31:5
@ -20,23 +36,69 @@ error[E0423]: expected value, found enum `B`
LL | B.foo(); LL | B.foo();
| ^ | ^
| |
= help: you might have meant to use one of the enum's variants note: the enum is defined here
--> $DIR/issue-73427.rs:9:1
|
LL | / enum B {
LL | | StructWithFields { x: () },
LL | | TupleWithFields(()),
LL | | }
| |_^
help: the following enum variants are available
|
LL | (B::StructWithFields { /* fields */ }).foo();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | (B::TupleWithFields(/* fields */)).foo();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0423]: expected value, found enum `C` error[E0423]: expected value, found enum `C`
--> $DIR/issue-73427.rs:33:5 --> $DIR/issue-73427.rs:33:5
| |
LL | C.foo(); LL | C.foo();
| ^ help: try using one of the enum's variants: `C::Unit` | ^
| |
= help: you might have meant to use one of the enum's other variants that have fields note: the enum is defined here
--> $DIR/issue-73427.rs:14:1
|
LL | / enum C {
LL | | StructWithFields { x: () },
LL | | TupleWithFields(()),
LL | | Unit,
LL | | }
| |_^
help: you might have meant to use the following enum variant
|
LL | C::Unit.foo();
| ^^^^^^^
help: the following enum variants are available
|
LL | (C::StructWithFields { /* fields */ }).foo();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | (C::TupleWithFields(/* fields */)).foo();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0423]: expected value, found enum `D` error[E0423]: expected value, found enum `D`
--> $DIR/issue-73427.rs:35:5 --> $DIR/issue-73427.rs:35:5
| |
LL | D.foo(); LL | D.foo();
| ^ help: try using one of the enum's variants: `D::Unit` | ^
| |
= help: you might have meant to use the enum's other variant that has fields note: the enum is defined here
--> $DIR/issue-73427.rs:20:1
|
LL | / enum D {
LL | | TupleWithFields(()),
LL | | Unit,
LL | | }
| |_^
help: you might have meant to use the following enum variant
|
LL | D::Unit.foo();
| ^^^^^^^
help: the following enum variant is available
|
LL | (D::TupleWithFields(/* fields */)).foo();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0423]: expected function, tuple struct or tuple variant, found enum `A` error[E0423]: expected function, tuple struct or tuple variant, found enum `A`
--> $DIR/issue-73427.rs:40:13 --> $DIR/issue-73427.rs:40:13
@ -45,7 +107,18 @@ LL | let x = A(3);
| ^ | ^
| |
= help: you might have meant to construct one of the enum's non-tuple variants = help: you might have meant to construct one of the enum's non-tuple variants
help: try using one of the enum's variants note: the enum is defined here
--> $DIR/issue-73427.rs:1:1
|
LL | / enum A {
LL | | StructWithFields { x: () },
LL | | TupleWithFields(()),
LL | | Struct {},
LL | | Tuple(),
LL | | Unit,
LL | | }
| |_^
help: try to construct one of the enum's variants
| |
LL | let x = A::TupleWithFields(3); LL | let x = A::TupleWithFields(3);
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
@ -59,7 +132,18 @@ LL | if let A(3) = x { }
| ^ | ^
| |
= help: you might have meant to match against one of the enum's non-tuple variants = help: you might have meant to match against one of the enum's non-tuple variants
help: try using one of the enum's variants note: the enum is defined here
--> $DIR/issue-73427.rs:1:1
|
LL | / enum A {
LL | | StructWithFields { x: () },
LL | | TupleWithFields(()),
LL | | Struct {},
LL | | Tuple(),
LL | | Unit,
LL | | }
| |_^
help: try to match against one of the enum's variants
| |
LL | if let A::TupleWithFields(3) = x { } LL | if let A::TupleWithFields(3) = x { }
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^

View file

@ -8,6 +8,9 @@ LL | macro_two!();
| |
LL | macro_rules! macro_one { () => ("one") } LL | macro_rules! macro_one { () => ("one") }
| ---------------------- similarly named macro `macro_one` defined here | ---------------------- similarly named macro `macro_one` defined here
|
= note: consider importing this macro:
two_macros::macro_two
error: aborting due to previous error error: aborting due to previous error

View file

@ -3,6 +3,9 @@ error: cannot find macro `macro_two` in this scope
| |
LL | macro_two!(); LL | macro_two!();
| ^^^^^^^^^ | ^^^^^^^^^
|
= note: consider importing this macro:
two_macros::macro_two
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -170,6 +170,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error: aborting due to 24 previous errors; 1 warning emitted error: aborting due to 24 previous errors; 1 warning emitted

View file

@ -31,6 +31,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0046]: not all trait items implemented, missing: `foo` error[E0046]: not all trait items implemented, missing: `foo`
--> $DIR/default.rs:22:1 --> $DIR/default.rs:22:1

View file

@ -54,6 +54,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error: aborting due to 6 previous errors; 1 warning emitted error: aborting due to 6 previous errors; 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(const_generics, rustc_attrs)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error: item has unused generic parameters error: item has unused generic parameters
--> $DIR/closures.rs:19:19 --> $DIR/closures.rs:19:19

View file

@ -6,6 +6,7 @@ LL | #![feature(const_generics, rustc_attrs)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error: item has unused generic parameters error: item has unused generic parameters
--> $DIR/functions.rs:15:8 --> $DIR/functions.rs:15:8

View file

@ -6,6 +6,7 @@ LL | #![feature(const_generics, generators, generator_trait, rustc_attrs)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error: item has unused generic parameters error: item has unused generic parameters
--> $DIR/generators.rs:36:5 --> $DIR/generators.rs:36:5

View file

@ -1,15 +1,3 @@
error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the union it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:67:21
|
LL | impl<AddsBnd:Copy + Bound> Drop for Union<AddsBnd> { fn drop(&mut self) { } } // REJECT
| ^^^^^
|
note: the implementor must specify the same requirement
--> $DIR/reject-specialized-drops-8142.rs:21:1
|
LL | union Union<T: Copy> { f: T }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not error[E0367]: `Drop` impl requires `'adds_bnd: 'al` but the struct it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:23:20 --> $DIR/reject-specialized-drops-8142.rs:23:20
| |
@ -145,6 +133,18 @@ note: the implementor must specify the same requirement
LL | struct TupleStruct<T>(T); LL | struct TupleStruct<T>(T);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0367]: `Drop` impl requires `AddsBnd: Bound` but the union it is implemented for does not
--> $DIR/reject-specialized-drops-8142.rs:67:21
|
LL | impl<AddsBnd:Copy + Bound> Drop for Union<AddsBnd> { fn drop(&mut self) { } } // REJECT
| ^^^^^
|
note: the implementor must specify the same requirement
--> $DIR/reject-specialized-drops-8142.rs:21:1
|
LL | union Union<T: Copy> { f: T }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 11 previous errors error: aborting due to 11 previous errors
Some errors have detailed explanations: E0308, E0366, E0367, E0495. Some errors have detailed explanations: E0308, E0366, E0367, E0495.

View file

@ -48,6 +48,7 @@ LL | #![feature(const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
error: aborting due to 5 previous errors; 1 warning emitted error: aborting due to 5 previous errors; 1 warning emitted

View file

@ -2,17 +2,57 @@ error[E0423]: expected value, found enum `n::Z`
--> $DIR/privacy-enum-ctor.rs:23:9 --> $DIR/privacy-enum-ctor.rs:23:9
| |
LL | n::Z; LL | n::Z;
| ^^^^ help: try using one of the enum's variants: `m::Z::Unit` | ^^^^
| |
= help: you might have meant to use one of the enum's other variants that have fields note: the enum is defined here
--> $DIR/privacy-enum-ctor.rs:11:9
|
LL | / pub(in m) enum Z {
LL | | Fn(u8),
LL | | Struct {
LL | | s: u8,
LL | | },
LL | | Unit,
LL | | }
| |_________^
help: you might have meant to use the following enum variant
|
LL | m::Z::Unit;
| ^^^^^^^^^^
help: the following enum variants are available
|
LL | (m::Z::Fn(/* fields */));
| ^^^^^^^^^^^^^^^^^^^^^^^^
LL | (m::Z::Struct { /* fields */ });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0423]: expected value, found enum `Z` error[E0423]: expected value, found enum `Z`
--> $DIR/privacy-enum-ctor.rs:25:9 --> $DIR/privacy-enum-ctor.rs:25:9
| |
LL | Z; LL | Z;
| ^ help: try using one of the enum's variants: `m::Z::Unit` | ^
| |
= help: you might have meant to use one of the enum's other variants that have fields note: the enum is defined here
--> $DIR/privacy-enum-ctor.rs:11:9
|
LL | / pub(in m) enum Z {
LL | | Fn(u8),
LL | | Struct {
LL | | s: u8,
LL | | },
LL | | Unit,
LL | | }
| |_________^
help: you might have meant to use the following enum variant
|
LL | m::Z::Unit;
| ^^^^^^^^^^
help: the following enum variants are available
|
LL | (m::Z::Fn(/* fields */));
| ^^^^^^^^^^^^^^^^^^^^^^^^
LL | (m::Z::Struct { /* fields */ });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0423]: expected value, found struct variant `Z::Struct` error[E0423]: expected value, found struct variant `Z::Struct`
--> $DIR/privacy-enum-ctor.rs:29:20 --> $DIR/privacy-enum-ctor.rs:29:20
@ -34,11 +74,27 @@ LL | fn f() {
LL | let _: E = m::E; LL | let _: E = m::E;
| ^^^^ | ^^^^
| |
= help: you might have meant to use one of the enum's other variants that have fields note: the enum is defined here
help: try using one of the enum's variants --> $DIR/privacy-enum-ctor.rs:2:5
|
LL | / pub enum E {
LL | | Fn(u8),
LL | | Struct {
LL | | s: u8,
LL | | },
LL | | Unit,
LL | | }
| |_____^
help: you might have meant to use the following enum variant
| |
LL | let _: E = E::Unit; LL | let _: E = E::Unit;
| ^^^^^^^ | ^^^^^^^
help: the following enum variants are available
|
LL | let _: E = (E::Fn(/* fields */));
| ^^^^^^^^^^^^^^^^^^^^^
LL | let _: E = (E::Struct { /* fields */ });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: a function with a similar name exists help: a function with a similar name exists
| |
LL | let _: E = m::f; LL | let _: E = m::f;
@ -67,11 +123,27 @@ error[E0423]: expected value, found enum `E`
LL | let _: E = E; LL | let _: E = E;
| ^ | ^
| |
= help: you might have meant to use one of the enum's other variants that have fields note: the enum is defined here
help: try using one of the enum's variants --> $DIR/privacy-enum-ctor.rs:2:5
|
LL | / pub enum E {
LL | | Fn(u8),
LL | | Struct {
LL | | s: u8,
LL | | },
LL | | Unit,
LL | | }
| |_____^
help: you might have meant to use the following enum variant
| |
LL | let _: E = E::Unit; LL | let _: E = E::Unit;
| ^^^^^^^ | ^^^^^^^
help: the following enum variants are available
|
LL | let _: E = (E::Fn(/* fields */));
| ^^^^^^^^^^^^^^^^^^^^^
LL | let _: E = (E::Struct { /* fields */ });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider importing one of these items instead help: consider importing one of these items instead
| |
LL | use std::f32::consts::E; LL | use std::f32::consts::E;
@ -112,9 +184,29 @@ error[E0423]: expected value, found enum `m::n::Z`
--> $DIR/privacy-enum-ctor.rs:57:16 --> $DIR/privacy-enum-ctor.rs:57:16
| |
LL | let _: Z = m::n::Z; LL | let _: Z = m::n::Z;
| ^^^^^^^ help: try using one of the enum's variants: `m::Z::Unit` | ^^^^^^^
| |
= help: you might have meant to use one of the enum's other variants that have fields note: the enum is defined here
--> $DIR/privacy-enum-ctor.rs:11:9
|
LL | / pub(in m) enum Z {
LL | | Fn(u8),
LL | | Struct {
LL | | s: u8,
LL | | },
LL | | Unit,
LL | | }
| |_________^
help: you might have meant to use the following enum variant
|
LL | let _: Z = m::Z::Unit;
| ^^^^^^^^^^
help: the following enum variants are available
|
LL | let _: Z = (m::Z::Fn(/* fields */));
| ^^^^^^^^^^^^^^^^^^^^^^^^
LL | let _: Z = (m::Z::Struct { /* fields */ });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error[E0412]: cannot find type `Z` in this scope error[E0412]: cannot find type `Z` in this scope
--> $DIR/privacy-enum-ctor.rs:61:12 --> $DIR/privacy-enum-ctor.rs:61:12

View file

@ -507,6 +507,7 @@ LL | #![feature(const_generics)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: consider using `min_const_generics` instead, which is more stable and complete
warning: the feature `let_chains` is incomplete and may not be safe to use and/or cause compiler crashes warning: the feature `let_chains` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/disallowed-positions.rs:22:12 --> $DIR/disallowed-positions.rs:22:12

View file

@ -1,7 +1,4 @@
// build-pass (FIXME(62277): could be check-pass?) // build-pass (FIXME(62277): could be check-pass?)
#![feature(untagged_unions)]
#![allow(dead_code)] #![allow(dead_code)]
use std::mem::ManuallyDrop; use std::mem::ManuallyDrop;

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0277]: the trait bound `str: Clone` is not satisfied error[E0277]: the trait bound `str: Clone` is not satisfied
--> $DIR/deafult-associated-type-bound-1.rs:19:5 --> $DIR/deafult-associated-type-bound-1.rs:19:5

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0277]: can't compare `&'static B` with `B` error[E0277]: can't compare `&'static B` with `B`
--> $DIR/deafult-associated-type-bound-2.rs:16:5 --> $DIR/deafult-associated-type-bound-2.rs:16:5

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes warning: the feature `generic_associated_types` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/deafult-generic-associated-type-bound.rs:4:12 --> $DIR/deafult-generic-associated-type-bound.rs:4:12

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default` error[E0520]: `foo` specializes an item from a parent `impl`, but that item is not marked `default`
--> $DIR/specialization-no-default.rs:20:5 --> $DIR/specialization-no-default.rs:20:5

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0046]: not all trait items implemented, missing: `foo_two` error[E0046]: not all trait items implemented, missing: `foo_two`
--> $DIR/specialization-trait-item-not-implemented.rs:18:1 --> $DIR/specialization-trait-item-not-implemented.rs:18:1

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0599]: no method named `foo_one` found for struct `MyStruct` in the current scope error[E0599]: no method named `foo_one` found for struct `MyStruct` in the current scope
--> $DIR/specialization-trait-not-implemented.rs:22:29 --> $DIR/specialization-trait-not-implemented.rs:22:29

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0277]: the trait bound `U: Eq` is not satisfied error[E0277]: the trait bound `U: Eq` is not satisfied
--> $DIR/specialization-wfcheck.rs:7:17 --> $DIR/specialization-wfcheck.rs:7:17

View file

@ -16,6 +16,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error: impls of auto traits cannot be default error: impls of auto traits cannot be default
--> $DIR/validation.rs:9:21 --> $DIR/validation.rs:9:21

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0275]: overflow evaluating the requirement `i32: Check` error[E0275]: overflow evaluating the requirement `i32: Check`
| |

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0277]: the trait bound `(): Valid` is not satisfied error[E0277]: the trait bound `(): Valid` is not satisfied
--> $DIR/issue-38091.rs:12:5 --> $DIR/issue-38091.rs:12:5

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
error[E0275]: overflow evaluating the requirement `T: FromA<U>` error[E0275]: overflow evaluating the requirement `T: FromA<U>`
--> $DIR/issue-39448.rs:45:13 --> $DIR/issue-39448.rs:45:13

View file

@ -6,6 +6,7 @@ LL | #![feature(specialization)]
| |
= note: `#[warn(incomplete_features)]` on by default = note: `#[warn(incomplete_features)]` on by default
= note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
= help: consider using `min_specialization` instead, which is more stable and complete
warning: 1 warning emitted warning: 1 warning emitted

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